This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new de7172097a Trivial tweak: avoid unnecessary checks
de7172097a is described below
commit de7172097ad837b17f84d923aef76ecb6566f097
Author: Daniel Sun <[email protected]>
AuthorDate: Fri Jan 10 23:21:38 2025 +0900
Trivial tweak: avoid unnecessary checks
---
src/main/java/groovy/lang/MetaClassImpl.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main/java/groovy/lang/MetaClassImpl.java
b/src/main/java/groovy/lang/MetaClassImpl.java
index 86e10e1f81..20795be982 100644
--- a/src/main/java/groovy/lang/MetaClassImpl.java
+++ b/src/main/java/groovy/lang/MetaClassImpl.java
@@ -2517,8 +2517,8 @@ public class MetaClassImpl implements MetaClass,
MutableMetaClass {
boolean isBooleanGetter = methodName.startsWith("is");
if (methodNameLength < (isBooleanGetter ? 3 : 4)) continue;
- boolean isGetter = methodName.startsWith("get") || isBooleanGetter;
- boolean isSetter = methodName.startsWith("set");
+ boolean isGetter = isBooleanGetter || methodName.startsWith("get");
+ boolean isSetter = !isGetter && methodName.startsWith("set");
if (!isGetter && !isSetter) continue;
Object propertyMethods = filterPropertyMethod(isThis ? e.methods :
e.methodsForSuper, isGetter, isBooleanGetter);