harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-1279) [classlib][logging] java.util.logging.StreamHandler.publish(LogRecord)'s condition check sequence is different from spec's.
Date Fri, 25 Aug 2006 07:28:23 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-1279?page=all ]

Andrew Zhang updated HARMONY-1279:
----------------------------------

    Attachment: Harmony-1279.diff

Hi,

Would you please try my patch?

Thanks!

Best regards,
Andrew

> [classlib][logging] java.util.logging.StreamHandler.publish(LogRecord)'s condition check
sequence is different from spec's.
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-1279
>                 URL: http://issues.apache.org/jira/browse/HARMONY-1279
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Andrew Zhang
>         Attachments: Harmony-1279.diff
>
>
> StreamHandler.publish spec says "The StreamHandler first checks if there is an OutputStream
and if the given LogRecord has at least the required log level. If not it silently returns.
If so, it calls any associated Filter to check if the record should be published." But Harmony
checks filter before OutputStream. 
> Following test reproduces the bug:
> 	public void testHandler() throws Exception {
> 		StreamHandler handler = new StreamHandler();
> 		MockFilter filter = new MockFilter();
> 		handler.setLevel(Level.FINER);
> 		handler.setFilter(filter);
> 		LogRecord record = new LogRecord(Level.FINE, "abc");
> 		handler.publish(record);
> 		assertFalse(filter.isLoggableCalled);
> 	}
> 	static class MockFilter implements Filter {
> 		private boolean isLoggableCalled = false;
> 		public boolean isLoggable(LogRecord arg0) {
> 			isLoggableCalled = true;
> 			return false;
> 		}
> 	}
> The test passes against RI while fails against Harmony. 
> I'll upload a patch to fix this problem soon.
> Best regards,
> Andrew

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message