From 6950ab960392d34e065430a9ab74a99b78987e1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 16:40:07 +0100 Subject: [PATCH] Bump org.eclipse.jdt:ecj from 3.38.0 to 3.40.0 (#422) Bumps [org.eclipse.jdt:ecj](https://github.com/eclipse-jdt/eclipse.jdt.core) from 3.38.0 to 3.40.0. - [Commits](https://github.com/eclipse-jdt/eclipse.jdt.core/commits) --- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sylwester Lachiewicz --- .../plexus-compiler-eclipse/pom.xml | 2 +- .../compiler/eclipse/EclipseJavaCompiler.java | 6 +++--- .../EclipseCompilerErrorsAsWarningsTest.java | 18 ++++++++++++------ .../EclipseCompilerFailOnWarningsTest.java | 15 +++++++++++++-- .../compiler/eclipse/EclipseCompilerTest.java | 15 +++++++++++++-- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/plexus-compilers/plexus-compiler-eclipse/pom.xml b/plexus-compilers/plexus-compiler-eclipse/pom.xml index e2d1d344..90e32eff 100644 --- a/plexus-compilers/plexus-compiler-eclipse/pom.xml +++ b/plexus-compilers/plexus-compiler-eclipse/pom.xml @@ -25,7 +25,7 @@ org.eclipse.jdt ecj - 3.38.0 + 3.40.0 javax.inject diff --git a/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java b/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java index f14db674..3c7f4f4c 100644 --- a/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java +++ b/plexus-compilers/plexus-compiler-eclipse/src/main/java/org/codehaus/plexus/compiler/eclipse/EclipseJavaCompiler.java @@ -234,11 +234,11 @@ public CompilerResult performCompile(CompilerConfiguration config) throws Compil getLog().debug("Using JSR-199 EclipseCompiler"); // ECJ JSR-199 compiles against the latest Java version it supports if no source // version is given explicitly. BatchCompiler uses 1.3 as default. So check - // whether a source version is specified, and if not supply 1.3 explicitly. + // whether a source version is specified, and if not supply 8 explicitly. if (!haveSourceOrReleaseArgument(args)) { - getLog().debug("ecj: no source level nor release specified, defaulting to Java 1.3"); + getLog().debug("ecj: no source level nor release specified, defaulting to Java 8"); args.add("-source"); - args.add("1.3"); + args.add("8"); } // Also check for the encoding. Could have been set via the CompilerConfig diff --git a/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerErrorsAsWarningsTest.java b/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerErrorsAsWarningsTest.java index 91580922..75c5279a 100644 --- a/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerErrorsAsWarningsTest.java +++ b/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerErrorsAsWarningsTest.java @@ -36,15 +36,21 @@ protected int expectedWarnings() { @Override protected Collection expectedOutputFiles() { + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0") + || javaVersion.contains("11") + || javaVersion.contains("17") + || javaVersion.contains("21") + || javaVersion.contains("23")) { + return Arrays.asList( + "org/codehaus/foo/Deprecation.class", + "org/codehaus/foo/ExternalDeps.class", + "org/codehaus/foo/Person.class"); + } return Arrays.asList( "org/codehaus/foo/Deprecation.class", "org/codehaus/foo/ExternalDeps.class", "org/codehaus/foo/Person.class", - "org/codehaus/foo/ReservedWord.class" - // "org/codehaus/foo/Bad.class", // This one has no class file generated as it's one big - // issue - // "org/codehaus/foo/UnknownSymbol.class", - // "org/codehaus/foo/RightClassname.class" - ); + "org/codehaus/foo/ReservedWord.class"); } } diff --git a/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerFailOnWarningsTest.java b/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerFailOnWarningsTest.java index c5a94b3d..bf87e8e8 100644 --- a/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerFailOnWarningsTest.java +++ b/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerFailOnWarningsTest.java @@ -19,16 +19,27 @@ protected String getRoleHint() { @Override protected int expectedErrors() { - return 6; + return 5; } @Override protected int expectedWarnings() { - return 1; + return 0; } @Override protected Collection expectedOutputFiles() { + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0") + || javaVersion.contains("11") + || javaVersion.contains("17") + || javaVersion.contains("21") + || javaVersion.contains("23")) { + return Arrays.asList( + "org/codehaus/foo/Deprecation.class", + "org/codehaus/foo/ExternalDeps.class", + "org/codehaus/foo/Person.class"); + } return Arrays.asList( "org/codehaus/foo/Deprecation.class", "org/codehaus/foo/ExternalDeps.class", diff --git a/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerTest.java b/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerTest.java index de72e6b4..042bddb2 100644 --- a/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerTest.java +++ b/plexus-compilers/plexus-compiler-eclipse/src/test/java/org/codehaus/plexus/compiler/eclipse/EclipseCompilerTest.java @@ -53,16 +53,27 @@ protected String getRoleHint() { @Override protected int expectedErrors() { - return 4; + return 5; } @Override protected int expectedWarnings() { - return 2; + return 1; } @Override protected Collection expectedOutputFiles() { + String javaVersion = getJavaVersion(); + if (javaVersion.contains("9.0") + || javaVersion.contains("11") + || javaVersion.contains("17") + || javaVersion.contains("21") + || javaVersion.contains("23")) { + return Arrays.asList( + "org/codehaus/foo/Deprecation.class", + "org/codehaus/foo/ExternalDeps.class", + "org/codehaus/foo/Person.class"); + } return Arrays.asList( "org/codehaus/foo/Deprecation.class", "org/codehaus/foo/ExternalDeps.class",