Bug 475728 - LTW breaks Eclipse classloading for non javac-named inner classes
Summary: LTW breaks Eclipse classloading for non javac-named inner classes
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: LTWeaving (show other bugs)
Version: 1.8.6   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: 1.8.7   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-24 11:09 EDT by Lukas Hanke CLA
Modified: 2015-09-02 12:07 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Hanke CLA 2015-08-24 11:09:53 EDT
Hi,

in the past days I experienced a bug in the org.aspectj.weaver plug-in using equinox load-time weaving.

The problematic source code is contained in org.aspectj.weaver.bcel.BcelObjectType at lines 903-905 of the method getOuterClass().

The method should resolve the declaring class for a current inner class. The problematic code tries to resolve the declaring class using String operations. It assumes the compiled class to follow the javac naming conventions.

If this isn't the case (like it can happen e.g. for obfuscated classes), a StringIndexOutOfBoundException is raised (since the javac-specific $ in the inner-classe's name wasn't found).

This Exception is propagated and never catched which results in the class to be never loaded (neither woven nor unwoven). A NoClassDefFoundError is the result and the class loading process is broken in this moment.

To fix this, properly the outerclass check should not rely on the javac assumption. A hotfix could be to catch the Exception to avoid a broken class loading process...

Best regards,
Lukas

PS: A similar problem is maybe described in Bug 432874
Comment 1 Andrew Clement CLA 2015-09-02 12:07:43 EDT
Changes are in to 'give up' if we can't work it out, rather than throw the exception.