Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353815 - NPE in P2TargetUtils.getAgent()
Summary: NPE in P2TargetUtils.getAgent()
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 354066 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-03 15:10 EDT by Ed Willink CLA
Modified: 2011-08-25 17:22 EDT (History)
4 users (show)

See Also:
ankur_sharma: review+
daniel_megert: review+


Attachments
Fix (1.28 KB, patch)
2011-08-12 15:40 EDT, Curtis Windatt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2011-08-03 15:10:49 EDT
When shutting down Eclipse 3.7, I'm getting

Thread [ModalContext] (Suspended (exception NullPointerException))	
	P2TargetUtils.getAgent() line: 300	
	P2TargetUtils.getProfileRegistry() line: 775	
	P2TargetUtils.cleanOrphanedTargetDefinitionProfiles() line: 159	
	PDECore$1.saving(ISaveContext) line: 258	
	SaveManager.executeLifecycle(int, ISaveParticipant, SaveContext) line: 382	
	SaveManager$1.run() line: 191	
	SafeRunner.run(ISafeRunnable) line: 42	
	SaveManager.broadcastLifecycle(int, Map<String,SaveContext>, MultiStatus, IProgressMonitor) line: 194	
	SaveManager.save(int, boolean, Project, IProgressMonitor) line: 1129	
	Workspace.save(boolean, boolean, IProgressMonitor) line: 2375	
	IDEWorkbenchAdvisor$5.run(IProgressMonitor) line: 508	
	ModalContext$ModalContextThread.run() line: 121	

Not quite sure what the cause is, but it may be aggravated by the unhelpful rebuild on shutdown save that now occurs.

The particular NPE seems lazy and to subvert the proper CoreException throw in the caller.
Comment 1 Ed Willink CLA 2011-08-04 01:28:27 EDT
Failures during shutdown save are reported via a Workspace Save failed popup so I think that this should be in SR1.
Comment 2 Curtis Windatt CLA 2011-08-08 09:55:38 EDT
*** Bug 354066 has been marked as a duplicate of this bug. ***
Comment 3 Curtis Windatt CLA 2011-08-12 15:40:27 EDT
Created attachment 201428 [details]
Fix
Comment 4 Curtis Windatt CLA 2011-08-12 15:42:00 EDT
Fixed in HEAD for 3.8 M2.
Comment 5 Curtis Windatt CLA 2011-08-12 15:44:03 EDT
Released to 3.7.1
Comment 6 Dani Megert CLA 2011-08-17 07:58:56 EDT
As per http://www.eclipse.org/eclipse/development/plans/freeze_plan_3_7_1.php this bug needs a review+ on the patch from another committer and a review+ from a component lead to be committed into 3.7.1.
Comment 7 Curtis Windatt CLA 2011-08-17 09:44:21 EDT
Dani and Ankur, please review.
Comment 8 Ankur Sharma CLA 2011-08-17 14:23:45 EDT
+1
Comment 9 Curtis Windatt CLA 2011-08-18 17:15:19 EDT
Fix is released for 3.7.1.  Ankur's review satisfies the SR1 freeze requirements.
Comment 10 Curtis Windatt CLA 2011-08-25 17:22:13 EDT
I wasn't able to reproduce the NPE. Confirmed that the fix is in M20110825-0847