2323 */
2424public class JXPathContextFactoryConfigurationError extends Error {
2525
26- private static final long serialVersionUID = 1L ;
27- /** @serial */
28- private final Exception exception ;
26+ private static final long serialVersionUID = 2L ;
2927
3028 /**
3129 * Create a new {@code JXPathContextFactoryConfigurationError} with no detail mesage.
3230 */
3331 public JXPathContextFactoryConfigurationError () {
34- this .exception = null ;
3532 }
3633
3734 /**
3835 * Create a new {@code JXPathContextFactoryConfigurationError} with a given {@code Exception} base cause of the error.
3936 *
40- * @param e The exception to be encapsulated in a JXPathContextFactoryConfigurationError.
37+ * @param cause The exception to be encapsulated in a JXPathContextFactoryConfigurationError.
4138 */
42- public JXPathContextFactoryConfigurationError (final Exception e ) {
43- super (e .toString ());
44- this .exception = e ;
39+ public JXPathContextFactoryConfigurationError (final Exception cause ) {
40+ super (cause );
4541 }
4642
4743 /**
4844 * Create a new {@code JXPathContextFactoryConfigurationError} with the given {@code Exception} base cause and detail message.
4945 *
50- * @param e The exception to be encapsulated in a JXPathContextFactoryConfigurationError
46+ * @param cause The exception to be encapsulated in a JXPathContextFactoryConfigurationError
5147 * @param msg The detail message.
5248 */
53- public JXPathContextFactoryConfigurationError (final Exception e , final String msg ) {
54- super (msg );
55- this .exception = e ;
49+ public JXPathContextFactoryConfigurationError (final Exception cause , final String msg ) {
50+ super (msg , cause );
5651 }
5752
5853 /**
@@ -62,7 +57,6 @@ public JXPathContextFactoryConfigurationError(final Exception e, final String ms
6257 */
6358 public JXPathContextFactoryConfigurationError (final String msg ) {
6459 super (msg );
65- this .exception = null ;
6660 }
6761
6862 /**
@@ -71,21 +65,7 @@ public JXPathContextFactoryConfigurationError(final String msg) {
7165 * @return The encapsulated exception, or null if there is none.
7266 */
7367 public Exception getException () {
74- return exception ;
68+ return ( Exception ) super . getCause () ;
7569 }
7670
77- /**
78- * Gets the message (if any) for this error . If there is no message for the exception and there is an encapsulated exception then the message of that
79- * exception will be returned.
80- *
81- * @return The error message.
82- */
83- @ Override
84- public String getMessage () {
85- final String message = super .getMessage ();
86- if (message == null && exception != null ) {
87- return exception .getMessage ();
88- }
89- return message ;
90- }
9171}
0 commit comments