]> source.dussan.org Git - aspectj.git/commitdiff
More work on 'cant find type' (bug 44191)
authoraclement <aclement>
Fri, 6 Aug 2004 15:04:45 +0000 (15:04 +0000)
committeraclement <aclement>
Fri, 6 Aug 2004 15:04:45 +0000 (15:04 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java
weaver/src/org/aspectj/weaver/ResolvedTypeX.java
weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java
weaver/src/org/aspectj/weaver/bcel/BcelShadow.java
weaver/src/org/aspectj/weaver/patterns/DeclareParents.java
weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java

index 9025cf439eb1ee32fcf1bc659058701b35b05b97..432e4f76c4d97338fdd12385324a052d54a01280 100644 (file)
@@ -128,13 +128,13 @@ public class AspectDeclaration extends TypeDeclaration {
                
                // can't be Serializable/Cloneable unless -XserializableAspects
                if (!world.isXSerializableAspects()) {
-                       if (world.getWorld().resolve(TypeX.SERIALIZABLE).isAssignableFrom(myType)) {
+                       if (world.getWorld().getCoreType(TypeX.SERIALIZABLE).isAssignableFrom(myType)) {
                                scope.problemReporter().signalError(sourceStart, sourceEnd,
                                                                "aspects may not implement Serializable");
                                ignoreFurtherInvestigation = true;
                            return;
                        }
-                       if (world.getWorld().resolve(TypeX.CLONEABLE).isAssignableFrom(myType)) {
+                       if (world.getWorld().getCoreType(TypeX.CLONEABLE).isAssignableFrom(myType)) {
                                scope.problemReporter().signalError(sourceStart, sourceEnd,
                                                                "aspects may not implement Cloneable");
                                ignoreFurtherInvestigation = true;
index 2667909bc5647309174f818040d5ae40294f67f9..00cadb8a1dc6f7ede5ac8bbba302602542fb3517 100644 (file)
@@ -71,7 +71,7 @@ public class EclipseSourceType extends ResolvedTypeX.ConcreteName {
        }
        
        public ResolvedTypeX getSuperclass() {
-               if (binding.isInterface()) return getResolvedTypeX().getWorld().resolve(TypeX.OBJECT);
+               if (binding.isInterface()) return getResolvedTypeX().getWorld().getCoreType(TypeX.OBJECT);
                //XXX what about java.lang.Object
                return eclipseWorld().fromEclipse(binding.superclass());
        }
index a51736ce40a9fd3bcbfd224ecab96a16296b6758..c21a5db91a2820c769843a36357d8e46b7abea36 100644 (file)
@@ -729,8 +729,8 @@ public abstract class ResolvedTypeX extends TypeX {
         public final ResolvedTypeX[] getDeclaredInterfaces() {
             return
                 new ResolvedTypeX[] {
-                    world.resolve(CLONEABLE), 
-                    world.resolve(SERIALIZABLE)
+                    world.getCoreType(CLONEABLE), 
+                    world.getCoreType(SERIALIZABLE)
                 };
         }
         public final ResolvedMember[] getDeclaredPointcuts() {
@@ -738,7 +738,7 @@ public abstract class ResolvedTypeX extends TypeX {
         }
         
         public final ResolvedTypeX getSuperclass() {
-            return world.resolve(OBJECT);
+            return world.getCoreType(OBJECT);
         }
         public final boolean isAssignableFrom(TypeX o) {
             if (! o.isArray()) return false;
@@ -1064,7 +1064,7 @@ public abstract class ResolvedTypeX extends TypeX {
                        if (!compareToExistingMembers(munger, getMethods())) return;
                        if (this.isInterface()) {
                                if (!compareToExistingMembers(munger, 
-                                               Arrays.asList(world.resolve(OBJECT).getDeclaredMethods()).iterator())) return;
+                                               Arrays.asList(world.getCoreType(OBJECT).getDeclaredMethods()).iterator())) return;
                        }
                } else if (sig.getKind() == Member.FIELD) {
                        if (!compareToExistingMembers(munger, Arrays.asList(getDeclaredFields()).iterator())) return;
index ddc6392b707adf9226935dc29a72340e70784de7..e35128a622154ac48beae3e5652ea8a9aff7a171 100644 (file)
@@ -169,8 +169,8 @@ public class BcelAdvice extends Advice {
                
                Collection ret = new ArrayList();
                World world = concreteAspect.getWorld();
-               ResolvedTypeX runtimeException = world.resolve(TypeX.RUNTIME_EXCEPTION);
-               ResolvedTypeX error = world.resolve(TypeX.ERROR);
+               ResolvedTypeX runtimeException = world.getCoreType(TypeX.RUNTIME_EXCEPTION);
+               ResolvedTypeX error = world.getCoreType(TypeX.ERROR);
                
                for (int i=0, len=excs.length; i < len; i++) {
                        ResolvedTypeX t = world.resolve(excs[i]);
index bbb56b777d9b5c33280de0a0e4ad2777cbd46b86..4e6010eea2c680ca4b6f102d85d1634fd436e25d 100644 (file)
@@ -960,7 +960,7 @@ public class BcelShadow extends Shadow {
                                                                        Constants.INVOKESTATIC));
                                break;
                        case 1:
-                               ((BcelVar)getArgVar(0)).appendLoadAndConvert(il, fact, world.resolve(ResolvedTypeX.OBJECT));
+                               ((BcelVar)getArgVar(0)).appendLoadAndConvert(il, fact, world.getCoreType(ResolvedTypeX.OBJECT));
                                il.append(fact.createInvoke("org.aspectj.runtime.reflect.Factory", 
                                                                        "makeJP", LazyClassGen.tjpType,
                                                                        new Type[] { LazyClassGen.staticTjpType,
@@ -968,8 +968,8 @@ public class BcelShadow extends Shadow {
                                                                        Constants.INVOKESTATIC));
                                break;
                        case 2:
-                               ((BcelVar)getArgVar(0)).appendLoadAndConvert(il, fact, world.resolve(ResolvedTypeX.OBJECT));
-                               ((BcelVar)getArgVar(1)).appendLoadAndConvert(il, fact, world.resolve(ResolvedTypeX.OBJECT));
+                               ((BcelVar)getArgVar(0)).appendLoadAndConvert(il, fact, world.getCoreType(ResolvedTypeX.OBJECT));
+                               ((BcelVar)getArgVar(1)).appendLoadAndConvert(il, fact, world.getCoreType(ResolvedTypeX.OBJECT));
                                il.append(fact.createInvoke("org.aspectj.runtime.reflect.Factory", 
                                                                        "makeJP", LazyClassGen.tjpType,
                                                                        new Type[] { LazyClassGen.staticTjpType,
@@ -994,7 +994,7 @@ public class BcelShadow extends Shadow {
                Field field = getEnclosingClass().getTjpField(this);
                thisJoinPointStaticPartVar =
                        new BcelFieldRef(
-                               world.resolve(TypeX.forName("org.aspectj.lang.JoinPoint$StaticPart")),
+                               world.getCoreType(TypeX.forName("org.aspectj.lang.JoinPoint$StaticPart")),
                                getEnclosingClass().getClassName(),
                                field.getName());
 //             getEnclosingClass().warnOnAddedStaticInitializer(this,munger.getSourceLocation());
@@ -2030,7 +2030,7 @@ public class BcelShadow extends Shadow {
                final InstructionFactory fact = getFactory();   
                
                BcelVar arrayVar = new BcelVar(
-                       world.resolve(TypeX.OBJECTARRAY),
+                       world.getCoreType(TypeX.OBJECTARRAY),
                        extractedMethod.allocateLocal(1));
                
                int len = superConstructorTypes.length;
index c42eed9106d9214ebe8dc919793509a9d299e14c..a5ece09bdc4600f945e2911ce05504f83fa5773d 100644 (file)
@@ -115,7 +115,7 @@ public class DeclareParents extends Declare {
                TypeX iType = typePattern.getExactType();
                ResolvedTypeX parentType = iType.resolve(world);
                
-               if (targetType.equals(world.resolve(TypeX.OBJECT))) {
+               if (targetType.equals(world.getCoreType(TypeX.OBJECT))) {
                        world.showMessage(IMessage.ERROR, 
                                        WeaverMessages.format(WeaverMessages.DECP_OBJECT),
                                this.getSourceLocation(), null);
index c2159aca40116d5ceb85896a22c91a33c11afefd..766df62d2f8aaccc74ec5d0d33d9fbcde8d3284e 100644 (file)
@@ -86,7 +86,7 @@ public class DeclareSoft extends Declare {
        exception = exception.resolveBindings(scope, null, false, true);
        TypeX excType = exception.getExactType();
        if (excType != ResolvedTypeX.MISSING) {
-               if (!scope.getWorld().resolve(TypeX.THROWABLE).isAssignableFrom(excType)) {
+               if (!scope.getWorld().getCoreType(TypeX.THROWABLE).isAssignableFrom(excType)) {
                        scope.getWorld().showMessage(IMessage.ERROR,
                                        WeaverMessages.format(WeaverMessages.NOT_THROWABLE,excType.getName()),
                                        exception.getSourceLocation(), null);