jpountz commented on code in PR #12111:
URL: https://github.com/apache/lucene/pull/12111#discussion_r1086310610


##########
lucene/core/src/java/org/apache/lucene/codecs/BufferingKnnVectorsWriter.java:
##########
@@ -39,79 +37,81 @@
  * @lucene.experimental
  */
 public abstract class BufferingKnnVectorsWriter extends KnnVectorsWriter {
-  private final List<FieldWriter> fields = new ArrayList<>();
+  private final List<FieldWriter<?>> fields = new ArrayList<>();
 
   /** Sole constructor */
   protected BufferingKnnVectorsWriter() {}
 
   @Override
-  public KnnFieldVectorsWriter<float[]> addField(FieldInfo fieldInfo) throws 
IOException {
-    FieldWriter newField = new FieldWriter(fieldInfo);
+  public KnnFieldVectorsWriter<?> addField(FieldInfo fieldInfo) throws 
IOException {

Review Comment:
   Unrelated: your change reminds me that I'd rather like to split this method 
in two: `KnnFieldVectorsWriter<float[]> addFloatField` and 
`KnnFieldVectorsWriter<byte[]> addByteField`. Otherwise we can never take 
advantage of the type safety of generics? This is a codec internal rather than 
something user-facing so we can look into it after 9.5.



-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to