File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
core/src/main/java/edu/wpi/grip/core Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change 1+ import groovy.xml.XmlUtil
2+
13buildscript {
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()
Original file line number Diff line number Diff line change 1010import java .util .Optional ;
1111import java .util .Set ;
1212
13+ import javax .annotation .Nullable ;
1314import javax .annotation .concurrent .Immutable ;
1415
1516import 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 }
You can’t perform that action at this time.
0 commit comments