From 2af1b06b6a9439109520b249b5e44dfc1375c199 Mon Sep 17 00:00:00 2001 From: Alexander Kriegisch Date: Tue, 22 Aug 2023 07:54:19 +0700 Subject: [PATCH] Improve bridge method test, bootstrapping ASM usage Instead of using a pre-generated JAR, the source code generating the class with reordered methods (bridge method first) is now compiled directly before usage. This is possible, because in the previous commit ASM was put on the Ajc classpath for tests. Relates to #256. Signed-off-by: Alexander Kriegisch --- .../gh_spring_27761/JpaRepositoryDump.java | 7 +++++-- .../JpaRepository_bridge_first.jar | Bin 456 -> 0 bytes .../org/aspectj/systemtest/ajc1920/ajc1920.xml | 7 ++++++- 3 files changed, 11 insertions(+), 3 deletions(-) delete mode 100644 tests/bugs1921/gh_spring_27761/JpaRepository_bridge_first.jar diff --git a/tests/bugs1921/gh_spring_27761/JpaRepositoryDump.java b/tests/bugs1921/gh_spring_27761/JpaRepositoryDump.java index a007abe96..b70330bff 100644 --- a/tests/bugs1921/gh_spring_27761/JpaRepositoryDump.java +++ b/tests/bugs1921/gh_spring_27761/JpaRepositoryDump.java @@ -3,12 +3,15 @@ import org.objectweb.asm.Label; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; +import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -class JpaRepositoryDump implements Opcodes { +public class JpaRepositoryDump implements Opcodes { public static void main(String[] args) throws IOException { - try (FileOutputStream outputStream = new FileOutputStream("JpaRepository.class")) { + // Write class file to test sandbox directory + String classFile = args[0] + File.separator + "JpaRepository.class"; + try (FileOutputStream outputStream = new FileOutputStream(classFile)) { outputStream.write(dump()); } } diff --git a/tests/bugs1921/gh_spring_27761/JpaRepository_bridge_first.jar b/tests/bugs1921/gh_spring_27761/JpaRepository_bridge_first.jar deleted file mode 100644 index 47aa5c05332b6bec84f71c4bf136687a8b34e3f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 456 zcmWIWW@Zs#U|`^2(997HKVAC#hYTYF!y6zL28wzWBnG7x%WM^%$)D|)eGd|` z@o6dD*s5}SvDs?Jbc@?xJyjPU`LZY|sBOab1EO!f@8f>Q+;pdg?C zCb0%C7gUmwL4x5zL37;C%QqR_OD=FST)D}(wXqt^5AbGX1DU`GgsDK<7Z_Iz3;>i2 Bw(kG{ diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml index db47e073d..89c9b5f41 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1920/ajc1920.xml @@ -420,7 +420,12 @@ - + + + + + + -- 2.39.5