Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix for GRAILS-9004 "where/findall closures can fail on entities with…

… relationships"
  • Loading branch information...
commit 8cd50d2761b541e95fec8714ec9188c60314e52a 1 parent 1b9e214
@graemerocher graemerocher authored
View
5 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsClassUtils.java
@@ -919,7 +919,10 @@ public static String getPropertyForGetter(String getterName) {
}
private static String convertPropertyName(String prop) {
- if (Character.isUpperCase(prop.charAt(0)) && Character.isUpperCase(prop.charAt(1))) {
+ if(prop.length() == 1) {
+ return prop.toLowerCase();
+ }
+ else if (Character.isUpperCase(prop.charAt(0)) && Character.isUpperCase(prop.charAt(1))) {
return prop;
}
if (Character.isDigit(prop.charAt(0))) {
View
1  ...-suite-uber/src/test/groovy/org/codehaus/groovy/grails/commons/GrailsClassUtilsTests.java
@@ -128,6 +128,7 @@ public void testIsGetterOrSetter() {
public void testGetPropertyForGetter() {
assertEquals("something", GrailsClassUtils.getPropertyForGetter("getSomething"));
assertEquals("URL", GrailsClassUtils.getPropertyForGetter("getURL"));
+ assertEquals("p", GrailsClassUtils.getPropertyForGetter("getP"));
}
public void testGetStaticField() {
Please sign in to comment.
Something went wrong with that request. Please try again.