Copilot commented on code in PR #4591:
URL: https://github.com/apache/solr/pull/4591#discussion_r3519393936
##########
solr/test-framework/src/java/org/apache/solr/util/SolrMatchers.java:
##########
@@ -40,17 +40,17 @@ public class SolrMatchers {
* @param <T> The type that the list being matched against will contain
*/
public static <T> Matcher<List<? extends T>> subListMatches(
- int fromIndex, int toIndex, Matcher<? super List<? super T>>
subListMatcher) {
+ int fromIndex, int toIndex, Matcher<Iterable<? extends T>>
subListMatcher) {
return new SubListMatcher<>(fromIndex, toIndex, subListMatcher);
}
Review Comment:
The parameter type here is too restrictive: `Matcher<Iterable<? extends T>>`
is invariant, so callers with matchers typed to a wider iterable (e.g.,
`Matcher<Iterable<?>>`) can no longer pass them. Use `Matcher<? super
Iterable<? extends T>>` to keep the helper flexible while still type-safe.
##########
solr/test-framework/src/java/org/apache/solr/util/SolrMatchers.java:
##########
@@ -40,17 +40,17 @@ public class SolrMatchers {
* @param <T> The type that the list being matched against will contain
*/
public static <T> Matcher<List<? extends T>> subListMatches(
- int fromIndex, int toIndex, Matcher<? super List<? super T>>
subListMatcher) {
+ int fromIndex, int toIndex, Matcher<Iterable<? extends T>>
subListMatcher) {
return new SubListMatcher<>(fromIndex, toIndex, subListMatcher);
}
public static class SubListMatcher<T> extends
TypeSafeDiagnosingMatcher<List<? extends T>> {
private final int fromIndex;
private final int toIndex;
- private final Matcher<? super List<T>> matchOnSubList;
+ private final Matcher<Iterable<? extends T>> matchOnSubList;
public SubListMatcher(
- int fromIndex, int toIndex, Matcher<? super List<? super T>>
matchOnSubList) {
+ int fromIndex, int toIndex, Matcher<Iterable<? extends T>>
matchOnSubList) {
Review Comment:
Constructor parameter should match the widened matcher type (`Matcher<?
super Iterable<? extends T>>`) to avoid forcing callers into an exact generic
instantiation.
##########
solr/test-framework/src/java/org/apache/solr/util/SolrMatchers.java:
##########
@@ -40,17 +40,17 @@ public class SolrMatchers {
* @param <T> The type that the list being matched against will contain
*/
public static <T> Matcher<List<? extends T>> subListMatches(
- int fromIndex, int toIndex, Matcher<? super List<? super T>>
subListMatcher) {
+ int fromIndex, int toIndex, Matcher<Iterable<? extends T>>
subListMatcher) {
return new SubListMatcher<>(fromIndex, toIndex, subListMatcher);
}
public static class SubListMatcher<T> extends
TypeSafeDiagnosingMatcher<List<? extends T>> {
private final int fromIndex;
private final int toIndex;
- private final Matcher<? super List<T>> matchOnSubList;
+ private final Matcher<Iterable<? extends T>> matchOnSubList;
Review Comment:
For the same reason as the factory method, storing the matcher with an exact
generic type is unnecessarily strict; using `Matcher<? super Iterable<? extends
T>>` avoids rejecting matchers declared against supertypes of `Iterable<?
extends T>`.
##########
solr/core/gradle.lockfile:
##########
@@ -13,15 +13,16 @@
com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.22.0=compileClasspat
com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.22.0=compileClasspath,compileClasspathCopy,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
com.fasterxml.jackson:jackson-bom:2.22.0=compileClasspath,compileClasspathCopy,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
com.fasterxml.woodstox:woodstox-core:7.2.1=compileClasspath,compileClasspathCopy,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
-com.github.ben-manes.caffeine:caffeine:3.2.3=annotationProcessor,compileClasspath,compileClasspathCopy,errorprone,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testAnnotationProcessor,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
+com.github.ben-manes.caffeine:caffeine:3.2.4=annotationProcessor,compileClasspath,compileClasspathCopy,errorprone,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testAnnotationProcessor,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,errorprone,testAnnotationProcessor
-com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,testCompileClasspath
+com.github.spotbugs:spotbugs-annotations:4.10.2=compileClasspath,testCompileClasspath
com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,compileClasspathCopy,jarValidation
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,errorprone,testAnnotationProcessor
com.google.auto.value:auto-value-annotations:1.11.1=annotationProcessor,errorprone,testAnnotationProcessor
com.google.auto:auto-common:1.2.2=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_annotation:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
-com.google.errorprone:error_prone_annotations:2.47.0=annotationProcessor,compileClasspath,compileClasspathCopy,errorprone,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testAnnotationProcessor,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
+com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,compileClasspathCopy,jarValidation,runtimeClasspath,runtimeClasspathCopy,runtimeLibs,testCompileClasspath,testCompileClasspathCopy,testRuntimeClasspath,testRuntimeClasspathCopy
+com.google.errorprone:error_prone_annotations:2.49.0=annotationProcessor,errorprone,testAnnotationProcessor
Review Comment:
This lock introduces `error_prone_annotations:2.49.0`, but the repo’s
licenses folder only contains SHA1s for `error_prone_annotations-2.47.0` and
`-2.48.0` (no `-2.49.0`). This likely breaks the license/verification tasks;
please add `solr/licenses/error_prone_annotations-2.49.0.jar.sha1` (and any
required NOTICE/LICENSE updates) or keep the locked version aligned with the
tracked artifacts.
##########
gradle/libs.versions.toml:
##########
@@ -61,15 +61,15 @@ bats-file = "0.3.0"
# @keep bats-support version used in packaging
bats-support = "0.2.0"
bc-jose4j = "0.9.6"
-benmanes-caffeine = "3.2.3"
-benmanes-versions = "0.53.0"
+benmanes-caffeine = "3.2.4"
+benmanes-versions = "0.54.0"
bouncycastle = "1.84"
# @keep Browserify version used in ref-guide
browserify = "17.0.0"
Review Comment:
PR metadata says this is updating `com.google.errorprone:*` to 2.50.0 and
`org.apache.rat:apache-rat` to 0.18, but the version catalog still pins
`google-errorprone = 2.41.0` and `apache-rat = 0.15` (so lockfiles still
resolve `error_prone_core:2.41.0` and `apache-rat:0.15`). Either update those
versions + regenerate locks, or adjust the PR description to match what’s
actually being upgraded.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]