-
Notifications
You must be signed in to change notification settings - Fork 131
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 in ClasspathMultiDirectory#directoryList() #545
base: master
Are you sure you want to change the base?
Conversation
@jdneo do you know why |
What is missing is same change in the parent class, and a test. |
@fbricon Not yet, I can investigate more tomorrow. But might need some time since I'm not quite familiar with the code base now. If anyone has some background knowledge/hints that will be helpful :) |
@iloveeclipse yeah, I could do that after I get some certain understanding of this problem |
Scanning the call hierarchy of Seams like one of those clients didn't observe that discipline? |
I found that the same NPE issues can be found in bugzilla as well, but for different use cases. For this PR, looks like it is caused by multiple instances reference the same When triggering eclipse.jdt.core/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/JavaBuilder.java Lines 271 to 272 in efccc21
And then, during the build, some typebindings are generated with the same After imageBuilder.build();, it starts to clean up At this time, the Then, the And NPE happens. I'm thinking that, maybe reset Update:Looks like the root cause is that, the annotation processor dependency (In this case, it's micronaut) caches the Though we can make sure we can discard the To simply fix this issue, maybe we can just add null checks and return null directly if the |
That sounds fair. Still I'm a bit worried that perhaps we are leaking internal structures, inviting all kinds of unexpected usage. @jarthana can you say a word on the life cycle of |
I will have to check, but a quick search for BaseProcessingEnvImpl.getLookupEnvironment() brings up a lot of results :) |
Signed-off-by: Sheng Chen <sheche@microsoft.com>
Signed-off-by: Sheng Chen sheche@microsoft.com
What it does
Fix a potential NPE issue in
ClasspathMultiDirectory
. the memberthis.directoryCache
could be null ifcleanup()
is calledHow to test
HelloControllerTest
Behavior without the change
target/test-classes/example
HelloControllerTest
failsBehavior with the change
target/test-classes/example
HelloControllerTest
passesAuthor checklist