Author: hlship
Date: Sat Mar  3 23:19:16 2007
New Revision: 514367

URL: http://svn.apache.org/viewvc?view=rev&rev=514367
Log:
TAPESTRY-1314: ExceptionAnalyzer throws NPE when an exception message is null

Modified:
    
tapestry/tapestry5/tapestry-ioc/trunk/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java

Modified: 
tapestry/tapestry5/tapestry-ioc/trunk/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java
URL: 
http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-ioc/trunk/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java?view=diff&rev=514367&r1=514366&r2=514367
==============================================================================
--- 
tapestry/tapestry5/tapestry-ioc/trunk/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java
 (original)
+++ 
tapestry/tapestry5/tapestry-ioc/trunk/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java
 Sat Mar  3 23:19:16 2007
@@ -12,58 +12,58 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-package org.apache.tapestry.ioc.internal.services;
-
-import static java.util.Collections.unmodifiableList;
-
-import java.util.List;
-import java.util.Map;
-
+package org.apache.tapestry.ioc.internal.services;
+
+import static java.util.Collections.unmodifiableList;
+
+import java.util.List;
+import java.util.Map;
+
 import org.apache.tapestry.ioc.internal.util.InternalUtils;
-import org.apache.tapestry.ioc.services.ExceptionInfo;
-
-public class ExceptionInfoImpl implements ExceptionInfo
-{
-    private final String _className;
-
-    private final String _message;
-
-    private final Map<String, Object> _properties;
-
-    private final List<String> _stackTrace;
-
-    public ExceptionInfoImpl(Throwable t, Map<String, Object> properties, 
List<String> stackTrace)
-    {
-        _className = t.getClass().getName();
-        _message = t.getMessage();
-
-        _properties = properties;
-        _stackTrace = unmodifiableList(stackTrace);
-    }
-
-    public String getClassName()
-    {
-        return _className;
-    }
-
-    public String getMessage()
-    {
-        return _message;
-    }
-
-    public Object getProperty(String name)
-    {
-        return _properties.get(name);
-    }
-
-    public List<String> getPropertyNames()
-    {
-        return InternalUtils.sortedKeys(_properties);
-    }
-
-    public List<String> getStackTrace()
-    {
-        return _stackTrace;
-    }
-
-}
+import org.apache.tapestry.ioc.services.ExceptionInfo;
+
+public class ExceptionInfoImpl implements ExceptionInfo
+{
+    private final String _className;
+
+    private final String _message;
+
+    private final Map<String, Object> _properties;
+
+    private final List<String> _stackTrace;
+
+    public ExceptionInfoImpl(Throwable t, Map<String, Object> properties, 
List<String> stackTrace)
+    {
+        _className = t.getClass().getName();
+        _message = t.getMessage() != null ? t.getMessage() : "";
+
+        _properties = properties;
+        _stackTrace = unmodifiableList(stackTrace);
+    }
+
+    public String getClassName()
+    {
+        return _className;
+    }
+
+    public String getMessage()
+    {
+        return _message;
+    }
+
+    public Object getProperty(String name)
+    {
+        return _properties.get(name);
+    }
+
+    public List<String> getPropertyNames()
+    {
+        return InternalUtils.sortedKeys(_properties);
+    }
+
+    public List<String> getStackTrace()
+    {
+        return _stackTrace;
+    }
+
+}


Reply via email to