spring-shell icon indicating copy to clipboard operation
spring-shell copied to clipboard

Allow empty input with double quotes.

Open lifenjoy51 opened this issue 6 years ago • 1 comments
trafficstars

Empty input with double quotes("") was not allowed because of filtering empty string in StandardParameterResolver.resolve(). Assuming ShellMethod test(String a, @ShellOption(defaultValue = "") String b) and input 'test "" B'. Expected parameter is (a="", b="B"). But result is (a="B", b=""). So I remove filtering in StandardParameterResolver.resolve().

And remove unnecessary code.

I tested few method and It seems fine. But I am worrying about side effects. Please check my modification.

lifenjoy51 avatar Jan 25 '19 14:01 lifenjoy51

Codecov Report

Merging #249 into master will decrease coverage by 0.03%. The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #249      +/-   ##
============================================
- Coverage     48.91%   48.87%   -0.04%     
+ Complexity      252      250       -2     
============================================
  Files            53       53              
  Lines          1333     1332       -1     
  Branches        204      204              
============================================
- Hits            652      651       -1     
  Misses          625      625              
  Partials         56       56
Impacted Files Coverage Δ Complexity Δ
...work/shell/standard/StandardParameterResolver.java 84.54% <0%> (-0.07%) 64 <1> (-2)

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 5ec5899...9fbff08. Read the comment docs.

codecov-io avatar Jan 25 '19 14:01 codecov-io