java-1.8.0-openjdk/disable-doclint-by-default.patch
Omair Majid 8f540da22d Fix tests when doclint is disabled by default
Include original author and the author of test-fixes patch.
2014-04-28 16:42:01 -04:00

59 lines
2.3 KiB
Diff

Disable doclint by default
OpenJDK 8 adds and enables doclint by default. This catches issues in
javadoc comments. It is too strict, breaks javadoc compilation and, in
general, breaks the build for old code known to build with previous
versions of OpenJDK.
See: http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
See: https://lists.fedoraproject.org/pipermail/java-devel/2014-February/005150.html
Author: Andrew John Hughes <ahughes@redhat.com>
Author: Emmanuel Bourg <ebourg@apache.org>
--- jdk8/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java
+++ jdk8/langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java
@@ -811,10 +811,9 @@
doclintOpts.add(opt == null ? DocLint.XMSGS_OPTION : DocLint.XMSGS_CUSTOM_PREFIX + opt);
}
- if (doclintOpts.isEmpty()) {
- doclintOpts.add(DocLint.XMSGS_OPTION);
- } else if (doclintOpts.size() == 1
- && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none")) {
+ if (doclintOpts.isEmpty() ||
+ (doclintOpts.size() == 1
+ && doclintOpts.get(0).equals(DocLint.XMSGS_CUSTOM_PREFIX + "none"))) {
return;
}
--- jdk8/langtools/test/tools/javadoc/doclint/DocLintTest.java
+++ jdk8/langtools/test/tools/javadoc/doclint/DocLintTest.java
@@ -130,12 +130,12 @@
};
test(Collections.<String>emptyList(),
- Main.Result.ERROR,
- EnumSet.of(Message.DL_ERR9A, Message.DL_WRN12A));
+ Main.Result.OK,
+ EnumSet.of(Message.JD_WRN10, Message.JD_WRN13));
test(Arrays.asList(rawDiags),
- Main.Result.ERROR,
- EnumSet.of(Message.DL_ERR9, Message.DL_WRN12));
+ Main.Result.OK,
+ EnumSet.of(Message.JD_WRN10, Message.JD_WRN13));
test(Arrays.asList("-Xdoclint:none"),
Main.Result.OK,
@@ -158,8 +158,8 @@
EnumSet.of(Message.DL_WRN12));
test(Arrays.asList(rawDiags, "-private"),
- Main.Result.ERROR,
- EnumSet.of(Message.DL_ERR6, Message.DL_ERR9, Message.DL_WRN12));
+ Main.Result.OK,
+ EnumSet.of(Message.JD_WRN10, Message.JD_WRN13));
test(Arrays.asList(rawDiags, "-Xdoclint:syntax", "-private"),
Main.Result.ERROR,