Merge branch 'pr-1263'

This commit is contained in:
Andreas Dangel
2018-07-29 11:33:23 +02:00
2 changed files with 8 additions and 4 deletions

View File

@ -51,6 +51,7 @@ extended for lambda parameters with Java 11 via
### Fixed Issues
* core
* [#1178](https://github.com/pmd/pmd/issues/1178): \[core] "Unsupported build listener" in gradle build
* [#1225](https://github.com/pmd/pmd/issues/1225): \[core] Error in sed expression on line 82 of run.sh while detecting installed version of Java
* doc
* [#1215](https://github.com/pmd/pmd/issues/1215): \[doc] TOC links don't work?

View File

@ -35,7 +35,7 @@ public class AntLogHandler extends Handler {
public AntLogHandler(Project project) {
this.project = project;
}
public Level getAntLogLevel() {
for (final BuildListener l : project.getBuildListeners()) {
Field declaredField = null;
@ -50,10 +50,10 @@ public class AntLogHandler extends Handler {
try {
declaredField = l.getClass().getDeclaredField("logLevel");
} catch (final NoSuchFieldException e) {
project.log("Unsupported build listener: " + l.getClass(), Project.MSG_WARN);
project.log("Unsupported build listener: " + l.getClass(), Project.MSG_DEBUG);
}
}
if (declaredField != null) {
declaredField.setAccessible(true);
return LOG_LEVELS[declaredField.getInt(l)];
@ -62,7 +62,10 @@ public class AntLogHandler extends Handler {
// Just ignore it
}
}
project.log("Could not determine ant log level, no supported build listeners found. "
+ "Log level is set to FINEST", Project.MSG_WARN);
return Level.FINEST;
}