Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.1.6, 2.2.0-beta-1
-
None
-
Patch
Description
The problem appears in versions 2.1.6, 2.2.0-beta-1 and in revision ca83beb.
I attached a simple patch that fixes it.
The patch moves only one line, but it looks larger because I indented the loop to preserve formatting.
In method "DefaultGrailsDomainClassInjector.implementsMethod", the loop over "methods" should not be executed when
"(argTypes == null || argTypes.length ==0)" is false. When "(argTypes == null || argTypes.length ==0)" is false, "isZeroArg" is false, which makes "methodMatch" false, which means the loop will not execute "return true". "return true" is the loop's only side effect, so when "return true" cannot be executed, the loop is not necessary.
Note that "argTypes" and "argTypes.length" are never modified in the loop, so the value of "(argTypes == null || argTypes.length ==0)" does not change during the loop execution.