Bug 216939 - [search] NPE in JavaSearchScope
Summary: [search] NPE in JavaSearchScope
Status: VERIFIED DUPLICATE of bug 158526
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-29 12:15 EST by Chris Aniszczyk CLA
Modified: 2008-04-29 04:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Aniszczyk CLA 2008-01-29 12:15:23 EST
3.4M4

Here is the stack trace... this just happened to me after creating a new test project... never has happened to me before...

eclipse.buildId=I20071213-1700
java.version=1.6.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86


Error
Tue Jan 29 11:13:41 CST 2008
An internal error occurred during: "Items filtering".

java.lang.NullPointerException
at org.eclipse.jdt.internal.core.search.JavaSearchScope.addEnclosingProjectOrJar(JavaSearchScope.java:77)
at org.eclipse.jdt.internal.core.search.JavaSearchScope.add(JavaSearchScope.java:167)
at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.initialize(JavaWorkspaceScope.java:84)
at org.eclipse.jdt.internal.core.search.JavaWorkspaceScope.enclosingProjectsAndJars(JavaWorkspaceScope.java:63)
at org.eclipse.jdt.internal.core.search.IndexSelector.initializeIndexLocations(IndexSelector.java:120)
at org.eclipse.jdt.internal.core.search.IndexSelector.getIndexLocations(IndexSelector.java:201)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.selectIndexes(JavaSearchParticipant.java:112)
at org.eclipse.jdt.internal.core.search.PatternSearchJob.getIndexes(PatternSearchJob.java:80)
at org.eclipse.jdt.internal.core.search.PatternSearchJob.ensureReadyToRun(PatternSearchJob.java:51)
at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:177)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:784)
at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:814)
at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.fillContentProvider(FilteredTypesSelectionDialog.java:608)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.filterContent(FilteredItemsSelectionDialog.java:2141)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.internalRun(FilteredItemsSelectionDialog.java:2083)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.doRun(FilteredItemsSelectionDialog.java:2055)
at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.run(FilteredItemsSelectionDialog.java:2042)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Dani Megert CLA 2008-01-29 12:20:22 EST
Most likely caused by fix for bug 215841.
Comment 2 Frederic Fusier CLA 2008-01-29 12:31:25 EST
(In reply to comment #1)
> Most likely caused by fix for bug 215841.
> 
How could it be as this bug was released yesterday and the corresponding I-build is not on the download page yet!?? The build ref is I20071213-1700 (aka 3.4M4)

Can you also explain why did you increase the severity?
Comment 3 Dani Megert CLA 2008-01-29 12:43:46 EST
>How could it be as this bug was released yesterday and the corresponding
>I-build is not on the download page yet!?? The build ref is I20071213-1700 (aka
>3.4M4)
>
>Can you also explain why did you increase the severity?

Sorry, I didn't look at the build id, just remembered recent incoming code change in that class.
Comment 4 Frederic Fusier CLA 2008-01-29 15:20:02 EST
(In reply to comment #3)
> Sorry, I didn't look at the build id, just remembered recent incoming code
> change in that class.
> 
No problem :-)

It seems to be a potential problem from the beginning with the initialization of the JavaWorkspaceScope global variable stored in the JavaModelManager.

I cannot see any synchronization which would make it thread safe and I guess that 2 threads trying to get a java workspace scope concurrently on the first place may fall into such problematic situation...
Comment 5 Frederic Fusier CLA 2008-02-04 12:17:51 EST

*** This bug has been marked as a duplicate of bug 158526 ***
Comment 6 Maxime Daniel CLA 2008-04-29 04:19:37 EDT
Verified for 3.4 M7 by code inspection of v_856.