Skip to content

Commit 44691cc

Browse files
committedJun 25, 2021
8268972: Add default impl for recent new Reporter.print method
Reviewed-by: prappo
1 parent 7ab1285 commit 44691cc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Reporter.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@ public interface Reporter {
9494
* The positions are all 0-based character offsets from the beginning of content of the file.
9595
* The positions should satisfy the relation {@code start <= pos <= end}.
9696
*
97+
* @implSpec
98+
* This implementation always throws {@code UnsupportedOperationException}.
99+
* The implementation provided by the {@code javadoc} tool to
100+
* {@link Doclet#init(Locale, Reporter) initialize} a doclet
101+
* overrides this implementation.
102+
*
97103
* @param kind the kind of diagnostic
98104
* @param file the file
99105
* @param start the beginning of the enclosing range
@@ -103,7 +109,9 @@ public interface Reporter {
103109
*
104110
* @since 17
105111
*/
106-
void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message);
112+
default void print(Diagnostic.Kind kind, FileObject file, int start, int pos, int end, String message) {
113+
throw new UnsupportedOperationException();
114+
}
107115

108116
/**
109117
* Returns a writer that can be used to write non-diagnostic output,

0 commit comments

Comments
 (0)
Please sign in to comment.