-
Notifications
You must be signed in to change notification settings - Fork 148
Do not throw NPE from IFile.getContents(false) #2290
#2291
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
Do not throw NPE from IFile.getContents(false) #2290
#2291
Conversation
bceb85e to
8c49f31
Compare
4e38707 to
fc411ce
Compare
fc411ce to
a5d5f6c
Compare
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
5e2a755 to
b60a035
Compare
|
@jukzi could you please review this? |
....eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/IFileTest.java
Outdated
Show resolved
Hide resolved
....eclipse.core.tests.resources/src/org/eclipse/core/tests/resources/regression/IFileTest.java
Show resolved
Hide resolved
jukzi
left a comment
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.
The NPE fix itself looks legit.
b60a035 to
3549904
Compare
|
Build fails due to a dead mirror: |
e73e0d4 to
706f2f6
Compare
|
Thanks. Patch makes sense. |
|
The test introduced with this PR sporadically fails on Windows, see: |
IFile.getContents(false)does thread unsafe existence checks, resulting in random exceptions.eclipse.platform/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/File.java
Lines 354 to 362 in b7cb30f
Ideally, read operations should be synchronized with write operations, but that might break backward compatibility.
This PR works around one of such exceptions by adding an explicit null check.
Error handling is copied from thread-unsafe check:
eclipse.platform/resources/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/resources/Resource.java
Lines 367 to 378 in b7cb30f
Fixes #2290