diff options
author | aclement <aclement> | 2005-12-09 10:52:15 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-12-09 10:52:15 +0000 |
commit | 0c8c0a3d21365eade6f53a0484bba71f24637a65 (patch) | |
tree | efa8c4ba005882f172f1abfc9460adda738031c3 | |
parent | 5f8d2cdff480ac9d04cc73a4a69eb11563a0bb01 (diff) | |
download | aspectj-0c8c0a3d21365eade6f53a0484bba71f24637a65.tar.gz aspectj-0c8c0a3d21365eade6f53a0484bba71f24637a65.zip |
Some updates for 118754. The various places that were checking for 'MISSING' now call 'isMissing' if they can. I think this negates some work Adrian did with introducing MissingWithKnownSignature - but we have to make this change for LTW to work properly. Someone with a bit of time on their hands should go through all the places isMissing() is now called and see if the check should be 'isReallyMissing()' which would allow the MissingWithKnownSignature to get through. I will raise an enhancement to cover this.
41 files changed, 215 insertions, 86 deletions
diff --git a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java index 897e17f52..ff1ea65cf 100644 --- a/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java +++ b/loadtime/src/org/aspectj/weaver/loadtime/ConcreteAspectCodeGen.java @@ -125,7 +125,7 @@ public class ConcreteAspectCodeGen { m_parent = m_world.resolve(m_concreteAspect.extend, true); // handle inner classes - if (m_parent.equals(ResolvedType.MISSING)) { + if (m_parent.isMissing()) { // fallback on inner class lookup mechanism String fixedName = m_concreteAspect.extend; int hasDot = fixedName.lastIndexOf('.'); @@ -135,7 +135,7 @@ public class ConcreteAspectCodeGen { fixedName = new String(fixedNameChars); hasDot = fixedName.lastIndexOf('.'); m_parent = m_world.resolve(UnresolvedType.forName(fixedName), true); - if (!m_parent.equals(ResolvedType.MISSING)) { + if (!m_parent.isMissing()) { break; } } diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java index 9df8b0382..35eb97dfb 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/lookup/EclipseFactory.java @@ -253,7 +253,7 @@ public class EclipseFactory { String baseTypeSignature = null; ResolvedType baseType = getWorld().resolve(UnresolvedType.forName(getName(binding)),true); - if (baseType != ResolvedType.MISSING) { + if (!baseType.isMissing()) { // can legitimately be missing if a bound refers to a type we haven't added to the world yet... if (!baseType.isGenericType() && arguments!=null) baseType = baseType.getGenericType(); baseTypeSignature = baseType.getErasureSignature(); @@ -966,7 +966,7 @@ public class EclipseFactory { UnresolvedType complexTx = fromBinding(binding); // fully aware of any generics info ResolvedType cName = world.resolve(complexTx,true); ReferenceType complexName = null; - if (cName != ResolvedType.MISSING) { + if (!cName.isMissing()) { complexName = (ReferenceType) cName; complexName = (ReferenceType) complexName.getGenericType(); if (complexName == null) complexName = new ReferenceType(complexTx,world); diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java index 8dab02aec..e62a4a05b 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmElementFormatter.java @@ -314,7 +314,7 @@ public class AsmElementFormatter { String label; UnresolvedType typeX = tp.getExactType(); - if (typeX != ResolvedType.MISSING) { + if (!ResolvedType.isMissing(typeX)) { label = typeX.getName(); if (tp.isIncludeSubtypes()) label += "+"; } else { diff --git a/tests/java5/ataspectj/ajc-ant.xml b/tests/java5/ataspectj/ajc-ant.xml index 5c4495be4..695e8ac07 100644 --- a/tests/java5/ataspectj/ajc-ant.xml +++ b/tests/java5/ataspectj/ajc-ant.xml @@ -60,6 +60,14 @@ </java> </target> + <target name="ltw.DumpProxyTest"> + <java fork="yes" classname="ataspectj.TestProxyGenerator" failonerror="yes"> + <classpath refid="aj.path"/> + <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/> + <jvmarg value="-Daj5.def=ataspectj/aop-dumpproxy.xml"/> + </java> + </target> + <target name="javac.ltw" depends="compile:javac, ltw"/> <target name="ltw.Aspect2MainTest"> diff --git a/tests/java5/ataspectj/ataspectj/Test$$EnhancerByCGLIB$$12345.java b/tests/java5/ataspectj/ataspectj/Test$$EnhancerByCGLIB$$12345.java new file mode 100644 index 000000000..78df5f1b1 --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/Test$$EnhancerByCGLIB$$12345.java @@ -0,0 +1,19 @@ +/******************************************************************************* + * Copyright (c) 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Matthew Webster - initial implementation + *******************************************************************************/ +package ataspectj; + +public class Test$$EnhancerByCGLIB$$12345 { + + public static void main(String[] args) { + System.out.println("Test$$EnhancerByCGLIB$$12345.main()"); + } + +} diff --git a/tests/java5/ataspectj/ataspectj/TestInterface.java b/tests/java5/ataspectj/ataspectj/TestInterface.java new file mode 100644 index 000000000..beac1461b --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/TestInterface.java @@ -0,0 +1,16 @@ +/******************************************************************************* + * Copyright (c) 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Matthew Webster - initial implementation + *******************************************************************************/ +package ataspectj; + +public interface TestInterface { + + public void testMethod (); +} diff --git a/tests/java5/ataspectj/ataspectj/TestProxyGenerator.java b/tests/java5/ataspectj/ataspectj/TestProxyGenerator.java new file mode 100644 index 000000000..1dc0e9aac --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/TestProxyGenerator.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright (c) 2005 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * Matthew Webster - initial implementation + *******************************************************************************/ +package ataspectj; + +import java.lang.reflect.Proxy; + +public class TestProxyGenerator implements TestInterface { + + public void testMethod() { + } + + public static void main(String[] args) { + Class clazz = TestProxyGenerator.class; + Class proxyClazz = Proxy.getProxyClass(clazz.getClassLoader(),new Class[] { TestInterface.class}); + System.out.println("TestProxyGenerator.main() proxyClazz=" + proxyClazz + ", proxyClassLoader=" + proxyClazz.getClassLoader()); + } + +} diff --git a/tests/java5/ataspectj/ataspectj/aop-dumpbeforeandafter.xml b/tests/java5/ataspectj/ataspectj/aop-dumpbeforeandafter.xml index c2824e2be..487d5dd62 100644 --- a/tests/java5/ataspectj/ataspectj/aop-dumpbeforeandafter.xml +++ b/tests/java5/ataspectj/ataspectj/aop-dumpbeforeandafter.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <aspectj> - <weaver options="-XmessageHandlerClass:ataspectj.TestHelper"> - <dump within="ataspectj.DumpTestThe*" beforeandafter="true"/> + <weaver options="-verbose"> + <dump within="ataspectj..*" beforeandafter="true"/> </weaver> </aspectj> diff --git a/tests/java5/ataspectj/ataspectj/aop-dumpclosure.xml b/tests/java5/ataspectj/ataspectj/aop-dumpclosure.xml index d73c1c23b..fdee559eb 100644 --- a/tests/java5/ataspectj/ataspectj/aop-dumpclosure.xml +++ b/tests/java5/ataspectj/ataspectj/aop-dumpclosure.xml @@ -4,6 +4,9 @@ <aspect name="ataspectj.TestAroundAspect"/> </aspects> <weaver options="-Xnoinline"> - <dump within="ataspectj.DumpTestThe*" beforeandafter="true"/> + <dump within="ataspectj..*Closure*"/> +<!-- + <dump within="*"/> +--> </weaver> </aspectj> diff --git a/tests/java5/ataspectj/ataspectj/aop-dumpproxy.xml b/tests/java5/ataspectj/ataspectj/aop-dumpproxy.xml new file mode 100644 index 000000000..1a76c0152 --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/aop-dumpproxy.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<aspectj> + <weaver> +<!-- + <dump within="*..*Proxy*" beforeandafter="true"/> +--> + <dump within="*Proxy*" beforeandafter="true"/> + </weaver> +</aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java index 5db988b07..2d27cb8e1 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java @@ -11,12 +11,13 @@ *******************************************************************************/ package org.aspectj.systemtest.ajc150.ataspectj; -import org.aspectj.testing.XMLBasedAjcTestCase; -import org.aspectj.util.FileUtil; +import java.io.File; +import java.io.FilenameFilter; import junit.framework.Test; -import java.io.File; +import org.aspectj.testing.XMLBasedAjcTestCase; +import org.aspectj.util.FileUtil; /** * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> @@ -97,11 +98,9 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase { public void testLTWDumpBeforeAndAfter() { runTest("LTW DumpTest before and after"); - File f = new File("_ajdump/ataspectj/DumpTest.class"); - assertFalse(f.exists()); - f = new File("_ajdump/_before/ataspectj/DumpTestTheDump.class"); + File f = new File("_ajdump/_before/ataspectj/Test$$EnhancerByCGLIB$$12345.class"); assertTrue(f.exists()); - f = new File("_ajdump/ataspectj/DumpTestTheDump.class"); + f = new File("_ajdump/ataspectj/Test$$EnhancerByCGLIB$$12345.class"); assertTrue(f.exists()); // tidy up... @@ -110,23 +109,39 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase { f.delete(); } - /* FIXME maw currently can't dump closures because the logic in - * ClassLoaderWeavingAdaptor.shouldDump() relies on the World being - * able to resolve the name which it can't for closures. - */ -// public void testLTWDumpClosure() { -// runTest("LTW DumpTest closure"); -// -// File f = new File("_ajdump/_before/ataspectj/DumpTestTheDump$AjcClosure1.class"); -// assertTrue(f.exists()); -// f = new File("_ajdump/ataspectj/DumpTestTheDump$AjcClosure1.class"); -// assertTrue(f.exists()); -// -// // tidy up... -// f = new File("_ajdump"); -// FileUtil.deleteContents(f); -// f.delete(); -// } + public void testLTWDumpClosure() { + runTest("LTW DumpTest closure"); + + File f = new File("_ajdump/ataspectj/DumpTestTheDump$AjcClosure1.class"); + assertTrue("Missing dump file " + f.getAbsolutePath(),f.exists()); + + // tidy up... + f = new File("_ajdump"); + FileUtil.deleteContents(f); + f.delete(); + } + + public void testLTWDumpProxy() { + runTest("LTW DumpTest proxy"); + + // The working directory is different because this test must be forked + File dir = new File("../tests/java5/ataspectj"); + File f = new File(dir,"_ajdump/_before"); + System.out.println("AtAjLTWTests.testLTWDumpProxy() f=" + f.getAbsolutePath()); + CountingFilenameFilter cff = new CountingFilenameFilter(); + f.listFiles(cff); + assertEquals("Expected dump file in " + f.getAbsolutePath(),1,cff.getCount()); + f = new File(dir,"_ajdump"); + System.out.println("AtAjLTWTests.testLTWDumpProxy() f=" + f.getAbsolutePath()); + cff = new CountingFilenameFilter(); + f.listFiles(cff); + assertEquals(1,cff.getCount()); + + // tidy up... + f = new File(dir,"_ajdump"); + FileUtil.deleteContents(f); + f.delete(); + } public void testAjcAspect1LTWAspect2_Xreweavable() { runTest("Ajc Aspect1 LTW Aspect2 -Xreweavable"); @@ -185,4 +200,17 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase { runTest("AppContainer"); } + private static class CountingFilenameFilter implements FilenameFilter { + + private int count; + + public boolean accept(File dir, String name) { + if (name.endsWith(".class")) count++; + return false; + } + + public int getCount() { + return count; + } + } } diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml index 1510598fb..f4ac1a7bb 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml @@ -95,9 +95,9 @@ <ajc-test dir="java5/ataspectj" title="LTW DumpTest before and after"> <compile - files="ataspectj/DumpTest.java,ataspectj/DumpTestTheDump.java,ataspectj/TestHelper.java" + files="ataspectj/Test$$EnhancerByCGLIB$$12345.java" options="-1.5"/> - <run class="ataspectj.DumpTest" ltw="ataspectj/aop-dumpbeforeandafter.xml"/> + <run class="ataspectj.Test$$EnhancerByCGLIB$$12345" ltw="ataspectj/aop-dumpbeforeandafter.xml"/> </ajc-test> <ajc-test dir="java5/ataspectj" title="LTW DumpTest closure"> @@ -107,6 +107,13 @@ <run class="ataspectj.DumpTest" ltw="ataspectj/aop-dumpclosure.xml"/> </ajc-test> + <ajc-test dir="java5/ataspectj" title="LTW DumpTest proxy"> + <compile + files="ataspectj/TestProxyGenerator.java,ataspectj/TestInterface.java" + options="-1.5"/> + <ant file="ajc-ant.xml" target="ltw.DumpProxyTest" verbose="true"/> + </ajc-test> + <ajc-test dir="java5/ataspectj" title="Ajc Aspect1 LTW Aspect2 -Xreweavable"> <compile files="ataspectj/ltwreweavable/Main.java,ataspectj/ltwreweavable/Aspect1.java,ataspectj/ltwreweavable/Advisable.java" diff --git a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java index 39f94f852..ed2d8b52e 100644 --- a/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java +++ b/weaver/src/org/aspectj/weaver/CrosscuttingMembers.java @@ -151,7 +151,7 @@ public class CrosscuttingMembers { } public void exposeType(UnresolvedType typeToExpose) { - if (typeToExpose == ResolvedType.MISSING) return; + if (ResolvedType.isMissing(typeToExpose)) return; if (typeToExpose.isParameterizedType() || typeToExpose.isRawType()) { if (typeToExpose instanceof ResolvedType) { typeToExpose = ((ResolvedType)typeToExpose).getGenericType(); diff --git a/weaver/src/org/aspectj/weaver/ResolvedType.java b/weaver/src/org/aspectj/weaver/ResolvedType.java index 7ef50c857..a77c88ca1 100644 --- a/weaver/src/org/aspectj/weaver/ResolvedType.java +++ b/weaver/src/org/aspectj/weaver/ResolvedType.java @@ -98,6 +98,16 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl return false; } + // FIXME asc I wonder if in some circumstances MissingWithKnownSignature should not be considered + // 'really' missing as some code can continue based solely on the signature + public static boolean isMissing (UnresolvedType unresolved) { + if (unresolved instanceof ResolvedType) { + ResolvedType resolved = (ResolvedType)unresolved; + return resolved.isMissing(); + } + else return (unresolved == MISSING); + } + public ResolvedType[] getAnnotationTypes() { return EMPTY_RESOLVED_TYPE_ARRAY; } @@ -1243,7 +1253,7 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl int lastDollar = name.lastIndexOf('$'); while (lastDollar != -1) { ResolvedType ret = world.resolve(UnresolvedType.forName(name.substring(0, lastDollar)), true); - if (ret != ResolvedType.MISSING) return ret; + if (!ResolvedType.isMissing(ret)) return ret; lastDollar = name.lastIndexOf('$', lastDollar-1); } return null; diff --git a/weaver/src/org/aspectj/weaver/WeaverStateInfo.java b/weaver/src/org/aspectj/weaver/WeaverStateInfo.java index ca3fe6356..77af4bbbc 100644 --- a/weaver/src/org/aspectj/weaver/WeaverStateInfo.java +++ b/weaver/src/org/aspectj/weaver/WeaverStateInfo.java @@ -204,7 +204,7 @@ public class WeaverStateInfo { for (Iterator i = typeMungers.iterator(); i.hasNext();) { Entry entry = (Entry) i.next(); ResolvedType aspectType = world.resolve(entry.aspectType, true); - if (aspectType == ResolvedType.MISSING) { + if (aspectType.isMissing()) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.ASPECT_NEEDED,entry.aspectType,onType), onType.getSourceLocation(), null); diff --git a/weaver/src/org/aspectj/weaver/World.java b/weaver/src/org/aspectj/weaver/World.java index 4a21711d4..85dec384d 100644 --- a/weaver/src/org/aspectj/weaver/World.java +++ b/weaver/src/org/aspectj/weaver/World.java @@ -144,7 +144,7 @@ public abstract class World implements Dump.INode { */ public ResolvedType resolve(UnresolvedType ty,ISourceLocation isl) { ResolvedType ret = resolve(ty,true); - if (ty == ResolvedType.MISSING) { + if (ResolvedType.isMissing(ty)) { //IMessage msg = null; getLint().cantFindType.signal(WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE,ty.getName()),isl); //if (isl!=null) { @@ -215,13 +215,13 @@ public abstract class World implements Dump.INode { componentType); } else { ret = resolveToReferenceType(ty); - if (!allowMissing && ret == ResolvedType.MISSING) { + if (!allowMissing && ret.isMissing()) { ret = handleRequiredMissingTypeDuringResolution(ty); } } // Pulling in the type may have already put the right entry in the map - if (typeMap.get(signature)==null && ret != ResolvedType.MISSING) { + if (typeMap.get(signature)==null && !ret.isMissing()) { typeMap.put(signature, ret); } return ret; @@ -298,7 +298,9 @@ public abstract class World implements Dump.INode { String erasedSignature = ty.getErasureSignature(); ReferenceType simpleOrRawType = new ReferenceType(erasedSignature, this); ReferenceTypeDelegate delegate = resolveDelegate(simpleOrRawType); - if (delegate == null) return ResolvedType.MISSING; + // 117854 +// if (delegate == null) return ResolvedType.MISSING; + if (delegate == null) return new MissingResolvedTypeWithKnownSignature(ty.getSignature(),erasedSignature,this);//ResolvedType.MISSING; if (delegate.isGeneric() && behaveInJava5Way) { // ======== raw type =========== @@ -401,7 +403,7 @@ public abstract class World implements Dump.INode { */ public ResolvedType getCoreType(UnresolvedType tx) { ResolvedType coreTy = resolve(tx,true); - if (coreTy == ResolvedType.MISSING) { + if (coreTy.isMissing()) { MessageUtil.error(messageHandler, WeaverMessages.format(WeaverMessages.CANT_FIND_CORE_TYPE,tx.getName())); } diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java index 42b07a859..728b6c128 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelAdvice.java @@ -175,7 +175,7 @@ public class BcelAdvice extends Advice { private boolean canInline(Shadow s) { if (attribute.isProceedInInners()) return false; //XXX this guard seems to only be needed for bad test cases - if (concreteAspect == null || concreteAspect == ResolvedType.MISSING) return false; + if (concreteAspect == null || concreteAspect.isMissing()) return false; if (concreteAspect.getWorld().isXnoInline()) return false; //System.err.println("isWoven? " + ((BcelObjectType)concreteAspect).getLazyClassGen().getWeaverState()); @@ -261,7 +261,7 @@ public class BcelAdvice extends Advice { for (int i=0, len=excs.length; i < len; i++) { ResolvedType t = world.resolve(excs[i],true); - if (t == ResolvedType.MISSING) { + if (t.isMissing()) { world.getLint().cantFindType.signal( WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_EXCEPTION_TYPE,excs[i].getName()), getSourceLocation() diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java index 9163bc019..96fe92f4d 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelShadow.java @@ -2030,7 +2030,7 @@ public class BcelShadow extends Shadow { if (rm.hasBackingGenericMember()) mungerSig = rm.getBackingGenericMember(); } ResolvedType declaringType = world.resolve(mungerSig.getDeclaringType(),true); - if (declaringType == ResolvedType.MISSING) { + if (declaringType.isMissing()) { world.getLint().cantFindType.signal( new String[] {WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_DURING_AROUND_WEAVE,declaringType.getClassName())}, getSourceLocation(), @@ -2636,7 +2636,7 @@ public class BcelShadow extends Shadow { for (int i = 0, len = stateTypes.length; i < len; i++) { UnresolvedType bcelTX = BcelWorld.fromBcel(stateTypes[i]); ResolvedType stateRTX = world.resolve(bcelTX,true); - if (stateRTX == ResolvedType.MISSING) { + if (stateRTX.isMissing()) { world.getLint().cantFindType.signal( new String[] {WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_DURING_AROUND_WEAVE_PREINIT,bcelTX.getClassName())}, getSourceLocation(), diff --git a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java index 30d35cff0..ad39f3f44 100644 --- a/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/org/aspectj/weaver/bcel/BcelWeaver.java @@ -148,7 +148,7 @@ public class BcelWeaver implements IWeaver { public ResolvedType addLibraryAspect(String aspectName) { // 1 - resolve as is ResolvedType type = world.resolve(UnresolvedType.forName(aspectName), true); - if (type.equals(ResolvedType.MISSING)) { + if (type.isMissing()) { // fallback on inner class lookup mechanism String fixedName = aspectName; int hasDot = fixedName.lastIndexOf('.'); @@ -159,7 +159,7 @@ public class BcelWeaver implements IWeaver { fixedName = new String(fixedNameChars); hasDot = fixedName.lastIndexOf('.'); type = world.resolve(UnresolvedType.forName(fixedName), true); - if (!type.equals(ResolvedType.MISSING)) { + if (!type.isMissing()) { break; } } @@ -1223,7 +1223,7 @@ public class BcelWeaver implements IWeaver { String requiredTypeName = (String) iter.next(); if (!alreadyConfirmedReweavableState.contains(requiredTypeName)) { ResolvedType rtx = world.resolve(UnresolvedType.forName(requiredTypeName),true); - boolean exists = rtx!=ResolvedType.MISSING; + boolean exists = !rtx.isMissing(); if (!exists) { world.showMessage(IMessage.ERROR, WeaverMessages.format(WeaverMessages.MISSING_REWEAVABLE_TYPE,requiredTypeName,className), diff --git a/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java b/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java index 2c82ab042..aec5585df 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/ArgsAnnotationPointcut.java @@ -144,7 +144,7 @@ public class ArgsAnnotationPointcut extends NameBindingPointcut { ExactAnnotationTypePattern ap = (ExactAnnotationTypePattern)arguments.get(i); UnresolvedType argType = shadow.getArgType(argsIndex); ResolvedType rArgType = argType.resolve(shadow.getIWorld()); - if (rArgType == ResolvedType.MISSING) { + if (rArgType.isMissing()) { shadow.getIWorld().getLint().cantFindType.signal( new String[] {WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_ARG_TYPE,argType.getName())}, shadow.getSourceLocation(), diff --git a/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java b/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java index 2db231129..ae4e507e5 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/ArgsPointcut.java @@ -204,7 +204,7 @@ public class ArgsPointcut extends NameBindingPointcut { TypePattern type = patterns[i]; ResolvedType argRTX = shadow.getIWorld().resolve(argType,true); if (!(type instanceof BindingTypePattern)) { - if (argRTX == ResolvedType.MISSING) { + if (argRTX.isMissing()) { shadow.getIWorld().getLint().cantFindType.signal( new String[] {WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_ARG_TYPE,argType.getName())}, shadow.getSourceLocation(), diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java b/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java index 0c401c504..91465a12f 100644 --- a/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java +++ b/weaver/src/org/aspectj/weaver/patterns/DeclarePrecedence.java @@ -93,7 +93,7 @@ public class DeclarePrecedence extends Declare { continue; } ResolvedType exactType = pi.getExactType().resolve(scope.getWorld()); - if (exactType == ResolvedType.MISSING) continue; + if (exactType.isMissing()) continue; // Cannot do a dec prec specifying a non-aspect types unless suffixed with a '+' if (!exactType.isAspect() && !pi.isIncludeSubtypes() && !exactType.isTypeVariableReference()) { diff --git a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java index c9a668e0d..3d23857d5 100644 --- a/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java +++ b/weaver/src/org/aspectj/weaver/patterns/DeclareSoft.java @@ -99,7 +99,7 @@ public class DeclareSoft extends Declare { public void resolve(IScope scope) { exception = exception.resolveBindings(scope, null, false, true); ResolvedType excType = exception.getExactType().resolve(scope.getWorld()); - if (excType != ResolvedType.MISSING) { + if (!excType.isMissing()) { if (excType.isTypeVariableReference()) { // a declare soft in a generic abstract aspect, we need to check the upper bound excType = excType.getUpperBound().resolve(scope.getWorld()); diff --git a/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java index 9381e1422..0af6e5a5e 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/ExactAnnotationTypePattern.java @@ -154,9 +154,9 @@ public class ExactAnnotationTypePattern extends AnnotationTypePattern { annotationType = scope.getWorld().resolve(annotationType,true); // We may not have found it if it is in a package, lets look it up... - if (annotationType == ResolvedType.MISSING) { + if (ResolvedType.isMissing(annotationType)) { UnresolvedType type = null; - while ((type = scope.lookupType(cleanname,this)) == ResolvedType.MISSING) { + while (ResolvedType.isMissing(type = scope.lookupType(cleanname,this))) { int lastDot = cleanname.lastIndexOf('.'); if (lastDot == -1) break; cleanname = cleanname.substring(0,lastDot)+"$"+cleanname.substring(lastDot+1); diff --git a/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java index 9f99baf17..ec6850a0e 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/ExactTypePattern.java @@ -83,7 +83,7 @@ public class ExactTypePattern extends TypePattern { if (super.couldEverMatchSameTypesAs(other)) return true; // false is necessary but not sufficient UnresolvedType otherType = other.getExactType(); - if (otherType != ResolvedType.MISSING) { + if (!ResolvedType.isMissing(otherType)) { return type.equals(otherType); } if (other instanceof WildTypePattern) { diff --git a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java index db47527dd..0f124a7f9 100644 --- a/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/KindedPointcut.java @@ -145,7 +145,7 @@ public class KindedPointcut extends Pointcut { shadow.getSignature().getDeclaringType().resolve(world); if (signature.getDeclaringType().isStar() - || exactDeclaringType == ResolvedType.MISSING + || ResolvedType.isMissing(exactDeclaringType) || exactDeclaringType.resolve(world).isMissing()) return; @@ -267,7 +267,7 @@ public class KindedPointcut extends Pointcut { World world = scope.getWorld(); UnresolvedType exactType = signature.getDeclaringType().getExactType(); if (signature.getKind() == Member.CONSTRUCTOR && - !exactType.equals(ResolvedType.MISSING) && + !ResolvedType.isMissing(exactType) && exactType.resolve(world).isInterface() && !signature.getDeclaringType().isIncludeSubtypes()) { world.getLint().noInterfaceCtorJoinpoint.signal(exactType.toString(), getSourceLocation()); diff --git a/weaver/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java b/weaver/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java index daaf2d5e1..0d3cb2a5f 100644 --- a/weaver/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java +++ b/weaver/src/org/aspectj/weaver/patterns/PerThisOrTargetPointcutVisitor.java @@ -165,7 +165,7 @@ public class PerThisOrTargetPointcutVisitor extends IdentityPointcutVisitor { ResolvedType searchStart = m_fromAspectType; if (node.onType != null) { searchStart = node.onType.resolve(m_fromAspectType.getWorld()); - if (searchStart == ResolvedType.MISSING) { + if (searchStart.isMissing()) { return MAYBE;// this should not happen since concretize will fails but just in case.. } } diff --git a/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java b/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java index b1fb147c1..0f8d2a327 100644 --- a/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java +++ b/weaver/src/org/aspectj/weaver/patterns/PerTypeWithin.java @@ -79,7 +79,7 @@ public class PerTypeWithin extends PerClause { protected FuzzyBoolean matchInternal(Shadow shadow) { ResolvedType enclosingType = shadow.getIWorld().resolve(shadow.getEnclosingType(),true); - if (enclosingType == ResolvedType.MISSING) { + if (enclosingType.isMissing()) { //PTWIMPL ?? Add a proper message IMessage msg = new Message( "Cant find type pertypewithin matching...", diff --git a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java index f20223cb4..ae7b841cc 100644 --- a/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/ReferencePointcut.java @@ -129,7 +129,7 @@ public class ReferencePointcut extends Pointcut { if (onTypeSymbolic != null) { onType = onTypeSymbolic.resolveExactType(scope, bindings); // in this case we've already signalled an error - if (onType == ResolvedType.MISSING) return; + if (ResolvedType.isMissing(onType)) return; } ResolvedType searchType; @@ -263,7 +263,7 @@ public class ReferencePointcut extends Pointcut { ResolvedPointcutDefinition pointcutDec; if (onType != null) { searchStart = onType.resolve(searchStart.getWorld()); - if (searchStart == ResolvedType.MISSING) { + if (searchStart.isMissing()) { return Pointcut.makeMatchesNothing(Pointcut.CONCRETE); } } diff --git a/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java b/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java index 31e85dcb0..13475e6a0 100644 --- a/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java +++ b/weaver/src/org/aspectj/weaver/patterns/SimpleScope.java @@ -51,8 +51,8 @@ public class SimpleScope implements IScope { for (int i=0; i<importedPrefixes.length; i++) { String importedPrefix = importedPrefixes[i]; - UnresolvedType tryType = world.resolve(UnresolvedType.forName(importedPrefix + name), true); - if (tryType != ResolvedType.MISSING) { + ResolvedType tryType = world.resolve(UnresolvedType.forName(importedPrefix + name), true); + if (!tryType.isMissing()) { return tryType; } } diff --git a/weaver/src/org/aspectj/weaver/patterns/TypePattern.java b/weaver/src/org/aspectj/weaver/patterns/TypePattern.java index ca7f99547..daaa83421 100644 --- a/weaver/src/org/aspectj/weaver/patterns/TypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/TypePattern.java @@ -125,7 +125,7 @@ public abstract class TypePattern extends PatternNode { public final FuzzyBoolean matches(ResolvedType type, MatchKind kind) { FuzzyBoolean typeMatch = null; //??? This is part of gracefully handling missing references - if (type == ResolvedType.MISSING) return FuzzyBoolean.NO; + if (type.isMissing()) return FuzzyBoolean.NO; if (kind == STATIC) { // typeMatch = FuzzyBoolean.fromBoolean(matchesStatically(type)); diff --git a/weaver/src/org/aspectj/weaver/patterns/TypePatternList.java b/weaver/src/org/aspectj/weaver/patterns/TypePatternList.java index f4f0848f5..98ff2c632 100644 --- a/weaver/src/org/aspectj/weaver/patterns/TypePatternList.java +++ b/weaver/src/org/aspectj/weaver/patterns/TypePatternList.java @@ -270,7 +270,7 @@ public class TypePatternList extends PatternNode { ArrayList ret = new ArrayList(); for (int i=0; i<typePatterns.length; i++) { UnresolvedType t = typePatterns[i].getExactType(); - if (t != ResolvedType.MISSING) ret.add(t); + if (!ResolvedType.isMissing(t)) ret.add(t); } return ret; } diff --git a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java index 234bcc334..9d39c1791 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java +++ b/weaver/src/org/aspectj/weaver/patterns/WildTypePattern.java @@ -182,7 +182,7 @@ public class WildTypePattern extends TypePattern { if (super.couldEverMatchSameTypesAs(other)) return true; // false is necessary but not sufficient UnresolvedType otherType = other.getExactType(); - if (otherType != ResolvedType.MISSING) { + if (!ResolvedType.isMissing(otherType)) { if (namePatterns.length > 0) { if (!namePatterns[0].matches(otherType.getName())) return false; } @@ -703,7 +703,7 @@ public class WildTypePattern extends TypePattern { private UnresolvedType lookupTypeInScope(IScope scope, String typeName, IHasPosition location) { UnresolvedType type = null; - while ((type = scope.lookupType(typeName, location)) == ResolvedType.MISSING) { + while (ResolvedType.isMissing(type = scope.lookupType(typeName, location))) { int lastDot = typeName.lastIndexOf('.'); if (lastDot == -1) break; typeName = typeName.substring(0, lastDot) + '$' + typeName.substring(lastDot+1); @@ -713,7 +713,7 @@ public class WildTypePattern extends TypePattern { private ResolvedType lookupTypeInWorld(World world, String typeName) { ResolvedType ret = world.resolve(UnresolvedType.forName(typeName),true); - while (ret == ResolvedType.MISSING) { + while (ret.isMissing()) { int lastDot = typeName.lastIndexOf('.'); if (lastDot == -1) break; typeName = typeName.substring(0, lastDot) + '$' + typeName.substring(lastDot+1); @@ -744,8 +744,8 @@ public class WildTypePattern extends TypePattern { private TypePattern resolveGenericWildcard(IScope scope, UnresolvedType aType) { if (!aType.getSignature().equals(GENERIC_WILDCARD_CHARACTER)) throw new IllegalStateException("Can only have bounds for a generic wildcard"); boolean canBeExact = true; - if ((upperBound != null) && (upperBound.getExactType() == ResolvedType.MISSING)) canBeExact = false; - if ((lowerBound != null) && (lowerBound.getExactType() == ResolvedType.MISSING)) canBeExact = false; + if ((upperBound != null) && ResolvedType.isMissing(upperBound.getExactType())) canBeExact = false; + if ((lowerBound != null) && ResolvedType.isMissing(lowerBound.getExactType())) canBeExact = false; if (canBeExact) { ResolvedType type = null; if (upperBound != null) { @@ -813,7 +813,7 @@ public class WildTypePattern extends TypePattern { return NO; } else if (scope.getWorld().getLint().invalidAbsoluteTypeName.isEnabled()) { // Only put the lint warning out if we can't find it in the world - if (typeFoundInWholeWorldSearch == ResolvedType.MISSING) { + if (typeFoundInWholeWorldSearch.isMissing()) { scope.getWorld().getLint().invalidAbsoluteTypeName.signal(nameWeLookedFor, getSourceLocation()); } } @@ -854,11 +854,11 @@ public class WildTypePattern extends TypePattern { } else { // we have to set bounds on the TypeVariable held by tvrType before resolving it boolean canCreateExactTypePattern = true; - if (upperBound != null && upperBound.getExactType() == ResolvedType.MISSING) canCreateExactTypePattern = false; - if (lowerBound != null && lowerBound.getExactType() == ResolvedType.MISSING) canCreateExactTypePattern = false; + if (upperBound != null && ResolvedType.isMissing(upperBound.getExactType())) canCreateExactTypePattern = false; + if (lowerBound != null && ResolvedType.isMissing(lowerBound.getExactType())) canCreateExactTypePattern = false; if (additionalInterfaceBounds != null) { for (int i = 0; i < additionalInterfaceBounds.length; i++) { - if (additionalInterfaceBounds[i].getExactType() == ResolvedType.MISSING) canCreateExactTypePattern = false; + if (ResolvedType.isMissing(additionalInterfaceBounds[i].getExactType())) canCreateExactTypePattern = false; } } if (canCreateExactTypePattern) { diff --git a/weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java b/weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java index 1e849f8ab..5996464d7 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/WithinAnnotationPointcut.java @@ -87,7 +87,7 @@ public class WithinAnnotationPointcut extends NameBindingPointcut { */ protected FuzzyBoolean matchInternal(Shadow shadow) { ResolvedType enclosingType = shadow.getIWorld().resolve(shadow.getEnclosingType(),true); - if (enclosingType == ResolvedType.MISSING) { + if (enclosingType.isMissing()) { shadow.getIWorld().getLint().cantFindType.signal( new String[] {WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_WITHINPCD, shadow.getEnclosingType().getName())}, diff --git a/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java b/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java index 381bf6eba..5e893256a 100644 --- a/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java +++ b/weaver/src/org/aspectj/weaver/patterns/WithinPointcut.java @@ -71,7 +71,7 @@ public class WithinPointcut extends Pointcut { protected FuzzyBoolean matchInternal(Shadow shadow) { ResolvedType enclosingType = shadow.getIWorld().resolve(shadow.getEnclosingType(),true); - if (enclosingType == ResolvedType.MISSING) { + if (enclosingType.isMissing()) { shadow.getIWorld().getLint().cantFindType.signal( new String[] {WeaverMessages.format(WeaverMessages.CANT_FIND_TYPE_WITHINPCD, shadow.getEnclosingType().getName())}, diff --git a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java index 3aeaa7f70..6b62365e8 100644 --- a/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java +++ b/weaver/src/org/aspectj/weaver/tools/WeavingAdaptor.java @@ -361,6 +361,7 @@ public class WeavingAdaptor { dir.mkdirs(); String fileName = dirName + File.separator + className + ".class"; try { +// System.out.println("WeavingAdaptor.dump() fileName=" + new File(fileName).getAbsolutePath()); FileOutputStream os = new FileOutputStream(fileName); os.write(b); os.close(); diff --git a/weaver/testsrc/org/aspectj/weaver/AbstractWorldTestCase.java b/weaver/testsrc/org/aspectj/weaver/AbstractWorldTestCase.java index 306cc1da4..8a8ff8302 100644 --- a/weaver/testsrc/org/aspectj/weaver/AbstractWorldTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/AbstractWorldTestCase.java @@ -78,7 +78,7 @@ public abstract class AbstractWorldTestCase extends TestCase { ResolvedType[] primitives = getWorld().resolve(primitiveTypeXs); UnresolvedType tx = UnresolvedType.forSignature(sig); ResolvedType ty = getWorld().resolve(tx,true); - assertTrue("Couldnt find type "+tx,ty!=ResolvedType.MISSING); + assertTrue("Couldnt find type "+tx,!ty.isMissing()); ResolvedType[] lowerTyArray = getWorld().resolve(UnresolvedType.forSignatures(lowers)); List lowerTys = new ArrayList(Arrays.asList(lowerTyArray)); @@ -103,7 +103,7 @@ public abstract class AbstractWorldTestCase extends TestCase { ResolvedType ty = primitives[i]; UnresolvedType tx = UnresolvedType.forSignature("["+ty.getSignature()); ResolvedType aty = getWorld().resolve(tx,true); - assertTrue("Couldnt find type "+tx,aty!=ResolvedType.MISSING); + assertTrue("Couldnt find type "+tx,!aty.isMissing()); modifiersTest(aty, Modifier.PUBLIC | Modifier.FINAL); fieldsTest(aty, ResolvedMember.NONE); methodsTest(aty, ResolvedMember.NONE); @@ -121,7 +121,7 @@ public abstract class AbstractWorldTestCase extends TestCase { isCoerceableFromTest(aty, ty1, false); tx = UnresolvedType.forSignature("[" + ty1.getSignature()); ResolvedType aty1 = getWorld().resolve(tx,true); - assertTrue("Couldnt find type "+tx,aty1!=ResolvedType.MISSING); + assertTrue("Couldnt find type "+tx,!aty1.isMissing()); if (ty.equals(ty1)) { isCoerceableFromTest(aty, aty1, true); isAssignableFromTest(aty, aty1, true); diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java index 722e4a83c..abb5e8bc2 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java @@ -101,7 +101,7 @@ public class ArgsWeaveTestCase extends WeaveTestCase { private BcelAdvice makeArgsMunger(final String kindx) { ResolvedType rtx = world.resolve(UnresolvedType.forName("Aspect"),true); - assertTrue("Cant find required type Aspect",rtx!=ResolvedType.MISSING); + assertTrue("Cant find required type Aspect",!rtx.isMissing()); return new BcelAdvice(AdviceKind.stringToKind(kindx), makePointcutNoZeroArg(), MemberImpl.method(UnresolvedType.forName("Aspect"), 0, "foo", "()V"), 0, -1, -1, null, rtx) { diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java index a028f9a98..6dc75c4e7 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/TjpWeaveTestCase.java @@ -76,7 +76,7 @@ public class TjpWeaveTestCase extends WeaveTestCase { public void testAround2Tjp() throws IOException { ResolvedType rtx = world.resolve(UnresolvedType.forName("Aspect"),true); - assertTrue("Couldnt find type Aspect",rtx!=ResolvedType.MISSING); + assertTrue("Couldnt find type Aspect",!rtx.isMissing()); BcelAdvice munger1 = new BcelAdvice( AdviceKind.stringToKind("around"), makePointcutAll(), diff --git a/weaver/testsrc/org/aspectj/weaver/bcel/WorldTestCase.java b/weaver/testsrc/org/aspectj/weaver/bcel/WorldTestCase.java index cb82a2f5f..6b6656634 100644 --- a/weaver/testsrc/org/aspectj/weaver/bcel/WorldTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/bcel/WorldTestCase.java @@ -36,7 +36,7 @@ public class WorldTestCase extends AbstractWorldTestCase { // XXX fix the various XXXs before expecting this test to work public void xtestTraceJar() { ResolvedType trace = world.resolve(UnresolvedType.forName("Trace"),true); - assertTrue("Couldnt find type Trace",trace!=ResolvedType.MISSING); + assertTrue("Couldnt find type Trace",!trace.isMissing()); fieldsTest(trace, Member.NONE); /*Member constr = */MemberImpl.methodFromString("void Trace.<init>()"); //XXX need attribute fix - @@ -69,7 +69,7 @@ public class WorldTestCase extends AbstractWorldTestCase { }); ResolvedType myTrace = world.resolve(UnresolvedType.forName("MyTrace"),true); - assertTrue("Couldnt find type MyTrace",myTrace!=ResolvedType.MISSING); + assertTrue("Couldnt find type MyTrace",!myTrace.isMissing()); interfacesTest(myTrace, ResolvedType.NONE); superclassTest(myTrace, trace); diff --git a/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java b/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java index e9db3caa8..7f25ac1ac 100644 --- a/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java +++ b/weaver/testsrc/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java @@ -122,11 +122,11 @@ import org.aspectj.weaver.bcel.BcelWorld; assertTrue("resolves to WildTypePattern",rtp instanceof WildTypePattern); assertTrue("one type parameter", rtp.typeParameters.size() == 1); - assertEquals("missing",ResolvedType.MISSING,rtp.getExactType()); + assertTrue("missing",ResolvedType.isMissing(rtp.getExactType())); WildTypePattern wtp = (WildTypePattern) writeAndRead(rtp); assertTrue("one type parameter", wtp.typeParameters.size() == 1); - assertEquals("missing",ResolvedType.MISSING,wtp.getExactType()); + assertTrue("missing",ResolvedType.isMissing(wtp.getExactType())); assertEquals("Str*",wtp.getTypeParameters().getTypePatterns()[0].toString()); assertFalse("does not match List",wtp.matches(javaUtilList, TypePattern.STATIC).alwaysTrue()); |