mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 11:06:25 +00:00
Now that we use Java 6, can finally deprecate IOException2.
This commit is contained in:
1 parent
dbf1ea0717
commit
15ac490af1
37 files changed
+92
-144
No files matched your search
@@ -32,7 +32,6 @@ import com.thoughtworks.xstream.io.xml.XppDriver;
|
||||
import hudson.diagnosis.OldDataMonitor;
|
||||
import hudson.model.Descriptor;
|
||||
import hudson.util.AtomicFileWriter;
|
||||
import hudson.util.IOException2;
|
||||
import hudson.util.XStream2;
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.InputSource;
|
||||
@@ -142,11 +141,11 @@ public final class XmlFile {
|
||||
try {
|
||||
return xs.fromXML(in);
|
||||
} catch(StreamException e) {
|
||||
throw new IOException2("Unable to read "+file,e);
|
||||
throw new IOException("Unable to read "+file,e);
|
||||
} catch(ConversionException e) {
|
||||
throw new IOException2("Unable to read "+file,e);
|
||||
throw new IOException("Unable to read "+file,e);
|
||||
} catch(Error e) {// mostly reflection errors
|
||||
throw new IOException2("Unable to read "+file,e);
|
||||
throw new IOException("Unable to read "+file,e);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
@@ -165,11 +164,11 @@ public final class XmlFile {
|
||||
// TODO: expose XStream the driver from XStream
|
||||
return xs.unmarshal(DEFAULT_DRIVER.createReader(in), o);
|
||||
} catch (StreamException e) {
|
||||
throw new IOException2("Unable to read "+file,e);
|
||||
throw new IOException("Unable to read "+file,e);
|
||||
} catch(ConversionException e) {
|
||||
throw new IOException2("Unable to read "+file,e);
|
||||
throw new IOException("Unable to read "+file,e);
|
||||
} catch(Error e) {// mostly reflection errors
|
||||
throw new IOException2("Unable to read "+file,e);
|
||||
throw new IOException("Unable to read "+file,e);
|
||||
} finally {
|
||||
in.close();
|
||||
}
|
||||
@@ -183,7 +182,7 @@ public final class XmlFile {
|
||||
xs.toXML(o,w);
|
||||
w.commit();
|
||||
} catch(StreamException e) {
|
||||
throw new IOException2(e);
|
||||
throw new IOException(e);
|
||||
} finally {
|
||||
w.abort();
|
||||
}
|
||||
@@ -294,7 +293,7 @@ public final class XmlFile {
|
||||
// in such a case, assume UTF-8 rather than fail, since Jenkins internally always write XML in UTF-8
|
||||
return "UTF-8";
|
||||
} catch (SAXException e) {
|
||||
throw new IOException2("Failed to detect encoding of "+file,e);
|
||||
throw new IOException("Failed to detect encoding of "+file,e);
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new AssertionError(e); // impossible
|
||||
} finally {
|
||||
|
||||
Reference in new issue
Block a user