runTest("verification problem"); // build the code
Utils.verifyClass(ajc,"mypackage.MyAspect"); // verify it <<< BRAND NEW VERIFY UTILITY FOR EVERYONE TO TRY ;)
}
- public void testIncorrectAnnotationValue_pr148537() { runTest("incorrect annotation value");}
+ public void testIncorrectAnnotationValue_pr148537() { runTest("incorrect annotation value");}
+ public void testVerifyErrNoTypeCflowField_pr145693_1() { runTest("verifyErrNoTypeCflowField"); }
+// public void testVerifyErrInpathNoTypeCflowField_pr145693_2() { runTest("verifyErrInpathNoTypeCflowField"); }
+// public void testCpathNoTypeCflowField_pr145693_3() { runTest("cpathNoTypeCflowField"); }
/////////////////////////////////////////
protected File getSpecFile() {
return new File("../tests/src/org/aspectj/systemtest/ajc153/ajc153.xml");
}
+
}
\ No newline at end of file
</compile>
</ajc-test>
+ <ajc-test dir="bugs153/pr145693" title="verifyErrNoTypeCflowField">
+ <compile files="Event.java" outjar="cpath.jar"/>
+ <compile files="Monitor.aj" outjar="apath.jar" classpath="cpath.jar"/>
+ <compile files="Sample.java" options="-Xlint:ignore" aspectpath="apath.jar" outjar="run.jar">
+ <message kind="warning" line="8" text="Unable to determine match at this join point because the type 'Event' cannot be found"/>
+ </compile>
+ <run class="Sample" classpath="run.jar,apath.jar">
+ <stderr>
+ <line text="method running"/>
+ </stderr>
+ </run>
+ </ajc-test>
+
+ <ajc-test dir="bugs153/pr145693" title="verifyErrInpathNoTypeCflowField">
+ <compile files="Event.java" outjar="cpath.jar"/>
+ <compile files="Monitor.aj" outjar="apath.jar" classpath="cpath.jar"/>
+ <compile files="Sample.java" options="-Xlint:ignore" inpath="cpath.jar" aspectpath="apath.jar" outjar="run.jar"/>
+ <run class="Sample" classpath="run.jar,apath.jar"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs153/pr145693" title="cpathNoTypeCflowField">
+ <compile files="Event.java" outjar="cpath.jar"/>
+ <compile files="Monitor.aj" outjar="apath.jar" classpath="cpath.jar"/>
+ <compile files="Sample.java" options="-Xlint:ignore" classpath="cpath.jar" aspectpath="apath.jar" outjar="run.jar"/>
+ <run class="Sample" classpath="run.jar,apath.jar"/>
+ </ajc-test>
</suite>
\ No newline at end of file
import java.util.List;
import java.util.Map;
+import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.bridge.Message;
import org.aspectj.util.FuzzyBoolean;
import org.aspectj.weaver.IntMap;
import org.aspectj.weaver.Member;
import org.aspectj.weaver.ResolvedType;
import org.aspectj.weaver.Shadow;
import org.aspectj.weaver.UnresolvedType;
+import org.aspectj.weaver.WeaverMessages;
import org.aspectj.weaver.ast.Expr;
import org.aspectj.weaver.ast.Test;
import org.aspectj.weaver.bcel.BcelCflowAccessVar;
protected FuzzyBoolean matchInternal(Shadow shadow) {
//??? this is not maximally efficient
+ // Check we'll be able to do the residue!
+
+ // this bit is for pr145693 - we cannot match at all if one of the types is missing, we will be unable
+ // to create the residue
+ if (slots != null) {
+ for (Iterator i = slots.iterator(); i.hasNext();) {
+ Slot slot = (Slot) i.next();
+ ResolvedType rt = slot.formalType;
+ if (rt.isMissing()) {
+ ISourceLocation[] locs = new ISourceLocation[]{getSourceLocation()};
+ Message m = new Message(
+ WeaverMessages.format(WeaverMessages.MISSING_TYPE_PREVENTS_MATCH,rt.getName()),
+ "",Message.WARNING,shadow.getSourceLocation(),null,locs);
+ rt.getWorld().getMessageHandler().handleMessage(m);
+ return FuzzyBoolean.NO;
+ }
+ }
+ }
return FuzzyBoolean.MAYBE;
}