On Wed, 22 Apr 2026 17:34:25 GMT, Justin Lu <[email protected]> wrote:
> > Or what if we "accept" null elements, which would be simply ignored? That > > would avoid NPE crash. > > I think of the options at hand, I'd learn towards enforcing NPE for null > elements in `lookupTag` OR using the weakened specification proposed earlier. > These seem to be the least intrusive options. > > Accepting null elements would be behaviorally changing all of the > lookup/filtering methods, since most of the methods do not already allow such > elements (besides early match on lookupTag and the empty collection edge > cases). There are also issues for the filter APIs if given no non-zero weighted range(s), as they bypass the implicit NPE path that a non-zero weight range would encounter. So they would also require the manual upfront `null` element checking. I'm leaning towards the weakened specification wording. ------------- PR Comment: https://git.openjdk.org/jdk/pull/30632#issuecomment-4300599864
