@Test public void testFindParameterWhenSuffixMatch() throws Exception { assertThat(QueryUtil.findParameter("name", "other=value&myname=value"), is(nullValue())); }
public static String findParameter(String param, String query) { String token = param + "="; int i = query.indexOf(token); if (i == -1) return null; while (i > 0 && query.charAt(i - 1) != '&') { i = query.indexOf(token, i + 1); } if (i == -1) return null; int j = query.indexOf('&', i); if (j == -1) { j = query.length(); } return query.substring(query.indexOf('=', i) + 1, j); }
QueryUtil { public static String findParameter(String param, String query) { String token = param + "="; int i = query.indexOf(token); if (i == -1) return null; while (i > 0 && query.charAt(i - 1) != '&') { i = query.indexOf(token, i + 1); } if (i == -1) return null; int j = query.indexOf('&', i); if (j == -1) { j = query.length(); } return query.substring(query.indexOf('=', i) + 1, j); } }
QueryUtil { public static String findParameter(String param, String query) { String token = param + "="; int i = query.indexOf(token); if (i == -1) return null; while (i > 0 && query.charAt(i - 1) != '&') { i = query.indexOf(token, i + 1); } if (i == -1) return null; int j = query.indexOf('&', i); if (j == -1) { j = query.length(); } return query.substring(query.indexOf('=', i) + 1, j); }  }
QueryUtil { public static String findParameter(String param, String query) { String token = param + "="; int i = query.indexOf(token); if (i == -1) return null; while (i > 0 && query.charAt(i - 1) != '&') { i = query.indexOf(token, i + 1); } if (i == -1) return null; int j = query.indexOf('&', i); if (j == -1) { j = query.length(); } return query.substring(query.indexOf('=', i) + 1, j); }  static String removeProtocolParameters(
      AuthenticationProtocol protocol, String query); static String removeEachParameter(String param, String query); static String removeParameter(String param, String query); static String findParameter(String param, String query); }
QueryUtil { public static String findParameter(String param, String query) { String token = param + "="; int i = query.indexOf(token); if (i == -1) return null; while (i > 0 && query.charAt(i - 1) != '&') { i = query.indexOf(token, i + 1); } if (i == -1) return null; int j = query.indexOf('&', i); if (j == -1) { j = query.length(); } return query.substring(query.indexOf('=', i) + 1, j); }  static String removeProtocolParameters(
      AuthenticationProtocol protocol, String query); static String removeEachParameter(String param, String query); static String removeParameter(String param, String query); static String findParameter(String param, String query);  }