Przeglądaj źródła

test for Bugzilla Bug 39479

   NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch.
tags/V1_1_1
jhugunin 21 lat temu
rodzic
commit
8d5101c858
3 zmienionych plików z 41 dodań i 4 usunięć
  1. 6
    0
      tests/ajcTestsFailing.xml
  2. 31
    0
      tests/bugs/NewSwitch.java
  3. 4
    4
      tests/jimTests.xml

+ 6
- 0
tests/ajcTestsFailing.xml Wyświetl plik

@@ -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>

+ 31
- 0
tests/bugs/NewSwitch.java Wyświetl plik

@@ -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 ) { }

}

+ 4
- 4
tests/jimTests.xml Wyświetl plik

@@ -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>

Ładowanie…
Anuluj
Zapisz