diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9a6a9f4148c..0d2b5cf2cb9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -31,8 +31,6 @@ jobs: uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3 env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} with: arguments: build groovydoc publish: @@ -55,8 +53,6 @@ jobs: uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3 env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} with: diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index 3383698559d..4edd53263ae 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -52,11 +52,10 @@ jobs: - name: Checkout Groovy 3_0_X (Grails 5 and later) if: startsWith(github.ref, 'refs/heads/6.') || startsWith(github.base_ref, '6.') || startsWith(github.ref, 'refs/heads/5.') || startsWith(github.base_ref, '5.') run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_3_0_X --single-branch - - name: Set CI_GROOVY_VERSION for Grails + - name: Get Groovy version for Grails id: groovy-version run: | cd ../groovy - echo "CI_GROOVY_VERSION=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_ENV echo "value=$(cat gradle.properties | grep groovyVersion | cut -d\= -f2 | tr -d '[:space:]')" >> $GITHUB_OUTPUT - name: Prepare GE Set-up Configuration id: ge_conf @@ -130,7 +129,7 @@ jobs: distribution: 'adopt' java-version: '11' - name: Cache local Maven repository & Groovy - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 with: path: | ~/groovy @@ -143,10 +142,11 @@ jobs: id: build_grails uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3 env: + ORG_GRADLE_PROJECT_groovyVersion: ${{ needs.build_groovy.outputs.groovyVersion }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} with: arguments: | build - -x groovydoc + -x groovydoc \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d9e67017be..c648de29a74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} - name: Upload Distribution if: success() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: name: grails-${{ steps.release_version.outputs.value }}.zip path: build/distributions/grails-${{ steps.release_version.outputs.value }}.zip diff --git a/.github/workflows/retry-release.yml b/.github/workflows/retry-release.yml index a25ee6a466f..7de28ab8a90 100644 --- a/.github/workflows/retry-release.yml +++ b/.github/workflows/retry-release.yml @@ -49,8 +49,6 @@ jobs: arguments: assemble env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }} - GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }} - name: Upload artifacts to the Github release id: upload_artifact if: steps.assemble.outcome == 'success' diff --git a/build.gradle b/build.gradle index 94da16e85cf..e7777ada6ef 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ ext { // When making changes in the dependencyVersions, remember to also update the Grails BOM Documentation: // https://docs.grails.org/snapshot/ref/Dependency%20Versions/Grails%20BOM.html dependencyVersions = [ - 'fieldsPlugin' : [version: feildsPluginVersion, + 'fieldsPlugin' : [version: fieldsPluginVersion, group : 'org.grails.plugins', names : ['fields'], modules: [''] @@ -220,14 +220,14 @@ if (isReleaseVersion) { allprojects { repositories { - mavenLocal() + mavenLocal() // Used by the Groovy Joint Validation Github workflow after building groovy locally in CI mavenCentral() - maven { url "https://repo.grails.org/grails/core" } - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + maven { url = "https://repo.grails.org/grails/core" } + maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" } if (groovyVersion.endsWith('-SNAPSHOT')) { - maven { - name 'JFrog OSS snapshot repo' - url 'https://oss.jfrog.org/oss-snapshot-local/' + maven { // Used for testing with Groovy snapshots locally + name = 'Groovy Snapshot repository' + url = 'https://groovy.jfrog.io/artifactory/libs-snapshot-local/' } } } diff --git a/gradle.properties b/gradle.properties index 975126b5c78..cb2a8301ae5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ cglibVersion=2.2.2 commonsLangVersion=2.6 datastoreVersion=8.1.2 directoryWatcherVersion=0.9.9 -feildsPluginVersion=5.1.0-SNAPSHOT +fieldsPluginVersion=5.1.0-SNAPSHOT gdocEngineVersion=1.0.1 gradleNexusPluginVersion=2.3.1 gradleNexusStagingPluginVersion=0.12.0 @@ -42,6 +42,7 @@ spockVersion=2.1-groovy-3.0 springBootVersion=2.7.18 springLoadedVersion=1.2.8.RELEASE springVersion=5.3.39 +spring.version=5.3.39 testingSupportVersion=3.2.1 testingSupportVersionForTests=3.2.2 tomcatLog4jVersion=8.5.2 diff --git a/grails-core/src/main/groovy/grails/boot/config/GrailsApplicationPostProcessor.groovy b/grails-core/src/main/groovy/grails/boot/config/GrailsApplicationPostProcessor.groovy index 9de746d7e8f..5c5b0d02709 100644 --- a/grails-core/src/main/groovy/grails/boot/config/GrailsApplicationPostProcessor.groovy +++ b/grails-core/src/main/groovy/grails/boot/config/GrailsApplicationPostProcessor.groovy @@ -68,15 +68,10 @@ class GrailsApplicationPostProcessor implements BeanDefinitionRegistryPostProces GrailsApplicationPostProcessor(GrailsApplicationLifeCycle lifeCycle, ApplicationContext applicationContext, Class...classes) { this.lifeCycle = lifeCycle - if(lifeCycle instanceof GrailsApplicationClass) { - this.applicationClass = (GrailsApplicationClass)lifeCycle - } - else { - this.applicationClass = null - } - this.classes = classes != null ? classes : [] as Class[] - grailsApplication = applicationClass != null ? new DefaultGrailsApplication(applicationClass) : new DefaultGrailsApplication() - pluginManager = new DefaultGrailsPluginManager(grailsApplication) + this.applicationClass = lifeCycle instanceof GrailsApplicationClass ? (GrailsApplicationClass) lifeCycle : null + this.classes = classes ?: [] as Class[] + this.grailsApplication = applicationClass ? new DefaultGrailsApplication(applicationClass) : new DefaultGrailsApplication() + this.pluginManager = applicationContext?.getBeanNamesForType(GrailsPluginManager) ? applicationContext.getBean(GrailsPluginManager) : new DefaultGrailsPluginManager(grailsApplication) if(applicationContext != null) { setApplicationContext(applicationContext) } @@ -290,30 +285,22 @@ class GrailsApplicationPostProcessor implements BeanDefinitionRegistryPostProces } } - @SuppressWarnings("GrMethodMayBeStatic") private void loadPluginConfigurationsToMicronautContext(ConfigurableApplicationContext applicationContext) { - String[] beanNames = applicationContext.getBeanNamesForType(GrailsPluginManager) - if (beanNames.length == 0) { - // do not continue if PluginManager is not available + ConfigurableApplicationContext parentApplicationContext = (ConfigurableApplicationContext) applicationContext.parent + if (!parentApplicationContext) { + // No Micronaut parent context, return early return } - - GrailsPluginManager pluginManager = applicationContext.getBean(GrailsPluginManager) - ConfigurableApplicationContext parentApplicationContext = (ConfigurableApplicationContext) applicationContext.parent ConfigurableEnvironment parentContextEnv = parentApplicationContext.getEnvironment() if (parentContextEnv instanceof MicronautEnvironment) { - if (log.isDebugEnabled()) { - log.debug("Loading configurations from the plugins to the parent Micronaut context") - } + log.debug('Loading configurations from the plugins to the parent Micronaut context') final io.micronaut.context.env.Environment micronautEnv = ((io.micronaut.context.env.Environment) parentContextEnv.getEnvironment()) final GrailsPlugin[] plugins = pluginManager.allPlugins Integer priority = AbstractPropertySourceLoader.DEFAULT_POSITION Arrays.stream(plugins) .filter({ GrailsPlugin plugin -> plugin.propertySource != null }) .forEach({ GrailsPlugin plugin -> - if (log.isDebugEnabled()) { - log.debug("Loading configurations from {} plugin to the parent Micronaut context", plugin.name) - } + log.debug('Loading configurations from {} plugin to the parent Micronaut context', plugin.name) micronautEnv.addPropertySource(PropertySource.of("grails.plugins.$plugin.name", (Map) plugin.propertySource.source, --priority)) }) micronautEnv.refresh() diff --git a/grails-core/src/test/groovy/org/grails/plugins/GrailsPluginConfigurationClass.groovy b/grails-core/src/test/groovy/org/grails/plugins/GrailsPluginConfigurationClass.groovy index 6f413170fce..65e0056a8f9 100644 --- a/grails-core/src/test/groovy/org/grails/plugins/GrailsPluginConfigurationClass.groovy +++ b/grails-core/src/test/groovy/org/grails/plugins/GrailsPluginConfigurationClass.groovy @@ -1,13 +1,10 @@ package org.grails.plugins import grails.boot.config.GrailsAutoConfiguration -import grails.core.DefaultGrailsApplication import grails.core.GrailsApplication import grails.plugins.GrailsPlugin import grails.plugins.GrailsPluginManager import groovy.transform.CompileStatic -import org.grails.plugins.DefaultGrailsPlugin -import org.grails.plugins.MockGrailsPluginManager import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.core.io.FileSystemResource @@ -24,17 +21,17 @@ class GrailsPluginConfigurationClass extends GrailsAutoConfiguration { @Bean(name = "grailsPluginManager") GrailsPluginManager getGrailsPluginManager() { - String tempDir = System.getProperty("java.io.tmpdir") - GrailsApplication grailsApplication = new DefaultGrailsApplication() - final MockGrailsPluginManager pluginManager = new MockGrailsPluginManager(grailsApplication) - final List plugins = createGrailsPlugins(grailsApplication) - plugins.forEach({ plugin -> pluginManager.registerMockPlugin((GrailsPlugin) plugin)}) - return pluginManager + MockGrailsPluginManager pluginManager = new MockGrailsPluginManager() + createGrailsPlugins(pluginManager.application).each { + pluginManager.registerMockPlugin(it) + } + pluginManager } - private List createGrailsPlugins(DefaultGrailsApplication grailsApplication) { + private List createGrailsPlugins(GrailsApplication grailsApplication) { final String grailsVersion = '4.0.1' def gcl = new GroovyClassLoader() + GrailsPlugin plugin = new MockTestGrailsPlugin(gcl.parseClass("""class TestGrailsPlugin { def version = '1.0.0' def grailsVersion = '$grailsVersion' @@ -45,7 +42,8 @@ class GrailsPluginConfigurationClass extends GrailsAutoConfiguration { def version = '1.0.0' def grailsVersion = '$grailsVersion' }"""), grailsApplication) - [plugin, plugin2] + + List.of(plugin, plugin2) } class MockTestGrailsPlugin extends DefaultGrailsPlugin { @@ -82,10 +80,6 @@ class GrailsPluginConfigurationClass extends GrailsAutoConfiguration { class MockTestTwoGrailsPlugin extends DefaultGrailsPlugin { - MockTestTwoGrailsPlugin(Class pluginClass, Resource resource, GrailsApplication application) { - super(pluginClass, resource, application) - } - MockTestTwoGrailsPlugin(Class pluginClass, GrailsApplication application) { super(pluginClass, application) } diff --git a/grails-databinding/src/test/groovy/grails/databinding/SimpleDataBinderSpec.groovy b/grails-databinding/src/test/groovy/grails/databinding/SimpleDataBinderSpec.groovy index 0f18c41e9f3..632e320a6b4 100755 --- a/grails-databinding/src/test/groovy/grails/databinding/SimpleDataBinderSpec.groovy +++ b/grails-databinding/src/test/groovy/grails/databinding/SimpleDataBinderSpec.groovy @@ -152,17 +152,17 @@ class SimpleDataBinderSpec extends Specification { then: obj.localDateTime == LocalDateTime.parse("2013-04-15T21:26:31.974", DateTimeFormatter.ISO_LOCAL_DATE_TIME) } - + @Issue('GRAILS-10925') void 'Test binding a Date to a Date property marked with @BindingFormat'() { given: def binder = new SimpleDataBinder() def obj = new DateContainer() def nowDate = new Date() - + when: binder.bind obj, [formattedUtilDate: nowDate] as SimpleMapDataBindingSource - + then: obj.formattedUtilDate == nowDate } @@ -224,117 +224,141 @@ class SimpleDataBinderSpec extends Specification { when: binder.bind obj, new SimpleMapDataBindingSource([utilDate: '2013-04-15 21:26:31.973', formattedUtilDate: '11151969']) + final Calendar calendar = Calendar.getInstance() + calendar.setTime(obj.utilDate) + + then: + Calendar.APRIL == calendar.get(Calendar.MONTH) + 15 == calendar.get(Calendar.DAY_OF_MONTH) + 2013 == calendar.get(Calendar.YEAR) + 21 == calendar.get(Calendar.HOUR_OF_DAY) + 26 == calendar.get(Calendar.MINUTE) + 31 == calendar.get(Calendar.SECOND) + + when: + calendar.setTime(obj.formattedUtilDate) then: - Calendar.APRIL == obj.utilDate.month - 15 == obj.utilDate.date - 113 == obj.utilDate.year - 21 == obj.utilDate.hours - 26 == obj.utilDate.minutes - 31 == obj.utilDate.seconds - Calendar.NOVEMBER == obj.formattedUtilDate.month - 15 == obj.formattedUtilDate.date - 69 == obj.formattedUtilDate.year + Calendar.NOVEMBER == calendar.get(Calendar.MONTH) + 15 == calendar.get(Calendar.DAY_OF_MONTH) + 1969 == calendar.get(Calendar.YEAR) when: obj.utilDate = null binder.bind obj, new SimpleMapDataBindingSource([utilDate: "2011-03-12T09:24:22Z"]) + calendar.setTime(obj.utilDate) then: - Calendar.MARCH == obj.utilDate.month - 12 == obj.utilDate.date - 111 == obj.utilDate.year - 9 == obj.utilDate.hours - 24 == obj.utilDate.minutes - 22 == obj.utilDate.seconds + Calendar.MARCH == calendar.get(Calendar.MONTH) + 12 == calendar.get(Calendar.DAY_OF_MONTH) + 2011 == calendar.get(Calendar.YEAR) + 9 == calendar.get(Calendar.HOUR_OF_DAY) + 24 == calendar.get(Calendar.MINUTE) + 22 == calendar.get(Calendar.SECOND) } void 'Test structured date binding'() { given: def binder = new SimpleDataBinder() def obj = new DateContainer() + Calendar calendar = Calendar.getInstance() when: binder.bind(obj, new SimpleMapDataBindingSource([utilDate_month: '11', - utilDate_day: '15', - utilDate_year: '1969', - calendar_month: '4', - calendar_day: '21', - calendar_year: '2049', - sqlDate_month: '6', - sqlDate_day: '14', - sqlDate_year: '1937', - sqlDate: 'struct', - calendar: 'struct', - utilDate: 'struct'])) + utilDate_day: '15', + utilDate_year: '1969', + calendar_month: '4', + calendar_day: '21', + calendar_year: '2049', + sqlDate_month: '6', + sqlDate_day: '14', + sqlDate_year: '1937', + sqlDate: 'struct', + calendar: 'struct', + utilDate: 'struct'])) def utilDate = obj.utilDate - def calendar = obj.calendar - def sqlDate = obj.sqlDate + calendar.setTime(utilDate) then: - Calendar.NOVEMBER == utilDate.month - 15 == utilDate.date - 69 == utilDate.year - Calendar.JUNE == sqlDate.month - 14 == sqlDate.date - 37 == sqlDate.year - Calendar.APRIL == calendar.get(Calendar.MONTH) - 21 == calendar.get(Calendar.DATE) - 2049 == calendar.get(Calendar.YEAR) + Calendar.NOVEMBER == calendar.get(Calendar.MONTH) + 15 == calendar.get(Calendar.DAY_OF_MONTH) + 1969 == calendar.get(Calendar.YEAR) + + when: + calendar.setTime(obj.sqlDate) + + then: + Calendar.JUNE == calendar.get(Calendar.MONTH) + 14 == calendar.get(Calendar.DAY_OF_MONTH) + 1937 == calendar.get(Calendar.YEAR) + + when: + def cal = obj.calendar + + then: + Calendar.APRIL == cal.get(Calendar.MONTH) + 21 == cal.get(Calendar.DATE) + 2049 == cal.get(Calendar.YEAR) when: obj.utilDate = obj.calendar = obj.sqlDate = null binder.bind(obj, new SimpleMapDataBindingSource([utilDate_month: '11', - utilDate_day: '15', - utilDate_year: '1969', - calendar_month: '4', - calendar_day: '21', - calendar_year: '2049', - sqlDate_month: '6', - sqlDate_day: '14', - sqlDate_year: '1937', - sqlDate: 'date.struct', - calendar: 'date.struct', - utilDate: 'date.struct'])) - utilDate = obj.utilDate - calendar = obj.calendar - sqlDate = obj.sqlDate + utilDate_day: '15', + utilDate_year: '1969', + calendar_month: '4', + calendar_day: '21', + calendar_year: '2049', + sqlDate_month: '6', + sqlDate_day: '14', + sqlDate_year: '1937', + sqlDate: 'date.struct', + calendar: 'date.struct', + utilDate: 'date.struct'])) + calendar.setTime(obj.utilDate) then: - Calendar.NOVEMBER == utilDate.month - 15 == utilDate.date - 69 == utilDate.year - Calendar.JUNE == sqlDate.month - 14 == sqlDate.date - 37 == sqlDate.year - Calendar.APRIL == calendar.get(Calendar.MONTH) - 21 == calendar.get(Calendar.DATE) - 2049 == calendar.get(Calendar.YEAR) + Calendar.NOVEMBER == calendar.get(Calendar.MONTH) + 15 == calendar.get(Calendar.DAY_OF_MONTH) + 1969 == calendar.get(Calendar.YEAR) + + when: + calendar.setTime(obj.sqlDate) + + then: + Calendar.JUNE == calendar.get(Calendar.MONTH) + 14 == calendar.get(Calendar.DAY_OF_MONTH) + 1937 == calendar.get(Calendar.YEAR) + + when: + cal = obj.calendar + + then: + Calendar.APRIL == cal.get(Calendar.MONTH) + 21 == cal.get(Calendar.DATE) + 2049 == cal.get(Calendar.YEAR) when: obj.utilDate = obj.calendar = obj.sqlDate = null binder.bind(obj, new SimpleMapDataBindingSource([utilDate_month: '11', - utilDate_day: '15', - utilDate_year: '1969', - calendar_month: '4', - calendar_day: '21', - calendar_year: '2049', - sqlDate_month: '6', - sqlDate_day: '14', - sqlDate_year: '1937', - sqlDate: 'struct', - calendar: 'struct', - utilDate: 'struct']), null, ['sqlDate', 'utilDate']) + utilDate_day: '15', + utilDate_year: '1969', + calendar_month: '4', + calendar_day: '21', + calendar_year: '2049', + sqlDate_month: '6', + sqlDate_day: '14', + sqlDate_year: '1937', + sqlDate: 'struct', + calendar: 'struct', + utilDate: 'struct']), null, ['sqlDate', 'utilDate']) utilDate = obj.utilDate - calendar = obj.calendar - sqlDate = obj.sqlDate + cal = obj.calendar then: - sqlDate == null utilDate == null - Calendar.APRIL == calendar.get(Calendar.MONTH) - 21 == calendar.get(Calendar.DATE) - 2049 == calendar.get(Calendar.YEAR) + Calendar.APRIL == cal.get(Calendar.MONTH) + 21 == cal.get(Calendar.DATE) + 2049 == cal.get(Calendar.YEAR) } void 'Test struct binding to a list'() { @@ -530,44 +554,44 @@ class SimpleDataBinderSpec extends Specification { widget.names[1] == null widget.names[2] == 'two' } - + void 'Test @BindUsing on a List'() { given: def binder = new SimpleDataBinder() def widget = new Widget() - + when: binder.bind widget, [listOfIntegers: '4'] as SimpleMapDataBindingSource - + then: widget.listOfIntegers == [0, 1, 2, 3] } - + @Issue('GRAILS-10853') void 'Test adding new elements to a Set using indexed properties'() { given: def binder = new SimpleDataBinder() def widget = new Widget() - + when: binder.bind widget, ['factories[2]': [name: 'Tres'], 'factories[0]': [name: 'Uno'], 'factories[1]': [name: 'Dos']] as SimpleMapDataBindingSource - + then: widget.factories.size() == 3 widget.factories.find { it.name == 'Uno' } widget.factories.find { it.name == 'Dos' } widget.factories.find { it.name == 'Tres' } } - + @Issue('GRAILS-10865') void 'Test binding to an inherited typed collection'() { given: def binder = new SimpleDataBinder() def obj = new ClassWithInheritedTypedCollection() - + when: binder.bind obj, [list: ['1', '2', '3'], 'map[one]': '1', 'map[two]': '2' ] as SimpleMapDataBindingSource - + then: obj.list == [1, 2, 3] obj.map.one == 1 @@ -699,7 +723,7 @@ class Widget { byte[] byteArray Integer[] integers List names - @BindUsing({ obj, source -> + @BindUsing({ obj, source -> def cnt = source['listOfIntegers'] as int def result = [] cnt.times { result << it } diff --git a/grails-shell/src/main/groovy/org/grails/cli/profile/AbstractProfile.groovy b/grails-shell/src/main/groovy/org/grails/cli/profile/AbstractProfile.groovy index 9b87bdc4dce..0644bbf6f0b 100644 --- a/grails-shell/src/main/groovy/org/grails/cli/profile/AbstractProfile.groovy +++ b/grails-shell/src/main/groovy/org/grails/cli/profile/AbstractProfile.groovy @@ -166,8 +166,8 @@ abstract class AbstractProfile implements Profile { } } - defaultFeaturesNames.addAll((List) defaultFeatures) - requiredFeatureNames.addAll((List) requiredFeatures) + defaultFeaturesNames.addAll(defaultFeatures as Set) + requiredFeatureNames.addAll(requiredFeatures as Set) } diff --git a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/converters/AbstractStructuredBindingEditor.groovy b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/converters/AbstractStructuredBindingEditor.groovy index 1a2c33e7be6..2fa71d0cd53 100644 --- a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/converters/AbstractStructuredBindingEditor.groovy +++ b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/converters/AbstractStructuredBindingEditor.groovy @@ -73,6 +73,6 @@ abstract class AbstractStructuredBindingEditor implements TypedStructuredBind valuesMap[propName] = bindingSource.getPropertyValue(key) } } - valuesMap + valuesMap as Map } }