HI!
StringHelper.firstIndexOfChar is extremely inefficient on long strings. It'd
scan all string many times even if it starts with stop character. I propose to
change it this way:
public static int firstIndexOfChar(String sqlString, String string, int
startindex) {
Set stopchars = new HashSet();
for (int i = 0; i < string.length(); i++)
stopchars.add(string.charAt(i));
for (int i = startindex; i < sqlString.length(); i++) {
if (stopchars.contains(sqlString.charAt(i)))
return i;
}
return -1;
}
works fine in my project.
Stepan Yakovenko, [email protected], +79039036253
_______________________________________________
hibernate-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/hibernate-dev