The -Xlintfile:lint.properties allows fine-grained control. In tools.jar, see
org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy.
### AspectJ-specific messages
-compiler.name = AspectJ Compiler 1.8.4
+compiler.name = AspectJ Compiler 1.8.5
compiler.version = Eclipse Compiler BETA_JAVA8_2b07958, 3.11
compiler.copyright =
// it is a privileged aspect
return true;
}
-
+
if (isProtected()) {
throw new RuntimeException("unimplemented");
}
// XXX make sure this walks correctly
if (isPrivate()) {
+ // Possibly the call is made from an inner type within the privileged aspect
+ // TODO should check the first outer aspect we come across and stop at that point?
+ if (invocationType.isNestedType()) {
+ TypeBinding enclosingType = invocationType.enclosingType();
+ while (enclosingType != null) {
+ if ((enclosingType instanceof SourceTypeBinding) && ((SourceTypeBinding)enclosingType).privilegedHandler != null) {
+ return true;
+ }
+ enclosingType = enclosingType.enclosingType();
+ }
+ }
+
// answer true if the receiverType is the declaringClass
// AND the invocationType and the declaringClass have a common enclosingType
// if (receiverType != declaringClass) return false;
--- /dev/null
+
+public class Code2 {
+ public static void main(String []argv) {
+ new Bar().foo();
+ }
+}
+interface Common { }
+
+interface Allergies extends Common {
+ default public void foo() {
+ }
+}
+
+class Bar implements Allergies { }
+
+aspect Y {
+ private boolean Common.instancesInvariant() {
+ return false;
+ }
+}
+
+privileged aspect AspectJMLRac_allergies_Allergies {
+ before(final Allergies object$rac): execution(* Allergies+.*(..)) && this(object$rac) {
+ Runnable r = new Runnable() {
+ public void run() {
+ boolean b = object$rac.instancesInvariant();
+ }
+ };
+ boolean b = object$rac.instancesInvariant();
+ }
+}
public void testITDInterface_451966() throws Exception {
runTest("itd interface");
}
-
+
+ public void testITDInterface_451966_2() throws Exception {
+ // call made from inner type
+ runTest("itd interface - 2");
+ }
+
// ---
public static Test suite() {
<suite>
-
<ajc-test dir="bugs185/451966" title="itd interface">
<compile files="Code.java" options="-1.8"/>
<run class="Code">
</run>
</ajc-test>
+<ajc-test dir="bugs185/451966" title="itd interface - 2">
+<compile files="Code2.java" options="-1.8"/>
+<run class="Code2">
+</run>
+</ajc-test>
+
</suite>