From 459848fff09af3d22e15a4718f6213d577cdeb12 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Tue, 6 Aug 2024 02:20:01 +0200 Subject: [PATCH] Fix for Java 21, 22 --- .../plexus/compiler/javac/JavacErrorProneCompilerTest.java | 4 ++-- .../plexus/compiler/javac/JavaxToolsCompilerTest.java | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plexus-compilers/plexus-compiler-javac-errorprone/src/test/java/org/codehaus/plexus/compiler/javac/JavacErrorProneCompilerTest.java b/plexus-compilers/plexus-compiler-javac-errorprone/src/test/java/org/codehaus/plexus/compiler/javac/JavacErrorProneCompilerTest.java index dd5bc492..c648bc4b 100644 --- a/plexus-compilers/plexus-compiler-javac-errorprone/src/test/java/org/codehaus/plexus/compiler/javac/JavacErrorProneCompilerTest.java +++ b/plexus-compilers/plexus-compiler-javac-errorprone/src/test/java/org/codehaus/plexus/compiler/javac/JavacErrorProneCompilerTest.java @@ -20,10 +20,10 @@ protected int expectedWarnings() { } else if (javaVersion.contains("18") || javaVersion.contains("19") || javaVersion.contains("20") + || javaVersion.contains("21") + || javaVersion.contains("22") || javaVersion.contains("23")) { return 5; - } else if (javaVersion.contains("21") || javaVersion.contains("22")) { - return 6; } return 2; } diff --git a/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/JavaxToolsCompilerTest.java b/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/JavaxToolsCompilerTest.java index cf952bfd..d1e89f1b 100644 --- a/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/JavaxToolsCompilerTest.java +++ b/plexus-compilers/plexus-compiler-javac/src/test/java/org/codehaus/plexus/compiler/javac/JavaxToolsCompilerTest.java @@ -27,9 +27,7 @@ public class JavaxToolsCompilerTest extends AbstractJavacCompilerTest { @Override protected int expectedWarnings() { String javaVersion = getJavaVersion(); - if (javaVersion.contains("21") || javaVersion.contains("22")) { - return 8; - } else if (javaVersion.contains("23")) { + if (javaVersion.contains("21") || javaVersion.contains("22") || javaVersion.contains("23")) { return 1; } else { return super.expectedWarnings();