Skip to content

Add support for Findbugs v3 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jdk:
- openjdk7
env:
matrix:
- FB_VERSION=1
- FB_VERSION=2
- FB_VERSION=3
script: "mvn clean install -P build-with-findbugs-v${FB_VERSION}"

8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<findbugs.version>[1.3.9, 3.0.3]</findbugs.version>
<findbugs.version>[1.3.9,4.0.0)</findbugs.version>
</properties>
</profile>
<profile>
Expand All @@ -58,6 +58,12 @@
<findbugs.version>2.0.2</findbugs.version>
</properties>
</profile>
<profile>
<id>build-with-findbugs-v3</id>
<properties>
<findbugs.version>[3.0.0,4.0.0)</findbugs.version>
</properties>
</profile>
</profiles>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static class Singleton {
static final AuxCodeBaseLocatorProvider AUX_CODEBASE_LOCATOR_PROVIDER = new AuxCodeBaseLocatorProvider();
static final BugReporter STATIC_BUG_REPORTER = TestingBugReporter.tddBugReporter();
static final InitialisationResult INITIALISATION_RESULT = attemptSetup();


private static InitialisationResult attemptSetup() {
try {
Expand All @@ -83,7 +83,7 @@ private static InitialisationResult attemptSetup() {
return new InitialisationResult(e);
}
}

private static void setUpStaticDependenciesWithinFindBugs(BugReporter bugReporter) throws Exception {
bugReporter.setPriorityThreshold(Priorities.LOW_PRIORITY);
ClassPathImpl classPath = new ClassPathImpl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,18 @@ public class DetectorRunnerTest {

public static ArgumentMatcher<ClassContext> isClassContextFor(final String simpleClassName) {
return new ArgumentMatcher<ClassContext>() {
@Override public boolean matches(Object argument) {
if (!(argument instanceof ClassContext)) {
return false;
} else {
return ((ClassContext) argument).getClassDescriptor().getSimpleName().equals(simpleClassName);
}
@Override
public boolean matches(ClassContext argument) {
return argument.getClassDescriptor().getSimpleName().equals(simpleClassName);
}

};
}

private ArgumentMatcher<ClassDescriptor> isClassDescriptorFor(final String simpleClassName) {
return new ArgumentMatcher<ClassDescriptor>() {
@Override public boolean matches(Object argument) {
if (!(argument instanceof ClassDescriptor)) {
return false;
} else {
return ((ClassDescriptor) argument).getSimpleName().equals(simpleClassName);
}
@Override public boolean matches(ClassDescriptor argument) {
return argument.getSimpleName().equals(simpleClassName);
}
};
}
Expand Down