Bug 451966 - Problem with interface ITDs (possibly visibility related) using AspectJ 1.8
Summary: Problem with interface ITDs (possibly visibility related) using AspectJ 1.8
Status: NEW
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.8.4   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-17 14:33 EST by Andrew Clement CLA
Modified: 2014-11-18 10:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.