Browse Source

1) cope with the new MissingTypeBinding (so set parent to Object rather than proceeding with a missing one - the downstream infrastructure cant cope right now)

2) use raw form of binding for new parents otherwise the methodverifier15 triggers about a problem (previously methodverifier was used on <1.5 projects but not with e37)
tags/V1_7_0RC1
aclement 12 years ago
parent
commit
7b18920d09

+ 13
- 1
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/AjLookupEnvironment.java View File

@@ -49,6 +49,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MissingTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.PackageBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding;
@@ -165,6 +166,11 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
SourceTypeBinding[] b = units[i].scope.topLevelTypes;
for (int j = 0; j < b.length; j++) {
factory.addSourceTypeBinding(b[j], units[i]);
if (b[j].superclass instanceof MissingTypeBinding) {
// e37: Undoing the work in ClassScope.connectSuperClass() as it will lead to cascade errors
// TODO allow MissingTypeBinding through here and cope with it in all situations later?
b[j].superclass = units[i].scope.getJavaLangObject();
}
}
}

@@ -877,7 +883,7 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
ContextToken tok = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.PROCESSING_DECLARE_PARENTS,
sourceType.sourceName);
ResolvedType resolvedSourceType = factory.fromEclipse(sourceType);
List newParents = declareParents.findMatchingNewParents(resolvedSourceType, false);
List<ResolvedType> newParents = declareParents.findMatchingNewParents(resolvedSourceType, false);
if (!newParents.isEmpty()) {
for (Iterator i = newParents.iterator(); i.hasNext();) {
ResolvedType parent = (ResolvedType) i.next();
@@ -1315,6 +1321,12 @@ public class AjLookupEnvironment extends LookupEnvironment implements AnonymousC
if (parentBinding == null) {
return; // The parent is missing, it will be reported elsewhere.
}
// Due to e37 switching to MethodVerifier15 for everything, it is important added types are correctly
// raw or not. For example, if Comparable is used in generic form compareTo(T) will be used to check
// methods against in the verifier rather than compareTo(Object)
if (!factory.getWorld().isInJava5Mode()) {
parentBinding = (ReferenceBinding)convertToRawType(parentBinding, false /*do not force conversion of enclosing types*/);
}
sourceType.rememberTypeHierarchy();
if (parentBinding.isClass()) {
sourceType.superclass = parentBinding;

Loading…
Cancel
Save