SwitchBoostraps.enumSwitch does not throw an NPE when lookup is null in some cases

XMLWordPrintable

    • Type: CSR
    • Resolution: Unresolved
    • Priority: P3
    • 27
    • Component/s: tools
    • None
    • behavioral
    • minimal
    • Hide
      This method is typically called using the invoke dynamic machinery, that passes a non-null lookup parameter.

      Even in cases when the method is called outside of the invoke dynamic machinery, the caller is likely to fill the lookup parameter, as the method already throws an NPE in some cases.
      Show
      This method is typically called using the invoke dynamic machinery, that passes a non-null lookup parameter. Even in cases when the method is called outside of the invoke dynamic machinery, the caller is likely to fill the lookup parameter, as the method already throws an NPE in some cases.
    • Java API
    • SE

      Summary

      Invoking SwitchBoostraps.enumSwitch with a null lookup should always throw a NullPointerException.

      Problem

      Invoking SwitchBoostraps.enumSwitch with a null lookup does not always throw a NullPointerException. The lookup is already needed in some cases, and during future evolution, the set of cases where lookup will be needed may change. The method should always throw a NullPointerException when the lookup parameter is null.

      Solution

      SwitchBoostraps.enumSwitch will explicitly check that the lookup parameter is not null.

      Specification

      No change to the specification, the specification already disallows the lookup parameter to be null. The behavior will be changed for that SwitchBoostraps.enumSwitch will always and unconditionally throw a NullPointerException when the lookup parameter is null.

            Assignee:
            Jan Lahoda
            Reporter:
            Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: