Bug 284265 [JFace] DialogSettings.save() silently ignores IOException
Build ID: M20090211-1700 (Problem still in HEAD) STEPS TO REPRODUCE Call DialogSettings.save() on a Writer that produced a IOException or with a file which causes trouble during output (e.g. full drive). EXPECTED The original exception thrown by the underlying output should be propagated to the caller -- as "save() throws IOException" suggests. ACTUAL The IOException is silently ignored. ANALYSIS The internal DialogSettings.XMLWriter is based in a java.io.PrintWriter, which catches all IOExceptions.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/DialogSettings.java
* Method declared on IDialogSettings.
     */
    public void save(String fileName) throws IOException {
        FileOutputStream stream = new FileOutputStream(fileName);
        XMLWriter writer = new XMLWriter(stream);
        save(writer);
        writer.close();
    }
    /* (non-Javadoc)
     * Save the settings in the <code>document</code>.
     */
    private void save(XMLWriter out) {
    	HashMap attributes = new HashMap(2);
    	attributes.put(TAG_NAME, name == null ? "" : name); 
        out.startTag(TAG_SECTION, attributes);
        attributes.clear();
        for (Iterator i = items.keySet().iterator(); i.hasNext();) {
            String key = (String) i.next();
            attributes.put(TAG_KEY, key == null ? "" : key); 
            String string = (String) items.get(key);
            attributes.put(TAG_VALUE, string == null ? "" : string); 
            out.printTag(TAG_ITEM, attributes, true);
        }
        attributes.clear();
        for (Iterator i = arrayItems.keySet().iterator(); i.hasNext();) {
            String key = (String) i.next();
            attributes.put(TAG_KEY, key == null ? "" : key); 
            out.startTag(TAG_LIST, attributes);
            String[] value = (String[]) arrayItems.get(key);
            attributes.clear();