db-derby-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=958632&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.4/   (props changed)
    db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java

Propchange: db/derby/code/branches/10.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 28 16:47:36 2010
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.5:814216,958230
-/db/derby/code/trunk:788436,793588,794303,796316,796372,797147,798347,798742,800523,803548,805696,809643,812669,816536,835286,882732,898635,915733,928065,934996,946794,954544,958230
+/db/derby/code/trunk:788436,793588,794303,796316,796372,797147,798347,798742,800523,803548,805696,809643,812669,816536,835286,882732,898635,915733,928065,934996,946794,954544,958163,958230

Modified: db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java?rev=958632&r1=958631&r2=958632&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
(original)
+++ db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java
Mon Jun 28 16:47:36 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