Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix loading map names with a numeric name #8774

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

DanVanAtta
Copy link
Member

@DanVanAtta DanVanAtta commented Feb 4, 2021

Fixes loading maps with names like '1941'.

When stored in game data properties, the value at some point
turns into an Integer. When extracting we attempt to cast this
to a 'String' and this then causes a ClassCastException. To fix
this, we can instead do a 'String.valueOf' rather than do an
explicit cast.

Testing

Screens Shots

Additional Notes to Reviewer

Release Note

FIX|Games with numeric names, like '1941', would not load.

Fixes loading maps with names like '1941'.

When stored in game data properties, the value at some point
turns into an Integer. When extracting we attempt to cast this
to a 'String' and this then causes a ClassCastException. To fix
this, we can instead do a 'String.valueOf' rather than do an
explicit cast.
@codecov
Copy link

codecov bot commented Feb 4, 2021

Codecov Report

Merging #8774 (4bafdf7) into master (caa2068) will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #8774   +/-   ##
=========================================
  Coverage     25.24%   25.24%           
- Complexity     7502     7503    +1     
=========================================
  Files          1297     1297           
  Lines         80768    80768           
  Branches      11048    11048           
=========================================
  Hits          20391    20391           
+ Misses        58289    58288    -1     
- Partials       2088     2089    +1     
Impacted Files Coverage Δ Complexity Δ
...main/java/games/strategy/triplea/ui/UiContext.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/ui/unit/scroller/AvatarCoordinateCalculator.java 69.23% <0.00%> (-15.39%) 5.00% <0.00%> (-1.00%)
...egate/power/calculator/MainDefenseCombatValue.java 76.08% <0.00%> (+2.17%) 11.00% <0.00%> (+2.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update caa2068...4bafdf7. Read the comment docs.

@DanVanAtta DanVanAtta merged commit 76dea10 into master Feb 4, 2021
@DanVanAtta DanVanAtta deleted the fix-loading-numeric-map-names branch February 4, 2021 19:00
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