Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 360532

Summary: NPE getting module children when not retrieved by deferred
Product: [Eclipse Project] Platform Reporter: Malgorzata Janczarska <malgorzata.tomczyk>
Component: CVSAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tomasz.zarna
Version: 3.7Flags: tomasz.zarna: review+
Target Milestone: 3.8 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 339990, 363155, 363156, 363157, 363158    
Attachments:
Description Flags
Added monitorFor none

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.