maven-surefire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fgi...@apache.org
Subject svn commit: r615569 - /maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
Date Sun, 27 Jan 2008 10:00:04 GMT
Author: fgiust
Date: Sun Jan 27 02:00:03 2008
New Revision: 615569

URL: http://svn.apache.org/viewvc?rev=615569&view=rev
Log:
SUREFIRE-444 NPE in PojoStackTraceWriter.writeTraceToString

Modified:
    maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java

Modified: maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
URL: http://svn.apache.org/viewvc/maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java?rev=615569&r1=615568&r2=615569&view=diff
==============================================================================
--- maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
(original)
+++ maven/surefire/trunk/surefire-api/src/main/java/org/apache/maven/surefire/report/PojoStackTraceWriter.java
Sun Jan 27 02:00:03 2008
@@ -48,8 +48,11 @@
     public String writeTraceToString()
     {
         StringWriter w = new StringWriter();
-        t.printStackTrace( new PrintWriter( w ) );
-        w.flush();
+        if ( t != null )
+        {
+            t.printStackTrace( new PrintWriter( w ) );
+            w.flush();
+        }
         return w.toString();
     }
 
@@ -69,7 +72,7 @@
             if ( line.startsWith( marker ) )
             {
                 lastLine = i;
-            } else if ( line.startsWith( "Caused by" ) ) 
+            } else if ( line.startsWith( "Caused by" ) )
             {
                 causedByLine = i;
                 break;



Mime
View raw message