This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 42f40fad15e3bea00ab45426a4e8e8890d69e859 Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Sat Nov 13 16:42:25 2021 +0100 Remove a hack which is not needed anymore when building with Java 17. --- core/sis-build-helper/pom.xml | 10 +++--- .../org/apache/sis/internal/doclet/Doclet.java | 36 ++-------------------- .../org/apache/sis/internal/doclet/Taglet.java | 6 ++-- .../apache/sis/internal/doclet/package-info.java | 2 +- 4 files changed, 12 insertions(+), 42 deletions(-) diff --git a/core/sis-build-helper/pom.xml b/core/sis-build-helper/pom.xml index bad16bf..a72e2d4 100644 --- a/core/sis-build-helper/pom.xml +++ b/core/sis-build-helper/pom.xml @@ -90,7 +90,7 @@ <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> - <release>9</release> + <release>17</release> <compilerArgs> <!-- As of August 2018, we can not yet moduralize Maven plugins because the Maven dependencies are themselves not modularized. Attempts to use them as unnamed modules cause package conflicts. @@ -102,7 +102,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-plugin-plugin</artifactId> - <version>3.6.0</version> + <version>3.6.1</version> <executions> <execution> <id>default-descriptor</id> @@ -121,17 +121,17 @@ <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> - <version>3.5.4</version> + <version>3.8.3</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> - <version>3.5.4</version> + <version>3.8.3</version> </dependency> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-annotations</artifactId> - <version>3.5.2</version> + <version>3.6.1</version> <scope>provided</scope> </dependency> <dependency> diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java b/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java index 8396c86..d90f279 100644 --- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java +++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Doclet.java @@ -19,8 +19,6 @@ package org.apache.sis.internal.doclet; import java.util.Set; import java.util.LinkedHashSet; import java.util.List; -import java.util.Locale; -import java.util.function.Supplier; import java.nio.file.Path; import java.nio.file.Paths; import java.io.File; @@ -46,11 +44,11 @@ import jdk.javadoc.doclet.StandardDoclet; * </ul> * * @author Martin Desruisseaux (Geomatys) - * @version 1.0 + * @version 1.2 * @since 0.5 * @module */ -public final class Doclet extends StandardDoclet implements Supplier<Reporter> { +public final class Doclet extends StandardDoclet { /** * The name of the SIS-specific stylesheet file. */ @@ -62,41 +60,12 @@ public final class Doclet extends StandardDoclet implements Supplier<Reporter> { private String outputDirectory; /** - * Where to report warnings, or {@code null} if unknown. - */ - private Reporter reporter; - - /** * Invoked by the Javadoc tools for instantiating the custom doclet. */ public Doclet() { } /** - * Invoked by the Javadoc tools for initializing the doclet. - * - * @param locale the locale to use for formatting HTML content. - * @param reporter where to report warnings and errors. - */ - @Override - public void init(final Locale locale, final Reporter reporter) { - super.init(locale, reporter); - this.reporter = reporter; - } - - /** - * Returns the {@link Reporter} associated to this doclet environment. - * This method is hack for giving that information to the taglets. We have to use a standard Java interfaces - * because the class loader of this {@code Doclet} will not be the same than the {@link Taglet} class loader. - * - * @return implementation-dependent information to give to taglets. - */ - @Override - public Reporter get() { - return reporter; - } - - /** * Returns the options supported by the standard doclet. * * @return all the supported options. @@ -225,6 +194,7 @@ public final class Doclet extends StandardDoclet implements Supplier<Reporter> { */ @SuppressWarnings("CallToPrintStackTrace") private void error(final IOException e) { + final Reporter reporter = getReporter(); if (reporter != null) { final StringWriter buffer = new StringWriter(); final PrintWriter p = new PrintWriter(buffer); diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Taglet.java b/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Taglet.java index b7be2cf..2ee35b4 100644 --- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Taglet.java +++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/Taglet.java @@ -31,7 +31,7 @@ import com.sun.source.util.TreePath; import com.sun.source.doctree.DocTree; import com.sun.source.doctree.TextTree; import com.sun.source.doctree.UnknownInlineTagTree; -import java.util.function.Supplier; +import jdk.javadoc.doclet.StandardDoclet; /** @@ -39,7 +39,7 @@ import java.util.function.Supplier; * Taglets are assumed inline by default. * * @author Martin Desruisseaux (Geomatys) - * @version 1.0 + * @version 1.2 * @since 0.3 * @module */ @@ -73,7 +73,7 @@ abstract class Taglet implements jdk.javadoc.doclet.Taglet { */ @Override public void init(final DocletEnvironment env, final Doclet doclet) { - reporter = (Reporter) ((Supplier<?>) doclet).get(); + reporter = ((StandardDoclet) doclet).getReporter(); trees = env.getDocTrees(); } diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java b/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java index c1e16f1..ab3680c 100644 --- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java +++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/doclet/package-info.java @@ -21,7 +21,7 @@ * together with doclet performing post-processing after Javadoc generation. * * @author Martin Desruisseaux (Geomatys) - * @version 1.0 + * @version 1.2 * @since 0.5 * @module */