Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk17 Public archive

Commit

Permalink
8268972: Add default impl for recent new Reporter.print method
Browse files Browse the repository at this point in the history
Reviewed-by: prappo
  • Loading branch information
jonathan-gibbons committed Jun 25, 2021
1 parent 7ab1285 commit 44691cc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Reporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

1 comment on commit 44691cc

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.