Bug 4092 - Null Pointer Exception when delete 2 projects with the search view open (1GI7GCW)
Summary: Null Pointer Exception when delete 2 projects with the search view open (1GI7...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Erich Gamma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 23:05 EDT by Erich Gamma CLA
Modified: 2001-10-29 17:31 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erich Gamma CLA 2001-10-10 23:05:55 EDT
prefix        test
name          180651
reference     
abstract      NPE when delete 2 web examples with Search view open
duplicate     

state         open                        priority                          
severity      2                           target                            
age           17                          due                               
product                         hasApar                           

compName      wsa.web.oti                 answer                            
release                                   symptom       ra                  
envName       Win2000                     phaseFound    cvt                 
level                                     phaseInject                       

addDate       2001/07/23 12:28:06         assignDate    2001/07/24 10:32:52 
lastUpdate    2001/07/24 16:02:02         responseDate                      
endDate                                

ownerLogin    decandio                    originLogin   endres              
ownerName     George DeCandio             originName    Kathy Endres        
ownerArea     9ZVA                        originArea    AVALON              

apar                                      pmr                          
test                                                                                               

tracks: none.

verify: none.

history:
    addDate              action          userLogin (userName)
    -------------------- --------------- ----------------------------------
    2001/07/23 12:28:08  open            endres (Kathy Endres)
    2001/07/24 10:22:39  assign          decandio (George DeCandio)
    2001/07/24 10:29:28  assign          decandio (George DeCandio)
    2001/07/24 10:32:52  assign          decandio (George DeCandio)
    2001/07/24 16:02:02  note            endres (Kathy Endres)

duplicate defects: none.

duplicate features: none.

sizing: none.

notes:
    <Note by endres (Kathy Endres), 2001/07/23 12:28:06, seq: 1 rel: 0  action: open>
In doing some testing against the 20010722-0100 R09 Packaged JDK build,
I created all 3 web examples.
Then I searched on text/css in the html, htm, and jsp files.
With the Search view still open, I then tried to delete all 3 web examples.
I was able to successfully delete the Home Page example,
but I got an internal error message when I tried to delete
the other 2 web examples I had created.

The log file shows the internal error to be a NullPointer Exception.
Here's the stack trace:
Log: Sun Jul 22 21:38:11 EDT 2001
4 org.eclipse.ui 0 java.lang.NullPointerException
java.lang.NullPointerException
       at org.eclipse.search.internal.ui.SearchResultLabelProvider$FileLabelProvider.getText(SearchResultLabelProvider.java:32)
       at org.eclipse.search.internal.ui.SearchResultLabelProvider.getText(SearchResultLabelProvider.java:51)
       at org.eclipse.jface.viewers.TableViewer.doUpdateItem(TableViewer.java(Compiled Code))
       at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:879)
       at org.eclipse.search.internal.ui.SearchResultViewer.handleUpdateMatch(SearchResultViewer.java:274)
       at org.eclipse.search.internal.ui.SearchManager.handleRemoveMatch(SearchManager.java:189)
       at org.eclipse.search.internal.ui.SearchManager.access$1(SearchManager.java:176)
       at org.eclipse.search.internal.ui.SearchManager$1.visit(SearchManager.java:224)
       at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java(Compiled Code))
       at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java(Compiled Code))
       at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java(Compiled Code))
       at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java(Compiled Code))
       at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java(Compiled Code))
       at org.eclipse.core.internal.events.ResourceDelta.accept(ResourceDelta.java:42)
       at org.eclipse.search.internal.ui.SearchManager.handleResourceChanged(SearchManager.java:233)
       at org.eclipse.search.internal.ui.SearchManager$5.run(SearchManager.java:392)
       at org.eclipse.ui.internal.UIWorkspaceLock.doPendingWork(UIWorkspaceLock.java(Compiled Code))
       at org.eclipse.ui.internal.UISynchronizer$1.run(UISynchronizer.java:23)
       at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:26)
       at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java(Compiled Code))
       at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java(Compiled Code))
       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
       at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java(Compiled Code))
       at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:258)
       at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:335)
       at org.eclipse.ui.actions.DeleteResourceAction.run(DeleteResourceAction.java:235)
       at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:408)
       at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:362)
       at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:353)
       at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47)
       at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
       at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code))
       at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
       at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
       at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
       at org.eclipse.ui.internal.Workbench.run(Workbench.java:622)
       at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:815)
       at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.eclipse.core.launcher.Main.basicRun(Main.java:119)
       at org.eclipse.core.launcher.Main.run(Main.java:401)
       at org.eclipse.core.launcher.Main.main(Main.java:274)

    <Note by decandio (George DeCandio), 2001/07/24 10:22:39, seq: 2 rel: 0  action: assign>
Old Component: wsa.web.tooling
New Component: wsa.web.oti



    <Note by decandio (George DeCandio), 2001/07/24 10:29:28, seq: 3 rel: 0  action: assign>
Old Owner: decandio
New Owner: ccc



    <Note by decandio (George DeCandio), 2001/07/24 10:32:52, seq: 4 rel: 0  action: assign>
Old Owner: ccc
New Owner: decandio



    <Note by endres (Kathy Endres), 2001/07/24 16:02:02, seq: 5 rel: 0  action: note>
George,
did you say you were going to forward
this to OTI (that is, update the component
of this defect to wsa.web.oti)?



NOTES:
DM (9/18/01 11:12:12 AM)
	Could be reproduced. Happens when a project (any nature) is being deleted and one of its files
	has several text search matches in the search result view.
	The search results stay after the NPE. Some actions (like sorting) then also cause errors.

	Also check against Java once it's fixed for text
	-	Java project and text search: error 
	-	Java project and java search: no error

	Error was in SearchResultLabelProvider.FileLabelProvider: did not take into
	account that resource may be there but project might have gone. This resulted
	in an NPE when getting the last segment of the location. The error was not
	detected before, because removing the resource alone did not show the error
	(nonExistentResource.getLocation() returns a path if if the project is there but
	null if it is not).

	Fixed in 2.0 stream.
	Fix for 1.0 stream would be:
		Test was:
			if (resource == null)
		And should be:
			if (resource == null || !resource.exists())

EG (18.09.2001 15:49:04)
	walkback - fix is low risk. propose to fix for 1.0

DM (9/19/01 12:40:33 PM)
	Fixed in 1.0
	Reviewed by EG
Comment 1 Claude Knaus CLA 2001-10-12 07:00:46 EDT
moved to fixed
Comment 2 DJ Houghton CLA 2001-10-29 17:31:15 EST
PRODUCT VERSION:
	Win2000, R09