-
CSR
-
Resolution: Approved
-
P3
-
None
-
source
-
minimal
-
just providing a default implementation
-
Java API
-
JDK
Summary
Provide a default implementation for the recent new Reporter.print
method
Problem
In methods recently added to Reporter, one of the methods was not given a default implementation.
Solution
Provide a default implementation and corresponding @implSpec
.
Specification
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Reporter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Reporter.java
index 2ac7741ce46..91bc5fe8ea2 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Reporter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Reporter.java
@@ -94,6 +94,12 @@ public interface Reporter {
* The positions are all 0-based character offsets from the beginning of content of the file.
* The positions should satisfy the relation {@code start <= pos <= end}.
*
+ * @implSpec
+ * This implementation always throws {@code UnsupportedOperationException}.
+ * The implementation provided by the {@code javadoc} tool to
+ * {@link Doclet#init(Locale, Reporter) initialize} a doclet
+ * overrides this implementation.
+ *
* @param kind the kind of diagnostic
* @param file the file
* @param start the beginning of the enclosing range
@@ -103,7 +109,9 @@ public interface Reporter {
*
* @since 17
*/
- void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message);
+ default void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message) {
+ throw new UnsupportedOperationException();
+ }
/**
* Returns a writer that can be used to write non-diagnostic output,
- csr of
-
JDK-8268972 Add default impl for recent new Reporter.print method
-
- Resolved
-
- relates to
-
JDK-8267279 New methods and clarifications for the doclet Reporter interface
-
- Closed
-