@Test public void testRightTrimWhitespace() { assertNull(Utilities.rightTrimWhiteSpace(null)); assertEquals("", Utilities.rightTrimWhiteSpace("")); assertEquals("abc", Utilities.rightTrimWhiteSpace("abc")); assertEquals(" abc", Utilities.rightTrimWhiteSpace(" abc")); assertEquals("abc", Utilities.rightTrimWhiteSpace("abc ")); assertEquals("abc", Utilities.rightTrimWhiteSpace("abc ")); assertEquals("", Utilities.rightTrimWhiteSpace(" ")); assertEquals("abc \t", Utilities.rightTrimWhiteSpace("abc \t ")); assertEquals("abc \t\t", Utilities.rightTrimWhiteSpace("abc \t\t")); assertEquals("abc \n", Utilities.rightTrimWhiteSpace("abc \n ")); assertEquals("abc \n", Utilities.rightTrimWhiteSpace("abc \n")); }
public static String rightTrimWhiteSpace(String s) { if (s == null) return null; int length = s.length(); while (length > 0 && s.charAt(length - 1) == ' ') length--; if (length == s.length()) return s; if (length == 0) return ""; return s.substring(0, length); }
Utilities { public static String rightTrimWhiteSpace(String s) { if (s == null) return null; int length = s.length(); while (length > 0 && s.charAt(length - 1) == ' ') length--; if (length == s.length()) return s; if (length == 0) return ""; return s.substring(0, length); } }
Utilities { public static String rightTrimWhiteSpace(String s) { if (s == null) return null; int length = s.length(); while (length > 0 && s.charAt(length - 1) == ' ') length--; if (length == s.length()) return s; if (length == 0) return ""; return s.substring(0, length); }  }
Utilities { public static String rightTrimWhiteSpace(String s) { if (s == null) return null; int length = s.length(); while (length > 0 && s.charAt(length - 1) == ' ') length--; if (length == s.length()) return s; if (length == 0) return ""; return s.substring(0, length); }  static byte[] parseBase64(String encoded, String paramName); static boolean isValidDirectoryName(String name); static boolean isValidRestrictedDirectoryName(String name); static Object createAnyInstance(Class<?> confClass,
                                           String className, RequestContext metaData); static Object createAnyInstance(String className); static void byteArrayToOctalString(byte[] bytes, StringBuilder sb); static String maskNonPrintables(String input); static FragmentMetadata parseFragmentMetadata(RequestContext context); static boolean aggregateOptimizationsSupported(RequestContext requestContext); static boolean implementsInterface(String className, Class<?> iface); static boolean isFragmenterCacheEnabled(); static String absoluteDataPath(String dataSource); static boolean isSecurityEnabled(Configuration configuration); static String rightTrimWhiteSpace(String s); static String getHost(String uri); }
Utilities { public static String rightTrimWhiteSpace(String s) { if (s == null) return null; int length = s.length(); while (length > 0 && s.charAt(length - 1) == ' ') length--; if (length == s.length()) return s; if (length == 0) return ""; return s.substring(0, length); }  static byte[] parseBase64(String encoded, String paramName); static boolean isValidDirectoryName(String name); static boolean isValidRestrictedDirectoryName(String name); static Object createAnyInstance(Class<?> confClass,
                                           String className, RequestContext metaData); static Object createAnyInstance(String className); static void byteArrayToOctalString(byte[] bytes, StringBuilder sb); static String maskNonPrintables(String input); static FragmentMetadata parseFragmentMetadata(RequestContext context); static boolean aggregateOptimizationsSupported(RequestContext requestContext); static boolean implementsInterface(String className, Class<?> iface); static boolean isFragmenterCacheEnabled(); static String absoluteDataPath(String dataSource); static boolean isSecurityEnabled(Configuration configuration); static String rightTrimWhiteSpace(String s); static String getHost(String uri); static final Pattern SCHEME_PATTERN; static final Pattern NON_HOSTNAME_CHARACTERS; }