Skip to content

Commit

Permalink
Trivial tweak: avoid unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellansun committed Jan 10, 2025
1 parent 2ddb72c commit de71720
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/groovy/lang/MetaClassImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -2517,8 +2517,8 @@ private void applyStrayPropertyMethods(CachedClass source, Map<String, MetaPrope
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);
Expand Down

0 comments on commit de71720

Please sign in to comment.