commons-lang icon indicating copy to clipboard operation
commons-lang copied to clipboard

[LANG-1687] Propose update from substringBetween doc and new method

Open laurentschoelens opened this issue 1 year ago • 7 comments

Propose an update to documentation of substringBetween (treat LANG-1687) and add new method to have behaviour wanted by the user

laurentschoelens avatar Mar 14 '23 10:03 laurentschoelens

I am -1 for this new feature which feels like a super niche use case which overcomplicates the code base. I'm curious to hear what others think.

garydgregory avatar Mar 14 '23 12:03 garydgregory

HI @garydgregory thanks for the review and comment. Someone thought the stringBetween works like taking the substring between two strings, with last argument taken as far as possible, and maybe there is some use-cases, and the documentation is not clear on that.

If not adding the new function, maybe updating the documentation to make it clear what it does should be enough :)

laurentschoelens avatar Mar 14 '23 12:03 laurentschoelens

Codecov Report

Merging #1038 (3a7b485) into master (4d7e6ff) will increase coverage by 0.01%. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #1038      +/-   ##
============================================
+ Coverage     92.06%   92.08%   +0.01%     
- Complexity     7482     7486       +4     
============================================
  Files           194      194              
  Lines         15721    15727       +6     
  Branches       2897     2899       +2     
============================================
+ Hits          14474    14482       +8     
+ Misses          674      673       -1     
+ Partials        573      572       -1     
Impacted Files Coverage Δ
...ain/java/org/apache/commons/lang3/StringUtils.java 98.86% <100.00%> (+<0.01%) :arrow_up:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Mar 14 '23 12:03 codecov-commenter

seen build failed due to checkstyle violation (not having checkstyle activated on my IDE), added a fix for this

laurentschoelens avatar Mar 14 '23 13:03 laurentschoelens

@garydgregory : got an exemple for you of usage 5 * ((6 * 7 + 2) * 3) Actual method will return (6 * 7 + 2 where we would like to have (6 * 7 + 2) * 3 with params "(", ")"

laurentschoelens avatar Mar 14 '23 16:03 laurentschoelens

@garydgregory : got an exemple for you of usage 5 * ((6 * 7 + 2) * 3) Actual method will return (6 * 7 + 2 where we would like to have (6 * 7 + 2) * 3 with params "(", ")"

Hello @laurentschoelens I hope that's a random made up example because it's not a good one ;-) Expression parsing should not be hand-coded IMO, that's what Antlr and JavaCC are for...

garydgregory avatar Mar 14 '23 17:03 garydgregory

@garydgregory : got an exemple for you of usage 5 * ((6 * 7 + 2) * 3) Actual method will return (6 * 7 + 2 where we would like to have (6 * 7 + 2) * 3 with params "(", ")"

Hello @laurentschoelens I hope that's a random made up example because it's not a good one ;-) Expression parsing should not be hand-coded IMO, that's what Antlr and JavaCC are for...

Yes that is hand made but it's only to point that there could be some usage 😀

laurentschoelens avatar Mar 14 '23 17:03 laurentschoelens