Various small fixes found by IDEA inspection

This commit is contained in:
Jano Svitok 2018-08-06 13:26:37 +02:00
parent adb0cca09a
commit 3fd68d337f
3 changed files with 3 additions and 2 deletions

View File

@ -61,7 +61,7 @@ public class HostConnectionCommand {
private String extractError(String response) { private String extractError(String response) {
int lastColon = response.lastIndexOf(':'); int lastColon = response.lastIndexOf(':');
if (lastColon != -1) { if (lastColon != -1) {
return response.substring(lastColon, response.length()); return response.substring(lastColon);
} else { } else {
return response; return response;
} }

View File

@ -55,7 +55,7 @@ public class PackageManager {
arguments.add("install"); arguments.add("install");
arguments.addAll(extraArguments); arguments.addAll(extraArguments);
arguments.add(remote.getPath()); arguments.add(remote.getPath());
InputStream s = device.executeShell("pm", arguments.toArray(new String[arguments.size()])); InputStream s = device.executeShell("pm", arguments.toArray(new String[0]));
String result = Stream.readAll(s, StandardCharsets.UTF_8); String result = Stream.readAll(s, StandardCharsets.UTF_8);
remove(remote); remove(remote);
verifyOperation("install", apkFile.getName(), result); verifyOperation("install", apkFile.getName(), result);

View File

@ -41,6 +41,7 @@ class AdbProtocolHandler implements Runnable {
DataInputStream input = new DataInputStream(socket.getInputStream()); DataInputStream input = new DataInputStream(socket.getInputStream());
DataOutputStream output = new DataOutputStream(socket.getOutputStream()) DataOutputStream output = new DataOutputStream(socket.getOutputStream())
) { ) {
//noinspection StatementWithEmptyBody
while (processCommand(input, output)) { while (processCommand(input, output)) {
// nothing to do here // nothing to do here
} }