Bug 60441 - Compile Fails due to IllegalArgumentException "negative line: -1"
Summary: Compile Fails due to IllegalArgumentException "negative line: -1"
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.2   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Jim Hugunin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-29 11:24 EDT by John Kelty CLA
Modified: 2004-05-13 05:22 EDT (History)
0 users

See Also:


Attachments
Compiler Output (4.08 KB, text/plain)
2004-04-29 11:28 EDT, John Kelty CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Kelty CLA 2004-04-29 11:24:54 EDT
Compiling this simple aspect results in an IllegalArgumentException.  I don't 
know if the aspect should've compiled correctly, but it certainly requires a 
better error message from the compiler if not.

package test.providers.java;

import java.util.Map;
import javax.wsdl.BindingOperation;
import javax.wsdl.Port;
import org.apache.wsif.providers.java.WSIFOperation_Java;
import org.apache.wsif.providers.java.WSIFPort_Java;
import org.apache.wsif.WSIFException;

privileged public aspect SampleAspect {
   void around(Port p, BindingOperation b, WSIFPort_Java javaPort, Map m) 
throws WSIFException:
         initialization( WSIFOperation_Java.new(Port, BindingOperation, 
WSIFPort_Java, Map) ) && args(port, binding, javaPort, typeMaps)
   {
      System.out.println( "Around advice." );
   }
}

I compiled with the following ant task:

   <taskdef 
      resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
    <classpath>
      <pathelement location="/aspectj1.2/lib/aspectjtools.jar"/>
    </classpath>
  </taskdef>
....
  <target name="aspectj" depends="init" >
    <iajc verbose="false" destdir="../classes" 
         injars="${wsif.jar}">
         <sourceroots>
                   <pathelement location="../src/test/providers/java" />
         </sourceroots>
         ....
    </iajc>
Comment 1 John Kelty CLA 2004-04-29 11:28:26 EDT
Created attachment 10115 [details]
Compiler Output
Comment 2 Andrew Clement CLA 2004-05-04 05:35:18 EDT
I've fixed the IllegalArgumentException under bug #59397.  It is due to not 
being able to get the right line number for a shadow.  The fix will be in 1.2 
RC2 - due this week.  With the fix you get a message:

around on initialization not supported (compiler limitation)
Comment 3 Adrian Colyer CLA 2004-05-13 05:22:42 EDT
fixed by andy.