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

java.util.prefs: recursion error in the error report

XMLWordPrintable

    • x86_64
    • windows_10

      ADDITIONAL SYSTEM INFORMATION :
      Windows

      A DESCRIPTION OF THE PROBLEM :
      In the code below, 'rootNativeHandle()' is called in the constructor of the root - which must result en recursion if this root is affected by an error...

      Constructor from java.util.prefs:
          private WindowsPreferences(int rootNativeHandle, byte[] rootDirectory) {
              super(null, "");
              int[] result =
                      WindowsRegCreateKeyEx1(rootNativeHandle, rootDirectory);
              if (result[ERROR_CODE] != ERROR_SUCCESS) {
                  logger().warning("Could not open/create prefs root node " +
                          byteArrayToString(windowsAbsolutePath()) +
                          " at root 0x" + Integer.toHexString(rootNativeHandle()) +
                          ". Windows RegCreateKeyEx(...) returned error code " +
                          result[ERROR_CODE] + ".");
                  isBackingStoreAvailable = false;
                  return;
              }
              // Check if a new node
              newNode = (result[DISPOSITION] == REG_CREATED_NEW_KEY);
              closeKey(result[NATIVE_HANDLE]);
          }


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      I provoked the error by setting permissions in the windows registry to 'deny' for the user.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      an error report from java.util.prefs
      ACTUAL -
      after a long delay (the recursion) an exception on stackoverflow

      ---------- BEGIN SOURCE ----------
      a simple program opening preferences
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      I believe there should be no calls to functions in an error report at a basic level. Perhaps it is a typo error - a parameter is called rootNativeHandle - as the function rootNativeHandle().

      FREQUENCY : always


            bpb Brian Burkhalter
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: