Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354180 - Potential NPE in LMLResourceManagerMonitor#doShutdown()
Summary: Potential NPE in LMLResourceManagerMonitor#doShutdown()
Status: RESOLVED FIXED
Alias: None
Product: PTP
Classification: Tools
Component: RM (show other bugs)
Version: 5.0.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 5.0.2   Edit
Assignee: Claudia Knobloch CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-08 16:05 EDT by Greg Watson CLA
Modified: 2011-09-14 09:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.