harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Ivanov (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-777) [classlib][logging] unexpected IAE for java.util.logging.FileHandler.Ctor's if "limit < 1 || count < 0"
Date Thu, 06 Jul 2006 07:22:30 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-777?page=all ]

Vladimir Ivanov updated HARMONY-777:
------------------------------------

    Attachment: FileHandler.patch
                FileHandlerTest.patch

patch and unit test

> [classlib][logging] unexpected IAE for java.util.logging.FileHandler.Ctor's if "limit
< 1 || count < 0"
> -------------------------------------------------------------------------------------------------------
>
>          Key: HARMONY-777
>          URL: http://issues.apache.org/jira/browse/HARMONY-777
>      Project: Harmony
>         Type: Bug

>     Reporter: Vladimir Ivanov
>  Attachments: FileHandler.patch, FileHandlerTest.patch
>
> The Harmony throws unexpected IAE for methods java.util.logging.FileHandler.FileHandler(String
pattern, int limit, int count) and java.util.logging.FileHandler.FileHandler(String pattern,
int limit, int count, boolean append) when "limit < 1 || count < 0" while RI throws
IAE when 'if limit < 0, or count < 1'
> ================ test.java =====================
> import java.util.logging.FileHandler;
> public class test { 
>   public static void main (String[] args) { 
>      try { 
>          try {
>              new FileHandler("a",0,1);
>              System.out.println("OK");
>          } catch (IllegalArgumentException e) {
>             e.printStackTrace();
>          }
>          try {
>             new FileHandler("a",0,1,false);
>             System.out.println("OK");
>          } catch (IllegalArgumentException e) {
>              e.printStackTrace();
>          }        
>      } catch (Exception e) {
>          System.out.println("unexpected exception");
>      } 
>   }
> }
> ============================================
> Output:
> C:\tmp\tmp17>C:\jrockit-jdk1.5.0-windows-ia32\bin\java.exe -showversion test
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> BEA WebLogic JRockit(R) (build dra-38972-20041208-2001-win-ia32, R25.0.0-75, GC: System
optimized over throughput (initial strategy singleparpar))
> OK
> OK
> C:\tmp\tmp17>C:\harmony\trunk_0427\deploy\jdk\jre\bin\java.exe -showversion test
> java version 1.5 (subset)
> (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors, as applicable.
> java.lang.IllegalArgumentException: The limit and count property must larger than 0 and
1, respctively
>         at java.util.logging.FileHandler.<init>(FileHandler.java:454)
>         at test.main(test.java:8)
> java.lang.IllegalArgumentException: The limit and count property must larger than 0 and
1, respectively
>         at java.util.logging.FileHandler.<init>(FileHandler.java:498)
>         at test.main(test.java:14)

-- 
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