diff --git a/common/src/main/java/me/lucko/luckperms/common/util/Iterators.java b/common/src/main/java/me/lucko/luckperms/common/util/Iterators.java index 26706ad4a..045186639 100644 --- a/common/src/main/java/me/lucko/luckperms/common/util/Iterators.java +++ b/common/src/main/java/me/lucko/luckperms/common/util/Iterators.java @@ -34,10 +34,10 @@ import java.util.function.Function; public final class Iterators { private Iterators() {} - public static void tryIterate(Iterable iterable, Consumer action) { - for (I i : iterable) { + public static void tryIterate(Iterable iterable, Consumer action) { + for (E element : iterable) { try { - action.accept(i); + action.accept(element); } catch (Exception e) { e.printStackTrace(); } @@ -45,19 +45,19 @@ public final class Iterators { } public static void tryIterate(Iterable iterable, Function mapping, Consumer action) { - for (I i : iterable) { + for (I element : iterable) { try { - action.accept(mapping.apply(i)); + action.accept(mapping.apply(element)); } catch (Exception e) { e.printStackTrace(); } } } - public static void tryIterate(I[] array, Consumer action) { - for (I i : array) { + public static void tryIterate(E[] array, Consumer action) { + for (E element : array) { try { - action.accept(i); + action.accept(element); } catch (Exception e) { e.printStackTrace(); } @@ -65,20 +65,20 @@ public final class Iterators { } public static void tryIterate(I[] array, Function mapping, Consumer action) { - for (I i : array) { + for (I element : array) { try { - action.accept(mapping.apply(i)); + action.accept(mapping.apply(element)); } catch (Exception e) { e.printStackTrace(); } } } - public static List> divideIterable(Iterable source, int size) { - List> lists = new ArrayList<>(); - Iterator it = source.iterator(); + public static List> divideIterable(Iterable source, int size) { + List> lists = new ArrayList<>(); + Iterator it = source.iterator(); while (it.hasNext()) { - List subList = new ArrayList<>(); + List subList = new ArrayList<>(); for (int i = 0; it.hasNext() && i < size; i++) { subList.add(it.next()); }