Skip to content
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

Spotbugs in textui mode does not properly handle files if they have spaces in the file path #909

Open
bennydictor opened this issue Mar 22, 2019 · 2 comments

Comments

@bennydictor
Copy link

First, we build the Spotbugs distribution.

./gradlew assembleDist
unzip spotbugs/build/distributions/spotbugs-4.0.0-SNAPSHOT.zip

If we create an empty class (this bug happens with all classes, this is just for demonstration purposes),

echo 'public class Test {}' >Test.java
javac Test.java

And place its copy under a directory with spaces in the file name,

mkdir 'i have spaces in the file name'
cp Test.class 'i have spaces in the file name/Test.class'

Then running Spotbugs on the Test.class will, unsurprisingly, produce no errors,

./spotbugs-4.0.0-SNAPSHOT/bin/spotbugs -textui Test.class

But running Spotbugs on the same class, just placed under a directory with spaces in the file name

./spotbugs-4.0.0-SNAPSHOT/bin/spotbugs -textui 'i have spaces in the file name/Test.class'

Produces the following error:

Exception in thread "main" java.io.IOException: No files to analyze could be opened
        at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:274)
        at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:394)
        at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1185)
@welcome
Copy link

welcome bot commented Mar 22, 2019

Thanks for opening your first issue here! 😃
Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.

@geirsandearm
Copy link

Same thing happens if I have öäå in package names or class names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants