This is an automated email from the ASF dual-hosted git repository.

emilles pushed a commit to branch GROOVY-11841
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit a75e87f1222c57dcfd7a19d18dc4c247fe109fa0
Author: Eric Milles <[email protected]>
AuthorDate: Thu Jan 15 08:52:51 2026 -0600

    remove boundless property name map
---
 src/main/java/groovy/lang/MetaClassImpl.java | 29 ++++++----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/src/main/java/groovy/lang/MetaClassImpl.java 
b/src/main/java/groovy/lang/MetaClassImpl.java
index 61e6a2c0d5..10b98fd6fa 100644
--- a/src/main/java/groovy/lang/MetaClassImpl.java
+++ b/src/main/java/groovy/lang/MetaClassImpl.java
@@ -109,7 +109,6 @@ import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
 import java.util.function.BiConsumer;
 
 import static groovy.lang.Tuple.tuple;
@@ -270,10 +269,8 @@ public class MetaClassImpl implements MetaClass, 
MutableMetaClass {
     @Override
     public List<MetaMethod> respondsTo(final Object obj, final String name) {
         Object o = getMethods(getTheClass(), name, false);
-        if (o instanceof FastArray) {
-            @SuppressWarnings("unchecked")
-            List<MetaMethod> l = ((FastArray) o).toList();
-            return l;
+        if (o instanceof FastArray array) {
+            return (List<MetaMethod>) array.toList();
         }
         return Collections.singletonList((MetaMethod) o);
     }
@@ -2512,27 +2509,17 @@ public class MetaClassImpl implements MetaClass, 
MutableMetaClass {
             Object propertyMethods = filterPropertyMethod(isThis ? e.methods : 
e.methodsForSuper, isGetter, isBooleanGetter);
             if (propertyMethods == null) continue;
 
-            String propName = getPropName(methodName);
-            if (propertyMethods instanceof MetaMethod) {
-                createMetaBeanProperty(target, propName, isGetter, 
(MetaMethod) propertyMethods);
+            String propertyName = 
BeanUtils.decapitalize(methodName.substring(isBooleanGetter ? 2 : 3));
+            if (propertyMethods instanceof MetaMethod propertyMethod) {
+                createMetaBeanProperty(target, propertyName, isGetter, 
propertyMethod);
             } else {
                 for (MetaMethod m : (Iterable<MetaMethod>) propertyMethods) {
-                    createMetaBeanProperty(target, propName, isGetter, m);
+                    createMetaBeanProperty(target, propertyName, isGetter, m);
                 }
             }
         }
     }
 
-    private static final ConcurrentMap<String, String> PROP_NAMES = new 
ConcurrentHashMap<>(1024);
-
-    private static String getPropName(String methodName) {
-        return PROP_NAMES.computeIfAbsent(methodName, k -> {
-            // assume "is" or "[gs]et"
-            return BeanUtils.decapitalize(methodName.startsWith("is")
-                    ? methodName.substring(2) : methodName.substring(3));
-        });
-    }
-
     private static MetaProperty makeReplacementMetaProperty(MetaProperty mp, 
String propName, boolean isGetter, MetaMethod propertyMethod) {
         if (mp == null) {
             if (isGetter) {
@@ -3837,10 +3824,6 @@ out:    if (metaClass instanceof MetaClassImpl 
metaClassImpl) {
             return null;
         }
 
-        public ParameterTypes getParamTypes() {
-            return null;
-        }
-
         @Override
         public Object invoke(Object object, Object[] arguments) {
             return null;

Reply via email to