uschindler commented on code in PR #13328:
URL: https://github.com/apache/lucene/pull/13328#discussion_r1584314019


##########
lucene/core/src/java/org/apache/lucene/codecs/TermStats.java:
##########
@@ -16,24 +16,10 @@
  */
 package org.apache.lucene.codecs;
 
-import org.apache.lucene.index.TermsEnum; // javadocs
-
 /**
  * Holder for per-term statistics.
  *
- * @see TermsEnum#docFreq
- * @see TermsEnum#totalTermFreq
+ * @param docFreq How many documents have at least one occurrence of this term.
+ * @param totalTermFreq Total number of times this term occurs across all 
documents in the field.
  */
-public class TermStats {
-  /** How many documents have at least one occurrence of this term. */
-  public final int docFreq;
-
-  /** Total number of times this term occurs across all documents in the 
field. */
-  public final long totalTermFreq;
-
-  /** Sole constructor. */
-  public TermStats(int docFreq, long totalTermFreq) {
-    this.docFreq = docFreq;
-    this.totalTermFreq = totalTermFreq;
-  }
-}
+public record TermStats(int docFreq, long totalTermFreq) {}

Review Comment:
   Maybe as a quick fix we can exclude analysis of record ctors and methods 
until we have a fix for that. Let's rename that method to `isSyntheticMethod` 
(remove "enum" from name):
   
https://github.com/apache/lucene/blob/9af3ef8952597ead37a5a9ce5373ed3bbd40238e/dev-tools/missing-doclet/src/main/java/org/apache/lucene/missingdoclet/MissingDoclet.java#L274-L282
   
   and modify it:
   
   ```java
     private boolean isSyntheticMethod(Element element) {
       if (element.getEnclosingElement().getKind() == ElementKind.RECORD) {
         // TODO: fix this to exclude autogenerated accessors and ctors of 
records, which is hard
         return true;
       }
       String simpleName = element.getSimpleName().toString();
       if (simpleName.equals("values") || simpleName.equals("valueOf")) {
         if (element.getEnclosingElement().getKind() == ElementKind.ENUM) {
           return true;
         }
       }
       return false;
     }
   ```



-- 
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