dlr 2002/09/24 22:50:49
Modified: lang/src/test/org/apache/commons/lang/exception
ExceptionUtilsTestCase.java
Log:
Corrected semantics of ExceptionWithoutCause broken in CVS rev 1.3.
The point of the ExceptionWithoutCause is to test for false-positive
nested exception method signature matches. Documented this in the
header JavaDoc for both the ExceptionWithCause and
ExceptionWithoutCause classes, and changed the nested exception method
name of the latter from getCause() to getTargetException() to avoid
conflicts with getCause() method of JDK 1.4's Exception class (which
returns Throwable).
Revision Changes Path
1.4 +11 -2
jakarta-commons/lang/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java
Index: ExceptionUtilsTestCase.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/lang/src/test/org/apache/commons/lang/exception/ExceptionUtilsTestCase.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -u -r1.3 -r1.4
--- ExceptionUtilsTestCase.java 18 Sep 2002 15:47:44 -0000 1.3
+++ ExceptionUtilsTestCase.java 25 Sep 2002 05:50:49 -0000 1.4
@@ -107,6 +107,11 @@
assertEquals(ExceptionUtils.getThrowableCount(null), 0);
}
+ /**
+ * Provides a method with a well known chained/nested exception
+ * name which matches the full signature (e.g. has a return value
+ * of <code>Throwable</code>.
+ */
private static class ExceptionWithCause extends Exception
{
private Throwable cause;
@@ -122,11 +127,15 @@
}
}
+ /**
+ * Provides a method with a well known chained/nested exception
+ * name which does not match the full signature (e.g. lacks a
+ * return value of <code>Throwable</code>.
+ */
private static class ExceptionWithoutCause extends Exception
{
- public Throwable getCause()
+ public void getTargetException()
{
- return null;
}
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>