Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0.5
-
None
-
None
-
Patch
Description
The problem appears in version 2.0.5 and in revision 4cf5263.. I
attached a one-line patch that fixes it. I will also post (in the
"Comments" section) the URL for the github pull request.
In method "DefaultGrailsDomainClassInjector.implementsMethod", in the
loop over "methods", the statement
"boolean methodMatch = mn.getName().equals(methodName) && isZeroArg"
should be
"boolean methodMatch = isZeroArg && mn.getName().equals(methodName)".
The second statement avoids comparing strings when "isZeroArg" is
"false".
The code can be made even shorter and faster by having a fast exit (by
pulling "isZeroArg" out of the loop) at the beginning of the method
body; this avoids the entire method computation. While the resulting
code is more compact than the original, the patch itself is a bit
larger (deletes 3 lines, adds 2). I attached this patch
(patchFull.diff).