Skip to content

URLEncoder.encode(String, String) false positive #5558

@rdehuyss

Description

@rdehuyss

We're using the following code in our project:

return URLEncoder.encode(string, UTF_8.name());

When using errorprone with gradle we get a warning message that is obsolete. This is not the case however.

Build output

     /jobrunr/core/src/main/java/org/jobrunr/utils/StringUtils.java:112: warning: [JdkObsolete] Use URLEncoder.encode(String, Charset) instead.
            return URLEncoder.encode(string, UTF_8.name());
                                    ^
    (see https://errorprone.info/bugpattern/JdkObsolete)

Our setup:

plugins {
    id 'net.ltgt.errorprone' version '5.1.0' apply false
}

dependencies {
   errorprone 'com.google.errorprone:error_prone_core:2.48.0'
}

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