aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java20
-rw-r--r--tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java3
-rw-r--r--tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml13
3 files changed, 36 insertions, 0 deletions
diff --git a/tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java b/tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java
new file mode 100644
index 000000000..d083fe60f
--- /dev/null
+++ b/tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java
@@ -0,0 +1,20 @@
+public class SwitchCaseWith_Integer_MAX_VALUE {
+ public static void main(String[] args) {
+ System.out.println(switchTest(Integer.MAX_VALUE));
+ }
+
+ static String switchTest(int i) {
+ switch (i) {
+ case Integer.MAX_VALUE:
+ return "CASE_1";
+ default:
+ return "";
+ }
+ }
+}
+
+aspect MyAspect {
+ before() : execution(* switchTest(*)) {
+ System.out.println(thisJoinPoint);
+ }
+}
diff --git a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java
index 3c921f51a..1cfb22ff5 100644
--- a/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java
+++ b/tests/src/test/java/org/aspectj/systemtest/ajc1919/Bugs1919Tests.java
@@ -19,6 +19,9 @@ public class Bugs1919Tests extends XMLBasedAjcTestCase {
runTest("declare annotation with SOURCE retention");
}
+ public void testsSwitchWith_Integer_MAX_VALUE() {
+ runTest("switch with Integer.MAX_VALUE case");
+ }
public static Test suite() {
return XMLBasedAjcTestCase.loadSuite(Bugs1919Tests.class);
}
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
index 0e07ff84f..60d7e4f86 100644
--- a/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
+++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1919/ajc1919.xml
@@ -172,4 +172,17 @@
</compile>
</ajc-test>
+ <!-- RuntimeException in BcelWeaver, see https://github.com/eclipse/org.aspectj/issues/190 -->
+ <ajc-test dir="bugs1919/github_190" vm="1.5" title="switch with Integer.MAX_VALUE case">
+ <compile files="SwitchCaseWith_Integer_MAX_VALUE.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-execution(java.lang.String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))'"/>
+ </compile>
+ <run class="SwitchCaseWith_Integer_MAX_VALUE">
+ <stdout>
+ <line text="execution(String SwitchCaseWith_Integer_MAX_VALUE.switchTest(int))"/>
+ <line text="CASE_1"/>
+ </stdout>
+ </run>
+ </ajc-test>
+
</suite>