diff --git a/src/it/projects/MJAVADOC-679_encoding/module1/pom.xml "b/src/it/projects/MJAVADOC-679_encoding/m\303\264d\303\274l\303\251/pom.xml" similarity index 100% rename from src/it/projects/MJAVADOC-679_encoding/module1/pom.xml rename to "src/it/projects/MJAVADOC-679_encoding/m\303\264d\303\274l\303\251/pom.xml" diff --git a/src/it/projects/MJAVADOC-679_encoding/module1/src/main/java/com/foo/MyClass.java "b/src/it/projects/MJAVADOC-679_encoding/m\303\264d\303\274l\303\251/src/main/java/com/foo/MyClass.java" similarity index 100% rename from src/it/projects/MJAVADOC-679_encoding/module1/src/main/java/com/foo/MyClass.java rename to "src/it/projects/MJAVADOC-679_encoding/m\303\264d\303\274l\303\251/src/main/java/com/foo/MyClass.java" diff --git a/src/it/projects/MJAVADOC-679_encoding/setup.groovy b/src/it/projects/MJAVADOC-679_encoding/setup.groovy deleted file mode 100644 index e6403b352..000000000 --- a/src/it/projects/MJAVADOC-679_encoding/setup.groovy +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -new File(basedir, 'module1').renameTo(new File(basedir, 'môdülé')) \ No newline at end of file diff --git a/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java b/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java index 6658a7e20..61f7a102f 100644 --- a/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java +++ b/src/main/java/org/apache/maven/plugins/javadoc/StaleHelper.java @@ -20,7 +20,6 @@ import java.io.File; import java.io.IOException; -import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.nio.file.DirectoryStream; import java.nio.file.Files; @@ -31,7 +30,6 @@ import java.util.List; import org.apache.maven.reporting.MavenReportException; -import org.codehaus.plexus.languages.java.version.JavaVersion; import org.codehaus.plexus.util.cli.Commandline; /** @@ -41,21 +39,7 @@ public class StaleHelper { /** - * Compute the encoding of the stale javadoc - * - * @return the encoding of the stale data - */ - private static Charset getDataCharset() { - if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9") - && JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("12")) { - return StandardCharsets.UTF_8; - } else { - return Charset.defaultCharset(); - } - } - - /** - * Compute the data used to detect a stale javadoc + * Compute the data used to detect a stale javadoc. * * @param cmd the command line * @return the stale data @@ -72,7 +56,7 @@ public static List getStaleData(Commandline cmd) throws MavenReportExcep for (String arg : args) { if (arg.startsWith("@")) { String name = arg.substring(1); - options.addAll(Files.readAllLines(dir.resolve(name), getDataCharset())); + options.addAll(Files.readAllLines(dir.resolve(name), StandardCharsets.UTF_8)); ignored.add(name); } } @@ -113,7 +97,7 @@ public static List getStaleData(Commandline cmd) throws MavenReportExcep } /** - * Write the data used to detect a stale javadoc + * Write the data used to detect a stale javadoc. * * @param cmd the command line * @param path the stale data path @@ -121,9 +105,9 @@ public static List getStaleData(Commandline cmd) throws MavenReportExcep */ public static void writeStaleData(Commandline cmd, Path path) throws MavenReportException { try { - List curdata = getStaleData(cmd); + List currentData = getStaleData(cmd); Files.createDirectories(path.getParent()); - Files.write(path, curdata, getDataCharset()); + Files.write(path, currentData, StandardCharsets.UTF_8); } catch (IOException e) { throw new MavenReportException("Error checking stale data", e); }