Skip to content

Unjustified NullPointerException thrown by RiCache.getAll(Set)  #80

Description

@StraxGasser

RiCache.getAll checks the argument "keys" with keys.contains(null). This check throws a NulllPointerException irrespective of the actual sets elements if the java.util.Set Implementation won't accept null as an element.

java.util.Set.contains documents that the method will throw a NullPointerException "if the specified element is null and this set does not permit null elements". Such Set can easily be obtained by a call to java.util.Collections.unmodifiableSet() or from objects of TreeSet (and possibly other implementations).

Ensuring that the argument "keys" won't contain any null elements should certainly throw a NullPointerException only if the Set happens to actually contain some null-Elements.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions