-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Remove redundant escapes in regular expressions #24470
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
Remove redundant escapes in regular expressions #24470
Conversation
Whether or not it makes sense to remove those unnecessary escape sequences is (in my opinion) a matter of taste. In other words, it's technically correct to omit the escaping for a closing brace (and more concise), but many people are accustomed to escaping all special characters (opening and closing). In any case, was there a reason you did not remove all such unnecessary escaping in the |
@sbrannen But listening to your opinion, I seem to have tried to break down the style that many have. However, I think there is progress if technological pursuit is correct. What is your opinion? Apart from the earlier story, Thank you for sharing good idea. |
We discussed this within the team and decided to go ahead with this change in part to make the expressions more readable, and in part to avoid IDE warnings that add to the noise. To make matters worse, IntelliJ flags this warning while Eclipse doesn't. This means that while So we are okay with the change, but it needs to be applied consistently eveywhere. These are other classes where this exists:
Let me know if you are you going to make those changes. |
@rstoyanchev |
Yes if you'd like to, please go ahead and make those updates in this branch. I'll update the PR title accordingly to reflect the expanded scope. |
Thanks, I think the commits can be squashed. Logically it's one change applied everywhere. |
Update copy right year Remove unnecessary escaping Remove unnecessary escaping in AbstractHttpSendingTransportHandler class Remove unnecessary escaping in ClassPathResourceTests Remove unnecessary escaping in CustomizableTraceInterceptor Remove unnecessary escaping in MessageBrokerBeanDefinitionParserTests Remove unnecessary escaping in RedirectView Remove unnecessary escaping in RegexPathElement Remove unnecessary escaping in TestContextResourceUtils Remove unnecessary escaping in UriComponents Remove unnecessary escaping in UriComponentsBuilder Remove unnecessary escaping in WebSocketMessageBrokerConfigurationSupportTests
a280db9
to
9138dbc
Compare
As per the Javadoc of ConcurrentHashMap its computeIfAbsent implementation is atomic and hence already synchronized internally, so we can remove the surrounding synchronization block. See gh-24470
PR spring-projectsgh-24470 introduced a regression for Android users by no longer escaping closing curly braces in regular expressions. This commit therefore partially reverts the changes made in 273812f for closing curly braces (`}`). Closes gh27467
PR spring-projectsgh-24470 introduced a regression for Android users by no longer escaping closing curly braces in regular expressions. This commit therefore partially reverts the changes made in 273812f for closing curly braces (`}`). Closes gh27467
Remove redundant character escape in RegExp