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

Bug 367977

Summary: ServerEditorSection's doSave() does not handle a null monitor
Product: [WebTools] WTP ServerTools Reporter: Steven Hung <sghung>
Component: wst.serverAssignee: Steven Hung <sghung>
Status: RESOLVED FIXED QA Contact: Elson Yuen <eyuen7>
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 3.3.2   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/109089
Whiteboard:
Attachments:
Description Flags
v.1.0
none
Patch v1.1 eyuen7: iplog+

Description Steven Hung CLA 2012-01-05 14:39:19 EST
Build Identifier: I-3.4.0-20120105140022 and M-3.3.2-20120105131136

In Bug 367460, the doSave() in the ServerEditorSection went from doing nothing, to doing operations with the progress monitor, which is passed into the method.

A null check should be made before doing any operations on the progress monitor, as it could be null (in the case of the junit, it passes in null).

As a result of this fix, the junits for 3.4 and 3.3.2 are failing in the org.eclipse.wst.server.ui.tests.editor.ServerEditorPartTestCase, since null is passed in as the progress monitor.





Reproducible: Always
Comment 1 Steven Hung CLA 2012-01-05 14:47:47 EST
Created attachment 209098 [details]
v.1.0

Attached a patch for ensuring a null check is done in the doSave method
Comment 2 Steven Hung CLA 2012-01-10 10:37:29 EST
Created attachment 209267 [details]
Patch v1.1

Removed testing system out message from previous patch

In the R3_2_maintenance stream, this issue does not occur. Only in R3_3_maintenance and above.

I ran org.eclipse.wst.server.ui.tests.editor.ServerEditorPartTestCase pre-patch and got the NPE. After applying the patch, when running the test case, the NPE will not occur since it is caught in the doSave
Comment 3 Elson Yuen CLA 2012-01-10 11:56:06 EST
The new patch looks good.  Thanks for submitting the patch.

Code dropped to 32M and HEAD.
Comment 4 Eclipse Genie CLA 2017-10-11 16:37:47 EDT
New Gerrit change created: https://git.eclipse.org/r/109089