-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Revert 58 to fix spotbugs/spotbugs!819 #100
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
112407e
Revert "Fix #57. Implement Worker API support."
KengoTODA 6e9bcd9
add SLF4J API and bridge into spotbugsClasspath
KengoTODA 040d91f
Require Gradle 5 to avoid SLF4J related problem
KengoTODA 4d41992
add entries into CHANGELOG
KengoTODA 9347e93
Merge branch 'master' into revert-58
KengoTODA b99526b
add missing javadoc introduced at issue 58
KengoTODA 5be0e04
rename Executer to Executor
KengoTODA b5f7360
Merge remote-tracking branch 'origin/master' into revert-58
KengoTODA 067a55c
drop needless code to backward compatibility for Gradle < 4.7
KengoTODA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/github/spotbugs/internal/spotbugs/SpotBugsExecuter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.github.spotbugs.internal.spotbugs; | ||
|
||
import java.io.IOException; | ||
import java.util.List; | ||
|
||
import edu.umd.cs.findbugs.FindBugs; | ||
import edu.umd.cs.findbugs.FindBugs2; | ||
import edu.umd.cs.findbugs.IFindBugsEngine; | ||
import edu.umd.cs.findbugs.TextUICommandLine; | ||
|
||
public class SpotBugsExecuter implements SpotBugsWorker { | ||
KengoTODA marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@Override | ||
public SpotBugsResult runSpotbugs(SpotBugsSpec spec) throws IOException, InterruptedException { | ||
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); | ||
try { | ||
final List<String> args = spec.getArguments(); | ||
String[] strArray = args.toArray(new String[0]); | ||
|
||
Thread.currentThread().setContextClassLoader(FindBugs2.class.getClassLoader()); | ||
FindBugs2 findBugs2 = new FindBugs2(); | ||
TextUICommandLine commandLine = new TextUICommandLine(); | ||
FindBugs.processCommandLine(commandLine, strArray, findBugs2); | ||
findBugs2.execute(); | ||
|
||
return createSpotbugsResult(findBugs2); | ||
} finally { | ||
Thread.currentThread().setContextClassLoader(contextClassLoader); | ||
} | ||
} | ||
|
||
SpotBugsResult createSpotbugsResult(IFindBugsEngine findBugs) { | ||
int bugCount = findBugs.getBugCount(); | ||
int missingClassCount = findBugs.getMissingClassCount(); | ||
int errorCount = findBugs.getErrorCount(); | ||
return new SpotBugsResult(bugCount, missingClassCount, errorCount); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to seriously consider dropping SLF4J and just using JUL, for maximum compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean the trouble around gradle plugin, I think all the reported issues can be solved if we stop depending on Gradle internal API that excludes SLF4J from the dependency. This PR also solves a part of them by bumping up minimum supported version to 5.0. So I still think that SLF4J is better than that horrible JUL...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for JUL.. it just works.