Skip to content

Commit 4dbebb6

Browse files
committedJan 31, 2022
8280534: Enable compile-time doclint reference checking
Reviewed-by: serb, naoto, mchung, lancea, iris
1 parent 4191b2b commit 4dbebb6

File tree

21 files changed

+28
-7
lines changed

21 files changed

+28
-7
lines changed
 

‎make/modules/java.base/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# questions.
2424
#
2525

26-
DOCLINT += -Xdoclint:all/protected,-reference \
26+
DOCLINT += -Xdoclint:all/protected \
2727
'-Xdoclint/package:java.*,javax.*'
2828
JAVAC_FLAGS += -XDstringConcat=inline
2929
COPY += .icu .dat .spp .nrm content-types.properties \

‎make/modules/java.datatransfer/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
# questions.
2424
#
2525

26-
DOCLINT += -Xdoclint:all/protected,-reference \
26+
DOCLINT += -Xdoclint:all/protected \
2727
'-Xdoclint/package:java.*,javax.*'
2828
COPY += flavormap.properties

‎make/modules/java.logging/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
# questions.
2424
#
2525

26-
DOCLINT += -Xdoclint:all/protected,-reference \
26+
DOCLINT += -Xdoclint:all/protected \
2727
'-Xdoclint/package:java.*,javax.*'

‎make/modules/java.management/Java.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@
2323
# questions.
2424
#
2525

26-
DOCLINT += -Xdoclint:all/protected,-reference \
26+
DOCLINT += -Xdoclint:all/protected \
2727
'-Xdoclint/package:java.*,javax.*'

‎src/java.base/share/classes/java/io/FilenameFilter.java

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
* @see java.io.File#list(java.io.FilenameFilter)
4040
* @since 1.0
4141
*/
42+
@SuppressWarnings("doclint:reference") // cross-module links
4243
@FunctionalInterface
4344
public interface FilenameFilter {
4445
/**

‎src/java.base/share/classes/java/lang/Character.java

+4
Original file line numberDiff line numberDiff line change
@@ -10305,6 +10305,7 @@ public static boolean isIdeographic(int codePoint) {
1030510305
* @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
1030610306
* @since 1.1
1030710307
*/
10308+
@SuppressWarnings("doclint:reference") // cross-module links
1030810309
public static boolean isJavaIdentifierStart(char ch) {
1030910310
return isJavaIdentifierStart((int)ch);
1031010311
}
@@ -10334,6 +10335,7 @@ public static boolean isJavaIdentifierStart(char ch) {
1033410335
* @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
1033510336
* @since 1.5
1033610337
*/
10338+
@SuppressWarnings("doclint:reference") // cross-module links
1033710339
public static boolean isJavaIdentifierStart(int codePoint) {
1033810340
return CharacterData.of(codePoint).isJavaIdentifierStart(codePoint);
1033910341
}
@@ -10371,6 +10373,7 @@ public static boolean isJavaIdentifierStart(int codePoint) {
1037110373
* @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
1037210374
* @since 1.1
1037310375
*/
10376+
@SuppressWarnings("doclint:reference") // cross-module links
1037410377
public static boolean isJavaIdentifierPart(char ch) {
1037510378
return isJavaIdentifierPart((int)ch);
1037610379
}
@@ -10404,6 +10407,7 @@ public static boolean isJavaIdentifierPart(char ch) {
1040410407
* @see java.compiler/javax.lang.model.SourceVersion#isIdentifier(CharSequence)
1040510408
* @since 1.5
1040610409
*/
10410+
@SuppressWarnings("doclint:reference") // cross-module links
1040710411
public static boolean isJavaIdentifierPart(int codePoint) {
1040810412
return CharacterData.of(codePoint).isJavaIdentifierPart(codePoint);
1040910413
}

‎src/java.base/share/classes/java/lang/System.java

+2
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,7 @@ public interface Logger {
12401240
* @see java.lang.System.LoggerFinder
12411241
* @see java.lang.System.Logger
12421242
*/
1243+
@SuppressWarnings("doclint:reference") // cross-module links
12431244
public enum Level {
12441245

12451246
// for convenience, we're reusing java.util.logging.Level int values
@@ -1600,6 +1601,7 @@ public void log(Level level, ResourceBundle bundle, String format,
16001601
*
16011602
* @since 9
16021603
*/
1604+
@SuppressWarnings("doclint:reference") // cross-module links
16031605
public abstract static class LoggerFinder {
16041606
/**
16051607
* The {@code RuntimePermission("loggerFinder")} is

‎src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ private MethodHandleProxies() { } // do not instantiate
154154
// entry points, must be covered by hand-written or automatically
155155
// generated adapter classes.
156156
//
157-
@SuppressWarnings("removal")
157+
@SuppressWarnings({"removal",
158+
"doclint:reference"}) // cross-module links
158159
@CallerSensitive
159160
public static <T> T asInterfaceInstance(final Class<T> intfc, final MethodHandle target) {
160161
if (!intfc.isInterface() || !Modifier.isPublic(intfc.getModifiers()))

‎src/java.base/share/classes/java/lang/invoke/MethodHandles.java

+1
Original file line numberDiff line numberDiff line change
@@ -2105,6 +2105,7 @@ static int optionsToFlag(Set<ClassOption> options) {
21052105
* @jvms 5.5 Initialization
21062106
* @jls 12.7 Unloading of Classes and Interfaces
21072107
*/
2108+
@SuppressWarnings("doclint:reference") // cross-module links
21082109
public Lookup defineHiddenClass(byte[] bytes, boolean initialize, ClassOption... options)
21092110
throws IllegalAccessException
21102111
{

‎src/java.base/share/classes/java/net/package-info.java

+1
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,5 @@
157157
*
158158
* @since 1.0
159159
*/
160+
@SuppressWarnings("doclint:reference") // cross-module links
160161
package java.net;

‎src/java.base/share/classes/java/text/AttributedCharacterIterator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
* @see Annotation
7676
* @since 1.2
7777
*/
78-
78+
@SuppressWarnings("doclint:reference") // cross-module links
7979
public interface AttributedCharacterIterator extends CharacterIterator {
8080

8181
/**

‎src/java.base/share/classes/java/text/Bidi.java

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public Bidi(String paragraph, int flags) {
125125
* @see java.desktop/java.awt.font.TextAttribute#NUMERIC_SHAPING
126126
* @see java.desktop/java.awt.font.TextAttribute#RUN_DIRECTION
127127
*/
128+
@SuppressWarnings("doclint:reference") // cross-module links
128129
public Bidi(AttributedCharacterIterator paragraph) {
129130
if (paragraph == null) {
130131
throw new IllegalArgumentException("paragraph is null");

‎src/java.base/share/classes/java/util/Observable.java

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
* {@link java.util.concurrent.Flow} API.
7474
*/
7575
@Deprecated(since="9")
76+
@SuppressWarnings("doclint:reference") // cross-module links
7677
public class Observable {
7778
private boolean changed = false;
7879
private Vector<Observer> obs;

‎src/java.base/share/classes/java/util/ServiceLoader.java

+1
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,7 @@ static <S> ServiceLoader<S> load(Class<S> service,
16471647
* @revised 9
16481648
*/
16491649
@CallerSensitive
1650+
@SuppressWarnings("doclint:reference") // cross-module links
16501651
public static <S> ServiceLoader<S> load(Class<S> service,
16511652
ClassLoader loader)
16521653
{

‎src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
* @see java.desktop/java.awt.Toolkit#getSystemSelection
4848
* @since 1.1
4949
*/
50+
@SuppressWarnings("doclint:reference") // cross-module links
5051
public class Clipboard {
5152

5253
String name;

‎src/java.logging/share/classes/java/util/logging/LogManager.java

+2
Original file line numberDiff line numberDiff line change
@@ -2563,6 +2563,7 @@ private void setLevelsOnExistingLoggers() {
25632563
*
25642564
* @since 1.5
25652565
*/
2566+
@SuppressWarnings("doclint:reference")
25662567
public static final String LOGGING_MXBEAN_NAME
25672568
= "java.util.logging:type=Logging";
25682569

@@ -2581,6 +2582,7 @@ private void setLevelsOnExistingLoggers() {
25812582
* @since 1.5
25822583
*/
25832584
@Deprecated(since="9")
2585+
@SuppressWarnings("doclint:reference")
25842586
public static synchronized LoggingMXBean getLoggingMXBean() {
25852587
return Logging.getInstance();
25862588
}

‎src/java.logging/share/classes/java/util/logging/LoggingMXBean.java

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
* @see java.management/java.lang.management.PlatformLoggingMXBean
5353
*/
5454
@Deprecated(since="9")
55+
@SuppressWarnings("doclint:reference")
5556
public interface LoggingMXBean {
5657

5758
/**

‎src/java.management/share/classes/java/lang/management/ManagementFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@
246246
* @author Mandy Chung
247247
* @since 1.5
248248
*/
249-
@SuppressWarnings("removal")
249+
@SuppressWarnings({"removal",
250+
"doclint:reference"}) // cross-module links
250251
public class ManagementFactory {
251252
// A class with only static fields and methods.
252253
private ManagementFactory() {};

‎src/java.management/share/classes/java/lang/management/PlatformLoggingMXBean.java

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
*
4747
* @since 1.7
4848
*/
49+
@SuppressWarnings("doclint:reference") // cross-module links
4950
public interface PlatformLoggingMXBean extends PlatformManagedObject {
5051

5152
/**

‎src/java.management/share/classes/javax/management/remote/JMXAddressable.java

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
*
4242
* @since 1.6
4343
*/
44+
@SuppressWarnings("doclint:reference") // cross-module links
4445
public interface JMXAddressable {
4546
/**
4647
* <p>The address of this object.</p>

‎src/java.management/share/classes/javax/management/remote/JMXServerErrorException.java

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
* @see java.rmi/java.rmi.ServerError
4242
* @since 1.5
4343
*/
44+
@SuppressWarnings("doclint:reference") // cross-module links
4445
public class JMXServerErrorException extends IOException {
4546

4647
private static final long serialVersionUID = 3996732239558744666L;

0 commit comments

Comments
 (0)
Please sign in to comment.