diff --git a/build.gradle b/build.gradle index a200fb5ae9..9b3080a94c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import groovy.xml.XmlUtil + buildscript { repositories { jcenter() @@ -124,23 +126,24 @@ configure(allprojects - project(':ui:linuxLauncher')) { sourceSets = [sourceSets.main] excludeFilter = new File(rootDir, "findBugsSuppressions.xml") effort = "max" + ignoreFailures = true // Error will be reported by checkFindBugsReport } task checkFindBugsReport << { - try { - def xmlReport = findbugsMain.reports.getXml() - def slurped = new XmlSlurper().parse(xmlReport.destination) - def bugsFound = slurped.BugInstance.size() + def xmlReport = findbugsMain.reports.getXml().destination + if (findbugsMain.reports.getXml().destination.exists()) { + def bugs = (new XmlParser().parse(xmlReport)).BugInstance + def bugsFound = bugs.size() if (bugsFound > 0) { - new XmlNodePrinter().printList(slurped.BugInstance.list()) - throw new GradleException("$bugsFound FindBugs rule violations were found. See the report at: $xmlReport.destination") + bugs.each { System.out.println(new XmlUtil().serialize(it)) } + throw new GradleException("$bugsFound FindBugs rule violations were found. See the report at: $xmlReport") } - } catch (Exception e) { - } } - findbugsMain.finalizedBy checkFindBugsReport + tasks.withType(FindBugs) { + it.finalizedBy checkFindBugsReport + } repositories { mavenCentral() diff --git a/core/src/main/java/edu/wpi/grip/core/OperationDescription.java b/core/src/main/java/edu/wpi/grip/core/OperationDescription.java index 88fafdd6c0..6647c3b996 100644 --- a/core/src/main/java/edu/wpi/grip/core/OperationDescription.java +++ b/core/src/main/java/edu/wpi/grip/core/OperationDescription.java @@ -10,6 +10,7 @@ import java.util.Optional; import java.util.Set; +import javax.annotation.Nullable; import javax.annotation.concurrent.Immutable; import static com.google.common.base.Preconditions.checkNotNull; @@ -95,7 +96,7 @@ public ImmutableSet aliases() { } @Override - public boolean equals(Object o) { + public boolean equals(@Nullable Object o) { if (this == o) { return true; }