RFR: 8287695: Use String.contains() instead of String.indexOf() in jdk.hotspot.agent

Chris Plummer cjplummer at openjdk.java.net
Wed Jun 1 21:03:33 UTC 2022


On Wed, 1 Jun 2022 07:52:50 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> `String.contains` was introduced in Java 5.
> Some code in jdk.hotspot.agent 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.

Please make sure you run the SA tests.

-------------

Marked as reviewed by cjplummer (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/8966


More information about the serviceability-dev mailing list