return true;
}
}
+
if (this == other) {
return true;
}
+
if (this.getSignature().equals(ResolvedType.OBJECT.getSignature())) {
return true;
}
return true;
}
}
- // if (this.isParameterizedType() && other.isRawType()) {
- // if (((ReferenceType) this.getRawType()).isAssignableFrom(other.getGenericType())) {
- // return true;
- // }
- // }
if (this.isParameterizedType()) {
// look at wildcards...
return false;
}
- for (Iterator i = other.getDirectSupertypes(); i.hasNext();) {
- if (this.isAssignableFrom((ResolvedType) i.next(), allowMissing)) {
+ ResolvedType[] interfaces = other.getDeclaredInterfaces();
+ for (ResolvedType intface : interfaces) {
+ if (this.isAssignableFrom(intface, allowMissing)) {
+ return true;
+ }
+ }
+ ResolvedType superclass = other.getSuperclass();
+ if (superclass != null) {
+ if (this.isAssignableFrom(superclass, allowMissing)) {
return true;
}
}
interTypeMungers.add(munger);
}
-
/**
* Compare the type transformer with the existing members. A clash may not be an error (the ITD may be the 'default
* implementation') so returning false is not always a sign of an error.
}
public boolean isTopmostImplementor(ResolvedType interfaceType) {
+ boolean b = true;
if (isInterface()) {
- return false;
- }
- if (!interfaceType.isAssignableFrom(this, true)) {
- return false;
- }
+ b = false;
+ } else if (!interfaceType.isAssignableFrom(this, true)) {
+ b = false;
+ } else
// check that I'm truly the topmost implementor
if (this.getSuperclass().isMissing()) {
- return true; // we don't know anything about supertype, and it can't
- }
+ b = true; // we don't know anything about supertype, and it can't
+ } else
// be exposed to weaver
if (interfaceType.isAssignableFrom(this.getSuperclass(), true)) {
- return false;
+ b = false;
}
- return true;
+ // System.out.println("is " + getName() + " topmostimplementor of " + interfaceType + "? " + b);
+ // System.err.println("Was topmostimplementor? "+interfaceType.getName()+" "+b);
+ return b;
}
public ResolvedType getTopmostImplementor(ResolvedType interfaceType) {
if (getSuperclass() != null) {
ret.addAll(getSuperclass().getExposedPointcuts());
}
-
- for (ResolvedType type: getDeclaredInterfaces()) {
+
+ for (ResolvedType type : getDeclaredInterfaces()) {
addPointcutsResolvingConflicts(ret, Arrays.asList(type.getDeclaredPointcuts()), false);
}
-
+
addPointcutsResolvingConflicts(ret, Arrays.asList(getDeclaredPointcuts()), true);
-
- for (ResolvedMember member: ret) {
+
+ for (ResolvedMember member : ret) {
ResolvedPointcutDefinition inherited = (ResolvedPointcutDefinition) member;
if (inherited != null && inherited.isAbstract()) {
if (!this.isAbstract()) {
ResolvedPointcutDefinition toAdd = (ResolvedPointcutDefinition) i.next();
for (Iterator j = acc.iterator(); j.hasNext();) {
ResolvedPointcutDefinition existing = (ResolvedPointcutDefinition) j.next();
- if (toAdd==null || existing==null || existing == toAdd) {
+ if (toAdd == null || existing == null || existing == toAdd) {
continue;
}
UnresolvedType pointcutDeclaringTypeUT = existing.getDeclaringType();
- if (pointcutDeclaringTypeUT!=null) {
+ if (pointcutDeclaringTypeUT != null) {
ResolvedType pointcutDeclaringType = pointcutDeclaringTypeUT.resolve(getWorld());
if (!isVisible(existing.getModifiers(), pointcutDeclaringType, this)) {
// if they intended to override it but it is not visible,
if (existing.isAbstract() && conflictingSignature(existing, toAdd)) {
getWorld().showMessage(
IMessage.ERROR,
- WeaverMessages.format(WeaverMessages.POINTCUT_NOT_VISIBLE, existing.getDeclaringType().getName()
+ WeaverMessages.format(WeaverMessages.POINTCUT_NOT_VISIBLE, existing.getDeclaringType()
+ .getName()
+ "." + existing.getName() + "()", this.getName()), toAdd.getSourceLocation(), null);
j.remove();
}
return declaring.lookupSyntheticMember(member);
}
+ private boolean allLintIgnored = false;
+
+ public void setAllLintIgnored() {
+ allLintIgnored = true;
+ }
+
+ public boolean areAllLintIgnored() {
+ return allLintIgnored;
+ }
+
public abstract IWeavingSupport getWeavingSupport();
/**
* Map of types in the world, can have 'references' to expendable ones which can be garbage collected to recover memory. An
* expendable type is a reference type that is not exposed to the weaver (ie just pulled in for type resolution purposes).
*/
- protected static class TypeMap {
+ public static class TypeMap {
private static boolean debug = false;
// INFO);
}
+ // For testing
+ public Map getExpendableMap() {
+ return expendableMap;
+ }
+
+ // For testing
+ public Map getMainMap() {
+ return tMap;
+ }
+
/**
* Go through any types added during the previous file weave. If any are suitable for demotion, then put them in the
* expendable map where GC can claim them at some point later. Demotion means: the type is not an aspect, the type is not