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

Utility methods to check indexes and ranges doesn't specify behavior when function produces null

XMLWordPrintable

    • b94
    • Verified

        Each of the following lines

                    Objects.checkIndex(1, 1, (a,b) -> null);
                    Objects.checkFromToIndex(1, 7, 2, (a,b) -> null);
                    Objects.checkFromIndexSize(1, 7, 2, (a,b) -> null);

        produce NPE however this behavior doesn't seem to be specified by JDK-8135248

        If would be helpful to have the spec mention these thrown NPEs


              psandoz Paul Sandoz
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: