Repository: groovy Updated Branches: refs/heads/GROOVY_2_5_X 288a232a7 -> 31bb8214b
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/31bb8214 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/31bb8214 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/31bb8214 Branch: refs/heads/GROOVY_2_5_X Commit: 31bb8214b521924c3c2c477790b929d3d2f36d7c Parents: 288a232 Author: sunlan <[email protected]> Authored: Thu Nov 16 20:28:22 2017 +0800 Committer: sunlan <[email protected]> Committed: Thu Nov 16 20:29:13 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/31bb8214/src/main/groovy/lang/MetaClassImpl.java ---------------------------------------------------------------------- diff --git a/src/main/groovy/lang/MetaClassImpl.java b/src/main/groovy/lang/MetaClassImpl.java index 10e0b7f..7c8afd2 100644 --- a/src/main/groovy/lang/MetaClassImpl.java +++ b/src/main/groovy/lang/MetaClassImpl.java @@ -1467,7 +1467,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(); @@ -1850,7 +1850,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; @@ -2004,7 +2004,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) { @@ -2667,7 +2667,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 && @@ -3903,7 +3903,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) {
