You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2009/09/21 13:58:10 UTC
svn commit: r817215 - in /mina/ftpserver:
branches/1.0.x/core/src/main/java/org/apache/ftpserver/
branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/
trunk/core/src/main/java/org/apache/ftpserver/
trunk/ftplet-api/src/main/java/org/apa...
Author: ngn
Date: Mon Sep 21 11:58:08 2009
New Revision: 817215
URL: http://svn.apache.org/viewvc?rev=817215&view=rev
Log:
Fixed exception where we fail to forward the cause to the super constructor (FTPSERVER-318)
Deprecated FtpException.getRootCause() as it duplicates Exception.getCause(). Removed ancient handling of the causing exception
Modified:
mina/ftpserver/branches/1.0.x/core/src/main/java/org/apache/ftpserver/DataConnectionException.java
mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionException.java
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
Modified: mina/ftpserver/branches/1.0.x/core/src/main/java/org/apache/ftpserver/DataConnectionException.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/branches/1.0.x/core/src/main/java/org/apache/ftpserver/DataConnectionException.java?rev=817215&r1=817214&r2=817215&view=diff
==============================================================================
--- mina/ftpserver/branches/1.0.x/core/src/main/java/org/apache/ftpserver/DataConnectionException.java (original)
+++ mina/ftpserver/branches/1.0.x/core/src/main/java/org/apache/ftpserver/DataConnectionException.java Mon Sep 21 11:58:08 2009
@@ -66,6 +66,6 @@
* the original cause
*/
public DataConnectionException(final String msg, final Throwable th) {
- super(msg);
+ super(msg, th);
}
}
Modified: mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java?rev=817215&r1=817214&r2=817215&view=diff
==============================================================================
--- mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java (original)
+++ mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java Mon Sep 21 11:58:08 2009
@@ -65,6 +65,6 @@
* The original cause
*/
public AuthenticationFailedException(String msg, Throwable th) {
- super(msg);
+ super(msg, th);
}
}
Modified: mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java?rev=817215&r1=817214&r2=817215&view=diff
==============================================================================
--- mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java (original)
+++ mina/ftpserver/branches/1.0.x/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java Mon Sep 21 11:58:08 2009
@@ -19,8 +19,6 @@
package org.apache.ftpserver.ftplet;
-import java.io.PrintStream;
-import java.io.PrintWriter;
/**
* Ftplet exception class.
@@ -31,8 +29,6 @@
private static final long serialVersionUID = -1328383839915898987L;
- private Throwable throwable = null;
-
/**
* Default constructor.
*/
@@ -59,7 +55,6 @@
*/
public FtpException(Throwable th) {
super(th.getMessage());
- throwable = th;
}
/**
@@ -72,47 +67,14 @@
*/
public FtpException(String msg, Throwable th) {
super(msg);
- throwable = th;
}
/**
* Get the root cause.
* @return The root cause
+ * @deprecated Use {@link Exception#getCause()} instead
*/
public Throwable getRootCause() {
- return throwable;
- }
-
- /**
- * Print stack trace.
- */
- public void printStackTrace(PrintWriter pw) {
- if (throwable == null) {
- super.printStackTrace(pw);
- } else {
- throwable.printStackTrace(pw);
- }
- }
-
- /**
- * Print stack trace.
- */
- public void printStackTrace(PrintStream ps) {
- if (throwable == null) {
- super.printStackTrace(ps);
- } else {
- throwable.printStackTrace(ps);
- }
- }
-
- /**
- * Print stack trace.
- */
- public void printStackTrace() {
- if (throwable == null) {
- super.printStackTrace();
- } else {
- throwable.printStackTrace();
- }
+ return getCause();
}
}
Modified: mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionException.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionException.java?rev=817215&r1=817214&r2=817215&view=diff
==============================================================================
--- mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionException.java (original)
+++ mina/ftpserver/trunk/core/src/main/java/org/apache/ftpserver/DataConnectionException.java Mon Sep 21 11:58:08 2009
@@ -66,6 +66,6 @@
* the original cause
*/
public DataConnectionException(final String msg, final Throwable th) {
- super(msg);
+ super(msg, th);
}
}
Modified: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java?rev=817215&r1=817214&r2=817215&view=diff
==============================================================================
--- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java (original)
+++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/AuthenticationFailedException.java Mon Sep 21 11:58:08 2009
@@ -65,6 +65,6 @@
* The original cause
*/
public AuthenticationFailedException(String msg, Throwable th) {
- super(msg);
+ super(msg, th);
}
}
Modified: mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java
URL: http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java?rev=817215&r1=817214&r2=817215&view=diff
==============================================================================
--- mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java (original)
+++ mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FtpException.java Mon Sep 21 11:58:08 2009
@@ -19,8 +19,6 @@
package org.apache.ftpserver.ftplet;
-import java.io.PrintStream;
-import java.io.PrintWriter;
/**
* Ftplet exception class.
@@ -31,8 +29,6 @@
private static final long serialVersionUID = -1328383839915898987L;
- private Throwable throwable = null;
-
/**
* Default constructor.
*/
@@ -59,7 +55,6 @@
*/
public FtpException(Throwable th) {
super(th.getMessage());
- throwable = th;
}
/**
@@ -72,47 +67,14 @@
*/
public FtpException(String msg, Throwable th) {
super(msg);
- throwable = th;
}
/**
* Get the root cause.
* @return The root cause
+ * @deprecated Use {@link Exception#getCause()} instead
*/
public Throwable getRootCause() {
- return throwable;
- }
-
- /**
- * Print stack trace.
- */
- public void printStackTrace(PrintWriter pw) {
- if (throwable == null) {
- super.printStackTrace(pw);
- } else {
- throwable.printStackTrace(pw);
- }
- }
-
- /**
- * Print stack trace.
- */
- public void printStackTrace(PrintStream ps) {
- if (throwable == null) {
- super.printStackTrace(ps);
- } else {
- throwable.printStackTrace(ps);
- }
- }
-
- /**
- * Print stack trace.
- */
- public void printStackTrace() {
- if (throwable == null) {
- super.printStackTrace();
- } else {
- throwable.printStackTrace();
- }
+ return getCause();
}
}