@Test public void removeJSessionId() { assertNull(URLHelper.removeJSessionId(null)); assertEquals("", URLHelper.removeJSessionId("")); assertEquals("http: URLHelper.removeJSessionId("http: assertEquals("http: URLHelper.removeJSessionId( "http: assertEquals("http: URLHelper.removeJSessionId( "http: assertEquals("https: URLHelper .removeJSessionId( "https: assertEquals("https: URLHelper.removeJSessionId("https: assertEquals("https: URLHelper.removeJSessionId("https: assertEquals( "https: URLHelper .removeJSessionId( "https: assertEquals("https: URLHelper.removeJSessionId( "https: assertEquals("https: URLHelper.removeJSessionId("https: assertEquals("https: URLHelper.removeJSessionId("https: }
public static String removeJSessionId(final String url) { if (url == null) { return null; } final int pos = url.indexOf(";jsessionid="); if (pos < 0) { return url; } final int questionMark = url.indexOf('?'); if (questionMark < 0) { return url.substring(0, pos); } if (questionMark < pos) { return url; } return url.substring(0, pos) + url.substring(questionMark); }
URLHelper { public static String removeJSessionId(final String url) { if (url == null) { return null; } final int pos = url.indexOf(";jsessionid="); if (pos < 0) { return url; } final int questionMark = url.indexOf('?'); if (questionMark < 0) { return url.substring(0, pos); } if (questionMark < pos) { return url; } return url.substring(0, pos) + url.substring(questionMark); } }
URLHelper { public static String removeJSessionId(final String url) { if (url == null) { return null; } final int pos = url.indexOf(";jsessionid="); if (pos < 0) { return url; } final int questionMark = url.indexOf('?'); if (questionMark < 0) { return url.substring(0, pos); } if (questionMark < pos) { return url; } return url.substring(0, pos) + url.substring(questionMark); }  }
URLHelper { public static String removeJSessionId(final String url) { if (url == null) { return null; } final int pos = url.indexOf(";jsessionid="); if (pos < 0) { return url; } final int questionMark = url.indexOf('?'); if (questionMark < 0) { return url.substring(0, pos); } if (questionMark < pos) { return url; } return url.substring(0, pos) + url.substring(questionMark); }  static String encode(final String str); static String removeJSessionId(final String url); }
URLHelper { public static String removeJSessionId(final String url) { if (url == null) { return null; } final int pos = url.indexOf(";jsessionid="); if (pos < 0) { return url; } final int questionMark = url.indexOf('?'); if (questionMark < 0) { return url.substring(0, pos); } if (questionMark < pos) { return url; } return url.substring(0, pos) + url.substring(questionMark); }  static String encode(final String str); static String removeJSessionId(final String url);  }