From bfcd5fe17c9134c36abe9c74f67a63139bf0f69c Mon Sep 17 00:00:00 2001 From: Michael Yan Date: Wed, 19 Jun 2024 21:34:16 +0800 Subject: [PATCH] Fixes Groovy STC errors --- .../grails/plugin/formfields/BeanPropertyAccessorImpl.groovy | 4 ++-- .../formfields/DelegatingBeanPropertyAccessorImpl.groovy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorImpl.groovy b/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorImpl.groovy index ad59a42d..49e80751 100644 --- a/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorImpl.groovy +++ b/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorImpl.groovy @@ -124,8 +124,8 @@ class BeanPropertyAccessorImpl implements BeanPropertyAccessor { @CompileStatic private List getSuperclassesAndInterfaces(Class type) { - List superclasses = [] - superclasses.addAll(ClassUtils.getAllSuperclasses(ClassUtils.primitiveToWrapper(type))) + List superclasses = new ArrayList<>() + superclasses.addAll((List) ClassUtils.getAllSuperclasses(ClassUtils.primitiveToWrapper(type))) for(Object it in ClassUtils.getAllInterfaces(type)) { Class interfaceCls = (Class)it String name = interfaceCls.name diff --git a/src/main/groovy/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.groovy b/src/main/groovy/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.groovy index ae700f30..334449b3 100644 --- a/src/main/groovy/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.groovy +++ b/src/main/groovy/grails/plugin/formfields/DelegatingBeanPropertyAccessorImpl.groovy @@ -142,8 +142,8 @@ class DelegatingBeanPropertyAccessorImpl implements BeanPropertyAccessor { } private List getSuperclassesAndInterfaces(Class type) { - List superclasses = [] - superclasses.addAll(ClassUtils.getAllSuperclasses(ClassUtils.primitiveToWrapper(type))) + List superclasses = new ArrayList<>() + superclasses.addAll((List) ClassUtils.getAllSuperclasses(ClassUtils.primitiveToWrapper(type))) for (Object it in ClassUtils.getAllInterfaces(type)) { Class interfaceCls = (Class) it String name = interfaceCls.name