cpoerschke commented on a change in pull request #207:
URL: https://github.com/apache/solr/pull/207#discussion_r667464105
##########
File path:
solr/core/src/java/org/apache/solr/update/processor/MinFieldValueUpdateProcessorFactory.java
##########
@@ -55,20 +55,19 @@
public final class MinFieldValueUpdateProcessorFactory extends
FieldValueSubsetUpdateProcessorFactory {
@Override
- @SuppressWarnings({"unchecked"})
- public Collection<Object>
pickSubset(@SuppressWarnings({"rawtypes"})Collection values) {
- @SuppressWarnings({"rawtypes"})
- Collection result = values;
+ public <T> Collection<T> pickSubset(Collection<T> values) {
try {
+ // TODO: Verify this
// NOTE: the extra cast to Object is needed to prevent compile
// errors on Eclipse Compiler (ecj) used for javadoc lint
Review comment:
minor: once the verification is done the comment w.r.t. the extra cast
would become removable
```suggestion
// TODO: Verify this
```
##########
File path:
solr/core/src/java/org/apache/solr/update/processor/MaxFieldValueUpdateProcessorFactory.java
##########
@@ -55,20 +55,19 @@
public final class MaxFieldValueUpdateProcessorFactory extends
FieldValueSubsetUpdateProcessorFactory {
@Override
- @SuppressWarnings({"unchecked"})
- public Collection<Object>
pickSubset(@SuppressWarnings({"rawtypes"})Collection values) {
- @SuppressWarnings({"rawtypes"})
- Collection result = values;
+ public <T> Collection<T> pickSubset(Collection<T> values) {
try {
+ // TODO: Verify this
// NOTE: the extra cast to Object is needed to prevent compile
// errors on Eclipse Compiler (ecj) used for javadoc lint
Review comment:
minor: once the verification is done the comment w.r.t. the extra cast
would become removable
```suggestion
// TODO: Verify this
```
##########
File path: solr/core/src/java/org/apache/solr/search/Grouping.java
##########
@@ -642,16 +639,14 @@ protected DocList
getDocList(@SuppressWarnings({"rawtypes"})GroupDocs groups) {
return docs;
}
- @SuppressWarnings({"unchecked"})
- protected void addDocList(@SuppressWarnings({"rawtypes"})NamedList rsp
- , @SuppressWarnings({"rawtypes"})GroupDocs groups) {
+ protected void addDocList(NamedList<? super DocList> rsp, GroupDocs<?>
groups) {
Review comment:
Thanks for the explanation of `rsp` being a consumer!
It turns out human language was muddling my understanding of the PECS
(Producer Extends Consumer Super) thing i.e. adding something to `rsp` for me
somehow did not register as consumption and I somehow mistakenly had gotten the
impression that `extends` is used in `class` generics and `super` in method
arguments and that the usage means the same thing i.e. `extends` meaning but
that is not the case.
https://stackoverflow.com/questions/2723397/what-is-pecs-producer-extends-consumer-super
helped clear up my confusion.
--
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]