From 061395c8c7fe681ab40ab53a7d1bfeb8e17c1028 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 6 Aug 2004 15:04:45 +0000 Subject: [PATCH] More work on 'cant find type' (bug 44191) --- .../ajdt/internal/compiler/ast/AspectDeclaration.java | 4 ++-- .../internal/compiler/lookup/EclipseSourceType.java | 2 +- weaver/src/org/aspectj/weaver/ResolvedTypeX.java | 8 ++++---- weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java | 4 ++-- weaver/src/org/aspectj/weaver/bcel/BcelShadow.java | 10 +++++----- .../org/aspectj/weaver/patterns/DeclareParents.java | 2 +- .../src/org/aspectj/weaver/patterns/DeclareSoft.java | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java index 9025cf439..432e4f76c 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java @@ -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; diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java index 2667909bc..00cadb8a1 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseSourceType.java @@ -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()); } diff --git a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java index a51736ce4..c21a5db91 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedTypeX.java +++ b/weaver/src/org/aspectj/weaver/ResolvedTypeX.java @@ -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; diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java index ddc6392b7..e35128a62 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java @@ -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]); diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index bbb56b777..4e6010eea 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -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; diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java index c42eed910..a5ece09bd 100644 --- a/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java +++ b/weaver/src/org/aspectj/weaver/patterns/DeclareParents.java @@ -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); diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java index c2159aca4..766df62d2 100644 --- a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java +++ b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java @@ -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); -- 2.39.5