-
Notifications
You must be signed in to change notification settings - Fork 227
JDT Clean-up Use String.replace() instead of String.replaceAll() when #3544
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
base: master
Are you sure you want to change the base?
Conversation
|
So do you see any issues with that or not? |
|
@jjohnstn I think the change in AbstractTemplatePage are incorrect: // Before (CORRECT): // After (INCORRECT): Problem: The original code was escaping $ for regex replacement strings, not for regex patterns. In replaceAll(), the replacement string has special meaning for $ (backreferences like $1, However, String.replace() doesn't interpret $ specially in the replacement string. So while $$ will insert two literal dollar signs, the original intent was to escape one dollar sign for template syntax. Impact: This changes behavior - templates with $ will now have $$ instead of being properly escaped for the template engine. If you agree, I can open an issue in JDT UI |
|
Converting to draft so that this is not merged. |
|
I'm a big confused.... This method prints this result So I'm tying to imagine a string for which they would print out two different results... |
You're absolutely right to be confused - I made an error! Let me verify this myself: I was wrong. @jjohnstn please ignore my request. I would still wait this converting this to a real PR again, as IMHO we should not apply such clean-ups shortly before a release. |
possible In eclipse-platform#3517 we discuss which automatic clean-ups we should add. This is the result of a manual run in eclipse-platform.ui to see if this clean-up has issues. Also by running it manually before enabling the clean-ups we avoid creating PR per bundle.
23a1e0d to
c9bf7e6
Compare
possible
In #3517 we discuss which automatic clean-ups we should add. This is the result of a manual run in eclipse-platform.ui to see if this clean-up has issues. Also by running it manually before enabling the clean-ups we avoid creating PR per bundle.