Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reliance on Default Encoding #130

Open
jonknight73 opened this issue Sep 24, 2020 · 0 comments
Open

Reliance on Default Encoding #130

jonknight73 opened this issue Sep 24, 2020 · 0 comments

Comments

@jonknight73
Copy link
Contributor

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));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant