File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
grails-core/src/main/groovy/org/codehaus/groovy/grails/commons
grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/commons Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -919,7 +919,10 @@ public static String getPropertyForGetter(String getterName) {
919919 }
920920
921921 private static String convertPropertyName (String prop ) {
922- if (Character .isUpperCase (prop .charAt (0 )) && Character .isUpperCase (prop .charAt (1 ))) {
922+ if (prop .length () == 1 ) {
923+ return prop .toLowerCase ();
924+ }
925+ else if (Character .isUpperCase (prop .charAt (0 )) && Character .isUpperCase (prop .charAt (1 ))) {
923926 return prop ;
924927 }
925928 if (Character .isDigit (prop .charAt (0 ))) {
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ public void testIsGetterOrSetter() {
128128 public void testGetPropertyForGetter () {
129129 assertEquals ("something" , GrailsClassUtils .getPropertyForGetter ("getSomething" ));
130130 assertEquals ("URL" , GrailsClassUtils .getPropertyForGetter ("getURL" ));
131+ assertEquals ("p" , GrailsClassUtils .getPropertyForGetter ("getP" ));
131132 }
132133
133134 public void testGetStaticField () {
You can’t perform that action at this time.
0 commit comments