harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r436705 - in /incubator/harmony/enhanced/classlib/trunk/modules/logging/src: main/java/java/util/logging/StreamHandler.java test/java/org/apache/harmony/logging/tests/java/util/logging/StreamHandlerTest.java
Date Fri, 25 Aug 2006 08:00:20 GMT
Author: hindessm
Date: Fri Aug 25 01:00:19 2006
New Revision: 436705

URL: http://svn.apache.org/viewvc?rev=436705&view=rev
Log:
Applied patch from "[#HARMONY-1279] [classlib][logging]
java.util.logging.StreamHandler.publish(LogRecord)'s condition check
sequence is different from spec's".

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
    incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/StreamHandlerTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java?rev=436705&r1=436704&r2=436705&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/main/java/java/util/logging/StreamHandler.java
Fri Aug 25 01:00:19 2006
@@ -349,7 +349,7 @@
     	if (null == record) {
 			return false;
 		}
-        if (super.isLoggable(record) && null != this.os) {
+        if (null != this.os && super.isLoggable(record)) {
             return true;
         }
         return false;

Modified: incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/StreamHandlerTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/StreamHandlerTest.java?rev=436705&r1=436704&r2=436705&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/StreamHandlerTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/logging/src/test/java/org/apache/harmony/logging/tests/java/util/logging/StreamHandlerTest.java
Fri Aug 25 01:00:19 2006
@@ -611,6 +611,15 @@
 	public void testPublish_Null_NoOutputStream() {
 		StreamHandler h = new StreamHandler();
 		h.publish(null);
+		// regression test for Harmony-1275
+		MockFilter filter = new MockFilter();
+		h.setLevel(Level.FINER);
+		h.setFilter(filter);
+		LogRecord record = new LogRecord(Level.FINE, "abc");
+		h.publish(record);
+		// verify that filter.isLoggable is not called, because there's no
+		// associated output stream.
+		assertTrue(CallVerificationStack.getInstance().empty());
 	}
 
 	/*
@@ -906,7 +915,6 @@
 
 		public boolean isLoggable(LogRecord record) {
 			CallVerificationStack.getInstance().push(record);
-			// System.out.println("filter called...");
 			return false;
 		}
 	}



Mime
View raw message