db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r958633 - in /db/derby/code/branches/10.3: ./ java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
Date Mon, 28 Jun 2010 16:51:05 GMT
Author: kmarsden
Date: Mon Jun 28 16:51:05 2010
New Revision: 958633

URL: http://svn.apache.org/viewvc?rev=958633&view=rev
Log:
DERBY-2318 testStreams(org.apache.derbyTesting.functionTests.te
sts.lang.StreamsTest)

Change test to get the StackTraceElements just once



Modified:
    db/derby/code/branches/10.3/   (props changed)
    db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java

Propchange: db/derby/code/branches/10.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 28 16:51:05 2010
@@ -1 +1 @@
-/db/derby/code/trunk:552046,586313,586317,788436,793588,794303,796316,796372,798347,798742,800523,803548,816536,882732,946794
+/db/derby/code/trunk:552046,586313,586317,788436,793588,794303,796316,796372,798347,798742,800523,803548,816536,882732,946794,958163

Modified: db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java?rev=958633&r1=958632&r2=958633&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
(original)
+++ db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
Mon Jun 28 16:51:05 2010
@@ -300,18 +300,19 @@ class DummyReader extends java.io.Reader
     }
     
     private void whereAmI() {
+        StackTraceElement[] stelements = new Throwable().getStackTrace();
         if (count == 0) {
             // see DERBY-2318 - some jvms report a line like:
             // at java.lang.Throwable<init>. Ignore all Throwable lines
             // for the count.
-            if ((new Throwable().getStackTrace().toString()).indexOf(
+            if (stelements.toString().indexOf(
                     "java.lang.Throwable".toLowerCase()) >=0)
             {
                 readerStackLevel = 
-                    new Throwable().getStackTrace().length - 1;
+                    stelements.length - 1;
             }
             else
-                readerStackLevel = new Throwable().getStackTrace().length;
+                readerStackLevel = stelements.length;
         }
     }
     



Mime
View raw message