Skip to content

Conversation

@FiberMan
Copy link

This PR adds a null check for the frames field in CompositeFrame to safely handle cases where a CompositeFrame has a null frames property. At Dat.mobility, we frequently parse NeTEx data containing CompositeFrames with empty "frames" fields, which currently causes errors in the parser.

This fix allows us to use the netex-parser-java library as a regular Maven dependency without needing a forked version just to handle this edge case. The change is minimal but improves robustness when dealing with real-world NeTEx data that may not strictly follow the schema.

@testower testower requested a review from vpaturet April 22, 2025 12:56
@vpaturet
Copy link
Contributor

This looks good.
We use prettier for code formatting. Could you please run the unit tests locally in Maven: this will automatically reformat the code (and fix the indentation errors reported by @testower )
You may have to rebase your PR on the latest version of the master branch, we have just fixed an error in the Maven configuration.

@FiberMan FiberMan force-pushed the handle-missing-frames branch from 34e61c5 to 49eca92 Compare May 1, 2025 09:05
@FiberMan
Copy link
Author

FiberMan commented May 1, 2025

Fixed formatting. Thanks!

@FiberMan FiberMan requested a review from testower May 2, 2025 07:48
@testower testower closed this May 2, 2025
@testower testower reopened this May 2, 2025
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (master@1201b9e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...entur/netex/loader/parser/NetexDocumentParser.java 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master     #240   +/-   ##
=========================================
  Coverage          ?   89.62%           
  Complexity        ?      235           
=========================================
  Files             ?       16           
  Lines             ?      800           
  Branches          ?       60           
=========================================
  Hits              ?      717           
  Misses            ?       56           
  Partials          ?       27           

☔ View full report in Codecov by Sentry.
📢 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.

@testower testower merged commit a8a7edb into entur:master May 2, 2025
2 of 3 checks 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.

5 participants