Skip to content

OSM: Break out of processing a malformed level map - #5096

Merged
t2gran merged 4 commits into
opentripplanner:dev-2.xfrom
fredrik-stock:bugfix/osm_malformed_level_map
May 15, 2023
Merged

OSM: Break out of processing a malformed level map#5096
t2gran merged 4 commits into
opentripplanner:dev-2.xfrom
fredrik-stock:bugfix/osm_malformed_level_map

Conversation

@fredrik-stock

Copy link
Copy Markdown
Contributor

Summary

Prevent the OSM parser from crashing when encountering a level_map that doesn't actually include levels.

Issue

Closes #5094

Unit tests

No added tests.
Manual test was successful, new if branch triggered only on the one curre

Documentation

No documentation added, trivial change in essence amounting to a null-check before a method that crashes when supplied a null value.

@fredrik-stock
fredrik-stock requested a review from a team as a code owner May 5, 2023 20:36
@codecov

codecov Bot commented May 5, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 32.48% and project coverage change: +0.07 🎉

Comparison is base (ad3520f) 64.51% compared to head (5194a3d) 64.58%.

Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #5096      +/-   ##
=============================================
+ Coverage      64.51%   64.58%   +0.07%     
- Complexity     14031    14061      +30     
=============================================
  Files           1725     1728       +3     
  Lines          67222    67319      +97     
  Branches        7200     7206       +6     
=============================================
+ Hits           43365    43481     +116     
+ Misses         21434    21423      -11     
+ Partials        2423     2415       -8     
Impacted Files Coverage Δ
...anner/ext/legacygraphqlapi/LegacyGraphQLUtils.java 24.56% <0.00%> (ø)
...ygraphqlapi/datafetchers/LegacyGraphQLLegImpl.java 58.58% <0.00%> (+0.42%) ⬆️
...raphqlapi/generated/LegacyGraphQLDataFetchers.java 0.00% <ø> (ø)
...tripplanner/ext/transmodelapi/TransmodelGraph.java 0.00% <0.00%> (ø)
...er/ext/transmodelapi/TransmodelGraphQLPlanner.java 0.00% <0.00%> (ø)
.../support/OTPProcessingTimeoutGraphQLException.java 0.00% <0.00%> (ø)
...opentripplanner/api/common/OTPExceptionMapper.java 0.00% <0.00%> (ø)
.../opentripplanner/api/resource/PlannerResource.java 5.88% <0.00%> (+2.60%) ⬆️
...er/framework/concurrent/InterruptibleExecutor.java 0.00% <0.00%> (ø)
.../opentripplanner/framework/http/OtpHttpStatus.java 0.00% <0.00%> (ø)
... and 23 more

... and 57 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Comment thread src/main/java/org/opentripplanner/openstreetmap/issues/MalformedLevelMap.java Outdated
Comment thread src/main/java/org/opentripplanner/graph_builder/module/osm/OsmDatabase.java Outdated
@leonardehrenfried

Copy link
Copy Markdown
Member

You need to run mvn prettier:write to format the code.

@leonardehrenfried leonardehrenfried added the !Bug Apply to issues describing a bug and PRs witch fixes it. label May 11, 2023
@t2gran t2gran added this to the 2.4 (next release) milestone May 11, 2023
@t2gran
t2gran disabled auto-merge May 15, 2023 14:17
@t2gran
t2gran merged commit ebc2078 into opentripplanner:dev-2.x May 15, 2023
t2gran pushed a commit that referenced this pull request May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

!Bug Apply to issues describing a bug and PRs witch fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenStreetMapProvider - processLevelMap(...) crashes on malformed level_map relation

3 participants