Bug 432874

Summary: StringIndexOutOfBoundsException after adding project to inpath
Product: [Tools] AspectJ Reporter: Tracy Zhang <tracyzmq>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement, hanke, tracyzmq
Version: 1.8.0.M1   
Target Milestone: 1.8.7   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Tracy Zhang CLA 2014-04-15 23:50:49 EDT
when I add my project to Preference->AspectJ Build->Inpath, it report an exception error. 

ADJT version:2.2.3
Eclipse version:4.3.1

aspectJ-1.8.0.M1.jar
aspectjweaver-1.8.0.M1.jar
(I have added both jar file above to referenced libraries and Android private Libraries)

Error log see below.

java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1911)
at org.aspectj.weaver.bcel.BcelObjectType.getOuterClass(BcelObjectType.java:899)
at org.aspectj.weaver.AbstractReferenceTypeDelegate.getFormalTypeParametersFromOuterClass(AbstractReferenceTypeDelegate.java:108)
at org.aspectj.weaver.bcel.BcelObjectType.ensureGenericSignatureUnpacked(BcelObjectType.java:767)
at org.aspectj.weaver.bcel.BcelObjectType.getS ... 43)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Compile error: StringIndexOutOfBoundsException thrown: String index out of range: -1
Comment 1 Andrew Clement CLA 2014-04-16 14:32:12 EDT
Any way you could share the project with me (privately?) - I'd love to fix this for 1.8.0 which I'm building in the next 24hours.

You could try AspectJ 1.8.0.RC3 which may also make a difference since M1 was using a very beta version of the Eclipse Java8 compiler:
http://www.eclipse.org/downloads/download.php?file=/tools/aspectj/aspectj-1.8.0.RC3.jar
Comment 2 Lukas Hanke CLA 2015-08-24 11:12:47 EDT
A similar problem is maybe described in Bug 475728
Comment 3 Andrew Clement CLA 2015-09-02 12:09:36 EDT
Under Bug 475728 I committed a change to 'give up' if we can't work it out. If the class is not providing the right means of expressing what is an inner class via attributes then we then try the string analysis, if that works we will now give up rather than throw the exception.