Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 47119 invoked from network); 13 Feb 2007 16:55:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2007 16:55:07 -0000 Received: (qmail 42335 invoked by uid 500); 13 Feb 2007 16:55:15 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 42313 invoked by uid 500); 13 Feb 2007 16:55:15 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 42302 invoked by uid 99); 13 Feb 2007 16:55:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 08:55:15 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 08:55:06 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id C0B581A981A; Tue, 13 Feb 2007 08:54:46 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r507093 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java Date: Tue, 13 Feb 2007 16:54:46 -0000 To: derby-commits@db.apache.org From: djd@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070213165446.C0B581A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: djd Date: Tue Feb 13 08:54:45 2007 New Revision: 507093 URL: http://svn.apache.org/viewvc?view=rev&rev=507093 Log: DERBY-2318 Cleaned up the code that gets the stack trace, but didn't change anything that would change the behaviour. I don't see any failure on WEME 6.1 though. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java?view=diff&rev=507093&r1=507092&r2=507093 ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StreamsTest.java Tue Feb 13 08:54:45 2007 @@ -21,6 +21,13 @@ package org.apache.derbyTesting.functionTests.tests.lang; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.LineNumberReader; +import java.io.OutputStream; +import java.io.PrintWriter; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -294,30 +301,11 @@ private void whereAmI() { if (count == 0) { - readerStackLevel = -1; - try { - throw new Throwable(); - } catch (Throwable e) { - try { - readerStackLevel = e.getStackTrace().length; - // System.out.println("================= stack array length - // is: " + readerStackLevel); - // e.printStackTrace(); - } catch (NoSuchMethodError nme) { - DummyOutputStream dos = new DummyOutputStream(); - DummyPrintStream dps = new DummyPrintStream(dos); - e.printStackTrace(dps); - dps.flush(); - // System.out.println("================= print to dop level - // num is: " + dps.lines); - readerStackLevel = dps.lines; - // e.printStackTrace(); - } - } + readerStackLevel = new Throwable().getStackTrace().length; } } - public int read() { + public int read() throws IOException { if (count == 0) return -1; @@ -359,26 +347,9 @@ this.count = length; } - private void whereAmI() { + private void whereAmI() { if (count == 0) { - readerStackLevel = -1; - try { - throw new Throwable(); - } catch (Throwable e) { - try { - readerStackLevel = e.getStackTrace().length; - // System.out.println("================= stack array length is: " + readerStackLevel); - // e.printStackTrace(); - } catch (NoSuchMethodError nme) { - DummyOutputStream dos = new DummyOutputStream(); - DummyPrintStream dps = new DummyPrintStream(dos); - e.printStackTrace(dps); - dps.flush(); - // System.out.println("================= print to dop level num is: " + dps.lines); - readerStackLevel = dps.lines; - // e.printStackTrace(); - } - } + readerStackLevel = new Throwable().getStackTrace().length; } } @@ -391,7 +362,7 @@ return content++; } - public int read(byte[] buf, int offset, int length) { + public int read(byte[] buf, int offset, int length) { if (count == 0) return -1; @@ -410,69 +381,4 @@ public void close() { } -} - -class DummyOutputStream extends java.io.OutputStream { - public void close() { - } - - public void flush() { - } - - public void write(byte[] b) { - } - - public void write(byte[] b, int off, int len) { - } - - public void write(int b) { - } -} - -class DummyPrintStream extends java.io.PrintStream { - int lines; - - public DummyPrintStream(DummyOutputStream dos) { - super(dos); - } - - public void println() { - lines++; - } - - public void println(String x) { - lines++; - } - - public void println(Object x) { - lines++; - } - - public void println(char[] x) { - lines++; - } - - public void println(double x) { - lines++; - } - - public void println(float x) { - lines++; - } - - public void println(long x) { - lines++; - } - - public void println(int x) { - lines++; - } - - public void println(char x) { - lines++; - } - - public void println(boolean x) { - lines++; - } -} +} \ No newline at end of file