RFR: 8274949: Use String.contains() instead of String.indexOf() in java.base
Weijun Wang
weijun at openjdk.java.net
Fri Oct 8 07:29:27 UTC 2021
On Fri, 17 Sep 2021 08:56:47 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:
> String.contains was introduced in Java 5.
> Some code in java.base still uses old approach with `String.indexOf` to check if String contains specified substring.
> I propose to migrate such usages. Makes code shorter and easier to read.
security-related change looks fine.
-------------
Marked as reviewed by weijun (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5559
More information about the security-dev
mailing list