Skip to content

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

@StraxGasser

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.

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