Browse Source

Check for warnings in err stream too, to make javadoc task work on Java 17+

Discussed in dev list https://mail-archives.apache.org/mod_mbox/ant-dev/202106.mbox/%3c2e2ef67a-7d96-adfc-f050-efaccab7e6c2@apache.org%3e
master
Jaikiran Pai 3 years ago
parent
commit
fa91bff92e
2 changed files with 5 additions and 2 deletions
  1. +3
    -0
      WHATSNEW
  2. +2
    -2
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java

+ 3
- 0
WHATSNEW View File

@@ -27,6 +27,9 @@ Other changes:
* Ant tries to avoid file name canonicalization when possible.
Bugzilla Report 65499

* javadoc task will now look for warning messages in the STDERR stream too
when "failonwarning" is set to true to account for changes in JDK 17+

Changes from Ant 1.10.10 TO Ant 1.10.11
=======================================



+ 2
- 2
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -1918,7 +1918,7 @@ public class Javadoc extends Task {
throw new BuildException("Javadoc returned " + ret,
getLocation());
}
if (out.sawWarnings() && failOnWarning) {
if (failOnWarning && (out.sawWarnings() || err.sawWarnings())) {
throw new BuildException("Javadoc issued warnings.",
getLocation());
}
@@ -2623,7 +2623,7 @@ public class Javadoc extends Task {

@Override
protected void processLine(final String line, final int messageLevel) {
if (line.contains("warning")) {
if (line.matches("(\\d) warning[s]?$")) {
sawWarnings = true;
}
if (messageLevel == Project.MSG_INFO


Loading…
Cancel
Save