Skip to content

Commit

Permalink
Cleanup - Use StandardCharsets for UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
darxriggs committed Feb 14, 2019
1 parent eb55325 commit 79a67e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/org/jvnet/hudson/test/SingleFileSCM.java
Expand Up @@ -35,6 +35,8 @@
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.nio.charset.StandardCharsets;

import org.apache.commons.io.IOUtils;

/**
Expand All @@ -53,7 +55,7 @@ public SingleFileSCM(String path, byte[] contents) {

public SingleFileSCM(String path, String contents) throws UnsupportedEncodingException {
this.path = path;
this.contents = contents.getBytes("UTF-8");
this.contents = contents.getBytes(StandardCharsets.UTF_8);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jvnet/hudson/test/TestPluginManager.java
Expand Up @@ -36,6 +36,7 @@
import java.lang.reflect.Method;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -113,7 +114,7 @@ private Set<String> loadBundledPlugins(File fromDir) throws IOException, URISynt
// and copy them into $JENKINS_HOME/plugins.
URL index = getClass().getResource("/test-dependencies/index");
if (index!=null) {// if built with maven-hpi-plugin < 1.52 this file won't exist.
BufferedReader r = new BufferedReader(new InputStreamReader(index.openStream(),"UTF-8"));
BufferedReader r = new BufferedReader(new InputStreamReader(index.openStream(), StandardCharsets.UTF_8));
try {
String line;
while ((line=r.readLine())!=null) {
Expand Down

0 comments on commit 79a67e3

Please sign in to comment.