// answer true if the receiverType is the declaringClass
// AND the invocationType and the declaringClass have a common enclosingType
+ // see pr149071 - it has caused me to comment out this block below - what
+ // is it trying to achieve? Possibly it should be using the scope.parentScope (the class scope of
+ // where the reference is being made) rather than the receiver type
+
// Is the receiverType an innertype of the declaring type?
- boolean receiverTypeIsSameOrInsideDeclaringType = receiverType == declaringType;
- ReferenceBinding typeToCheckNext = receiverType.enclosingType();
- while (!receiverTypeIsSameOrInsideDeclaringType && typeToCheckNext!=null) {
- if (typeToCheckNext==declaringType) receiverTypeIsSameOrInsideDeclaringType=true;
- }
- if (!receiverTypeIsSameOrInsideDeclaringType) return false;
+// boolean receiverTypeIsSameOrInsideDeclaringType = receiverType == declaringType;
+// ReferenceBinding typeToCheckNext = receiverType.enclosingType();
+// while (!receiverTypeIsSameOrInsideDeclaringType && typeToCheckNext!=null) {
+// if (typeToCheckNext==declaringType) receiverTypeIsSameOrInsideDeclaringType=true;
+// }
+// if (!receiverTypeIsSameOrInsideDeclaringType) return false;
+
+
// the code above replaces this line: (pr118698)
// if (receiverType != declaringType) return false;
public aspect AspectItd {
//private interface Holder {}
private int Holder.x;
- static aspect Inner {
+ static class Inner {
int doIt(Holder h) {
return h.x++;
}
}
+
+ public static void main(String []argv) {
+ new Inner().doIt(new HolderImpl());
+ }
}
interface Holder{}
+
+class HolderImpl implements Holder {}
// public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
// public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); }
// public void testNegatedAnnotationMatchingProblem_pr153464() { runTest("negated annotation matching problem");}
+ public void testVisibilityProblem_pr149071() { runTest("visibility problem");}
public void testMissingLineNumbersInStacktraceAfter_pr145442() { runTest("missing line numbers in stacktrace after");}
public void testMissingLineNumbersInStacktraceAround_pr145442() { runTest("missing line numbers in stacktrace around");}
public void testGenericArrays_pr158624() { runTest("generics and arrays"); }
public void testVerifyErrNoTypeCflowField_pr145693_1() { runTest("verifyErrNoTypeCflowField"); }
public void testVerifyErrInpathNoTypeCflowField_pr145693_2() { runTest("verifyErrInpathNoTypeCflowField"); }
public void testCpathNoTypeCflowField_pr145693_3() { runTest("cpathNoTypeCflowField"); }
- // public void testVisibilityProblem_pr149071() { runTest("visibility problem");}
// public void testAdviceNotWovenAspectPath_pr147841() { runTest("advice not woven on aspectpath");}
public void testGenericSignatures_pr148409() { runTest("generic signature problem"); }
// public void testBrokenIfArgsCflowAtAj_pr145018() { runTest("ataj crashing with cflow, if and args");}
<ajc-test dir="bugs153/pr149071" title="visibility problem">
<compile files="AspectItd.java"/>
+ <run class="AspectItd"/>
</ajc-test>
<ajc-test dir="bugs153/pr147841" title="advice not woven on aspectpath">