You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/12/06 10:33:05 UTC

svn commit: r1817280 [2/2] - in /tomcat/tc8.0.x/trunk: ./ java/org/apache/tomcat/dbcp/pool2/ java/org/apache/tomcat/dbcp/pool2/impl/ webapps/docs/

Copied: tomcat/tc8.0.x/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java (from r1817092, tomcat/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java)
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java?p2=tomcat/tc8.0.x/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java&p1=tomcat/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java&r1=1817092&r2=1817280&rev=1817280&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java (original)
+++ tomcat/tc8.0.x/trunk/java/org/apache/tomcat/dbcp/pool2/impl/ThrowableCallStack.java Wed Dec  6 10:33:04 2017
@@ -21,7 +21,9 @@ import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 
 /**
- * CallStack strategy that uses the stack trace from a {@link Throwable}.
+ * CallStack strategy that uses the stack trace from a {@link Throwable}. This strategy, while slower than the
+ * SecurityManager implementation, provides call stack method names and other metadata in addition to the call stack
+ * of classes.
  *
  * @see Throwable#fillInStackTrace()
  * @since 2.4.3
@@ -34,15 +36,21 @@ public class ThrowableCallStack implemen
 
     private volatile Snapshot snapshot;
 
+    /**
+     * Create a new instance.
+     *
+     * @param messageFormat message format
+     * @param useTimestamp whether to format the dates in the output message or not
+     */
     public ThrowableCallStack(final String messageFormat, final boolean useTimestamp) {
         this.messageFormat = messageFormat;
         this.dateFormat = useTimestamp ? new SimpleDateFormat(messageFormat) : null;
     }
 
     @Override
-    public synchronized boolean printStackTrace(PrintWriter writer) {
-        Snapshot snapshot = this.snapshot;
-        if (snapshot == null) {
+    public synchronized boolean printStackTrace(final PrintWriter writer) {
+        final Snapshot snapshotRef = this.snapshot;
+        if (snapshotRef == null) {
             return false;
         }
         final String message;
@@ -50,11 +58,11 @@ public class ThrowableCallStack implemen
             message = messageFormat;
         } else {
             synchronized (dateFormat) {
-                message = dateFormat.format(Long.valueOf(snapshot.timestamp));
+                message = dateFormat.format(Long.valueOf(snapshotRef.timestamp));
             }
         }
         writer.println(message);
-        snapshot.printStackTrace(writer);
+        snapshotRef.printStackTrace(writer);
         return true;
     }
 
@@ -68,8 +76,11 @@ public class ThrowableCallStack implemen
         snapshot = null;
     }
 
+    /**
+     * A snapshot of a throwable.
+     */
     private static class Snapshot extends Throwable {
-        private static final long serialVersionUID = -7871548158947014789L;
+        private static final long serialVersionUID = 1L;
         private final long timestamp = System.currentTimeMillis();
     }
 }

Modified: tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml?rev=1817280&r1=1817279&r2=1817280&view=diff
==============================================================================
--- tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc8.0.x/trunk/webapps/docs/changelog.xml Wed Dec  6 10:33:04 2017
@@ -54,6 +54,13 @@
       </add>
     </changelog>
   </subsection>
+  <subsection name="Other">
+    <changelog>
+      <update>
+        Update the internal fork of Commons Pool 2 to 2.4.3. (markt)
+      </update>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 8.0.48 (violetagg)" rtext="release in progress">
   <subsection name="Catalina">



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org