From 394f3d133a73058bb50979e207a402fae35c6485 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 10 Feb 2019 21:53:31 +0100 Subject: [PATCH] Make SmackException abstract --- .../main/java/org/jivesoftware/smack/SmackException.java | 6 +++--- .../smackx/filetransfer/IncomingFileTransfer.java | 4 ++-- .../smackx/filetransfer/Socks5TransferNegotiator.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java index 512445e30..cec724682 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java @@ -29,12 +29,12 @@ import org.jxmpp.jid.Jid; * * @author Florian Schmaus */ -public class SmackException extends Exception { +public abstract class SmackException extends Exception { /** * */ - private static final long serialVersionUID = 1844674365368214457L; + private static final long serialVersionUID = 1844674365368214458L; /** * Creates a new SmackException with the Throwable that was the root cause of the exception. @@ -49,7 +49,7 @@ public class SmackException extends Exception { super(message); } - public SmackException(String message, Throwable wrappedThrowable) { + protected SmackException(String message, Throwable wrappedThrowable) { super(message, wrappedThrowable); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java index b8f058370..6fadab1bc 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.java @@ -198,10 +198,10 @@ public class IncomingFileTransfer extends FileTransfer { if (cause instanceof SmackException) { throw (SmackException) cause; } - throw new SmackException("Error in execution", e); + throw new SmackException.SmackWrappedException("Error in execution", e); } catch (TimeoutException e) { - throw new SmackException("Request timed out", e); + throw new SmackException.SmackWrappedException("Request timed out", e); } finally { streamNegotiatorTask.cancel(true); diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java index a123ca382..9bc29ea6a 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java @@ -56,10 +56,10 @@ public class Socks5TransferNegotiator extends StreamNegotiator { return this.manager.establishSession(target, streamID).getOutputStream(); } catch (IOException e) { - throw new SmackException("error establishing SOCKS5 Bytestream", e); + throw new SmackException.SmackWrappedException("error establishing SOCKS5 Bytestream", e); } catch (InterruptedException e) { - throw new SmackException("error establishing SOCKS5 Bytestream", e); + throw new SmackException.SmackWrappedException("error establishing SOCKS5 Bytestream", e); } } @@ -109,7 +109,7 @@ public class Socks5TransferNegotiator extends StreamNegotiator { return stream; } catch (IOException e) { - throw new SmackException("Error establishing input stream", e); + throw new SmackException.SmackWrappedException("Error establishing input stream", e); } }