Summary: | [plan] [weaving] Around advice on "new Integer()" within an interface results in runtime exception | ||
---|---|---|---|
Product: | [Tools] AspectJ | Reporter: | Uli Eibauer <ueno.4> |
Component: | Compiler | Assignee: | aspectj inbox <aspectj-inbox> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | aclement, eclipse |
Version: | 1.5.1 | ||
Target Milestone: | 1.6.3 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: |
Description
Uli Eibauer
2006-06-26 09:22:08 EDT
thanks for the clear testcase - I've recreated this on the HEAD version of AspectJ. and i've recreated it all the way back to AspectJ1.2.1 - looks like a scenario causing us to stick method bodies into an interface... I actually ran into this over the weekend. Puzzled me to no end until I search for a bug. Any progress on this or a work-around? worst case we must be able to detect we are going to do something wrong and report an error (compiler limitation) at compile time rather than exploding at runtime. The 'compiler limitation' solution is now available in AspectJ1.6.3 (work was done under bug 163005) - we will skip weaving the join point, and produce an xlint message to indicate the situation. The code here now says: [warning] The joinpoint 'constructor-call(void java.lang.Integer.<init>(int))' cannot be advised and is being skipped as the compiler implementation will lead to creation of methods with bodies in an interface (compiler limitation) [Xlint:cannotAdviseJoinpointInInterfaceWithAroundAdvice] Integer INTEGER_ALL = new Integer(ALL); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |