Use Long instead of primitive for dataStreamLength - #711
Conversation
📝 WalkthroughWalkthrough
ChangesInline image length contract
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/org/verapdf/pd/images/PDInlineImage.java (1)
46-54: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPreserve the primitive constructor for binary compatibility.
Changing the public
dataStreamLengthparameter fromlongtoLongchanges the JVM constructor descriptor. Existing compiled consumers calling the old constructor can fail withNoSuchMethodError; autoboxing only helps code recompiled from source.Proposed compatibility overload
+ public PDInlineImage(COSObject obj, PDResources imageResources, + PDResources pageResources, long dataStreamLength) { + this(obj, imageResources, pageResources, Long.valueOf(dataStreamLength)); + } + public PDInlineImage(COSObject obj, PDResources imageResources, PDResources pageResources, Long dataStreamLength) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/org/verapdf/pd/images/PDInlineImage.java` around lines 46 - 54, Restore the public PDInlineImage constructor overload that accepts primitive long to preserve its existing JVM descriptor. Keep the Long-based constructor for nullable values, and have the primitive overload delegate to the Long constructor while preserving the existing initialization of dataStreamLength.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/main/java/org/verapdf/pd/images/PDInlineImage.java`:
- Around line 46-54: Restore the public PDInlineImage constructor overload that
accepts primitive long to preserve its existing JVM descriptor. Keep the
Long-based constructor for nullable values, and have the primitive overload
delegate to the Long constructor while preserving the existing initialization of
dataStreamLength.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 00f26091-ff1f-4b1b-98b2-ba6c1cf5dc20
📒 Files selected for processing (1)
src/main/java/org/verapdf/pd/images/PDInlineImage.java
Summary by CodeRabbit