HHH-7869 code format

This commit is contained in:
Strong Liu 2013-03-26 16:35:16 +08:00
parent 681528b7cc
commit 1ee3be2da7
1 changed files with 9 additions and 4 deletions

View File

@ -23,6 +23,7 @@
*
*/
package org.hibernate.hql.internal.classic;
import java.util.BitSet;
import java.util.StringTokenizer;
@ -35,16 +36,18 @@ public final class ParserHelper {
public static final String HQL_SEPARATORS = " \n\r\f\t,()=<>&|+-=/*'^![]#~\\";
public static final BitSet HQL_SEPARATORS_BITSET = new BitSet();
static {
for ( int i = 0; i < HQL_SEPARATORS.length(); i++ ) {
HQL_SEPARATORS_BITSET.set( HQL_SEPARATORS.charAt( i ) );
}
}
//NOTICE: no " or . since they are part of (compound) identifiers
public static final String PATH_SEPARATORS = ".";
public static boolean isWhitespace(String str) {
return StringHelper.WHITESPACE.indexOf( str ) > -1;
return StringHelper.WHITESPACE.contains( str );
}
private ParserHelper() {
@ -54,7 +57,9 @@ public final class ParserHelper {
public static void parse(Parser p, String text, String seperators, QueryTranslatorImpl q) throws QueryException {
StringTokenizer tokens = new StringTokenizer( text, seperators, true );
p.start( q );
while ( tokens.hasMoreElements() ) p.token( tokens.nextToken(), q );
while ( tokens.hasMoreElements() ) {
p.token( tokens.nextToken(), q );
}
p.end( q );
}