Add isVisibleAnnotation method#702
Conversation
📝 WalkthroughWalkthroughA new static utility method Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/java/org/verapdf/pd/PDAnnotation.java (1)
327-330: Reuse existing flag helper instead of hardcoded mask.Line 329 duplicates
F-bit parsing already centralized inisHidden()/getFlagValue(int). Using the existing helper keeps behavior consistent if flag handling changes later.Proposed refactor
public static boolean isVisibleAnnotation(PDAnnotation annotation) { - Long f = annotation.getIntegerKey(ASAtom.F); - return (f == null || (f & 2) != 2); + return !annotation.isHidden(); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/org/verapdf/pd/PDAnnotation.java` around lines 327 - 330, The method isVisibleAnnotation currently reimplements the F flag bitmask; instead call the existing helper instead to keep behavior consistent: replace the manual mask with the centralized flag logic by returning !annotation.isHidden() (or, if you prefer, using annotation.getFlagValue(2) via the existing getFlagValue(int) helper) so visibility uses the same flag-parsing as isHidden()/getFlagValue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/main/java/org/verapdf/pd/PDAnnotation.java`:
- Around line 327-330: The method isVisibleAnnotation currently reimplements the
F flag bitmask; instead call the existing helper instead to keep behavior
consistent: replace the manual mask with the centralized flag logic by returning
!annotation.isHidden() (or, if you prefer, using annotation.getFlagValue(2) via
the existing getFlagValue(int) helper) so visibility uses the same flag-parsing
as isHidden()/getFlagValue.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1788f61f-bd2a-4787-9678-83e58ac6d384
📒 Files selected for processing (1)
src/main/java/org/verapdf/pd/PDAnnotation.java
Summary by CodeRabbit