@Test public void testToSafelyPastableToJavaCode2ArgsLatin3() { String[] testStrs = {LATIN2_STR.substring(0, 3), LATIN2_STR.substring(3, 7), LATIN2_STR.substring(7)}; assertEquals(LATIN2_STR_ESCAPED, BasicFileUtils.toSafelyPastableToJavaCode(testStrs)); }
public static String toSafelyPastableToJavaCode(String... strings) { StringBuilder result = new StringBuilder(sumLengths(strings)); char lastCh = '?'; for (String string: strings) { for (int i = 0; i < string.length(); i++) { char ch = string.charAt(i); if ((lastCh == '\\' && ch == 'u') || ch > 127) { appendAsEscaped(ch, result); } else { result.append(ch); } lastCh = ch; } } return result.toString(); }
BasicFileUtils { public static String toSafelyPastableToJavaCode(String... strings) { StringBuilder result = new StringBuilder(sumLengths(strings)); char lastCh = '?'; for (String string: strings) { for (int i = 0; i < string.length(); i++) { char ch = string.charAt(i); if ((lastCh == '\\' && ch == 'u') || ch > 127) { appendAsEscaped(ch, result); } else { result.append(ch); } lastCh = ch; } } return result.toString(); } }
BasicFileUtils { public static String toSafelyPastableToJavaCode(String... strings) { StringBuilder result = new StringBuilder(sumLengths(strings)); char lastCh = '?'; for (String string: strings) { for (int i = 0; i < string.length(); i++) { char ch = string.charAt(i); if ((lastCh == '\\' && ch == 'u') || ch > 127) { appendAsEscaped(ch, result); } else { result.append(ch); } lastCh = ch; } } return result.toString(); } private  BasicFileUtils(); }
BasicFileUtils { public static String toSafelyPastableToJavaCode(String... strings) { StringBuilder result = new StringBuilder(sumLengths(strings)); char lastCh = '?'; for (String string: strings) { for (int i = 0; i < string.length(); i++) { char ch = string.charAt(i); if ((lastCh == '\\' && ch == 'u') || ch > 127) { appendAsEscaped(ch, result); } else { result.append(ch); } lastCh = ch; } } return result.toString(); } private  BasicFileUtils(); static String toSafelyPastableToJavaCode(String... strings); static File getPluginTmpDir(); static File createTmpFile(String preferredName, String suffix); static File getSubPath(File root, String... subPaths); static File toCanonicalFile(File file); static String getMD5(byte[] input); }
BasicFileUtils { public static String toSafelyPastableToJavaCode(String... strings) { StringBuilder result = new StringBuilder(sumLengths(strings)); char lastCh = '?'; for (String string: strings) { for (int i = 0; i < string.length(); i++) { char ch = string.charAt(i); if ((lastCh == '\\' && ch == 'u') || ch > 127) { appendAsEscaped(ch, result); } else { result.append(ch); } lastCh = ch; } } return result.toString(); } private  BasicFileUtils(); static String toSafelyPastableToJavaCode(String... strings); static File getPluginTmpDir(); static File createTmpFile(String preferredName, String suffix); static File getSubPath(File root, String... subPaths); static File toCanonicalFile(File file); static String getMD5(byte[] input);  }