[hibernate-commits] Hibernate SVN: r10868 - branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/query

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Sat Nov 25 09:22:27 EST 2006


Author: epbernard
Date: 2006-11-25 09:22:25 -0500 (Sat, 25 Nov 2006)
New Revision: 10868

Modified:
   branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java
Log:
HHH-2264 avoid NPE on user query error

Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java	2006-11-24 00:37:46 UTC (rev 10867)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/engine/query/ParameterParser.java	2006-11-25 14:22:25 UTC (rev 10868)
@@ -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;
 				}




More information about the hibernate-commits mailing list