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

Fix NPE when empty working dir #1208

Merged
merged 4 commits into from
Mar 7, 2017

Conversation

surli
Copy link
Collaborator

@surli surli commented Mar 7, 2017

Fix a funny bug which happens when launching Spoon in an empty working directory: we have a NPE because JDT cannot find a .java file... We fix it by passing as argument to JDT the list of java files we want to Spoon. It should then fix #1116

@monperrus monperrus merged commit f03becb into INRIA:master Mar 7, 2017
@@ -392,7 +392,7 @@ protected boolean buildUnitsAndModel(JDTBuilder jdtBuilder, SpoonFolder sourcesF
.classpathOptions(new ClasspathOptions().encoding(this.encoding).classpath(classpath)) //
.complianceOptions(new ComplianceOptions().compliance(javaCompliance)) //
.advancedOptions(new AdvancedOptions().preserveUnusedVars().continueExecution().enableJavadoc()) //
.sources(new SourceOptions().sources()) // no sources, handled by the JDTBatchCompiler
.sources(new SourceOptions().sources(sourcesFolder.getAllJavaFiles())) // no sources, handled by the JDTBatchCompiler
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the unrelated comment

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

Successfully merging this pull request may close these issues.

NullPointerException when using Spoon inside an IntelliJ Plugin (works with .jar but not with Maven)
3 participants