File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
api/src/main/java/io/jsonwebtoken/lang Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -86,19 +86,16 @@ public static <T> List<T> of(T... elements) {
86
86
/**
87
87
* Returns the specified collection as a {@link Set} instance.
88
88
*
89
- * @param c the collection to represent as a set
89
+ * @param c the collection to be converted
90
90
* @param <T> collection element type
91
- * @return a type-safe immutable {@code Set} containing the specified collection elements.
91
+ * @return a type-safe immutable {@code Set} containing the specified collection elements.
92
92
* @since 0.12.0
93
93
*/
94
94
public static <T > Set <T > asSet (Collection <T > c ) {
95
- if (c instanceof Set ) {
96
- return (Set <T >) c ;
97
- }
98
95
if (isEmpty (c )) {
99
96
return java .util .Collections .emptySet ();
100
97
}
101
- return java .util .Collections .unmodifiableSet (new LinkedHashSet <>(c ));
98
+ return java .util .Collections .unmodifiableSet (new LinkedHashSet <T >(c ));
102
99
}
103
100
104
101
/**
You can’t perform that action at this time.
0 commit comments