Bug 339300 - problem weaving anonymous inner (member owned) classes in scala library
Summary: problem weaving anonymous inner (member owned) classes in scala library
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.6.10   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 major (vote)
Target Milestone: 1.6.11   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 337064 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-08 18:49 EST by Andrew Clement CLA
Modified: 2011-03-21 18:55 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Clement CLA 2011-03-08 18:49:10 EST
Reported by Ramnivas.

Due to the use of numerous $ chars in scala classnames, some of the AspectJ handling of inner classes breaks down.  It should be possible to correctly use the available class attributes rather than mess around with attributes.  A while back one use did contribute a change to enable scala weaving which tried to use the InnerClasses attribute before falling back on string chopping.  However we have now hit another case.

In the scenario we are dealing with the class scala.Predef$$anon$3 in the scala library (a 2.9.0-SNAPSHOT version).  What we normally do here is in that type we discover the InnerClass attribute and refer to the outerclass index it holds.  Unfortunately, due to it being an anonymous inner inside a method, the index is 0.  So we fail to process the attribute and with string chopping come up with a stupid guessed name for the outer.

The solution is to use the EnclosingMethod attribute in these situations.  The EnclosingMethod attribute is an optional attribute. A class must have an EnclosingMethod attribute if and only if it is a local class or an anonymous class. A class may have no more than one EnclosingMethod attribute.

The EnclosingMethod attribute includes a pointer to the containing outerclass (that had the method in which encloses this inner type).
Comment 1 Andrew Clement CLA 2011-03-21 18:49:46 EDT
fix just made it into 1.6.11
Comment 2 Andrew Clement CLA 2011-03-21 18:55:12 EDT
*** Bug 337064 has been marked as a duplicate of this bug. ***