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
if (setting == null) {
			throw new NumberFormatException(
                    "There is no setting associated with the key \"" + key + "\"");
		}
        return new Float(setting).floatValue();
    }
    /* (non-Javadoc)
     * Method declared on IDialogSettings.
     */
    public int getInt(String key) throws NumberFormatException {
        String setting = (String) items.get(key);
        if (setting == null) {
            
            
            throw new NumberFormatException(
                    "There is no setting associated with the key \"" + key + "\"");
        }
        return new Integer(setting).intValue();
    }
    /* (non-Javadoc)
     * Method declared on IDialogSettings.
     */
    public long getLong(String key) throws NumberFormatException {
        String setting = (String) items.get(key);
        if (setting == null) {
            
            
            throw new NumberFormatException(
                    "There is no setting associated with the key \"" + key + "\"");
        }