axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glyn Normington" <glyn_norming...@uk.ibm.com>
Subject [PATCH] Replace incorrect use of NullPointerException in AxisEngine
Date Tue, 11 Dec 2001 16:16:25 GMT
This patch is a small improvement to the Axis engine. A
NullPointerException was being thrown regardless of whether a null pointer
was the original problem. The fix introduces an InternalException class and
throws an instance of it. The change will impact anyone who specifically
catches NullPointerException resulting from engine construction (but they
deserve it IMHO).

Glyn

Index: xml-axis/java/src/org/apache/axis/AxisEngine.java
===================================================================
RCS file: /home/cvspublic/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
retrieving revision 1.60
diff -u -r1.60 AxisEngine.java
--- xml-axis/java/src/org/apache/axis/AxisEngine.java   2001/12/06 17:09:40 1.60
+++ xml-axis/java/src/org/apache/axis/AxisEngine.java   2001/12/11 16:05:05
@@ -125,6 +125,19 @@
     private static ThreadLocal currentMessageContext = new ThreadLocal();

     /**
+     * Exception class for reporting engine failures.
+     */
+    protected static class InternalException extends RuntimeException {
+
+        /**
+         * Only support the constructor which takes a message.
+         */
+        public InternalException(String details) {
+            super(details);
+        }
+    }
+
+    /**
      * Set the active message context.
      *
      * @param mc - the new active message context.
@@ -176,7 +189,7 @@
             configProvider.configureEngine(this);
         } catch (Exception e) {
             e.printStackTrace();
-            throw new NullPointerException(JavaUtils.getMessage("problemDeploying00"));
+            throw new InternalException(JavaUtils.getMessage("problemDeploying00"));
         }

         if (category.isDebugEnabled()) {



Mime
View raw message