From 4b46caabfc7aec455df6173a73d10afffddd8831 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Fri, 30 Dec 2022 09:52:09 +0100 Subject: Regression test for #190 Signed-off-by: Alexander Kriegisch --- .../github_190/SwitchCaseWith_Integer_MAX_VALUE.java | 20 ++++++++++++++++++++ .../aspectj/systemtest/ajc1919/Bugs1919Tests.java | 3 +++ .../org/aspectj/systemtest/ajc1919/ajc1919.xml | 13 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 tests/bugs1919/github_190/SwitchCaseWith_Integer_MAX_VALUE.java 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 @@ + + + + + + + + + + + + + -- cgit v1.2.3