@Override public IField getField(Atom name) { return realType.getField(name); }
@Override public IField getField(Atom name) { return realType.getField(name); }
@Override public IField getField(Atom name, TypeName typeName) { return getSuperclass().getField(name, typeName); }
@Override public IField getField(Atom name) { return getSuperclass().getField(name); }
@Override public IField getField(Atom name) { return getSuperclass().getField(name); }
@Override public IField getField(Atom name, TypeName typeName) { return getSuperclass().getField(name, typeName); }
@Override public IField getField(Atom name) { if (declaredFields.containsKey(name)) { return declaredFields.get(name); } else if (getSuperclass() != null) { return getSuperclass().getField(name); } else { return null; } }
@Override public IField getField(Atom name) { if (declaredFields.containsKey(name)) { return declaredFields.get(name); } else if (getSuperclass() != null) { return getSuperclass().getField(name); } else { return null; } }
@Override public IField getField(Atom name) { return loader.lookupClass(superReference.getName()).getField(name); }
@Override public IField getField(Atom name, TypeName type) { // assume that for AST classes, you can't have multiple fields with the same name return loader.lookupClass(superReference.getName()).getField(name); }
@Override public IField getField(Atom name, TypeName type) { // assume that for AST classes, you can't have multiple fields with the same name return loader.lookupClass(superReference.getName()).getField(name); }
/** * @return the canonical IField that represents a given field , or null if none found * @throws IllegalArgumentException if f is null * @throws IllegalArgumentException if klass is null */ @Override public IField resolveField(IClass klass, FieldReference f) { if (klass == null) { throw new IllegalArgumentException("klass is null"); } if (f == null) { throw new IllegalArgumentException("f is null"); } return klass.getField(f.getName(), f.getFieldType().getName()); }
@Override public IField getField(final Atom name) { IField x; if (declaredFields.containsKey(name)) { return declaredFields.get(name); } else if (getSuperclass() != null && (x = getSuperclass().getField(name)) != null) { return x; } else { final boolean isStatic = isStaticField(name); declaredFields.put(name, new AstDynamicField(isStatic, this, name, defaultDescriptor)); return declaredFields.get(name); } }
@Override public IField getField(final Atom name) { IField x; if (declaredFields.containsKey(name)) { return declaredFields.get(name); } else if (getSuperclass() != null && (x = getSuperclass().getField(name)) != null) { return x; } else { final boolean isStatic = isStaticField(name); declaredFields.put(name, new AstDynamicField(isStatic, this, name, defaultDescriptor)); return declaredFields.get(name); } }
@Override public PointerKey getPointerKeyForInstanceField(InstanceKey I, IField field) { if (field == null) { throw new IllegalArgumentException("field is null"); } IField resolveAgain = I.getConcreteType().getField(field.getName(), field.getFieldTypeReference().getName()); if (resolveAgain != null) { field = resolveAgain; } return new InstanceFieldKey(I, field); }
@Override public PointerKey getPointerKeyForInstanceField(InstanceKey I, IField field) { if (field == null) { throw new IllegalArgumentException("field is null"); } IField resolveAgain = I.getConcreteType().getField(field.getName(), field.getFieldTypeReference().getName()); if (resolveAgain != null) { field = resolveAgain; } return new InstanceFieldKey(I, field); }
/** * if F is a supported constant representing a field, return the corresponding {@link InstanceFieldKey} for I. Otherwise, return {@code null}. */ protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey<?> F) { Object v = F.getValue(); // FIXME: current only constant string are handled if (I.getConcreteType().getClassLoader().getLanguage().modelConstant(v)) { IField f = I.getConcreteType().getField(Atom.findOrCreateUnicodeAtom(String.valueOf(v))); return getPointerKeyForInstanceField(I, f); } return null; }
/** * if F is a supported constant representing a field, return the corresponding {@link InstanceFieldKey} for I. Otherwise, return {@code null}. */ protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey<?> F) { Object v = F.getValue(); // FIXME: current only constant string are handled if (I.getConcreteType().getClassLoader().getLanguage().modelConstant(v)) { IField f = I.getConcreteType().getField(Atom.findOrCreateUnicodeAtom(String.valueOf(v))); return getPointerKeyForInstanceField(I, f); } return null; }
@Override protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey<?> F) { Object v = F.getValue(); String strVal = JSCallGraphUtil.simulateToStringForPropertyNames(v); // if we know the string representation of the constant, use it... if (strVal != null) { IField f = I.getConcreteType().getField(Atom.findOrCreateUnicodeAtom(strVal)); return getPointerKeyForInstanceField(I, f); // ...otherwise it is some unknown string } else { return ReflectedFieldPointerKey.mapped(new ConcreteTypeKey(getFieldNameType(F)), I); } }
@Override protected PointerKey getInstanceFieldPointerKeyForConstant(InstanceKey I, ConstantKey<?> F) { Object v = F.getValue(); String strVal = JSCallGraphUtil.simulateToStringForPropertyNames(v); // if we know the string representation of the constant, use it... if (strVal != null) { IField f = I.getConcreteType().getField(Atom.findOrCreateUnicodeAtom(strVal)); return getPointerKeyForInstanceField(I, f); // ...otherwise it is some unknown string } else { return ReflectedFieldPointerKey.mapped(new ConcreteTypeKey(getFieldNameType(F)), I); } }