Passing null or undefined to adapter class constructors results in NPE or ClassCastException

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 8
    • Affects Version/s: None
    • Component/s: core-libs
    • None
    • b82
    • generic
    • generic

      The following scripts result in crash:

      var cl = new java.lang.ClassLoader(null); // -> NPE
      var cl = new java.lang.ClassLoader(undefined); //-> ClassCastException
      var r = new java.lang.Runnable(null); // RuntimeException that tells can't find correct constructor!
      var r = new java.lang.Runnable(undefined); // same as above.

      It'd be better if we uniformly throw TypeError for these cases - that tells the passed object is not a script "Object".

            Assignee:
            Sundararajan Athijegannathan
            Reporter:
            Sundararajan Athijegannathan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: