Bug 432874 - StringIndexOutOfBoundsException after adding project to inpath
Summary: StringIndexOutOfBoundsException after adding project to inpath
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.8.0.M1   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: 1.8.7   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-15 23:50 EDT by Tracy Zhang CLA
Modified: 2015-09-02 12:09 EDT (History)
3 users (show)

See Also:


Attachments

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