Add error analysis of ReqIF parser#1
Merged
Conversation
Documents all identified defects, grouped by severity: - Multiselect enums: only first ENUM-VALUE-REF is parsed, single-string data model, lost enum defaults - Image/object conversion: invalid toString output, path separator corruption, namespace prefix mismatch, broken picture map lookup, resource leaks, zip-slip - Crashes on valid files: null map key for unknown datatypes, missing null checks, NumberFormatExceptions, ClassCastException in getXHTMLContent, System.exit in library code - Robustness and code quality issues Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
- Move sources to standard Maven layout (src/main/java) - Add pom.xml (Java 17, JUnit 5, Surefire) - Add CI workflow running mvn verify on every push and pull request Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
- Parse documents namespace-aware and match XHTML elements by local name, so prefixed content (xhtml:div, reqif-xhtml:object, ...) is no longer dropped or causes NPEs - Expose XHTML tag names without namespace prefix - Replace System.exit(1) on parse errors with ReqIFParseException - Disallow DOCTYPE and external entities (XXE hardening) - Navigate TYPE/DEFINITION/DEFAULT-VALUE/SPEC-ATTRIBUTES by element instead of fixed child indices, so minified XML no longer breaks - Add XmlUtils helper for namespace/whitespace-independent DOM access - Tests: XHTMLNamespaceTest, ParserHardeningTest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
- Read ALL ENUM-VALUE-REF children of an enumeration attribute value; previously only the first selected value survived parsing - AttributeValueEnumeration now carries the full value list (getValues/ getValueRefs); getValue() returns the joined string for compatibility - AttributeDefinitionEnumeration resolves DEFAULT-VALUE enum refs (they are elements, not a THE-VALUE attribute) and exposes MULTI-VALUED - Rewrite DatatypeEnumeration parsing: element-based navigation instead of fixed child indices, optional LONG-NAME/KEY/OTHER-CONTENT handled - Null-safe enum lookups in DatatypeEnumeration and SpecType (unknown ids no longer throw NPE) - Tests: MultiselectEnumTest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
- XHTMLElementObject renders a valid data="..." attribute (plus type), keeps URI forward slashes on every platform and no longer NPEs when the data attribute is missing; adds getMimeType/getDataAsFilePath - Restore the dead XHTML deconstruction mapping so P/TBL/L/H/OBJ tokens (including image paths) are extracted again; expose getElementList() - Fix picture association: consistent map keys (full document name) with extension-less fallback, lookup by object data URI or plain file name - ReqIFz: guard against zip-slip, close streams while extracting, drop unused swing import; ReqIF/ReqIFz path handling no longer breaks on dots or mixed separators in paths - ReqIFFile implements Closeable so picture streams can be released - Fix var extraction in list items reading the wrong node - Tests: ImagePipelineTest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
- ReqIFCoreContent: register unknown datatypes under their ID instead of a null key; treat MIN/MAX/MAX-LENGTH as optional - DatatypeInteger: long-range bounds with BigInteger clamping (DOORS exports exceed int); DatatypeString: missing MAX-LENGTH = unbounded - AttributeValueInteger/Double: empty THE-VALUE parses as 0 instead of NumberFormatException - SpecHierarchy.getXHTMLContent: return the element list via its getter (the former cast threw ClassCastException on every call) - Specification: parse DATE and REAL attribute values (formerly dropped), fill DATE/DOUBLE defaults, fail with ExceptionSpecObject instead of NPE on unresolvable datatypes; null-safe getAttribute/getDescription - SpecObject: null-safe getAttribute, consistent empty REAL handling - ReqIFHeader: no crash on comments without 'Created by:' or unexpected CREATION-TIME formats - XHTMLElement.hasChildren: fix inverted logic - Remove unused javax.xml.crypto.Data import - Tests: RobustnessTest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
… README Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Documents all identified defects, grouped by severity:
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs