Skip to content

Commit dd0292c

Browse files
Ignore some SpotBugs warnings.
1 parent d09da67 commit dd0292c

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

objectbox-java/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ dependencies {
99
implementation 'org.greenrobot:essentials:3.0.0-RC1'
1010
implementation 'com.google.flatbuffers:flatbuffers-java:1.12.0'
1111
api 'com.google.code.findbugs:jsr305:3.0.2'
12+
13+
compileOnly 'com.github.spotbugs:spotbugs-annotations:4.0.4'
1214
}
1315

1416
spotbugs {
1517
ignoreFailures = true
18+
excludeFilter = file("spotbugs-exclude.xml")
1619
}
1720

1821
javadoc {

objectbox-java/spotbugs-exclude.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
<Match>
4+
<!-- Exclude FlatBuffers generated code. -->
5+
<Class name="~io\.objectbox\.model\.Model.*" />
6+
</Match>
7+
</FindBugsFilter>

objectbox-java/src/main/java/io/objectbox/ideasonly/ModelModifier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package io.objectbox.ideasonly;
1818

19+
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
20+
1921
public class ModelModifier {
2022
public class EntityModifier {
2123
final String schemaName;
@@ -37,6 +39,7 @@ public PropertyModifier property(String name) {
3739
}
3840
}
3941

42+
@SuppressFBWarnings // Class may be static, ignore as this is an idea only.
4043
public class PropertyModifier {
4144
final String name;
4245
final EntityModifier entityModifier;

0 commit comments

Comments
 (0)