Source:
<code>public Object configure(final List<String> args) throws RemoteException { final String option = args.size() == 0 ? "" : args.get(0); if (!POSSIBLE_TOKENS.contains(option)) throw new RemoteException(String.format("The 'config' option expects one of %s as an argument", String.join(",", POSSIBLE_TOKENS))); final List<String> arguments = args.subList(1, args.size()); if (option.equals(TOKEN_TIMEOUT)) { final String errorMessage = "The timeout option expects a positive integer representing milliseconds or 'none' as an argument"; if (arguments.size() != 1) throw new RemoteException(errorMessage); try { timeout = arguments.get(0).equals(TOKEN_MAX) ? Integer.MAX_VALUE : arguments.get(0).equals(TOKEN_NONE) ? NO_TIMEOUT : Integer.parseInt(arguments.get(0)); <START> return timeout == NO_TIMEOUT ? "Remote timeout is disable" : "Set remote timeout to " + timeout + "ms"; <END> } catch (Exception ignored) { throw new RemoteException(errorMessage); } } else if (option.equals(TOKEN_ALIAS)) { if (arguments.size() == 1 && arguments.get(0).equals(TOKEN_RESET)) { aliases.clear(); return "Aliases cleared"; } if (arguments.size() == 1 && arguments.get(0).equals(TOKEN_SHOW)) { return aliases; } if (arguments.size() % 2 != 0) throw new RemoteException("Arguments to alias must be 'reset' to clear any existing alias settings or key/value alias/binding pairs"); final Map<String,Object> aliasMap = ElementHelper.asMap(arguments.toArray()); aliases.clear(); aliasMap.forEach((k,v) -> aliases.put(k, v.toString())); return aliases; } return this.toString(); }</code><technical_language>Missing check for if (timeout < -1) throw new RemoteException(errorMessage); end gremlin> :remote config timeout -2 ==>Set remote timeout -2ms</technical_language>

Target:
public Object configure(final List<String> args) throws RemoteException { final String option = args.size() == 0 ? "" : args.get(0); if (!POSSIBLE_TOKENS.contains(option)) throw new RemoteException(String.format("The 'config' option expects one of %s as an argument", String.join(",", POSSIBLE_TOKENS))); final List<String> arguments = args.subList(1, args.size()); if (option.equals(TOKEN_TIMEOUT)) { final String errorMessage = "The timeout option expects a positive integer representing milliseconds or 'none' as an argument"; if (arguments.size() != 1) throw new RemoteException(errorMessage); try { timeout = arguments.get(0).equals(TOKEN_MAX) ? Integer.MAX_VALUE : arguments.get(0).equals(TOKEN_NONE) ? NO_TIMEOUT : Integer.parseInt(arguments.get(0)); if (timeout < NO_TIMEOUT) throw new RemoteException("The value for the timeout cannot be less than " + NO_TIMEOUT); return timeout == NO_TIMEOUT ? "Remote timeout is disabled" : "Set remote timeout to " + timeout + "ms"; } catch (Exception ignored) { throw new RemoteException(errorMessage); } } else if (option.equals(TOKEN_ALIAS)) { if (arguments.size() == 1 && arguments.get(0).equals(TOKEN_RESET)) { aliases.clear(); return "Aliases cleared"; } if (arguments.size() == 1 && arguments.get(0).equals(TOKEN_SHOW)) { return aliases; } if (arguments.size() % 2 != 0) throw new RemoteException("Arguments to alias must be 'reset' to clear any existing alias settings or key/value alias/binding pairs"); final Map<String,Object> aliasMap = ElementHelper.asMap(arguments.toArray()); aliases.clear(); aliasMap.forEach((k,v) -> aliases.put(k, v.toString())); return aliases; } return this.toString(); }