diff options
author | jhugunin <jhugunin> | 2003-07-03 00:06:53 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-07-03 00:06:53 +0000 |
commit | 8d5101c858324f957b8deed851742b2dc322a45a (patch) | |
tree | dbdf1a7a7b55b7a0aee71b78dbdb853463839178 /tests | |
parent | 0e3c87c56d6120afa0bb0db602a73b473d23b04a (diff) | |
download | aspectj-8d5101c858324f957b8deed851742b2dc322a45a.tar.gz aspectj-8d5101c858324f957b8deed851742b2dc322a45a.zip |
test for Bugzilla Bug 39479
NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcTestsFailing.xml | 6 | ||||
-rw-r--r-- | tests/bugs/NewSwitch.java | 31 | ||||
-rw-r--r-- | tests/jimTests.xml | 8 |
3 files changed, 41 insertions, 4 deletions
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 4292bacbd..25314b777 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -9,5 +9,11 @@ <compile files="lib.jar,TestAspect.aj,Test.java"/> <run class="Test"/> </ajc-test> + + <ajc-test dir="bugs" pr="39479" + title="NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch"> + <compile files="NewSwitch.java"/> + <run class="NewSwitch"/> + </ajc-test> </suite> diff --git a/tests/bugs/NewSwitch.java b/tests/bugs/NewSwitch.java new file mode 100644 index 000000000..f07efba6b --- /dev/null +++ b/tests/bugs/NewSwitch.java @@ -0,0 +1,31 @@ +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.Signature; +import org.aspectj.lang.reflect.SourceLocation; + +public class NewSwitch { + public static void main(String[] args) { + new NewSwitch(2); + } + + protected NewSwitch() { + this(3); + } + + protected NewSwitch(int p) { + switch (p) { + case 3: break; + } + } +} + +aspect FFDC { + + pointcut initializers( ) : staticinitialization( * ) || initialization( *.new(..) ); + pointcut methodsAndConstructors( ) : execution(* *(..)) || execution(new(..) ); + pointcut guarded( ) : initializers( ) || methodsAndConstructors( ); + + final pointcut nonStaticContext( Object o ) : this( o ); + + after(Object o) throwing(Throwable t) : guarded( ) && nonStaticContext( o ) { } + +} diff --git a/tests/jimTests.xml b/tests/jimTests.xml index 353042abe..c10a38f4a 100644 --- a/tests/jimTests.xml +++ b/tests/jimTests.xml @@ -1,9 +1,9 @@ <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"> <suite> - <ajc-test dir="bugs" pr="38345" keywords="purejava" - title="try switch VerifyError, InconsistentStackHeight"> - <compile files="TrySwitch.java"/> - <run class="TrySwitch"/> + <ajc-test dir="bugs" pr="39479" + title="NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch"> + <compile files="NewSwitch.java"/> + <run class="NewSwitch"/> </ajc-test> </suite>
\ No newline at end of file |