Fix parser defects (multiselect enums, image conversion, namespaces) + Maven build, CI and tests#2
Merged
Conversation
The requirement/headline/text classification relied on a hardcoded LONG-NAME substring heuristic that only fits certain tool profiles. - Add TypeClassifier strategy interface (classifySpecType, isRequirement, isSubRequirement) - Extract the historic heuristic unchanged into LongNameTypeClassifier, which remains the default - existing behavior is fully preserved - Thread the classifier through ReqIF/ReqIFz/ReqIFDocument/ ReqIFCoreContent via new constructor overloads; null falls back to the default - SpecObject delegates classification and isReq/isSubReq to the classifier; boolean-flag lookup is now null-safe for unresolved datatypes - Document usage in README and FEHLERANALYSE.md - Tests: TypeClassifierTest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011mat2d7AJkouKhXWUYzHxs
The type classification strategy now receives the fully parsed SpecObject (attribute values included), so classifiers can decide by attributes rather than only by the free-form spec type name. - TypeClassifier.classifySpecType(SpecType) -> classify(SpecObject); SpecObject classifies after its attribute values are parsed - Add ReqIFImplementationGuideClassifier: classifies by the ProSTEP Implementor Forum's standardized attribute names (ReqIF.ChapterName -> HEADLINE, ReqIF.Text -> REQ, else TEXT), tool-independent and more robust than the LONG-NAME heuristic; supports custom attribute names - LongNameTypeClassifier and the existing custom-classifier test adapted to the new signature (behavior unchanged) - Document the classification strategies in README (default heuristic, Implementation Guide classifier, custom classifier) and note that REQ/SUB-REQ/HEADLINE/TEXT are parser-internal, not official ReqIF types - Tests: ImplementationGuideClassifierTest 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.
Überblick
Dieser PR analysiert und behebt die gemeldeten Fehler im ReqIF-Parser (u. a. Multiselect-Enums und Bildkonvertierung), führt ein Maven-Build mit GitHub-Actions-Pipeline ein und sichert jeden behobenen Fehler mit Tests ab. Die vollständige Fehleranalyse liegt in
FEHLERANALYSE.md.37 Tests, alle grün (
mvn verify).Build & CI
src/main/java),pom.xml(Java 17, JUnit 5).github/workflows/ci.yml:mvn verifybei jedem Push und Pull Request, Testberichte als ArtefaktBehobene Fehler (nach Bereich)
Multiselect-Enums (gemeldet)
ENUM-VALUE-REFs gelesen; vorher überlebte nur der erste Wert.AttributeValueEnumerationführt die vollständige Werteliste (getValues()/getValueRefs());getValue()liefert kompatibel den verketteten String.DEFAULT-VALUEsind Elemente, keinTHE-VALUE-Attribut);MULTI-VALUEDist auslesbar.Bild-/Objekt-Konvertierung (gemeldet)
XHTMLElementObjectrendert gültiges Markup (data="…" type="…"), behält URI-Schrägstriche plattformübergreifend und crasht nicht mehr bei fehlendemdata-Attribut..reqifz: konsistente Map-Keys, Lookup per URI oder Dateiname; Zip-Slip-Absicherung; Streams werden geschlossen (ReqIFFile implements Closeable).Namespace-Handling & Parser-Härtung
xhtml:div,xhtml:object) überhaupt ankommt.System.exit(1)bei Parse-Fehlern →ReqIFParseException.item(1)-Indizes → minifiziertes XML wird korrekt geparst.Crash-/Robustheitsfehler
null-Key registriert.MIN/MAX/MAX-LENGTHoptional; Long-Grenzen (DOORS) laufen nicht mehr über; leere Zahlenwerte parsen als 0.SpecHierarchy.getXHTMLContent()wirft keineClassCastExceptionmehr.Specificationverarbeitet DATE/REAL-Werte; Header verkraftet Kommentare ohne „Created by:".XHTMLElement.hasChildren()korrigiert (invertierte Logik).Typklassifizierung (konfigurierbar statt hartkodiert)
TypeClassifier), die das fertig geparsteSpecObjecterhält.LongNameTypeClassifier= bisheriges Verhalten.ReqIFImplementationGuideClassifier: klassifiziert nach den standardisierten Attributnamen des ProSTEP-Implementor-Forums (ReqIF.ChapterName,ReqIF.Text) — tool-übergreifend robuster, empfohlen für DOORS-/Polarion-Exporte.REQ/SUB-REQ/HEADLINE/TEXTsind parserinterne Kategorien, keine offiziellen ReqIF-Typen.Tests
XHTMLNamespaceTest,ParserHardeningTest,MultiselectEnumTest,ImagePipelineTest,RobustnessTest,TypeClassifierTest,ImplementationGuideClassifierTestAPI-Änderungen (relevant für Nutzer)
XHTMLElementObject.getData()liefert die URI mit Schrägstrichen (vorher OS-Pfad); neu:getDataAsFilePath().DatatypeInteger.getMin()/getMax()gebenlongstattintzurück.ReqIFParseExceptionstatt die JVM zu beenden.Bewusst nicht angefasst
type-Semantik vonSpecRelation(4.3), HTML-Escaping/Attribut-Erhalt intoString()(4.8) und die kosmetischen Punkte aus Abschnitt 5 — jeweils inFEHLERANALYSE.mdbegründet.🤖 Generated with Claude Code
Generated by Claude Code