RFR: JDK-8291509 Minor cleanup could be done in sun.security [v6]
Weijun Wang
weijun at openjdk.org
Tue Sep 6 22:01:53 UTC 2022
On Tue, 6 Sep 2022 20:36:27 GMT, Sean Mullan <mullan at openjdk.org> wrote:
>> My understanding: In regex, there is no need to escape `"`, so `"` is the same as `"`.
>
> Ok,but the regex is `"\\""`, so shouldn't it keep the double-backslash at the beginning (`\`)?, i.e.:
>
> `...replaceAll("\"", "\\\\\\""));`
The regex `"` is enough, so as a Java string it is `"""`.
Before this code change, we thought the regex should be `"` (not wrong, just wasteful), and we wrote it as `"\\""` in Java.
The replacement string is another thing and the quotation mark is also not special there, but IJ has not given any suggestion.
-------------
PR: https://git.openjdk.org/jdk/pull/9972
More information about the security-dev
mailing list