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

Bug 354180

Summary: Potential NPE in LMLResourceManagerMonitor#doShutdown()
Product: [Tools] PTP Reporter: Greg Watson <g.watson>
Component: RMAssignee: Claudia Knobloch <cla.knobloch>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 5.0.1   
Target Milestone: 5.0.2   
Hardware: All   
OS: All   
Whiteboard:

Description Greg Watson CLA 2011-08-08 16:05:16 EDT
Line 308 references the memento variable, but this variable could be null since it is outside the check for null at line 283.

Also, line 290 creates a memento that is never used. If this is not an error, then the redundant code should be removed.
Comment 1 Claudia Knobloch CLA 2011-08-09 13:56:09 EDT
(In reply to comment #0)
> Line 308 references the memento variable, but this variable could be null since
> it is outside the check for null at line 283.

We can move the code from line 306 to line 311 into the if-statement that checks for null. 

> 
> Also, line 290 creates a memento that is never used. If this is not an error,
> then the redundant code should be removed.

I was not quite sure if the method call putString(LAYOUT, layout) would be enough, or if I should create a new child. To be sure I toke the second one. Should I change to the first option?
Comment 2 Greg Watson CLA 2011-08-10 08:10:27 EDT
(In reply to comment #1)
> > Also, line 290 creates a memento that is never used. If this is not an error,
> > then the redundant code should be removed.
> 
> I was not quite sure if the method call putString(LAYOUT, layout) would be
> enough, or if I should create a new child. To be sure I toke the second one.
> Should I change to the first option?

I'd suggest creating the new child, then adding the layout to it.
Comment 3 Greg Watson CLA 2011-09-14 09:36:06 EDT
Fixed in ptp_5_0 and HEAD.