Harmony
  1. Harmony
  2. HARMONY-693

[classlib][logging] unexpected NPE for XMLFormatter().getHead((Handler) null)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      The j2se spec says for java.util.logging.XMLFormatter().getHead(Handler h)
      'h - The target handler (can be null) ' but harmony throw NPE.
      ================ test.java =======================
      import java.util.logging.*;
      public class test {
      public static void main (String[] args)

      { System.out.println("getHead(null) = " + new XMLFormatter().getHead((Handler) null)); }

      }
      ==============================================

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

      getHead(null) = <?xml version="1.0" encoding="windows-1252" standalone="no"?>
      <!DOCTYPE log SYSTEM "logger.dtd">
      <log>

      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.
      Exception in thread "main" java.lang.NullPointerException
      at java.util.logging.XMLFormatter.getHead(XMLFormatter.java:191)
      at test.main(test.java:5)

      C:\tmp\tmp17>C:\harmony\drlvm\trunk\build\win_ia32_msvc_release\deploy\jre\bin\ij -showversion test
      Apache Harmony DRLVM HEAD-4807 (2006-05-02), Windows/ia32/msvc 1310, release
      java.io.FileNotFoundException
      at org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:223)
      at java.io.FileInputStream.<init>(FileInputStream.java:66)
      at java.io.FileInputStream.<init>(FileInputStream.java:110)
      at java.util.logging.LogManager.readConfigurationImpl(LogManager.java:428)
      at java.util.logging.LogManager.<clinit>(LogManager.java:186)
      at java.util.logging.XMLFormatter.<clinit>(XMLFormatter.java:41)
      at test.main(test.java:5)
      java.lang.NullPointerException
      at java.util.logging.XMLFormatter.getHead(XMLFormatter.java:191)
      at test.main(test.java:5)

      C:\tmp\tmp17>

      1. XMLFormatter.patch
        0.7 kB
        Vladimir Ivanov
      2. XMLFormatterTest.patch
        0.8 kB
        Vladimir Ivanov
      3. XMLFormatterTest2.patch
        0.7 kB
        Vladimir Ivanov

        Activity

        Hide
        Vladimir Ivanov added a comment -

        unit test

        Show
        Vladimir Ivanov added a comment - unit test
        Hide
        Vladimir Ivanov added a comment -

        patch;
        updated test cases depends on fixed functionality

        Show
        Vladimir Ivanov added a comment - patch; updated test cases depends on fixed functionality
        Hide
        Stepan Mishura added a comment -

        Vladimir, please verify that HARMONY-1280 resolved this issue.

        Show
        Stepan Mishura added a comment - Vladimir, please verify that HARMONY-1280 resolved this issue.
        Hide
        Vladimir Ivanov added a comment -

        verified, thanks

        Show
        Vladimir Ivanov added a comment - verified, thanks
        Hide
        Stepan Mishura added a comment -

        Resolved in HARMONY-1280, verified by Vladimir.

        Show
        Stepan Mishura added a comment - Resolved in HARMONY-1280 , verified by Vladimir.

          People

          • Assignee:
            Unassigned
            Reporter:
            Vladimir Ivanov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development