Bug 107956 - ArrayIndexOutOfBoundsException in Eclipse 3.1 when saving an aspect
Summary: ArrayIndexOutOfBoundsException in Eclipse 3.1 when saving an aspect
Status: RESOLVED DUPLICATE of bug 107953
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: 1.5.0M3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.5.0 M4   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-24 21:55 EDT by John J. Franey CLA
Modified: 2005-08-31 08:17 EDT (History)
0 users

See Also:


Attachments
aspect file: TransactionManager (871 bytes, text/plain)
2005-08-24 21:55 EDT, John J. Franey CLA
no flags Details
stacktrace from eclipse's .metadata/.log (1.80 KB, text/plain)
2005-08-24 21:56 EDT, John J. Franey CLA
no flags Details
output from ajc 1.5.0 M3 (5.94 KB, text/plain)
2005-08-25 13:52 EDT, John J. Franey CLA
no flags Details
all files, command line run as jar file (4.18 KB, application/octet-stream)
2005-08-25 14:22 EDT, John J. Franey CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John J. Franey CLA 2005-08-24 21:55:07 EDT
Eclipse 3.1, AJDT 1.3.0.20050824175147
Platform linux fedora core 4; java jvm 1.5.0-rc-b63
Aspect file and stack trace from .metadata/.log to be attached.

On save operation (ui click on floppy icon) on the following aspect after a
modification (e.g, a new line), a dialog appears stating that an
ArrayIndexOutOfBoundsException had occurred.  Apparently, the compile exits
because when running a clean build, no class file is created.
Comment 1 John J. Franey CLA 2005-08-24 21:55:50 EDT
Created attachment 26438 [details]
aspect file: TransactionManager
Comment 2 John J. Franey CLA 2005-08-24 21:56:56 EDT
Created attachment 26439 [details]
stacktrace from eclipse's .metadata/.log
Comment 3 John J. Franey CLA 2005-08-25 13:52:28 EDT
Created attachment 26461 [details]
output from ajc 1.5.0 M3

Exception occurs in ajc 1.5.0 M3.  So, this appears to NOT be an ajdt problem.

Assumed this was an ajdt plugin problem and decided to run ajc standalone.  The
eclipse plugin can be configured to NOT weave.	Such I did and rebuilt the
project leaving me with clean class files, I hope.

I ran ajc manually on said class files, instead of from within eclipse.  I ran
it with -inpath <build directory path> argument.  The same exception is thrown.
 I will also attach the java source file from the application that caused the
trouble.

In case it matters: please note I used the javax.ejb.TransactionAttribute from
glassfish 9.0-b09.
Comment 4 John J. Franey CLA 2005-08-25 14:22:25 EDT
Created attachment 26466 [details]
all files, command line run as jar file

Here are all the files necessary to recreate this problem except for the
non-redistributable j2ee from glassfish which contains the definition of
javax.ejb.TransactionAttribute.

Also included are the unix shell script used to run ajc, the java file list
(only one file) and the acore-.....txt file dumped by ajc.
Comment 5 Matt Chapman CLA 2005-08-25 17:10:51 EDT
Passing over to AspectJ
Comment 6 Adrian Colyer CLA 2005-08-26 11:48:36 EDT
I think I now understand what's going on here. I'm marking as M4 for resolution,
will try and take a peek early next week.

The after throwing form should take a formal, not a type name - that's what i
failed to spot last time i looked at this, so:

@AfterThrowing(pointcut="transactedMethod()",          
               throwing="java.lang.RuntimeException")
	public  void failedTransaction() {
		System.out.println("failed transaction");
	}	

should be:

@AfterThrowing(pointcut="transactedMethod()", 
               throwing="rtEx")
	public  void failedTransaction(RuntimeException rtEx) {
		System.out.println("failed transaction");
	}	

but we don't handle the error very gracefully at all.
Comment 7 John J. Franey CLA 2005-08-26 14:38:14 EDT
Thanks,
The edit you suggest has allowed me to continue.
Comment 8 Adrian Colyer CLA 2005-08-31 08:17:46 EDT
The cause of this bug is the same as bug 107953, and should be fixed by the same
patch that I applied to fix that bug. Closing this off as a duplicate, any
further work by Alex will be tracked under 107953.

Thanks, Adrian.

*** This bug has been marked as a duplicate of 107953 ***