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

It will be better if StringLocalizer will throw an explicit exception when key is set to null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • fx1.3
    • fx1.2
    • javafx
    • None


      Currently you would not be able to catch an exception by calling StringLocalizer { key: null }. Suppose key should not be able to set to null.

      var p2 = true;
      try {
          var a2 = StringLocalizer { key: null };
          p2 = false;
      }
      catch (e2 : NullPointerException) {
      }

      System.out.println("test pass: {p2}");

      I think it is better and easier o fix the issue at javafx.util.StringLocalilzer(choice a). Catch and rethrow the exception from there for being able to catch the exception from an application level.

            naoto Naoto Sato
            jwangsunw Jane Wang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: