}
super.unusedPrivateType(typeDecl);
}
+
private final static char[] thisJoinPointName = "thisJoinPoint".toCharArray();
+ private final static char[] thisJoinPointStaticPartName = "thisJoinPointStaticPart".toCharArray();
+ private final static char[] thisEnclosingJoinPointStaticPartName = "thisEnclosingJoinPointStaticPart".toCharArray();
public void uninitializedLocalVariable(LocalVariableBinding binding, ASTNode location) {
- if (CharOperation.equals(binding.name,thisJoinPointName)) {
+ if (CharOperation.equals(binding.name, thisJoinPointName) ||
+ CharOperation.equals(binding.name, thisJoinPointStaticPartName) ||
+ CharOperation.equals(binding.name, thisEnclosingJoinPointStaticPartName)) {
// If in advice, this is not a problem
if (binding.declaringScope!=null && binding.declaringScope.referenceContext() instanceof AdviceDeclaration) {
return;
}
- }
+ }
super.uninitializedLocalVariable(binding, location);
}
--- /dev/null
+import org.aspectj.lang.annotation.SuppressAjWarnings;
+
+privileged aspect BugThisJoinPoint {
+
+ @SuppressAjWarnings("adviceDidNotMatch")
+ void around(): execution(boolean forceFocus ()) {
+ thisEnclosingJoinPointStaticPart.getSignature();
+ }
+
+ @SuppressAjWarnings("adviceDidNotMatch")
+ void around(): execution(boolean forceFocus ()) {
+ thisJoinPointStaticPart.getSignature();
+ }
+}
+
TestSuite suite = new TestSuite("AspectJ 1.8.0 tests");
// $JUnit-BEGIN$
suite.addTest(Ajc180Tests.suite());
- suite.addTest(Ajc181Tests.suite());
// $JUnit-END$
return suite;
}
*/
public class Ajc181Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+ public void testThisEnclosingJoinPointStaticPartNotInitialized_431976() {
+ runTest("thisEnclosingJoinPointStaticPart not initialized");
+ }
+
public void testLvarTable_435446() throws Exception {
runTest("lvartable");
}
<suite>
+ <ajc-test dir="bugs181/431976" title="thisEnclosingJoinPointStaticPart not initialized">
+ <compile options="-1.8" files="Code.java"/>
+ </ajc-test>
+
<ajc-test dir="bugs181/435446" title="lvartable">
<compile options="-1.8" files="Application.java MyAspect.java">
</compile>