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

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

laurentschoelens
Copy link
Contributor

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

@garydgregory
Copy link
Member

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.

@laurentschoelens
Copy link
Contributor Author

laurentschoelens commented Mar 14, 2023

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 :)

@codecov-commenter
Copy link

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%) ⬆️

... and 1 file with indirect coverage changes

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

@laurentschoelens
Copy link
Contributor Author

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

@laurentschoelens
Copy link
Contributor Author

laurentschoelens commented Mar 14, 2023

@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 "(", ")"

@garydgregory
Copy link
Member

@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...

@laurentschoelens
Copy link
Contributor Author

@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 laurentschoelens changed the title LANG-1687 : Propose update from substringBetween doc and new method [LANG-1687] Propose update from substringBetween doc and new method Mar 14, 2023
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.

3 participants