Skip to content

Reliance on Default Encoding #130

@jonknight73

Description

@jonknight73

There are 2 instances of reliance on default encoding reported in FindBugs run on the Master branch.

Reliance on default encoding

Found a call to a method which will perform a byte to String (or String to byte) conversion, and will assume that the default platform encoding is suitable. This will cause the application behaviour to vary between platforms. Use an alternative API and specify a charset name or Charset object explicitly.
 
Bug kind and pattern: Dm - DM_DEFAULT_ENCODING

Line 265 in org.alfasoftware.morf.xml.ViewURLAsFile

      String basicAuth = "Basic " + new String(Base64.getEncoder().encode(userpass.getBytes(StandardCharsets.UTF_8)));

And line 288 in org.alfasoftware.morf.metadata.ValueConverters

      return new String(Base64.getEncoder().encode(value));

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