protected Map<String, UnresolvedType> getAjMemberParameterizationMap() { Map<String, UnresolvedType> myMap = getMemberParameterizationMap(); if (myMap.isEmpty()) { // might extend a parameterized aspect that we also need to // consider... if (getSuperclass() != null) { return getSuperclass().getAjMemberParameterizationMap(); } } return myMap; }
public ResolvedMember lookupMemberWithSupersAndITDs(Member member) { ResolvedMember ret = lookupMemberNoSupers(member); if (ret != null) { return ret; } ResolvedType supert = getSuperclass(); while (ret == null && supert != null) { ret = supert.lookupMemberNoSupers(member); if (ret == null) { supert = supert.getSuperclass(); } } return ret; }
public PerClause lookupConcretePerClause(ResolvedType lookupType) { PerClause ret = lookupType.getPerClause(); if (ret == null) { return null; } if (ret instanceof PerFromSuper) { return lookupConcretePerClause(lookupType.getSuperclass()); } return ret; }
/** * Returns an iterator through ResolvedType objects representing all the direct supertypes of this type. That is, through the * superclass, if any, and all declared interfaces. */ public final Iterator<ResolvedType> getDirectSupertypes() { Iterator<ResolvedType> interfacesIterator = Iterators.array(getDeclaredInterfaces()); ResolvedType superclass = getSuperclass(); if (superclass == null) { return interfacesIterator; } else { return Iterators.snoc(interfacesIterator, superclass); } }
@Override public ResolvedType next() { ResolvedType ret = curr; if (!wantGenerics && ret.isParameterizedOrGenericType()) { ret = ret.getRawType(); } iwalker.push(ret); // tell the interface walker about another class whose interfaces need visiting curr = curr.getSuperclass(); return ret; }
protected boolean ajMembersNeedParameterization() { if (isParameterizedType()) { return true; } ResolvedType superclass = getSuperclass(); if (superclass != null && !superclass.isMissing()) { return superclass.ajMembersNeedParameterization(); } return false; }
public boolean isGroovyObject() { if ((bits & GroovyObjectInitialized) == 0) { ResolvedType[] intfaces = getDeclaredInterfaces(); boolean done = false; // TODO do we need to walk more of these? (i.e. the interfaces interfaces and supertypes supertype). Check what groovy // does in the case where a hierarchy is involved and there are types in between GroovyObject/GroovyObjectSupport and // the type if (intfaces != null) { for (ResolvedType intface : intfaces) { if (intface.getName().equals("groovy.lang.GroovyObject")) { bits |= IsGroovyObject; done = true; break; } } } if (!done) { // take a look at the supertype if (getSuperclass().getName().equals("groovy.lang.GroovyObjectSupport")) { bits |= IsGroovyObject; } } bits |= GroovyObjectInitialized; } return (bits & IsGroovyObject) != 0; }
public ResolvedType getTopmostImplementor(ResolvedType interfaceType) { if (isInterface()) { return null; } if (!interfaceType.isAssignableFrom(this)) { return null; } // Check if my super class is an implementor? ResolvedType higherType = this.getSuperclass().getTopmostImplementor(interfaceType); if (higherType != null) { return higherType; } return this; }
private void getOutstandingAbstractMethodsHelper(ResolvedType type, Map<String, ResolvedMember> collector) { if (type == null) { return; } // Get to the top if (!type.equals(ResolvedType.OBJECT)) { if (type.getSuperclass() != null) { getOutstandingAbstractMethodsHelper(type.getSuperclass(), collector); } } ResolvedMember[] rms = type.getDeclaredMethods(); if (rms != null) { for (int i = 0; i < rms.length; i++) { ResolvedMember member = rms[i]; String key = member.getName() + member.getSignature(); if (member.isAbstract()) { collector.put(key, member); } else { collector.remove(key); } } } }
ResolvedType superclass = type.getSuperclass(); if (superclass != null) { typesTolookat.add(superclass);
public boolean isTopmostImplementor(ResolvedType interfaceType) { boolean b = true; if (isInterface()) { b = false; } else if (!interfaceType.isAssignableFrom(this, true)) { b = false; } else { ResolvedType superclass = this.getSuperclass(); if (superclass.isMissing()) { b = true; // we don't know anything about supertype, and it can't be exposed to weaver } else if (interfaceType.isAssignableFrom(superclass, true)) { // check that I'm truly the topmost implementor b = false; } } // System.out.println("is " + getName() + " topmostimplementor of " + interfaceType + "? " + b); return b; }
public List<ResolvedMember> getExposedPointcuts() { List<ResolvedMember> ret = new ArrayList<ResolvedMember>(); if (getSuperclass() != null) { ret.addAll(getSuperclass().getExposedPointcuts()); } for (ResolvedType type : getDeclaredInterfaces()) { addPointcutsResolvingConflicts(ret, Arrays.asList(type.getDeclaredPointcuts()), false); } addPointcutsResolvingConflicts(ret, Arrays.asList(getDeclaredPointcuts()), true); for (ResolvedMember member : ret) { ResolvedPointcutDefinition inherited = (ResolvedPointcutDefinition) member; if (inherited != null && inherited.isAbstract()) { if (!this.isAbstract()) { getWorld().showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.POINCUT_NOT_CONCRETE, inherited, this.getName()), inherited.getSourceLocation(), this.getSourceLocation()); } } } return ret; }
private ResolvedMember lookupMemberIncludingITDsOnInterfaces(Member member, ResolvedType onType) { ResolvedMember ret = onType.lookupMemberNoSupers(member); if (ret != null) { return ret; } else { ResolvedType superType = onType.getSuperclass(); if (superType != null) { ret = lookupMemberIncludingITDsOnInterfaces(member, superType); } if (ret == null) { // try interfaces then, but only ITDs now... ResolvedType[] superInterfaces = onType.getDeclaredInterfaces(); for (int i = 0; i < superInterfaces.length; i++) { ret = superInterfaces[i].lookupMethodInITDs(member); if (ret != null) { return ret; } } } } return ret; }
private boolean implementsSerializable(ResolvedType aType) { if (aType.getSignature().equals(UnresolvedType.SERIALIZABLE.getSignature())) { return true; } ResolvedType[] interfaces = aType.getDeclaredInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].isMissing()) { continue; } if (implementsSerializable(interfaces[i])) { return true; } } ResolvedType superType = aType.getSuperclass(); if (superType != null && !superType.isMissing()) { return implementsSerializable(superType); } return false; }
/** * Check if any parent aspects of the supplied aspect have unresolved dependencies (and so * should cause this aspect to be turned off). * @param aspectType the aspect whose parents should be checked * @return true if this aspect should be excluded because of a parents' missing dependencies */ private boolean excludeDueToParentAspectHavingUnresolvedDependency(ResolvedType aspectType) { ResolvedType parent = aspectType.getSuperclass(); boolean excludeDueToParent = false; while (parent != null) { if (parent.isAspect() && parent.isAbstract() && world.hasUnsatisfiedDependency(parent)) { if (!world.getMessageHandler().isIgnoring(IMessage.INFO)) { world.getMessageHandler().handleMessage( MessageUtil.info("deactivating aspect '" + aspectType.getName() + "' as the parent aspect '"+parent.getName()+ "' has unsatisfied dependencies")); } excludeDueToParent = true; } parent = parent.getSuperclass(); } return excludeDueToParent; }
} else { do { resolvedType1 = resolvedType1.getSuperclass(); if (resolvedType1 == null) {
public PerClause concretize(ResolvedType inAspect) { PerClause p = lookupConcretePerClause(inAspect.getSuperclass()); if (p == null) { inAspect.getWorld().getMessageHandler().handleMessage( MessageUtil.error(WeaverMessages.format(WeaverMessages.MISSING_PER_CLAUSE, inAspect.getSuperclass()), getSourceLocation())); return new PerSingleton().concretize(inAspect);// AV: fallback on something else NPE in AJDT } else { if (p.getKind() != kind) { inAspect.getWorld().getMessageHandler().handleMessage( MessageUtil.error(WeaverMessages.format(WeaverMessages.WRONG_PER_CLAUSE, kind, p.getKind()), getSourceLocation())); } return p.concretize(inAspect); } }
collector.add(resolvedType); if (!resolvedType.isInterface() && !resolvedType.equals(ResolvedType.OBJECT)) { ResolvedType superType = resolvedType.getSuperclass(); if (superType != null && !superType.isMissing()) { if (!genericsAware && (superType.isParameterizedType() || superType.isGenericType())) {
ResolvedType superT = getSuperclass(); if (superT.genericTypeEquals(lookingFor)) { return superT;
ResolvedType superclassType = resolvedTypeToWeave.getSuperclass(); String superclassTypename = (superclassType == null ? null : superclassType.getName());