Community
Participate
Working Groups
If line numbers have not been added to the generated class files the following exception is thrown: java.lang.IllegalArgumentException at org.aspectj.bridge.SourceLocation.validLine(SourceLocation.java:41) at org.aspectj.bridge.SourceLocation.<init>(SourceLocation.java:96) at org.aspectj.bridge.SourceLocation.<init>(SourceLocation.java:85) at org.aspectj.bridge.SourceLocation.<init>(SourceLocation.java:70) at org.aspectj.ajdt.internal.core.builder.EclipseSourceContext.makeSourceLocation(EclipseSourceContext.java:57) at org.aspectj.we ... reUtility.java:155) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Compile error: IllegalArgumentException thrown: negative line: -1 An easy way to reproduce the problem is to uncheck the corresponding checkbox in the Classfile Generation section of the Java Compiler options in Eclipse. A full build is performed during which an AspectJ Internal Compiler Error is thrown. My Eclipse feature version is org.eclipse.ajdt_1.5.0.200706070619.
I have also run into the same exception. After cleaning the project eclipse would proceed to rebuild. Once the rebuild was complete it wouldn't throw the exception right away but, if you waited a good 30 seconds or so the window would pop up with this exception. I also noticed if I modified an aspect and rebuilt either automatically or by hand it would throw the exception while it was building, so it appears it is some sort of an issue not with the initial build but with any following builds. Has this issue been explored since the original bug was posted? java.lang.IllegalArgumentException at org.aspectj.bridge.SourceLocation.validLine(SourceLocation.java:41) at org.aspectj.bridge.SourceLocation.<init>(SourceLocation.java:96) at org.aspectj.bridge.SourceLocation.<init>(SourceLocation.java:85) at org.aspectj.bridge.SourceLocation.<init>(SourceLocation.java:70) at org.aspectj.ajdt.internal.core.builder.EclipseAdapterUtils.makeMessage(EclipseAdapterUtils.java:136) at org.aspectj.ajdt.inter ... oBuildJob.java:235) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Compile error: IllegalArgumentException thrown: negative line: -1 Version: 1.5.2.200804241330 AspectJ version: 1.6.0.20080423100000 Eclipse Platform Version: 3.3.0 Build id: I20070621-1340
Doesn't happen for me - I tried turning off 'include line numbers' in the compiler options page and I have about 20 projects (some AspectJ/some Java) in my workspace, they all build just fine. I believe it is failing for a special kind of message that it wants to put out (a message which includes multiple related source locations). So I'll stick in a guard for now to cope with it and the likely effect is that when a message has supplementary source locations that it wants to tell you about, you won't see them because it can't find them, you'll just see the primary message.
guard is in now (latest builds of AJ and AJDT) - please reopen if still a problem as I never was able to recreate.