Bug 107953

Summary: VerifyError, @this(somearg) in @AspectJ style pointcut
Product: [Tools] AspectJ Reporter: John J. Franey <jjfraney>
Component: CompilerAssignee: Alexandre Vasseur <avasseur>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P5    
Version: unspecified   
Target Milestone: 1.5.0 M4   
Hardware: Other   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
TransTest.java source code
none
TransTest.class binary
none
aspect file: TransactionManager none

Description John J. Franey CLA 2005-08-24 21:28:13 EDT
Eclipse 3.1, AJDT 1.3.0.20050824175147
Platform linux fedora core 4; java jvm 1.5.0-rc-b63
Files to be attached.

When TranTest class is run, the following exception is received:
Exception in thread "main" java.lang.VerifyError: (class: all/mymoney/TransTest,
method: go signature: ()V) catch_type not a subclass of Throwable

For javax.ejb.TransactionAttribute I used glassfish (9.0-b09) lib/j2ee.jar.
Comment 1 John J. Franey CLA 2005-08-24 21:29:56 EDT
Created attachment 26435 [details]
TransTest.java source code
Comment 2 John J. Franey CLA 2005-08-24 21:30:50 EDT
Created attachment 26436 [details]
TransTest.class binary
Comment 3 John J. Franey CLA 2005-08-24 21:31:52 EDT
Created attachment 26437 [details]
aspect file: TransactionManager
Comment 4 John J. Franey CLA 2005-08-24 21:59:38 EDT
Sorry, wrong product.  Refiled to AJDT.
Comment 5 Matt Chapman CLA 2005-08-29 13:23:28 EDT
This probably belongs against the compiler
Comment 6 Adrian Colyer CLA 2005-08-30 10:50:54 EDT
compiler now says:

"throwing formal 'RuntimeException' must be declared as the last parameter in
the advice signature"

(the program should be of the form
@AfterThrowing(pointcut="...", throwing="ex")
void adviceMethod(RuntimeException ex) {...}
)

catching this error early prevents the downstream error of treating the pointcut
formal (attr) as if it were the thrown exception formal, with the results
described in this report.

Alex, I'm assigning to you as I'm not sure this is fully finished: I've put
guards in for after throwing and after returning, both in the ajc front-end and
in the weaver for javac compiled @Aspects. However, the weaver guards rely on
debug info having been left in the source file in order to find the matching
parameter (not a lot we can do about that I don't think), and have a poor line
number when the error is issued. I also restricted the extraArg to being the
last parameter in the advice signature, but that may have been stricter than
necessary?
Comment 7 Adrian Colyer CLA 2005-08-31 08:17:47 EDT
*** Bug 107956 has been marked as a duplicate of this bug. ***
Comment 8 Adrian Colyer CLA 2005-09-27 06:43:44 EDT
raising to P2
Comment 9 Alexandre Vasseur CLA 2005-09-28 08:53:22 EDT
close for M4

extra formal can be anywhere in signature - checks will be done
Comment 10 Eclipse Webmaster CLA 2009-08-30 02:50:13 EDT
LATER/REMIND bugs are being automatically reopened as P5 because the LATER and REMIND resolutions are deprecated.