Bug 451966

Summary: Problem with interface ITDs (possibly visibility related) using AspectJ 1.8
Product: [Tools] AspectJ Reporter: Andrew Clement <aclement>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 1.8.4   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Andrew Clement CLA 2014-11-17 14:33:38 EST
This code won't compile with 1.8:

interface Common { }

interface Allergies extends Common { }

aspect Y {
  private boolean Common.instancesInvariant() {
    return false;
  }
}

privileged aspect AspectJMLRac_allergies_Allergies {
  before(final Allergies object$rac): execution(* Allergies+.*(..)) && this(object$rac) {
    boolean b = object$rac.instancesInvariant();
  }
}
Comment 1 Andrew Clement CLA 2014-11-18 10:57:32 EST
The problems here appear to be due to some more strict visibility checking when interfaces are the targets for method invocations. Previously the JDT compiler seemed to let through methods targeting interfaces but now it is performing vis checks and the code here fails the check because we don't notice it is a privileged aspect making the call. I've added some smarts into the visibility checking (canBeSeenBy in the InterTypeMethodBinding).

Leaving open until I've got  1.8.5 tag to close it against.