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

NullPointerException in RefreshDSLDJob #970

Closed
AndreasWBartels opened this issue Oct 9, 2019 · 0 comments
Closed

NullPointerException in RefreshDSLDJob #970

AndreasWBartels opened this issue Oct 9, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@AndreasWBartels
Copy link

Maybe IFile.getFileExtension() can return a null value.

protected boolean isFile(IStorage file, String extension) { if (file instanceof IFile) { IFile iFile = (IFile) file; return !iFile.isDerived() && iFile.getFileExtension().equals(extension); } else { String name = file.getName(); return name != null && name.endsWith(extension); } }
possible nullsafe fix

protected boolean isFile(IStorage file, String extension) { if (file instanceof IFile) { IFile iFile = (IFile) file; return !iFile.isDerived() && Objects.equals(iFile.getFileExtension(), extension); } else { String name = file.getName(); return name != null && name.endsWith(extension); } }

java.lang.NullPointerException at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.isFile(RefreshDSLDJob.java:99) at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.isDSLD(RefreshDSLDJob.java:89) at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob$DSLDResourceVisitor.visit(RefreshDSLDJob.java:235) at org.eclipse.core.internal.resources.Resource.lambda$1(Resource.java:117) at org.eclipse.core.internal.resources.Resource.lambda$0(Resource.java:85) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:135) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:55) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:117) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:105) at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob$DSLDResourceVisitor.findFiles(RefreshDSLDJob.java:247) at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.refreshProject(RefreshDSLDJob.java:182) at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.run(RefreshDSLDJob.java:123) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

@eric-milles eric-milles added the bug label Oct 9, 2019
@eric-milles eric-milles self-assigned this Oct 9, 2019
@eric-milles eric-milles added this to the v3.6.0 milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants