Skip to content

Commit b4b9ad0

Browse files
committed
Fix printing
1 parent b211720 commit b4b9ad0

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

build.gradle

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import groovy.xml.XmlUtil
2+
13
buildscript {
24
repositories {
35
jcenter()
@@ -124,23 +126,24 @@ configure(allprojects - project(':ui:linuxLauncher')) {
124126
sourceSets = [sourceSets.main]
125127
excludeFilter = new File(rootDir, "findBugsSuppressions.xml")
126128
effort = "max"
129+
ignoreFailures = true // Error will be reported by checkFindBugsReport
127130
}
128131

129132
task checkFindBugsReport << {
130-
try {
131-
def xmlReport = findbugsMain.reports.getXml()
132-
def slurped = new XmlSlurper().parse(xmlReport.destination)
133-
def bugsFound = slurped.BugInstance.size()
133+
def xmlReport = findbugsMain.reports.getXml().destination
134+
if (findbugsMain.reports.getXml().destination.exists()) {
135+
def bugs = (new XmlParser().parse(xmlReport)).BugInstance
136+
def bugsFound = bugs.size()
134137
if (bugsFound > 0) {
135-
new XmlNodePrinter().printList(slurped.BugInstance.list())
136-
throw new GradleException("$bugsFound FindBugs rule violations were found. See the report at: $xmlReport.destination")
138+
bugs.each { System.out.println(new XmlUtil().serialize(it)) }
139+
throw new GradleException("$bugsFound FindBugs rule violations were found. See the report at: $xmlReport")
137140
}
138-
} catch (Exception e) {
139-
140141
}
141142
}
142143

143-
findbugsMain.finalizedBy checkFindBugsReport
144+
tasks.withType(FindBugs) {
145+
it.finalizedBy checkFindBugsReport
146+
}
144147

145148
repositories {
146149
mavenCentral()

core/src/main/java/edu/wpi/grip/core/OperationDescription.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.util.Optional;
1111
import java.util.Set;
1212

13+
import javax.annotation.Nullable;
1314
import javax.annotation.concurrent.Immutable;
1415

1516
import static com.google.common.base.Preconditions.checkNotNull;
@@ -95,7 +96,7 @@ public ImmutableSet<String> aliases() {
9596
}
9697

9798
@Override
98-
public boolean equals(Object o) {
99+
public boolean equals(@Nullable Object o) {
99100
if (this == o) {
100101
return true;
101102
}

0 commit comments

Comments
 (0)