Skip to content

Parse a parking that has no ParentSiteRef - #339

Open
teppope wants to merge 1 commit into
entur:masterfrom
tmfg:fix/parking-without-parent-site-ref
Open

teppope wants to merge 1 commit into
entur:masterfrom
tmfg:fix/parking-without-parent-site-ref

Conversation

@teppope

@teppope teppope commented Oct 30, 2026

Copy link
Copy Markdown

Summary

  • SiteFrameParser no longer throws a NullPointerException when a Parking has no ParentSiteRef.
  • The parser adds every Parking to the parking index. It adds a Parking to the index by parent site only when the Parking has a ParentSiteRef.

Issue

The NeTEx Nordic profile makes ParentSiteRef optional on a Parking. A file with a standalone Parking stopped the whole parse. The Parking example for a park-and-ride proposal on entur/profile-examples has no ParentSiteRef, and the parser could not read it.

Verification

  • ✅ Nordic NeTEx Profile: the stops document, Site, gives ParentSiteRef the cardinality 0:1. Parking inherits it from Site.
  • ✅ New test SiteFrameParserTest fails without the fix: NullPointerException: Cannot invoke "SiteRefStructure.getRef()" because the return value of "Parking.getParentSiteRef()" is null, at SiteFrameParser.parseParkings.
  • ✅ With the fix, the test passes. mvn verify -P prettierCheck passes, with 36 tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@teppope
teppope marked this pull request as ready for review October 30, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant