From 9dbf9e030b98245226a6ea4e9a005b2b62f6036c Mon Sep 17 00:00:00 2001 From: shifujun Date: Tue, 12 Dec 2023 14:10:23 +0800 Subject: [PATCH] Minimal changes make IDEA 2023.2 work out-of-box Correct maven-compiler-plugin JDK version for IDEA import Compiler bytecode version. Remove JvstTestRoot's constructor, otherwise IDEA cannot show Run icon aside testMethod. Another way is adding suite() static method to those classes. Now we can clone and open project with IDEA 2023.2. Debug single test case with IDEA is very useful. --- pom.xml | 4 ++-- src/test/javassist/Bench.java | 3 --- src/test/javassist/JvstTest.java | 3 --- src/test/javassist/JvstTest2.java | 3 --- src/test/javassist/JvstTest3.java | 3 --- src/test/javassist/JvstTest4.java | 3 --- src/test/javassist/JvstTest5.java | 3 --- src/test/javassist/JvstTestRoot.java | 4 ---- src/test/javassist/bytecode/InsertGap0.java | 3 --- 9 files changed, 2 insertions(+), 27 deletions(-) diff --git a/pom.xml b/pom.xml index a604e166..42106d56 100644 --- a/pom.xml +++ b/pom.xml @@ -151,8 +151,8 @@ maven-compiler-plugin 3.2 - 1.8 - 1.8 + 11 + 11 11 11 -parameters diff --git a/src/test/javassist/Bench.java b/src/test/javassist/Bench.java index b7b8b27e..1892b383 100644 --- a/src/test/javassist/Bench.java +++ b/src/test/javassist/Bench.java @@ -5,9 +5,6 @@ import javassist.compiler.*; public class Bench extends JvstTestRoot { - public Bench(String name) { - super(name); - } public void testProceed() throws Exception { CtClass cc = sloader.get("test.BenchProceed"); diff --git a/src/test/javassist/JvstTest.java b/src/test/javassist/JvstTest.java index 3ed16827..ecbf91f7 100644 --- a/src/test/javassist/JvstTest.java +++ b/src/test/javassist/JvstTest.java @@ -20,9 +20,6 @@ public class JvstTest extends JvstTestRoot { java9 = javassist.bytecode.ClassFile.MAJOR_VERSION >= javassist.bytecode.ClassFile.JAVA_9; } - public JvstTest(String name) { - super(name); - } public void testConfig() { // is the value of PATH correct? diff --git a/src/test/javassist/JvstTest2.java b/src/test/javassist/JvstTest2.java index 5d01961d..334282d5 100644 --- a/src/test/javassist/JvstTest2.java +++ b/src/test/javassist/JvstTest2.java @@ -14,9 +14,6 @@ @SuppressWarnings({"rawtypes","unused"}) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class JvstTest2 extends JvstTestRoot { - public JvstTest2(String name) { - super(name); - } public void testInsertAt() throws Exception { CtClass cc = sloader.get("test2.InsertAt"); diff --git a/src/test/javassist/JvstTest3.java b/src/test/javassist/JvstTest3.java index c065170c..2f9ffcd5 100644 --- a/src/test/javassist/JvstTest3.java +++ b/src/test/javassist/JvstTest3.java @@ -7,9 +7,6 @@ @SuppressWarnings({"rawtypes","unchecked","unused"}) public class JvstTest3 extends JvstTestRoot { - public JvstTest3(String name) { - super(name); - } public void testAnnotation() throws Exception { CtClass cc = sloader.get("test3.AnnoTest"); diff --git a/src/test/javassist/JvstTest4.java b/src/test/javassist/JvstTest4.java index 259451b9..e00c332a 100644 --- a/src/test/javassist/JvstTest4.java +++ b/src/test/javassist/JvstTest4.java @@ -16,9 +16,6 @@ @SuppressWarnings({"rawtypes","unchecked","unused"}) @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class JvstTest4 extends JvstTestRoot { - public JvstTest4(String name) { - super(name); - } public void testInsertLocalVars() throws Exception { CtClass cc = sloader.get("test4.LocalVars"); diff --git a/src/test/javassist/JvstTest5.java b/src/test/javassist/JvstTest5.java index 561181c3..dce27ab1 100644 --- a/src/test/javassist/JvstTest5.java +++ b/src/test/javassist/JvstTest5.java @@ -25,9 +25,6 @@ @SuppressWarnings({"rawtypes","unchecked","unused"}) public class JvstTest5 extends JvstTestRoot { - public JvstTest5(String name) { - super(name); - } public void testDollarClassInStaticMethod() throws Exception { CtClass cc = sloader.makeClass("test5.DollarClass"); diff --git a/src/test/javassist/JvstTestRoot.java b/src/test/javassist/JvstTestRoot.java index 69f4a6ae..923af666 100644 --- a/src/test/javassist/JvstTestRoot.java +++ b/src/test/javassist/JvstTestRoot.java @@ -13,10 +13,6 @@ public class JvstTestRoot extends TestCase { ClassPool sloader, dloader; Loader cloader; - public JvstTestRoot(String name) { - super(name); - } - protected void print(String msg) { System.out.println(msg); } diff --git a/src/test/javassist/bytecode/InsertGap0.java b/src/test/javassist/bytecode/InsertGap0.java index 425f12d7..9e94e593 100644 --- a/src/test/javassist/bytecode/InsertGap0.java +++ b/src/test/javassist/bytecode/InsertGap0.java @@ -159,9 +159,6 @@ public int run2(int x) { @SuppressWarnings({"rawtypes","unchecked","unused"}) public final class InsertGap0 extends JvstTestRoot { - public InsertGap0(String name) { - super(name); - } public void testExample() throws Throwable { ClassPool pool = ClassPool.getDefault();