Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367977 - ServerEditorSection's doSave() does not handle a null monitor
Summary: ServerEditorSection's doSave() does not handle a null monitor
Status: RESOLVED FIXED
Alias: None
Product: WTP ServerTools
Classification: WebTools
Component: wst.server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Steven Hung CLA
QA Contact: Elson Yuen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-05 14:39 EST by Steven Hung CLA
Modified: 2017-10-11 16:37 EDT (History)
0 users

See Also:


Attachments
v.1.0 (1.36 KB, patch)
2012-01-05 14:47 EST, Steven Hung CLA
no flags Details | Diff
Patch v1.1 (953 bytes, patch)
2012-01-10 10:37 EST, Steven Hung CLA
eyuen7: iplog+
Details | Diff

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