Skip to content

Commit cb02681

Browse files
committed
Solve Bugs
1 parent b4b9ad0 commit cb02681

File tree

9 files changed

+24
-4
lines changed

9 files changed

+24
-4
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 findbugsMain findbugsTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
33+
- ./gradlew checkstyleMain checkstyleTest pmdMain findbugsMain 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 findbugsMain findbugsTest jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
9+
- gradlew.bat checkstyleMain checkstyleTest pmdMain findbugsMain jacocoTestReport jacocoRootReport test --stacktrace -Pheadless=true -PlogTests
1010

1111
platform:
1212
- x64

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ configure(allprojects - project(':ui:linuxLauncher')) {
155155

156156

157157
dependencies {
158+
compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
158159
testCompile group: 'net.jodah', name: 'concurrentunit', version: '0.4.2'
159160
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.3'
160161
testCompile group: 'junit', name: 'junit', version: '4.12'

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

Lines changed: 3 additions & 0 deletions
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,7 @@ public class PublishVideoOperation implements Operation {
133135
};
134136

135137
@SuppressWarnings("JavadocMethod")
138+
@SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
136139
public PublishVideoOperation(InputSocket.Factory inputSocketFactory) {
137140
if (numSteps != 0) {
138141
throw new IllegalStateException("Only one instance of PublishVideoOperation may exist");

core/src/main/java/edu/wpi/grip/core/operations/network/http/DataHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import com.google.inject.Inject;
1313
import com.google.inject.Singleton;
1414

15+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
16+
1517
import org.eclipse.jetty.server.Request;
1618

1719
import java.io.IOException;
@@ -69,6 +71,7 @@ public final class DataHandler extends PedanticHandler {
6971
}
7072

7173
@Override
74+
@SuppressFBWarnings("UW_UNCOND_WAIT")
7275
protected void handleIfPassed(String target,
7376
Request baseRequest,
7477
HttpServletRequest request,

core/src/main/java/edu/wpi/grip/core/util/SafeShutdown.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package edu.wpi.grip.core.util;
22

3+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
4+
35
import javax.annotation.Nullable;
46

57
/**
@@ -16,8 +18,10 @@ public final class SafeShutdown {
1618
* flagging a shutdown
1719
* that we can't control.
1820
*/
21+
1922
Runtime.getRuntime().addShutdownHook(new Thread() {
2023
@Override
24+
@SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
2125
public void run() {
2226
SafeShutdown.stopping = true;
2327
}

findBugsSuppressions.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
<Match>
66
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
77
</Match>
8+
<Match>
9+
<Bug pattern="NP_METHOD_PARAMETER_TIGHTENS_ANNOTATION" />
10+
</Match>
811
</FindBugsFilter>

ui/src/main/java/edu/wpi/grip/ui/preview/BlobsSocketPreviewView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import com.google.common.eventbus.Subscribe;
1010

11+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
12+
1113
import javafx.application.Platform;
1214
import javafx.geometry.Orientation;
1315
import javafx.scene.control.CheckBox;
@@ -38,7 +40,8 @@ public class BlobsSocketPreviewView extends SocketPreviewView<BlobsReport> {
3840
private final Mat tmp = new Mat();
3941
private final GripPlatform platform;
4042
@SuppressWarnings("PMD.ImmutableField")
41-
private boolean showInputImage;
43+
@SuppressFBWarnings("IS2_INCONSISTENT_SYNC")
44+
private boolean showInputImage = false;
4245

4346
/**
4447
* @param socket An output socket to preview.

ui/src/main/java/edu/wpi/grip/ui/preview/LinesSocketPreviewView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import com.google.common.eventbus.Subscribe;
1010

11+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
12+
1113
import java.util.List;
1214
import javafx.application.Platform;
1315
import javafx.geometry.Orientation;
@@ -40,7 +42,8 @@ public class LinesSocketPreviewView extends SocketPreviewView<LinesReport> {
4042
private final Mat tmp = new Mat();
4143
private final GripPlatform platform;
4244
@SuppressWarnings("PMD.ImmutableField")
43-
private boolean showInputImage;
45+
@SuppressFBWarnings("IS2_INCONSISTENT_SYNC")
46+
private boolean showInputImage = false;
4447

4548
/**
4649
* @param socket An output socket to preview.

0 commit comments

Comments
 (0)