db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r425703 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Date Wed, 26 Jul 2006 11:12:33 GMT
Author: kahatlen
Date: Wed Jul 26 04:12:32 2006
New Revision: 425703

URL: http://svn.apache.org/viewvc?rev=425703&view=rev
Log:
DERBY-1571: NetworkServerControlImpl.consoleExceptionPrintTrace()
prints stack trace even when logWriter is null

Made NetworkServerControlImpl.shutdown() set logWriter to a silent
stream instead of null to avoid printing stack traces of expected
exceptions during shutdown.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=425703&r1=425702&r2=425703&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Wed Jul 26 04:12:32 2006
@@ -23,6 +23,7 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
+import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -753,7 +754,15 @@
 		// Wait up to 10 seconds for things to really shut down
 		// need a quiet ping so temporarily disable the logwriter
 		PrintWriter savWriter = logWriter;
-		setLogWriter(null);
+		// DERBY-1571: If logWriter is null, stack traces are printed to
+		// System.err. Set logWriter to a silent stream to suppress stack
+		// traces too.
+		FilterOutputStream silentStream = new FilterOutputStream(null) {
+				public void write(int b) { }
+				public void flush() { }
+				public void close() { }
+			};
+		setLogWriter(new PrintWriter(silentStream));
 		int ntry;
 		for (ntry = 0; ntry < SHUTDOWN_CHECK_ATTEMPTS; ntry++)
 		{



Mime
View raw message