Community
Participate
Working Groups
Build ID: 3.4.0 Steps To Reproduce: After I remove a project from the workspace, I see an exception from the log file. It looks like the "Search" job is run after the project is removed. Is it possible to add a checking to JDT code to prevent the exception? More information: Here is the stack: !MESSAGE Search failed: !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.core.search.matching.PossibleMatch.getContents(Unknown Source) at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Unknown Source) at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Unknown Source) at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Unknown Source) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.parseAndBuildBindings(Unknown Source) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(Unknown Source) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(Unknown Source) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(Unknown Source) at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(Unknown Source) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(Unknown Source) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(Unknown Source) at org.eclipse.jdt.core.search.SearchEngine.search(Unknown Source) at com.ibm.etools.annotations.core.internal.search.JavaSearchUtils.findAnnotations(Unknown Source) at com.ibm.etools.annotations.core.internal.listeners.TriggerAnnotationListenerImpl$InvokeChangeListenersJob.run(Unknown Source) at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
When the project is deleted, the possible match will get a null while asking for the openable source mapper in PossibleMatch.getContents() at line 70... As the search request is run asynchronously, this kind of thing may happen (and the given stack trace looks like an example of it). So it's seems reasonable to make the Search Engine aware of this possibility and protect the following lines by a null checking.
Created attachment 127186 [details] Proposed patch
Released for 3.5M6 in HEAD stream.
Verified for 3.5M6 using I20090310-0100
Created attachment 129088 [details] Proposed patch for R3_4_maintenance stream
Patch released in R3_4_maintenance branch.