Skip to content

Commit 992b503

Browse files
committed
classlib: remove dependency on String.format from Set.of
Fix #1169
1 parent d83fab4 commit 992b503

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

classlib/src/main/java/org/teavm/classlib/java/util/TTemplateCollections.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,7 @@ static class NElementSet<T> extends AbstractImmutableSet<T> {
262262
int index = 0;
263263
outerLoop:
264264
for (T element : (T[]) collection.toArray()) {
265-
if (element == null) {
266-
throw new NullPointerException(String.format("Element at index %s is null", index));
267-
}
265+
Objects.requireNonNull(element);
268266

269267
int indexTemp = Math.abs(element.hashCode()) % temp.length;
270268
while (temp[indexTemp] != null) {

0 commit comments

Comments
 (0)