Skip to content

Commit fd1075b

Browse files
committed
Merge branch 'master' into ntSource
2 parents c9efca1 + 3ca247f commit fd1075b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+192
-62
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ install:
3030
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && ./gradlew :ui:jfxNative --stacktrace || ./gradlew --stacktrace '
3131

3232
script:
33-
- ./gradlew checkstyleMain checkstyleTest pmdMain pmdTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
33+
- ./gradlew checkstyleMain checkstyleTest pmdMain pmdTest findbugsMain findbugsTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
3434

3535
after_success:
3636
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then codecov ; fi

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build_script:
66

77
# to run your custom scripts instead of automatic tests
88
test_script:
9-
- gradlew.bat checkstyleMain checkstyleTest pmdMain pmdTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
9+
- gradlew.bat checkstyleMain checkstyleTest pmdMain pmdTest findbugsMain findbugsTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
1010

1111
platform:
1212
- x64

build.gradle

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import groovy.xml.XmlUtil
2+
13
buildscript {
24
repositories {
35
jcenter()
@@ -85,13 +87,14 @@ def getVersionSimple = { ->
8587
}
8688
}
8789

88-
configure(allprojects - project(':ui:linuxLauncher')) {
90+
configure(subprojects - project(':ui:linuxLauncher')) {
8991
apply plugin: 'java'
9092
apply plugin: 'application'
9193
apply plugin: 'jacoco'
9294
apply plugin: 'net.ltgt.errorprone'
9395
apply plugin: 'checkstyle'
9496
apply plugin: 'pmd'
97+
apply plugin: 'findbugs'
9598

9699
configurations.errorprone {
97100
resolutionStrategy.force 'com.google.errorprone:error_prone_core:2.0.9'
@@ -119,6 +122,30 @@ configure(allprojects - project(':ui:linuxLauncher')) {
119122
ruleSets = []
120123
}
121124

125+
findbugs {
126+
sourceSets = [sourceSets.main]
127+
excludeFilter = new File(rootDir, "findBugsSuppressions.xml")
128+
effort = "max"
129+
}
130+
131+
ext.printReportSafe = { xmlReport ->
132+
if (xmlReport.exists()) {
133+
def bugs = (new XmlParser().parse(xmlReport)).BugInstance
134+
bugs.each { System.out.println(new XmlUtil().serialize(it)) }
135+
}
136+
}
137+
138+
task findbugsMainReport << {
139+
printReportSafe(findbugsMain.reports.getXml().destination)
140+
}
141+
142+
task findbugsTestReport << {
143+
printReportSafe(findbugsTest.reports.getXml().destination)
144+
}
145+
146+
findbugsMain.finalizedBy findbugsMainReport
147+
findbugsTest.finalizedBy findbugsTestReport
148+
122149
repositories {
123150
mavenCentral()
124151
jcenter()
@@ -129,6 +156,7 @@ configure(allprojects - project(':ui:linuxLauncher')) {
129156

130157

131158
dependencies {
159+
compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
132160
testCompile group: 'net.jodah', name: 'concurrentunit', version: '0.4.2'
133161
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
134162
testCompile group: 'junit', name: 'junit', version: '4.12'

checkstyle.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434

3535
<module name="SuppressWarningsFilter"/>
3636

37-
<!--<module name="NewlineAtEndOfFile" />--> <!-- Screwed up on Appveyor for some reason -->
37+
<module name="NewlineAtEndOfFile">
38+
<property name="lineSeparator" value="lf"/>
39+
</module>
3840

3941
<module name="TreeWalker">
4042
<module name="SuppressWarningsHolder"/>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ public final void onExceptionClearedEvent(ExceptionClearedEvent event) {
9696
+ "Event");
9797
}
9898

99-
}
99+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.util.Objects;
1010
import java.util.Optional;
1111
import java.util.Set;
12+
1213
import javax.annotation.Nullable;
1314
import javax.annotation.concurrent.Immutable;
1415

core/src/main/java/edu/wpi/grip/core/operations/Operations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ public void addOperations() {
202202
.map(OperationAddedEvent::new)
203203
.forEach(eventBus::post);
204204
}
205-
}
205+
}

core/src/main/java/edu/wpi/grip/core/operations/composite/FilterContoursOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void perform() {
191191
continue;
192192
}
193193

194-
final double ratio = bb.width() / bb.height();
194+
final double ratio = (double) bb.width() / (double) bb.height();
195195
if (ratio < minRatio || ratio > maxRatio) {
196196
continue;
197197
}

core/src/main/java/edu/wpi/grip/core/operations/composite/PublishVideoOperation.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
import com.google.common.collect.ImmutableList;
1111

12+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
13+
1214
import org.bytedeco.javacpp.BytePointer;
1315
import org.bytedeco.javacpp.IntPointer;
1416

@@ -133,6 +135,8 @@ public class PublishVideoOperation implements Operation {
133135
};
134136

135137
@SuppressWarnings("JavadocMethod")
138+
@SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD",
139+
justification = "Do not need to synchronize inside of a constructor")
136140
public PublishVideoOperation(InputSocket.Factory inputSocketFactory) {
137141
if (numSteps != 0) {
138142
throw new IllegalStateException("Only one instance of PublishVideoOperation may exist");
@@ -141,7 +145,7 @@ public PublishVideoOperation(InputSocket.Factory inputSocketFactory) {
141145
false));
142146
this.qualitySocket = inputSocketFactory.create(SocketHints.Inputs
143147
.createNumberSliderSocketHint("Quality", 80, 0, 100));
144-
numSteps = numSteps + 1;
148+
numSteps++;
145149

146150
serverThread = new Thread(runServer, "Camera Server");
147151
serverThread.setDaemon(true);

core/src/main/java/edu/wpi/grip/core/operations/composite/ValveOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
public class ValveOperation implements Operation {
1818

19-
public static OperationDescription DESCRIPTION =
19+
public static final OperationDescription DESCRIPTION =
2020
OperationDescription.builder()
2121
.name("Valve")
2222
.summary("Toggle an output socket on or off using a boolean")

0 commit comments

Comments
 (0)