Skip to content

String#replace(char, char) suggestion #2991

@ash211

Description

@ash211

What happened?

If String#replace(String,String) is ever called with two Strings each of length 1, then this can be replaced with the String#replace(char, char) overload that is a bit more efficient. Similarly replaceAll(String,String) takes a regex for the first String, and for simple single-char matching regexes like .replaceAll("/", ".") this can be rewritten as replace('/', '.')

What did you want to happen?

I'd like to get an auto-apply suggestion from gradle-baseline for changes like this.

See Palantir-internal gradle-plugins/conjure-backcompat/pull/1712

cc @schlosna

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions