This is an automated email from the ASF dual-hosted git repository. paulk-asert pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 8f4992a99e69a00486c5c06a96b4a6b86511651f Author: Paul King <[email protected]> AuthorDate: Sat May 23 07:07:09 2026 +1000 minor refactor: fix generics (comply with PECS from Effective Java) --- src/main/java/org/codehaus/groovy/runtime/ArrayGroovyMethods.java | 4 ++-- src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/codehaus/groovy/runtime/ArrayGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/ArrayGroovyMethods.java index 55099e9dd4..17c1a41a2c 100644 --- a/src/main/java/org/codehaus/groovy/runtime/ArrayGroovyMethods.java +++ b/src/main/java/org/codehaus/groovy/runtime/ArrayGroovyMethods.java @@ -6883,7 +6883,7 @@ public class ArrayGroovyMethods extends DefaultGroovyMethodsSupport { * @return an integer that is the index of the first element of the second partition * @since 5.0.0 */ - public static <T> int partitionPoint(T[] self, IntRange range, Predicate<T> condition) { + public static <T> int partitionPoint(T[] self, IntRange range, Predicate<? super T> condition) { Objects.requireNonNull(self); RangeInfo info = range.subListBorders(self.length); Objects.checkFromToIndex(info.from, info.to, self.length); @@ -6928,7 +6928,7 @@ public class ArrayGroovyMethods extends DefaultGroovyMethodsSupport { * @return an integer that is the index of the first element of the second partition * @since 5.0.0 */ - public static <T> int partitionPoint(T[] self, Predicate<T> condition) { + public static <T> int partitionPoint(T[] self, Predicate<? super T> condition) { return partitionPoint(self, new IntRange(true, 0, self.length - 1), condition); } diff --git a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java index e5bf058b9e..4fc75e7b5e 100644 --- a/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java +++ b/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java @@ -11624,7 +11624,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { * @return an integer that is the index of the first element of the second partition * @since 5.0.0 */ - public static <T> int partitionPoint(List<T> self, IntRange range, Predicate<T> condition) { + public static <T> int partitionPoint(List<T> self, IntRange range, Predicate<? super T> condition) { Objects.requireNonNull(self); RangeInfo info = range.subListBorders(self.size()); Objects.checkFromToIndex(info.from, info.to, self.size()); @@ -11671,7 +11671,7 @@ public class DefaultGroovyMethods extends DefaultGroovyMethodsSupport { * @return an integer that is the index of the first element of the second partition * @since 5.0.0 */ - public static <T> int partitionPoint(List<T> self, Predicate<T> condition) { + public static <T> int partitionPoint(List<T> self, Predicate<? super T> condition) { return partitionPoint(self, new IntRange(true, 0, self.size() - 1), condition); }
