Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4368016

TimeZone.getSystemTimeZoneID throws NPE when user.timezone property is removed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • core-libs
    • beta2
    • x86
    • windows_2000



      Name: skT45625 Date: 09/01/2000


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      This problem is very easy to reproduce. The code below causes the HotSpot VM
      crash.

      ----------- code start --------------
      import java.io.*;
      import java.util.*;

      public class HotSpotError {
          public static void main(String[] args) {

              // This is the workaround: if you create your Properties object
              // based on the current (intact) System properties, the problem
              // will not show!
              //Properties props = new Properties(System.getProperties());

              // This is the buggy way
              Properties props = new Properties();
              try {
                  // test.props contains some dummy properties
                  FileInputStream is = new FileInputStream("test.props");
                  props.load(is);
              } catch (IOException e) {
                  e.printStackTrace();
              }
              // And here's the devilish method call which kills HotSpot
              System.setProperties(props);

              // This line of code will not be reached if you called
      System.setProperties
              // in the buggy way
              // This same code works under JDK1.2.2 in both ways
              System.out.println(new Date() + " this will not be printed in JVM
      1.3.0");
          }
      }----------- code end --------------

      So, if you call System.setProperties() with a Properties object as an argument
      that does NOT contain the full set of the Java system properties, HotSpot will
      crash. Below is the detailed error message:

      #
      # HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
      # Please report this error at
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #
      # Error ID: 4F533F57494E13120E43505002D4
      #
      (Review ID: 109213)
      ======================================================================


      peter.allenbach@eng 2001-04-05
      In fact, the HotSpot error is not seen in 1.4. See the evaluation field for
      more details on why this is not really a HotSpot runtime bug.

            peytoia Yuka Kamiya (Inactive)
            skondamasunw Suresh Kondamareddy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: