From e3e6fd35fb0e58009c80b47e6d3e21a2c93640c0 Mon Sep 17 00:00:00 2001 From: Stephan Herrmann Date: Sat, 17 Feb 2024 15:18:05 +0100 Subject: [PATCH] ResourceLeakTests & ResourceLeakAnnotatedTests fail in some compliance levels when run locally via RunJDTCoreTests (#2042) fixes #2041 Don't try to run affected Tests below 1.7 (not designed to do so) --- .../jdt/core/tests/compiler/regression/ResourceLeakTests.java | 2 ++ .../eclipse/jdt/core/tests/compiler/regression/TestAll.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java index 646c9b46704..605c1799b57 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/ResourceLeakTests.java @@ -7036,6 +7036,8 @@ public void testBug499037_010_since_9() { options); } public void testGH1762() { + if (this.complianceLevel < ClassFileConstants.JDK1_7) + return; // uses t-w-r runLeakTest( new String[] { "X.java", diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java index 9538665de8d..d73f1694192 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/TestAll.java @@ -92,7 +92,6 @@ public static Test suite() { standardTests.add(ManifestAnalyzerTest.class); standardTests.add(InitializationTests.class); standardTests.add(ResourceLeakTests.class); - standardTests.add(ResourceLeakAnnotatedTests.class); standardTests.add(PackageBindingTest.class); // add all javadoc tests @@ -137,6 +136,8 @@ public static Test suite() { since_1_7.add(PolymorphicSignatureTest.class); since_1_7.add(Compliance_1_7.class); since_1_7.add(MethodHandleTest.class); + since_1_7.add(ResourceLeakAnnotatedTests.class); + ArrayList since_1_8 = new ArrayList(); since_1_8.add(NegativeTypeAnnotationTest.class);