Skip to content

Wrong param validation in SdkBytes #1145

Closed
@GuillermoBlasco

Description

@GuillermoBlasco

In line 80 of SdkBytes.java there is a param validation that does not correspond to the actual param to validate. Link

Actual code:

    public static SdkBytes fromString(String string, Charset charset) {
        Validate.paramNotNull(string, "string");
        Validate.paramNotNull(string, "charset");
        return new SdkBytes(string.getBytes(charset));
    }

Expected code:

    public static SdkBytes fromString(String string, Charset charset) {
        Validate.paramNotNull(string, "string");
        Validate.paramNotNull(charset, "charset"); // here the fix
        return new SdkBytes(string.getBytes(charset));
    }

As of seen in version 2.5.10

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