-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Documentation is wrong about immutability #965
Copy link
Copy link
Closed
Milestone
Description
| public static <T> Set<T> asSet(Collection<T> c) { |
You tell users, that asSet returns an immutable Set.
@return a type-safe immutable {@code Set} containing the specified collection elements.
This is not true, when you pass in a mutable Set. In this case the Collection is only cast to a Set. You probably want to change the documentation or use java.util.Collections.unmodifiableSet
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels