Author: epbernard
Date: 2006-11-25 09:23:04 -0500 (Sat, 25 Nov 2006)
New Revision: 10869
Modified:
trunk/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java
Log:
HHH-2264 Avoid NPE on user query error
Modified: trunk/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java
===================================================================
--- trunk/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java 2006-11-25
14:22:25 UTC (rev 10868)
+++ trunk/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java 2006-11-25
14:23:04 UTC (rev 10869)
@@ -64,6 +64,10 @@
int right = StringHelper.firstIndexOfChar( sqlString, ParserHelper.HQL_SEPARATORS,
indx + 1 );
int chopLocation = right < 0 ? sqlString.length() : right;
String param = sqlString.substring( indx + 1, chopLocation );
+ if ( StringHelper.isEmpty( param ) ) {
+ throw new QueryException("Space is not allowed after parameter prefix
':' '"
+ + sqlString + "'");
+ }
recognizer.namedParameter( param, indx );
indx = chopLocation - 1;
}
Show replies by date