1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

more work on generic

add ' quoting
fix IntegerInstantiation is more memory friendly

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@11024 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Michael Will 2009-06-04 11:58:25 +00:00 committed by michael.will
parent 634afb2cad
commit 1edc69780b
7 changed files with 40 additions and 27 deletions

View file

@ -31,6 +31,7 @@ import java.util.Random;
public class StringUtils {
private static final char[] QUOTE_ENCODE = """.toCharArray();
private static final char[] APOS_ENCODE = "'".toCharArray();
private static final char[] AMP_ENCODE = "&".toCharArray();
private static final char[] LT_ENCODE = "<".toCharArray();
private static final char[] GT_ENCODE = ">".toCharArray();
@ -326,6 +327,13 @@ public class StringUtils {
last = i + 1;
out.append(QUOTE_ENCODE);
}
else if (ch == '\'') {
if (i > last) {
out.append(input, last, i - last);
}
last = i + 1;
out.append(APOS_ENCODE);
}
}
if (last == 0) {
return string;
@ -501,4 +509,4 @@ public class StringUtils {
private StringUtils() {
// Not instantiable.
}
}
}