You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "gianmarcoschifone (via GitHub)" <gi...@apache.org> on 2025/12/21 15:12:43 UTC

[PR] Fix Javadoc parsing issues for Checkstyle [kafka]

gianmarcoschifone opened a new pull request, #21200:
URL: https://github.com/apache/kafka/pull/21200

   ### Summary
   
   This PR fixes Javadoc issues exposed by the updated Checkstyle Javadoc parser, specifically in relation to `UnusedImportsCheck`.
   
   ### Details
   
   After updating Checkstyle, several Javadocs started failing parsing and caused false positives in `UnusedImportsCheck`.  
   The root cause is stricter Javadoc parsing introduced in Checkstyle (see https://github.com/checkstyle/checkstyle/pull/18059), where malformed HTML and invalid `{@link}` usages prevent the parser from correctly identifying type references.
   
   The fixes in this PR:
   - Correct malformed HTML in Javadocs (for example invalid `<ul>/<li>` structures and unclosed tags).
   - Fix invalid `{@link}` syntax
   - Ensure referenced types are properly resolvable by the Javadoc parser so that imports are correctly detected as used.
   
   There are no behavioral or API changes. All modifications are limited to Javadoc formatting and correctness.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Fix Javadoc parsing issues for Checkstyle [kafka]

Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield merged PR #21200:
URL: https://github.com/apache/kafka/pull/21200


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] Fix Javadoc parsing issues for Checkstyle [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21200:
URL: https://github.com/apache/kafka/pull/21200#issuecomment-3695353387

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Fix Javadoc parsing issues for Checkstyle [kafka]

Posted by "gianmarcoschifone (via GitHub)" <gi...@apache.org>.
gianmarcoschifone commented on code in PR #21200:
URL: https://github.com/apache/kafka/pull/21200#discussion_r2658297509


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -452,7 +452,7 @@
  *       this.consumer = consumer;
  *     }
  *
- *     {@literal}@Override
+ *     {@literal @Override}

Review Comment:
   Oh, I see it now. IntelliJ renders it as you said. Javadoc tool renders it correctly though



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Fix Javadoc parsing issues for Checkstyle [kafka]

Posted by "gianmarcoschifone (via GitHub)" <gi...@apache.org>.
gianmarcoschifone commented on code in PR #21200:
URL: https://github.com/apache/kafka/pull/21200#discussion_r2658286001


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -452,7 +452,7 @@
  *       this.consumer = consumer;
  *     }
  *
- *     {@literal}@Override
+ *     {@literal @Override}

Review Comment:
   Thanks for review. I'm sorry, I'm not sure about what you mean, this is how I see the javadoc. Where is it not aligned?
   <img width="651" height="460" alt="image" src="https://github.com/user-attachments/assets/29f151f5-5177-4ffd-9a5d-e73eb088f4fd" />
   



-- 
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: jira-unsubscribe@kafka.apache.org

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


Re: [PR] Fix Javadoc parsing issues for Checkstyle [kafka]

Posted by "AndrewJSchofield (via GitHub)" <gi...@apache.org>.
AndrewJSchofield commented on code in PR #21200:
URL: https://github.com/apache/kafka/pull/21200#discussion_r2658171688


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -452,7 +452,7 @@
  *       this.consumer = consumer;
  *     }
  *
- *     {@literal}@Override
+ *     {@literal @Override}

Review Comment:
   nit: Because there's a space in the literal text, the resulting `@Override` appears not to be aligned in the example code. It's a bit messy, but perhaps remove one of the spaces before the `@{literal`??



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java:
##########
@@ -171,9 +170,8 @@ protected synchronized void closeInternal(Timer timer) {
     }
 
     /**
-     * Creates the {@link FetchRequest.Builder fetch request},
-     * {@link NetworkClient#send(ClientRequest, long) enqueues/sends it, and adds the {@link RequestFuture callback}
-     * for the response.
+     * Creates the {@link FetchRequest.Builder fetch request}, {@link NetworkClient#send(ClientRequest, long)}
+     * enqueues/sends it, and adds the {@link RequestFuture} callback for the response.

Review Comment:
   This change does not need like an improvement to me.



##########
clients/src/main/java/org/apache/kafka/common/utils/Utils.java:
##########
@@ -1406,7 +1406,7 @@ public static Set<Byte> from32BitField(final int intValue) {
      * @param <K> The Map key type

Review Comment:
   nit: While you're in here, this javadoc comment contains a numbered list which is not formatted accordingly, and uses blank lines to make paragraphs.



##########
streams/src/main/java/org/apache/kafka/streams/state/internals/TimestampedKeyAndJoinSideDeserializer.java:
##########
@@ -27,7 +27,8 @@
 import static org.apache.kafka.streams.kstream.internals.WrappingNullableUtils.initNullableDeserializer;
 
 /**
- * The deserializer that is used for {@link TimestampedKeyAndJoinSide}, which is a combo key format of <timestamp, left/right flag, raw-key>
+ * The deserializer that is used for {@link TimestampedKeyAndJoinSide}, which is a combo key format of
+ * {@code <timestamp, left/right flag, raw-key>}

Review Comment:
   Let's have a `.` on the end of the sentence please.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaShareConsumer.java:
##########
@@ -345,7 +345,7 @@
  *       this.consumer = consumer;
  *     }
  *
- *     {@literal}@Override
+ *     {@literal @Override}

Review Comment:
   And here.



##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/assignor/RangeAssignor.java:
##########
@@ -53,7 +53,7 @@
  *
  * <p>The co-partitioned assignment will be:
  * <ul>
- * <li<code>    M0: [T1P0, T1P1, T2P0, T2P1]    </code></li>
+ * <li><code>    M0: [T1P0, T1P1, T2P0, T2P1]    </code></li>

Review Comment:
   nit: Tidier with a space removed before "M0".



##########
streams/src/main/java/org/apache/kafka/streams/state/internals/TimestampedKeyAndJoinSide.java:
##########
@@ -27,7 +27,7 @@
  * access the key of the other processor.
  *

Review Comment:
   Probably ought to be a paragraph here.



##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LocalLog.java:
##########
@@ -889,7 +889,7 @@ public static LogSegment createNewCleanedSegment(File dir, LogConfig logConfig,
      * <br/>

Review Comment:
   This would read better with a `<p>` rather than `<br/>` I think. 



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchCollector.java:
##########
@@ -78,8 +78,6 @@ public FetchCollector(final LogContext logContext,
      * Return the fetched {@link ConsumerRecord records}, empty the {@link FetchBuffer record buffer}, and
      * update the consumed position.
      *
-     * </p>
-     *

Review Comment:
   We do want the NOTE in a new paragraph.



##########
streams/src/main/java/org/apache/kafka/streams/state/internals/TimestampedKeyAndJoinSideSerializer.java:
##########
@@ -27,7 +27,8 @@
 import static org.apache.kafka.streams.kstream.internals.WrappingNullableUtils.initNullableSerializer;
 
 /**
- * The serializer that is used for {@link TimestampedKeyAndJoinSide}, which is a combo key format of <timestamp, left/right flag, raw-key>
+ * The serializer that is used for {@link TimestampedKeyAndJoinSide}, which is a combo key format of
+ * {@code <timestamp, left/right flag, raw-key>}

Review Comment:
   And a `.` too here please.



-- 
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: jira-unsubscribe@kafka.apache.org

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