Repository: groovy Updated Branches: refs/heads/master c1593aed2 -> afb3f9dd7
Minor refactoring Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/afb3f9dd Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/afb3f9dd Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/afb3f9dd Branch: refs/heads/master Commit: afb3f9dd706d0d3b679149477c4a9d5ef5ac22f4 Parents: c1593ae Author: sunlan <[email protected]> Authored: Thu Nov 16 20:28:22 2017 +0800 Committer: sunlan <[email protected]> Committed: Thu Nov 16 20:28:22 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/afb3f9dd/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) {
