Skip to content

Commit 9649c04

Browse files
Alexander Zeillingerjeffscottbrown
authored andcommitted
fix for GRAILS-6691
1 parent cce0174 commit 9649c04

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/java/grails/orm/HibernateCriteriaBuilder.java

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -846,8 +846,9 @@ public Object sizeEq(String propertyName, int size) {
846846
* @return A Criterion instance
847847
*/
848848
public Object sizeGt(String propertyName, int size) {
849-
if(!validateSimpleExpression()) {
850-
throwRuntimeException( new IllegalArgumentException("Call to [sizeEq] with propertyName ["+propertyName+"] and size ["+size+"] not allowed here."));
849+
if (!validateSimpleExpression()) {
850+
throwRuntimeException(new IllegalArgumentException("Call to [sizeGt] with propertyName [" +
851+
propertyName + "] and size [" + size + "] not allowed here."));
851852
}
852853
propertyName = calculatePropertyName(propertyName);
853854
return addToCriteria(Restrictions.sizeGt(propertyName, size));
@@ -862,8 +863,9 @@ public Object sizeGt(String propertyName, int size) {
862863
* @return A Criterion instance
863864
*/
864865
public Object sizeGe(String propertyName, int size) {
865-
if(!validateSimpleExpression()) {
866-
throwRuntimeException( new IllegalArgumentException("Call to [sizeEq] with propertyName ["+propertyName+"] and size ["+size+"] not allowed here."));
866+
if (!validateSimpleExpression()) {
867+
throwRuntimeException(new IllegalArgumentException("Call to [sizeGe] with propertyName [" +
868+
propertyName + "] and size [" + size + "] not allowed here."));
867869
}
868870
propertyName = calculatePropertyName(propertyName);
869871
return addToCriteria(Restrictions.sizeGe(propertyName, size));
@@ -879,8 +881,9 @@ public Object sizeGe(String propertyName, int size) {
879881
* @return A Criterion instance
880882
*/
881883
public Object sizeLe(String propertyName, int size) {
882-
if(!validateSimpleExpression()) {
883-
throwRuntimeException( new IllegalArgumentException("Call to [sizeEq] with propertyName ["+propertyName+"] and size ["+size+"] not allowed here."));
884+
if (!validateSimpleExpression()) {
885+
throwRuntimeException(new IllegalArgumentException("Call to [sizeLe] with propertyName [" +
886+
propertyName + "] and size [" + size + "] not allowed here."));
884887
}
885888
propertyName = calculatePropertyName(propertyName);
886889
return addToCriteria(Restrictions.sizeLe(propertyName, size));
@@ -895,8 +898,9 @@ public Object sizeLe(String propertyName, int size) {
895898
* @return A Criterion instance
896899
*/
897900
public Object sizeLt(String propertyName, int size) {
898-
if(!validateSimpleExpression()) {
899-
throwRuntimeException( new IllegalArgumentException("Call to [sizeEq] with propertyName ["+propertyName+"] and size ["+size+"] not allowed here."));
901+
if (!validateSimpleExpression()) {
902+
throwRuntimeException(new IllegalArgumentException("Call to [sizeLt] with propertyName [" +
903+
propertyName + "] and size [" + size + "] not allowed here."));
900904
}
901905
propertyName = calculatePropertyName(propertyName);
902906
return addToCriteria(Restrictions.sizeLt(propertyName, size));
@@ -911,8 +915,9 @@ public Object sizeLt(String propertyName, int size) {
911915
* @return A Criterion instance
912916
*/
913917
public Object sizeNe(String propertyName, int size) {
914-
if(!validateSimpleExpression()) {
915-
throwRuntimeException( new IllegalArgumentException("Call to [sizeEq] with propertyName ["+propertyName+"] and size ["+size+"] not allowed here."));
918+
if (!validateSimpleExpression()) {
919+
throwRuntimeException(new IllegalArgumentException("Call to [sizeNe] with propertyName [" +
920+
propertyName + "] and size [" + size + "] not allowed here."));
916921
}
917922
propertyName = calculatePropertyName(propertyName);
918923
return addToCriteria(Restrictions.sizeNe(propertyName, size));

0 commit comments

Comments
 (0)