Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public static String getRunStateString(int state) {
case ServerManagementAPIConstants.STATE_STOPPING:
stateString = "stopping";
break;

default:
break;
}
return stateString;
}
Expand All @@ -149,7 +150,8 @@ public static String getPublishStateString(int state) {
case ServerManagementAPIConstants.PUBLISH_STATE_UNKNOWN:
stateString = "unknown";
break;

default:
break;
}
return stateString;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.io.Console;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
Expand Down Expand Up @@ -113,7 +114,7 @@ protected String getUserInput() {
}
}
if (scanner == null) {
scanner = new Scanner(System.in);
scanner = new Scanner(System.in, StandardCharsets.UTF_8);
}
return scanner.nextLine();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -825,11 +825,9 @@ protected ServerHandle findServer(String id, ServerManagementClientLauncher laun

protected void printAttr(Attributes attr) {
Map<String, Attribute> map = attr.getAttributes();
Iterator<String> kit = map.keySet().iterator();
while (kit.hasNext()) {
String key = kit.next();
Attribute val = map.get(key);
System.out.println(key);
for (Map.Entry<String, Attribute> entry : map.entrySet()) {
Attribute val = entry.getValue();
System.out.println(entry.getKey());
System.out.println(" type=" + val.getType());
System.out.println(" desc=" + val.getDescription());
System.out.println(" defaultVal=" + val.getDefaultVal());
Expand Down Expand Up @@ -929,14 +927,12 @@ private static void handleSinglePrompt(WorkflowResponseItem item, HashMap<String
}

private ServerManagementClientLauncher launcher;
private InputProvider provider;
private PromptAssistant assistant;
private boolean done = false;
private boolean shown = false;

public StandardCommandHandler(ServerManagementClientLauncher launcher, InputProvider provider) {
this.launcher = launcher;
this.provider = provider;
this.assistant = new PromptAssistant(launcher, provider);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
Expand Down Expand Up @@ -145,11 +144,8 @@ public static String[] convertEnvironment(Map<String, String> env) {

// Convert the combined map into a form that can be used to launch process
ArrayList<String> ret = new ArrayList<>();
Iterator<String> it = original.keySet().iterator();
String working = null;
while (it.hasNext()) {
working = it.next();
ret.add(working + "=" + original.get(working)); //$NON-NLS-1$
for (Map.Entry<String, String> entry : original.entrySet()) {
ret.add(entry.getKey() + "=" + entry.getValue()); //$NON-NLS-1$
}
return ret.toArray(new String[ret.size()]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -45,7 +46,7 @@ private synchronized List<String> getList() {
@Override
public void run() {
try {
InputStreamReader isr = new InputStreamReader(is);
InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8);
BufferedReader br = new BufferedReader(isr);
String line = null;
while (!isCanceled() && (line = br.readLine()) != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.HttpURLConnection;
import java.nio.charset.StandardCharsets;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLDecoder;
Expand Down Expand Up @@ -473,8 +474,8 @@ private HttpURLConnection getURLConnection(URL url, String user, String pass, in
HttpURLConnection.setFollowRedirects(true);
if( user != null && pass != null ) {
String authString = user + ":" + pass;
byte[] authEncBytes = Base64.getEncoder().encode(authString.getBytes());
String authStringEnc = new String(authEncBytes);
byte[] authEncBytes = Base64.getEncoder().encode(authString.getBytes(StandardCharsets.UTF_8));
String authStringEnc = new String(authEncBytes, StandardCharsets.UTF_8);
urlConnection.setRequestProperty("Authorization", "Basic " + authStringEnc);
}
return urlConnection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -273,11 +272,10 @@ protected String[] prependJREPath(String[] env, IPath jdkpath) {
if(env == null){
Map<String, String> map = NativeEnvironmentUtils.getDefault().getNativeEnvironment();
env = new String[map.size()];
String var = null;
int index = 0;
for(Iterator<String> iter = map.keySet().iterator(); iter.hasNext();) {
var = iter.next();
String value = map.get(var);
for(Map.Entry<String, String> entry : map.entrySet()) {
String var = entry.getKey();
String value = entry.getValue();
if (value == null) {
value = ""; //$NON-NLS-1$
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.nio.charset.StandardCharsets;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
Expand Down Expand Up @@ -296,7 +297,7 @@ private HashMap<String, String> parseSysprops(IProcess process, String text) thr
HashMap<String, String> map = new HashMap<String, String>();
try {
DocumentBuilder parser = getParser();
Document document = parser.parse(new ByteArrayInputStream(text.getBytes()));
Document document = parser.parse(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)));
Element envs = document.getDocumentElement();
NodeList list = envs.getChildNodes();
int length = list.getLength();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ public boolean equals(Object obj) {
if (!segments[i].equals(targetSegments[i]))
return false;
//check device last (least likely to differ)
return device == target.device || (device != null && device.equals(target.device));
return (device == null ? target.device == null : device.equals(target.device));
}

/* (Intentionally not included in javadoc)
Expand Down
Loading
Loading