diff --git a/core/src/main/java/hudson/ClassicPluginStrategy.java b/core/src/main/java/hudson/ClassicPluginStrategy.java index 481fa468712fc9e6fbe919c87727145a76750118..2c5f92de396b73255b4bae4ac9afea1d4f78bd36 100644 --- a/core/src/main/java/hudson/ClassicPluginStrategy.java +++ b/core/src/main/java/hudson/ClassicPluginStrategy.java @@ -29,7 +29,6 @@ import hudson.PluginWrapper.Dependency; import hudson.model.Hudson; import hudson.util.CyclicGraphDetector; import hudson.util.CyclicGraphDetector.CycleDetectedException; -import hudson.util.IOException2; import hudson.util.IOUtils; import hudson.util.MaskingClassLoader; import hudson.util.VersionNumber; @@ -117,7 +116,7 @@ public class ClassicPluginStrategy implements PluginStrategy { try { manifest = new Manifest(in); } catch (IOException e) { - throw new IOException2("Failed to load " + archive, e); + throw new IOException("Failed to load " + archive, e); } finally { in.close(); } @@ -350,13 +349,13 @@ public class ClassicPluginStrategy implements PluginStrategy { } wrapper.setPlugin((Plugin) o); } catch (LinkageError e) { - throw new IOException2("Unable to load " + className + " from " + wrapper.getShortName(),e); + throw new IOException("Unable to load " + className + " from " + wrapper.getShortName(),e); } catch (ClassNotFoundException e) { - throw new IOException2("Unable to load " + className + " from " + wrapper.getShortName(),e); + throw new IOException("Unable to load " + className + " from " + wrapper.getShortName(),e); } catch (IllegalAccessException e) { - throw new IOException2("Unable to create instance of " + className + " from " + wrapper.getShortName(),e); + throw new IOException("Unable to create instance of " + className + " from " + wrapper.getShortName(),e); } catch (InstantiationException e) { - throw new IOException2("Unable to create instance of " + className + " from " + wrapper.getShortName(),e); + throw new IOException("Unable to create instance of " + className + " from " + wrapper.getShortName(),e); } } @@ -367,7 +366,7 @@ public class ClassicPluginStrategy implements PluginStrategy { startPlugin(wrapper); } catch(Throwable t) { // gracefully handle any error in plugin. - throw new IOException2("Failed to initialize",t); + throw new IOException("Failed to initialize",t); } } finally { Thread.currentThread().setContextClassLoader(old); @@ -427,7 +426,7 @@ public class ClassicPluginStrategy implements PluginStrategy { unzipExceptClasses(archive, destDir, prj); createClassJarFromWebInfClasses(archive, destDir, prj); } catch (BuildException x) { - throw new IOException2("Failed to expand " + archive,x); + throw new IOException("Failed to expand " + archive,x); } try { diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index b2564edc70afb7de07ef5e418dd62ce1ee16e256..df548f5583364df32be1242190c16b8cef9e5bf7 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -43,7 +43,6 @@ import hudson.remoting.RemoteInputStream; import hudson.remoting.Which; import hudson.security.AccessControlled; import hudson.util.DirScanner; -import hudson.util.IOException2; import hudson.util.HeadBufferingStream; import hudson.util.FormValidation; import hudson.util.IOUtils; @@ -95,14 +94,12 @@ import java.util.concurrent.TimeoutException; import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; -import com.sun.jna.Native; import hudson.os.PosixException; import hudson.util.FileVisitor; import java.util.Enumeration; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.logging.Logger; -import org.apache.tools.ant.taskdefs.Chmod; import org.apache.tools.zip.ZipFile; import org.apache.tools.zip.ZipEntry; @@ -636,7 +633,7 @@ public final class FilePath implements Serializable { } catch (IOException e) { // various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better in.fillSide(); - throw new IOException2(e.getMessage()+"\nstream="+Util.toHexString(in.getSideBuffer()),e); + throw new IOException(e.getMessage()+"\nstream="+Util.toHexString(in.getSideBuffer()),e); } } public OutputStream compress(OutputStream out) throws IOException { @@ -760,13 +757,13 @@ public final class FilePath implements Serializable { else untarFrom(cis,GZIP); } catch (IOException e) { - throw new IOException2(String.format("Failed to unpack %s (%d bytes read of total %d)", + throw new IOException(String.format("Failed to unpack %s (%d bytes read of total %d)", archive,cis.getByteCount(),con.getContentLength()),e); } timestamp.touch(sourceTimestamp); return true; } catch (IOException e) { - throw new IOException2("Failed to install "+archive+" to "+remote,e); + throw new IOException("Failed to install "+archive+" to "+remote,e); } } @@ -786,7 +783,7 @@ public final class FilePath implements Serializable { readFromTar("input stream", dir, GZIP.extract(cis)); } } catch (IOException x) { - throw new IOException2(String.format("Failed to unpack %s (%d bytes read)", archive, cis.getByteCount()), x); + throw new IOException(String.format("Failed to unpack %s (%d bytes read)", archive, cis.getByteCount()), x); } } finally { in.close(); @@ -843,7 +840,7 @@ public final class FilePath implements Serializable { } catch (IOException e) { throw e; } catch (Exception e) { - throw new IOException2(e); + throw new IOException(e); } } else { InputStream i = file.getInputStream(); @@ -910,7 +907,7 @@ public final class FilePath implements Serializable { throw e; // pass through so that the caller can catch it as AbortException } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. - throw new IOException2("remote file operation failed: "+remote+" at "+channel,e); + throw new IOException("remote file operation failed: "+remote+" at "+channel,e); } } else { // the file is on the local machine. @@ -992,7 +989,7 @@ public final class FilePath implements Serializable { .callAsync(wrapper); } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. - throw new IOException2("remote file operation failed",e); + throw new IOException("remote file operation failed",e); } } @@ -1191,7 +1188,7 @@ public final class FilePath implements Serializable { } })); } catch (IOException e) { - throw new IOException2("Failed to create a temp file on "+remote,e); + throw new IOException("Failed to create a temp file on "+remote,e); } } @@ -1251,7 +1248,7 @@ public final class FilePath implements Serializable { try { f = File.createTempFile(prefix, suffix, dir); } catch (IOException e) { - throw new IOException2("Failed to create a temporary directory in "+dir,e); + throw new IOException("Failed to create a temporary directory in "+dir,e); } Writer w = new FileWriter(f); @@ -1265,7 +1262,7 @@ public final class FilePath implements Serializable { } })); } catch (IOException e) { - throw new IOException2("Failed to create a temp file on "+remote,e); + throw new IOException("Failed to create a temp file on "+remote,e); } } @@ -1295,7 +1292,7 @@ public final class FilePath implements Serializable { } })); } catch (IOException e) { - throw new IOException2("Failed to create a temp directory on "+remote,e); + throw new IOException("Failed to create a temp directory on "+remote,e); } } @@ -1749,7 +1746,7 @@ public final class FilePath implements Serializable { out.close(); } } catch (IOException e) { - throw new IOException2("Failed to copy "+this+" to "+target,e); + throw new IOException("Failed to copy "+this+" to "+target,e); } } @@ -1944,7 +1941,7 @@ public final class FilePath implements Serializable { future.get(); return future2.get(); } catch (ExecutionException e) { - throw new IOException2(e); + throw new IOException(e); } } else { // remote -> local copy @@ -1968,7 +1965,7 @@ public final class FilePath implements Serializable { throw e; // the remote side completed successfully, so the error must be local } catch (ExecutionException x) { // report both errors - throw new IOException2(Functions.printThrowable(e),x); + throw new IOException(Functions.printThrowable(e),x); } catch (TimeoutException _) { // remote is hanging throw e; @@ -1977,7 +1974,7 @@ public final class FilePath implements Serializable { try { return future.get(); } catch (ExecutionException e) { - throw new IOException2(e); + throw new IOException(e); } } } @@ -2049,12 +2046,12 @@ public final class FilePath implements Serializable { } } } catch(IOException e) { - throw new IOException2("Failed to extract "+name,e); + throw new IOException("Failed to extract "+name,e); } catch (InterruptedException e) { Thread.currentThread().interrupt(); // process this later - throw new IOException2("Failed to extract "+name,e); + throw new IOException("Failed to extract "+name,e); } catch (IllegalAccessException e) { - throw new IOException2("Failed to extract "+name,e); + throw new IOException("Failed to extract "+name,e); } finally { t.close(); } @@ -2438,7 +2435,7 @@ public final class FilePath implements Serializable { /** * Used to tunnel {@link InterruptedException} over a Java signature that only allows {@link IOException} */ - private static class TunneledInterruptedException extends IOException2 { + private static class TunneledInterruptedException extends IOException { private TunneledInterruptedException(InterruptedException cause) { super(cause); } diff --git a/core/src/main/java/hudson/PluginManager.java b/core/src/main/java/hudson/PluginManager.java index 7ce9dea6d3456fbbab2306b7ad951265ae0215c8..dc657a9a0b6e22e2fdf74b4419db4dd96f7516b9 100644 --- a/core/src/main/java/hudson/PluginManager.java +++ b/core/src/main/java/hudson/PluginManager.java @@ -40,7 +40,6 @@ import hudson.security.Permission; import hudson.security.PermissionScope; import hudson.util.CyclicGraphDetector; import hudson.util.CyclicGraphDetector.CycleDetectedException; -import hudson.util.IOException2; import hudson.util.PersistedList; import hudson.util.Service; import hudson.util.VersionNumber; @@ -435,7 +434,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas failedPlugins.add(new FailedPlugin(sn, e)); activePlugins.remove(p); plugins.remove(p); - throw new IOException2("Failed to install "+ sn +" plugin",e); + throw new IOException("Failed to install "+ sn +" plugin",e); } // run initializers in the added plugin @@ -449,7 +448,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas try { new InitReactorRunner().run(r); } catch (ReactorException e) { - throw new IOException2("Failed to initialize "+ sn +" plugin",e); + throw new IOException("Failed to initialize "+ sn +" plugin",e); } LOGGER.info("Plugin " + sn + " dynamically installed"); } @@ -925,7 +924,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas } }); } catch (SAXException x) { - throw new IOException2("Failed to parse XML",x); + throw new IOException("Failed to parse XML",x); } catch (ParserConfigurationException e) { throw new AssertionError(e); // impossible since we don't tweak XMLParser } diff --git a/core/src/main/java/hudson/Proc.java b/core/src/main/java/hudson/Proc.java index ca1f4a6767d26fedc768acb33f866f0bf0ece38b..b80d8144589a5fabdef87810f65a91f64160789f 100644 --- a/core/src/main/java/hudson/Proc.java +++ b/core/src/main/java/hudson/Proc.java @@ -28,7 +28,6 @@ import hudson.model.TaskListener; import hudson.remoting.Channel; import hudson.util.DaemonThreadFactory; import hudson.util.ExceptionCatchingThreadFactory; -import hudson.util.IOException2; import hudson.util.NullStream; import hudson.util.StreamCopyThread; import hudson.util.ProcessTree; @@ -454,7 +453,7 @@ public abstract class Proc { } catch (ExecutionException e) { if(e.getCause() instanceof IOException) throw (IOException)e.getCause(); - throw new IOException2("Failed to join the process",e); + throw new IOException("Failed to join the process",e); } catch (CancellationException x) { return -1; } diff --git a/core/src/main/java/hudson/Util.java b/core/src/main/java/hudson/Util.java index ad91672dc65a267e5a04bc0d3f4aee52d0642d90..893cd6cb233a10a417d5c7511c64eb2fcd564f07 100644 --- a/core/src/main/java/hudson/Util.java +++ b/core/src/main/java/hudson/Util.java @@ -30,7 +30,6 @@ import edu.umd.cs.findbugs.annotations.SuppressWarnings; import hudson.Proc.LocalProc; import hudson.model.TaskListener; import hudson.os.PosixAPI; -import hudson.util.IOException2; import hudson.util.QuotedStringTokenizer; import hudson.util.VariableResolver; import hudson.util.jna.WinIOException; @@ -569,7 +568,7 @@ public class Util { } return toHexString(md5.digest()); } catch (NoSuchAlgorithmException e) { - throw new IOException2("MD5 not installed",e); // impossible + throw new IOException("MD5 not installed",e); // impossible } /* JENKINS-18178: confuses Maven 2 runner try { diff --git a/core/src/main/java/hudson/XmlFile.java b/core/src/main/java/hudson/XmlFile.java index 18a95412dbaca0aa3be66147a13eb805aca495b6..148578c469f7a30d16339d97ce615fad8d4fcb95 100644 --- a/core/src/main/java/hudson/XmlFile.java +++ b/core/src/main/java/hudson/XmlFile.java @@ -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 { diff --git a/core/src/main/java/hudson/cli/CLIAction.java b/core/src/main/java/hudson/cli/CLIAction.java index dd5327f0cf8b664f97aa3f327393a9fa79870fed..3253fc2840074f4674e69d3f45456716f0692fcd 100644 --- a/core/src/main/java/hudson/cli/CLIAction.java +++ b/core/src/main/java/hudson/cli/CLIAction.java @@ -31,7 +31,6 @@ import java.util.UUID; import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; -import hudson.util.IOException2; import hudson.model.UnprotectedRootAction; import jenkins.model.Jenkins; @@ -130,7 +129,7 @@ public class CLIAction implements UnprotectedRootAction, StaplerProxy { duplexChannels.get(uuid).upload(req,rsp); } } catch (InterruptedException e) { - throw new IOException2(e); + throw new IOException(e); } } } diff --git a/core/src/main/java/hudson/cli/CliProtocol2.java b/core/src/main/java/hudson/cli/CliProtocol2.java index f1cea1add398c40724aa2ad3df51ec425bd752e1..bd3af1ee64977265cd5a6ab52dc725772daf283c 100644 --- a/core/src/main/java/hudson/cli/CliProtocol2.java +++ b/core/src/main/java/hudson/cli/CliProtocol2.java @@ -1,7 +1,6 @@ package hudson.cli; import hudson.Extension; -import hudson.util.IOException2; import jenkins.model.Jenkins; import javax.crypto.SecretKey; @@ -72,7 +71,7 @@ public class CliProtocol2 extends CliProtocol { runCli(c); } catch (GeneralSecurityException e) { - throw new IOException2("Failed to encrypt the CLI channel",e); + throw new IOException("Failed to encrypt the CLI channel",e); } } } diff --git a/core/src/main/java/hudson/cli/InstallPluginCommand.java b/core/src/main/java/hudson/cli/InstallPluginCommand.java index 38c04b3996da3715f7fefc7314a537f28e3d8e7e..1fd23d81acba7de5c3a4050e4925c96b797934b9 100644 --- a/core/src/main/java/hudson/cli/InstallPluginCommand.java +++ b/core/src/main/java/hudson/cli/InstallPluginCommand.java @@ -26,7 +26,6 @@ package hudson.cli; import hudson.Extension; import hudson.FilePath; import hudson.PluginManager; -import hudson.util.IOException2; import jenkins.model.Jenkins; import hudson.model.UpdateSite; import hudson.model.UpdateSite.Data; @@ -35,6 +34,7 @@ import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Option; import java.io.File; +import java.io.IOException; import java.net.URL; import java.net.MalformedURLException; import java.util.HashSet; @@ -114,7 +114,7 @@ public class InstallPluginCommand extends CLICommand { stdout.println(Messages.InstallPluginCommand_InstallingFromUpdateCenter(source)); Throwable e = p.deploy(dynamicLoad).get().getError(); if (e!=null) - throw new IOException2("Failed to install plugin "+source,e); + throw new IOException("Failed to install plugin "+source,e); continue; } diff --git a/core/src/main/java/hudson/console/AnnotatedLargeText.java b/core/src/main/java/hudson/console/AnnotatedLargeText.java index 298e034bf15ebf31a8f728b5c6bb9e7a6a82946b..4a3af765bdd04dd2831a451db7ccb5cd4d45c631 100644 --- a/core/src/main/java/hudson/console/AnnotatedLargeText.java +++ b/core/src/main/java/hudson/console/AnnotatedLargeText.java @@ -28,8 +28,6 @@ package hudson.console; import com.trilead.ssh2.crypto.Base64; import jenkins.model.Jenkins; import hudson.remoting.ObjectInputStreamEx; -import hudson.util.IOException2; -import hudson.util.Secret; import hudson.util.TimeUnit2; import jenkins.security.CryptoConfidentialKey; import org.apache.commons.io.output.ByteArrayOutputStream; @@ -50,7 +48,6 @@ import java.io.ObjectOutputStream; import java.io.OutputStream; import java.io.Writer; import java.nio.charset.Charset; -import java.security.GeneralSecurityException; import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; @@ -134,7 +131,7 @@ public class AnnotatedLargeText extends LargeText { } } } catch (ClassNotFoundException e) { - throw new IOException2(e); + throw new IOException(e); } // start from scratch return ConsoleAnnotator.initial(context==null ? null : context.getClass()); diff --git a/core/src/main/java/hudson/console/ConsoleNote.java b/core/src/main/java/hudson/console/ConsoleNote.java index c8ea004643309d73af2d5638bab3bf3f225d50d2..e4402c13308e848575d09169f1ef3fa50b1be3de 100644 --- a/core/src/main/java/hudson/console/ConsoleNote.java +++ b/core/src/main/java/hudson/console/ConsoleNote.java @@ -30,7 +30,6 @@ import hudson.model.Describable; import jenkins.model.Jenkins; import hudson.model.Run; import hudson.remoting.ObjectInputStreamEx; -import hudson.util.IOException2; import hudson.util.IOUtils; import hudson.util.UnbufferedBase64InputStream; import org.apache.commons.codec.binary.Base64OutputStream; @@ -228,7 +227,7 @@ public abstract class ConsoleNote implements Serializable, Describable,R extends Abs try { l.onChangeLogParsed(build,listener,build.getChangeSet()); } catch (Exception e) { - throw new IOException2("Failed to parse changelog",e); + throw new IOException("Failed to parse changelog",e); } // Get a chance to do something after checkout and changelog is done diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index 8a19a1d169c89d448a033bcfc7471591bffdc8cf..fd3b2693aafe90e31bbc151981405e6e743d2d5e 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -40,7 +40,6 @@ import hudson.security.ACL; import hudson.util.AlternativeUiTextProvider; import hudson.util.AlternativeUiTextProvider.Message; import hudson.util.AtomicFileWriter; -import hudson.util.IOException2; import hudson.util.IOUtils; import jenkins.model.Jenkins; import org.apache.tools.ant.taskdefs.Copy; @@ -586,7 +585,7 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet new StreamResult(out)); out.close(); } catch (TransformerException e) { - throw new IOException2("Failed to persist configuration.xml", e); + throw new IOException("Failed to persist configuration.xml", e); } // try to reflect the changes by reloading diff --git a/core/src/main/java/hudson/model/Api.java b/core/src/main/java/hudson/model/Api.java index 652fcf9e856121c986ac74767c80b917bf1e6c0b..71b617e46f8c85951bc1dae2ca642737dda2e660 100644 --- a/core/src/main/java/hudson/model/Api.java +++ b/core/src/main/java/hudson/model/Api.java @@ -23,7 +23,6 @@ */ package hudson.model; -import hudson.util.IOException2; import jenkins.model.Jenkins; import jenkins.security.SecureRequester; @@ -152,7 +151,7 @@ public class Api extends AbstractModelObject { } catch (DocumentException e) { LOGGER.log(Level.FINER, "Failed to do XPath/wrapper handling. XML is as follows:"+sw, e); - throw new IOException2("Failed to do XPath/wrapper handling. Turn on FINER logging to view XML.",e); + throw new IOException("Failed to do XPath/wrapper handling. Turn on FINER logging to view XML.",e); } OutputStream o = rsp.getCompressedOutputStream(req); diff --git a/core/src/main/java/hudson/model/DirectoryBrowserSupport.java b/core/src/main/java/hudson/model/DirectoryBrowserSupport.java index 7fd4dfd6613bdf418873625f059ae43f725aa611..5fd72727db61eb78a21e2ce1d1ac7ce33eef0729 100644 --- a/core/src/main/java/hudson/model/DirectoryBrowserSupport.java +++ b/core/src/main/java/hudson/model/DirectoryBrowserSupport.java @@ -25,7 +25,6 @@ package hudson.model; import hudson.FilePath; import hudson.Util; -import hudson.util.IOException2; import jenkins.model.Jenkins; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; @@ -122,7 +121,7 @@ public final class DirectoryBrowserSupport implements HttpResponse { try { serveFile(req,rsp,base,icon,serveDirIndex); } catch (InterruptedException e) { - throw new IOException2("interrupted",e); + throw new IOException("interrupted",e); } } diff --git a/core/src/main/java/hudson/model/DownloadService.java b/core/src/main/java/hudson/model/DownloadService.java index 4ca6c5b616b43a4e9e33e57e7eae96b3fafcae43..273dd56e8399a7ffd7e10dee1e007283f562e92a 100644 --- a/core/src/main/java/hudson/model/DownloadService.java +++ b/core/src/main/java/hudson/model/DownloadService.java @@ -28,7 +28,6 @@ import hudson.ExtensionList; import hudson.ExtensionPoint; import hudson.util.FormValidation; import hudson.util.FormValidation.Kind; -import hudson.util.IOException2; import hudson.util.IOUtils; import hudson.util.QuotedStringTokenizer; import hudson.util.TextFile; @@ -240,7 +239,7 @@ public class DownloadService extends PageDecorator { return JSONObject.fromObject(df.read()); } catch (JSONException e) { df.delete(); // if we keep this file, it will cause repeated failures - throw new IOException2("Failed to parse "+df+" into JSON",e); + throw new IOException("Failed to parse "+df+" into JSON",e); } return null; } diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index addc19fa9c0d2a7582f34112a0f15d441940d589..f32099bc707899add95259f5bd103bf5b87c2f61 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -34,7 +34,6 @@ import hudson.BulkChange; import hudson.EnvVars; import hudson.ExtensionPoint; import hudson.FeedAdapter; -import hudson.FilePath; import hudson.Util; import hudson.XmlFile; import hudson.cli.declarative.CLIMethod; @@ -55,7 +54,6 @@ import hudson.tasks.BuildWrapper; import hudson.tasks.test.AbstractTestResultAction; import hudson.util.FlushProofOutputStream; import hudson.util.FormApply; -import hudson.util.IOException2; import hudson.util.LogTaskListener; import hudson.util.XStream2; @@ -392,7 +390,7 @@ public abstract class Run ,RunT extends Run new java.io.IOException($t);; +new hudson.util.IOException2($s, $t) :: $s instanceof String && $t instanceof Throwable => new java.io.IOException($s, $t);; diff --git a/core/src/test/java/hudson/FilePathTest.java b/core/src/test/java/hudson/FilePathTest.java index 762d0e7d96d67bf3e8de314aec4506bd1b25aece..6749d1fa614282a13ee5bbfb60709f7abd97107f 100644 --- a/core/src/test/java/hudson/FilePathTest.java +++ b/core/src/test/java/hudson/FilePathTest.java @@ -28,7 +28,6 @@ import hudson.FilePath.TarCompression; import hudson.model.TaskListener; import hudson.remoting.LocalChannel; import hudson.remoting.VirtualChannel; -import hudson.util.IOException2; import hudson.util.NullStream; import java.io.ByteArrayInputStream; @@ -142,9 +141,9 @@ public class FilePathTest extends ChannelTestCase { private Exception closed; private volatile int count; - private void checkNotClosed() throws IOException2 { + private void checkNotClosed() throws IOException { if (closed != null) - throw new IOException2(closed); + throw new IOException(closed); } @Override diff --git a/test/src/main/java/org/jvnet/hudson/test/TemporaryDirectoryAllocator.java b/test/src/main/java/org/jvnet/hudson/test/TemporaryDirectoryAllocator.java index d28442e9845de02547aed322044bb0c0a4bdcfc2..e21dc4526eece62a96311c499d85a0e635e4a084 100644 --- a/test/src/main/java/org/jvnet/hudson/test/TemporaryDirectoryAllocator.java +++ b/test/src/main/java/org/jvnet/hudson/test/TemporaryDirectoryAllocator.java @@ -24,7 +24,6 @@ package org.jvnet.hudson.test; import hudson.FilePath; -import hudson.util.IOException2; import java.io.File; import java.io.IOException; @@ -68,7 +67,7 @@ public class TemporaryDirectoryAllocator { tmpDirectories.add(f); return f; } catch (IOException e) { - throw new IOException2("Failed to create a temporary directory in "+base,e); + throw new IOException("Failed to create a temporary directory in "+base,e); } } @@ -84,7 +83,7 @@ public class TemporaryDirectoryAllocator { x = e; } tmpDirectories.clear(); - if (x!=null) throw new IOException2("Failed to clean up temp dirs",x); + if (x!=null) throw new IOException("Failed to clean up temp dirs",x); } /**