voonhous commented on code in PR #18944:
URL: https://github.com/apache/hudi/pull/18944#discussion_r3385404420


##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieLogBlock.java:
##########
@@ -65,32 +70,24 @@ public abstract class HoodieLogBlock {
    */
   public static int version = 3;

Review Comment:
   Good catch. Audited the call sites and `null` is actually expected on the 
read path: `HoodieLogFileReader#readBlock` passes `footer = null` for log 
format v2/v3 blocks (`hasFooter()` is only true for v1) and `header = null` for 
legacy v0 blocks. Since Lombok generates a runtime null check in the 
constructor (unlike `javax.annotation.Nonnull`, which is static-analysis only), 
this would have caused an NPE on every modern log block read.
   
   Reverted to `javax.annotation.Nonnull` on the fields to keep this a pure 
refactor. Lombok copies this annotation to the generated constructor parameters 
(it is on Lombok's default copyable-annotations list), so the original 
static-analysis contract is preserved with no runtime behavior change.



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

Reply via email to