groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sun...@apache.org
Subject groovy git commit: Minor refactoring
Date Thu, 16 Nov 2017 12:28:55 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X fd90d099d -> 4e7bf8708


Minor refactoring

(cherry picked from commit afb3f9d)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/4e7bf870
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/4e7bf870
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/4e7bf870

Branch: refs/heads/GROOVY_2_6_X
Commit: 4e7bf87085f880e2b4e4db945cf9ba785b05ce85
Parents: fd90d09
Author: sunlan <sunlan@apache.org>
Authored: Thu Nov 16 20:28:22 2017 +0800
Committer: sunlan <sunlan@apache.org>
Committed: Thu Nov 16 20:28:49 2017 +0800

----------------------------------------------------------------------
 src/main/groovy/lang/MetaClassImpl.java | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/4e7bf870/src/main/groovy/lang/MetaClassImpl.java
----------------------------------------------------------------------
diff --git a/src/main/groovy/lang/MetaClassImpl.java b/src/main/groovy/lang/MetaClassImpl.java
index fdaee5b..964fe6a 100644
--- a/src/main/groovy/lang/MetaClassImpl.java
+++ b/src/main/groovy/lang/MetaClassImpl.java
@@ -1484,7 +1484,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
             return invokeStaticClosureProperty(arguments, prop);
         }
 
-        Object[] originalArguments = (Object[]) arguments.clone();
+        Object[] originalArguments = arguments.clone();
         MetaClassHelper.unwrap(arguments);
 
         Class superClass = sender.getSuperclass();
@@ -1867,7 +1867,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
             } else if (object instanceof Object[]) {
                 return DefaultGroovyMethods.getAt(Arrays.asList((Object[]) object), name);
             } else {
-                MetaMethod addListenerMethod = (MetaMethod) listeners.get(name);
+                MetaMethod addListenerMethod = listeners.get(name);
                 if (addListenerMethod != null) {
                     //TODO: one day we could try return the previously registered Closure
listener for easy removal
                     return null;
@@ -2021,7 +2021,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
                 }
             };
         } else {
-            MetaMethod addListenerMethod = (MetaMethod) listeners.get(name);
+            MetaMethod addListenerMethod = listeners.get(name);
             if (addListenerMethod != null) {
                 //TODO: one day we could try return the previously registered Closure listener
for easy removal
                 return new MetaProperty(name, Object.class) {
@@ -2684,7 +2684,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
         //----------------------------------------------------------------------
         boolean ambiguousListener = false;
         if (method == null) {
-            method = (MetaMethod) listeners.get(name);
+            method = listeners.get(name);
             ambiguousListener = method == AMBIGUOUS_LISTENER_METHOD;
             if (method != null &&
                     !ambiguousListener &&
@@ -3920,7 +3920,7 @@ public class MetaClassImpl implements MetaClass, MutableMetaClass {
         }
 
         public void put(CachedClass key, SingleKeyHashMap value) {
-            ((Entry) getOrPut(key)).value = value;
+            getOrPut(key).value = value;
         }
 
         public SingleKeyHashMap getNullable(CachedClass clazz) {


Mime
View raw message