From:
aspectj-dev-admin@xxxxxxxxxxx [mailto:aspectj-dev-admin@xxxxxxxxxxx] On Behalf Of Jim.Hugunin@xxxxxxxx
Sent: Friday, July 18, 2003 9:24 AM
To: aspectj-dev@xxxxxxxxxxx
To close this off, I've applied Andy's
patch to the tree in the general form he describes below. All calls to
Instruction.copy() now go through a Utility.copyInstruction() method to
work-around the problem with Select. We should have a rule in the code of
the following form:
* declare error:
*
call(* Instruction.copy()) && within(org.aspectj.weaver)
*
&& !withincode(* Utility.copyInstruction(Instruction)):
*
"use Utility.copyInstruction to work-around bug in Select.copy()";
-Jim
-----Original Message-----
From: Andrew Clement
[mailto:CLEMAS@xxxxxxxxxx]
Sent: Tuesday, July 15, 2003 8:22 AM
To: aspectj-dev@xxxxxxxxxxx
Cc: czhang@xxxxxxxxxxxxxxxx
Subject: Re: [aspectj-dev] Potential
bug: Problem with switch statement
Hi,
I've
just spent the morning looking at bug 39479 - which is to do with inlining
constructors that contain switch statements. I've fixed it - and then saw
this note which talks about advice that contains switch statements - I think
the code below demonstrates another case of the same bcel bug. It is to
do with Select instructions not supporting copy() correctly. I've created
a patch for the problem and verified it fixes the problem that appears when compiling
the sample code below - and the patch doesn't cause any of the existing tests
to fail. Basically, wherever there is a bcel instruction copy() we have
to check if its a Select instruction and do something special, until BCEL is
fixed.
Have
you raised a bugzilla report for it Charles? So I can attach the patch to it?
regards,
-
Andy.
|
Wes Isberg <wes@xxxxxxxxxxxxxx>
Sent
by: aspectj-users-admin@xxxxxxxxxxx
15/07/2003 07:02
Please
respond to aspectj-users
|
To: aspectj-users@xxxxxxxxxxx
cc:
Subject: Re: [aspectj-users]
Potential bug: Problem with switch statement
|
Thanks
- would you enter this to the bug database?
Wes
Charles Zhang wrote:
> Hi, AspectJ hackers, here is what I got
tonight as a reproducable error.
> Sorry, I searched a bit of the bugzilla but
couldn't find anything
> similar. It has something to do with a switch
statement in the aspect
> code. Thanks for any information.
>
> To re-produce, compile the following on
ajc1.1, ajc1.0, however, is OK.
> Test.java
> public class Test {
>
public String method1(){
>
System.out.println("method1");
>
return "method1";
>
}
>
>
>
>
public static void main(String [] args)
>
{
>
System.out.println(new Test().method1());
>
}
> }
>
> ===========TestAspect.java================
> String around(Test t):target(t)&&
>
call(public String method1())
>
{
>
int flag = 1;
>
switch(flag)
>
{
>
case 1:
>
}
>
return null;
>
}
>
>
> C:\eclipse\workspace\Test>c:\aspectj1.1\bin\ajc
*.java > out
> trouble in:
> public class Test extends java.lang.Object:
>
-------8< SNIP 8<------------
>
> Charles Zhang
(http://www.eecg.utoronto.ca/~czhang)
> Computer Group, Dept. of Elec. & Comp.
Engineering
> U. of Toronto, Ontario, Canada
>
*********************************************************
> " Yawn!!" (Charles Zhang)
>
>
>
_______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
>
http://dev.eclipse.org/mailman/listinfo/aspectj-users
>