Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360532 - NPE getting module children when not retrieved by deferred
Summary: NPE getting module children when not retrieved by deferred
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.8 M3   Edit
Assignee: Malgorzata Janczarska CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 339990 363155 363156 363157 363158
  Show dependency tree
 
Reported: 2011-10-11 07:15 EDT by Malgorzata Janczarska CLA
Modified: 2011-11-08 06:32 EST (History)
1 user (show)

See Also:
tomasz.zarna: review+


Attachments
Added monitorFor (1.25 KB, patch)
2011-10-11 09:15 EDT, Malgorzata Janczarska CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Malgorzata Janczarska CLA 2011-10-11 07:15:29 EDT
In Repositories View getting RemoteModule children is usually made by DeferredTreeContentManager, but this is not mandatory. When it's made without it CVSModelElement calls fetchChildren(o, null) where null is for Monitor.
But repository works on Monitor without checking if it's not null and NPE is thrown:

java.lang.NullPointerException
	at org.eclipse.team.internal.ccvs.ui.repo.RepositoryRoot.refreshDefinedTags(RepositoryRoot.java:337)
	at org.eclipse.team.internal.ccvs.ui.repo.RepositoryManager.refreshDefinedTags(RepositoryManager.java:249)
	at org.eclipse.team.internal.ccvs.ui.model.RemoteModule.fetchChildren(RemoteModule.java:118)
	at org.eclipse.team.internal.ccvs.ui.model.CVSModelElement.getChildren(CVSModelElement.java:67)
	at org.eclipse.ui.model.BaseWorkbenchContentProvider.getChildren(BaseWorkbenchContentProvider.java:64)
	at org.eclipse.team.internal.ccvs.ui.model.RemoteContentProvider.getChildren(RemoteContentProvider.java:116)
	at org.eclipse.team.tests.ccvs.ui.RepositoriesViewTests.testTagSubmoduleChildren(RepositoriesViewTests.java:150)
	... 53 more
Comment 1 Tomasz Zarna CLA 2011-10-11 08:12:47 EDT
Good catch! Missing "monitor = Policy.monitorFor(monitor);" before starting a new task?
Comment 2 Malgorzata Janczarska CLA 2011-10-11 09:15:43 EDT
Created attachment 204947 [details]
Added monitorFor
Comment 3 Tomasz Zarna CLA 2011-10-11 09:29:45 EDT
Fixed with 8cd9ea442066a2977f5f50ea27d8c74ceef024d2.