Bug 60441

Summary: Compile Fails due to IllegalArgumentException "negative line: -1"
Product: [Tools] AspectJ Reporter: John Kelty <jnjakelty>
Component: CompilerAssignee: Jim Hugunin <jim-aj>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Compiler Output none

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.