Skip to content

Parse a parking that has no ParentSiteRef - #339

Merged
vpaturet merged 2 commits into
entur:masterfrom
tmfg:fix/parking-without-parent-site-ref
Nov 26, 2026
Merged

vpaturet merged 2 commits into
entur:masterfrom
tmfg:fix/parking-without-parent-site-ref

Conversation

@teppope

@teppope teppope commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

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
@testower
testower requested a review from vpaturet November 19, 2026 09:45
@codecov-commenter

codecov-commenter commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.41%. Comparing base (e56f382) to head (9043921).
⚠️ Report is 94 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #339      +/-   ##
============================================
- Coverage     89.28%   88.41%   -0.88%     
- Complexity      241      244       +3     
============================================
  Files            16       17       +1     
  Lines           821      837      +16     
  Branches         63       71       +8     
============================================
+ Hits            733      740       +7     
- Misses           63       65       +2     
- Partials         25       32       +7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vpaturet
vpaturet merged commit e7bb506 into entur:master Nov 26, 2026
1 check passed
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.

4 participants