commons-configuration
commons-configuration copied to clipboard
Guard MapConfiguration against null maps
MapConfiguration has a protected property map, which is provided upon instantiation and cannot be changed later. The lack of null guards for this property leads to inevitable NPEs at an undetermined later time. This PR implements a fail-fast guard.
@pingpingy1 This PR does not even compile:
Error: COMPILATION ERROR :
[INFO] -------------------------------------------------------------
Error: /home/runner/work/commons-configuration/commons-configuration/src/test/java/org/apache/commons/configuration2/TestMapConfiguration.java:[161,57] reference to MapConfiguration is ambiguous
both constructor MapConfiguration(java.util.Map<java.lang.String,?>) in org.apache.commons.configuration2.MapConfiguration and constructor MapConfiguration(java.util.Properties) in org.apache.commons.configuration2.MapConfiguration match
Run mvn by itself to run all build checks.
@pingpingy1 Please address my comments.
@garydgregory Sorry for the trouble. I clearly wasn't thinking straight when I made this PR. I think I corrected the test case with this commit.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 89.08%. Comparing base (
ad9eaa0) to head (98c291c). Report is 74 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #381 +/- ##
============================================
- Coverage 89.09% 89.08% -0.01%
- Complexity 3536 3537 +1
============================================
Files 183 183
Lines 9635 9641 +6
Branches 1192 1196 +4
============================================
+ Hits 8584 8589 +5
+ Misses 772 771 -1
- Partials 279 281 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@pingpingy1 Would you please rebase on master?
@garydgregory Done! PTAL