diff --git a/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java b/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java index b45be2d967..ed2de0eeec 100644 --- a/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java +++ b/router/java/src/net/i2p/router/startup/LoadClientAppsJob.java @@ -117,18 +117,18 @@ public class LoadClientAppsJob extends JobImpl { public static String[] parseArgs(String args) { List argList = new ArrayList(4); if (args != null) { - char data[] = args.toCharArray(); StringBuilder buf = new StringBuilder(32); boolean isQuoted = false; - for (int i = 0; i < data.length; i++) { - switch (data[i]) { + for (int i = 0; i < args.length(); i++) { + char c = args.charAt(i); + switch (c) { case '\'': case '"': if (isQuoted) { String str = buf.toString().trim(); if (str.length() > 0) argList.add(str); - buf = new StringBuilder(32); + buf.setLength(0); } isQuoted = !isQuoted; break; @@ -137,16 +137,16 @@ public class LoadClientAppsJob extends JobImpl { // whitespace - if we're in a quoted section, keep this as part of the quote, // otherwise use it as a delim if (isQuoted) { - buf.append(data[i]); + buf.append(c); } else { String str = buf.toString().trim(); if (str.length() > 0) argList.add(str); - buf = new StringBuilder(32); + buf.setLength(0); } break; default: - buf.append(data[i]); + buf.append(c); break; } } @@ -315,12 +315,6 @@ public class LoadClientAppsJob extends JobImpl { } catch (Throwable t) {} return false; } - - - - - - } public String getName() { return "Load up any client applications"; }