Project: Eclipse_Platform_UI
Bug 24198 [Global Actions] CloseResourceAction passes null IProgressMonitor to editor.doSave()
Reported: 2002-09-27 14:54:12 | Status: resolved fixed

The saveDirtyEditors() method of the org.eclipse.ui.actions.CloseResourceAction class is passing null to editor.doSave() instead of passing a NullProgressMonitor. Existing editors seem to cope fine with this but until we did the workaround in our own flow editor, it would put up an ugly NPE dialog when this code was run. NullProgressMonitor is an instance of the NullObject pattern, the purpose of which is to relieve object-manipulating code of the burden of checking for null. Since we have NullProgressMonitors, passing null as an IProgressMonitor should always be considered bogus unless null has a special meaning like "use the default". (If the UI team disagrees, then IEditorPart.doSave()'s comment should be changed to mention the fact that null is an acceptable value).

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/actions/CloseResourceAction.java