Add NAMESPACE and NAMESPACES to ASAtom#695
Conversation
📝 WalkthroughWalkthroughAdds many new public predefined ASAtom constants in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/org/verapdf/as/ASAtom.java`:
- Line 318: Rename the misspelled constant ASAtom.HIGHTLIGHT to ASAtom.HIGHLIGHT
and correct its value string from "Hightlight" to "Highlight"; update any usages
(e.g., the reference in PDAnnotation from ASAtom.HIGHTLIGHT to ASAtom.HIGHLIGHT)
so the annotation subtype matches the PDF spec and PDAnnotation.isMarkup() will
detect highlight annotations correctly.
In `@src/main/java/org/verapdf/pd/PDAnnotation.java`:
- Around line 40-61: The static initializer for markupAnnotationTypes references
the misspelled constant ASAtom.HIGHTLIGHT; update this to the corrected
ASAtom.HIGHLIGHT (or whatever exact identifier was fixed in ASAtom.java) inside
the static block where markupAnnotationTypes is populated to match the renamed
symbol.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b9c62b13-9cfb-4645-8399-89d7bc38a661
📒 Files selected for processing (2)
src/main/java/org/verapdf/as/ASAtom.javasrc/main/java/org/verapdf/pd/PDAnnotation.java
| public static final ASAtom HIDE_MENUBAR = new ASAtom("HideMenubar"); | ||
| public static final ASAtom HIDE_TOOLBAR = new ASAtom("HideToolbar"); | ||
| public static final ASAtom HIDE_WINDOWUI = new ASAtom("HideWindowUI"); | ||
| public static final ASAtom HIGHTLIGHT = new ASAtom("Hightlight"); |
There was a problem hiding this comment.
Critical typo: HIGHTLIGHT should be HIGHLIGHT.
The constant name and value are both misspelled as "Hightlight" instead of "Highlight". According to PDF specification, the annotation subtype is "Highlight". This typo will cause PDAnnotation.isMarkup() to incorrectly return false for valid Highlight annotations because the subtype string won't match.
🐛 Proposed fix
- public static final ASAtom HIGHTLIGHT = new ASAtom("Hightlight");
+ public static final ASAtom HIGHLIGHT = new ASAtom("Highlight");Note: After renaming, update the reference in PDAnnotation.java line 50 from ASAtom.HIGHTLIGHT to ASAtom.HIGHLIGHT.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| public static final ASAtom HIGHTLIGHT = new ASAtom("Hightlight"); | |
| public static final ASAtom HIGHLIGHT = new ASAtom("Highlight"); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/org/verapdf/as/ASAtom.java` at line 318, Rename the misspelled
constant ASAtom.HIGHTLIGHT to ASAtom.HIGHLIGHT and correct its value string from
"Hightlight" to "Highlight"; update any usages (e.g., the reference in
PDAnnotation from ASAtom.HIGHTLIGHT to ASAtom.HIGHLIGHT) so the annotation
subtype matches the PDF spec and PDAnnotation.isMarkup() will detect highlight
annotations correctly.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/java/org/verapdf/pd/PDAnnotation.java (1)
40-61: Add a small regression matrix forisMarkup().This set is now the source of truth for markup classification, so a couple of positive and negative cases would make future drift much easier to catch — for example,
HighlightandFileAttachmentshould staytrue, whileLinkandWidgetshould stayfalse.Also applies to: 103-105
🤖 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 40 - 61, Add a small regression test matrix for PDAnnotation.isMarkup() that asserts the current source-of-truth set markupAnnotationTypes (and behavior of isMarkup()) stays stable: include positive cases using ASAtom.HIGHLIGHT and ASAtom.FILE_ATTACHMENT (expect true) and negative cases using ASAtom.LINK and ASAtom.WIDGET (expect false); place tests alongside existing PDAnnotation tests (also cover the items referenced around lines 103-105) so future changes to markupAnnotationTypes or isMarkup() will fail if classification drifts.
🤖 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 40-61: Add a small regression test matrix for
PDAnnotation.isMarkup() that asserts the current source-of-truth set
markupAnnotationTypes (and behavior of isMarkup()) stays stable: include
positive cases using ASAtom.HIGHLIGHT and ASAtom.FILE_ATTACHMENT (expect true)
and negative cases using ASAtom.LINK and ASAtom.WIDGET (expect false); place
tests alongside existing PDAnnotation tests (also cover the items referenced
around lines 103-105) so future changes to markupAnnotationTypes or isMarkup()
will fail if classification drifts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 81fabbfb-61ce-4955-b59c-1f9a3c690314
📒 Files selected for processing (2)
src/main/java/org/verapdf/as/ASAtom.javasrc/main/java/org/verapdf/pd/PDAnnotation.java
Summary by CodeRabbit