You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2022/06/26 16:19:37 UTC
[groovy] 01/02: Trivial refactoring: remove redundant type casting
This is an automated email from the ASF dual-hosted git repository.
sunlan pushed a commit to branch GROOVY_4_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git
commit dc6319c5225068262df611d55ed48a1f658740d7
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jun 25 19:59:55 2022 +0800
Trivial refactoring: remove redundant type casting
(cherry picked from commit cd7d21e994d0355aaa3058498849c80397c4aff6)
---
src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java b/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
index 93c075c56d..308bbb0463 100644
--- a/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
+++ b/src/main/java/org/codehaus/groovy/reflection/MixinInMetaClass.java
@@ -110,7 +110,7 @@ public class MixinInMetaClass {
ExpandoMetaClass mc = (ExpandoMetaClass) self;
- List<MetaMethod> arr = new ArrayList<MetaMethod>();
+ List<MetaMethod> arr = new ArrayList<>();
for (Class categoryClass : categoryClasses) {
final CachedClass cachedCategoryClass = ReflectionCache.getCachedClass(categoryClass);
@@ -152,8 +152,8 @@ public class MixinInMetaClass {
}
}
- for (Object res : arr) {
- final MetaMethod metaMethod = (MetaMethod) res;
+ for (MetaMethod res : arr) {
+ final MetaMethod metaMethod = res;
if (metaMethod.getDeclaringClass().isAssignableFrom(selfClass))
mc.registerInstanceMethod(metaMethod);
else {