RFR: 8274496: Use String.contains() instead of String.indexOf() in java.desktop

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Wed Sep 29 08:39:09 UTC 2021


String.contains was introduced in Java 5.
Some code in java.desktop 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.

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

Commit messages:
 - [PATCH] Use String.contains() instead of String.indexOf() in java.desktop

Changes: https://git.openjdk.java.net/jdk/pull/5565/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5565&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8274496
  Stats: 59 lines in 10 files changed: 0 ins; 6 del; 53 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5565.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5565/head:pull/5565

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



More information about the client-libs-dev mailing list