From eb9930e499ffebd9c2aae5fe5a177acf2b2e3032 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Mon, 21 Jul 2025 14:10:30 +0200 Subject: [PATCH 01/38] build: add Checkstyle and Codenarc support Add Checkstyle and Codenarc configuration for the `grails.core.ROOT` and `grails-gradle` projects to enforce consistent coding standards. Rules will be introduced gradually, and source files reformatted incrementally to maintain a manageable review process and avoid overwhelming diffs. Formatting commits will be squashed before merging to minimize noise in the project history. --- .../checkstyle/checkstyle-suppressions.xml | 22 ++++++++ etc/config/checkstyle/checkstyle.xml | 28 ++++++++++ etc/config/codenarc/codenarc.groovy | 5 ++ gradle.properties | 4 ++ gradle/code-style-config.gradle | 54 +++++++++++++++++++ grails-async/core/build.gradle | 1 + grails-async/gpars/build.gradle | 1 + grails-async/plugin/build.gradle | 1 + grails-async/rxjava/build.gradle | 1 + grails-async/rxjava2/build.gradle | 1 + grails-async/rxjava3/build.gradle | 1 + grails-bootstrap/build.gradle | 1 + grails-cache/build.gradle | 1 + grails-codecs-core/build.gradle | 1 + grails-codecs/build.gradle | 1 + grails-common/build.gradle | 1 + grails-console/build.gradle | 1 + grails-controllers/build.gradle | 1 + grails-converters/build.gradle | 1 + grails-core/build.gradle | 1 + .../boot-plugin/build.gradle | 1 + grails-data-hibernate5/core/build.gradle | 1 + .../dbmigration/build.gradle | 1 + .../grails-plugin/build.gradle | 1 + grails-data-mongodb/boot-plugin/build.gradle | 1 + grails-data-mongodb/bson/build.gradle | 1 + grails-data-mongodb/core/build.gradle | 1 + grails-data-mongodb/ext/build.gradle | 1 + .../grails-plugin/build.gradle | 1 + .../gson-templates/build.gradle | 1 + grails-data-simple/build.gradle | 1 + grails-databinding-core/build.gradle | 1 + grails-databinding/build.gradle | 1 + grails-datamapping-async/build.gradle | 1 + grails-datamapping-core-test/build.gradle | 1 + grails-datamapping-core/build.gradle | 1 + grails-datamapping-rx/build.gradle | 1 + grails-datamapping-support/build.gradle | 1 + grails-datamapping-tck/build.gradle | 1 + grails-datamapping-validation/build.gradle | 1 + grails-datasource/build.gradle | 1 + grails-datastore-async/build.gradle | 1 + grails-datastore-core/build.gradle | 1 + grails-datastore-web/build.gradle | 1 + grails-domain-class/build.gradle | 1 + grails-encoder/build.gradle | 1 + grails-events/compat/build.gradle | 1 + grails-events/core/build.gradle | 1 + grails-events/gpars/build.gradle | 1 + grails-events/plugin/build.gradle | 1 + grails-events/rxjava/build.gradle | 1 + grails-events/rxjava2/build.gradle | 1 + grails-events/rxjava3/build.gradle | 1 + grails-events/spring/build.gradle | 1 + grails-events/transforms/build.gradle | 1 + grails-fields/build.gradle | 1 + grails-geb/build.gradle | 1 + grails-gradle/docs-core/build.gradle | 1 + grails-gradle/gradle/code-style-config.gradle | 54 +++++++++++++++++++ grails-gradle/model/build.gradle | 1 + grails-gradle/plugins/build.gradle | 1 + grails-gradle/tasks/build.gradle | 1 + grails-gsp/core/build.gradle | 1 + grails-gsp/grails-layout/build.gradle | 1 + grails-gsp/grails-sitemesh3/build.gradle | 1 + grails-gsp/grails-taglib/build.gradle | 1 + grails-gsp/grails-web-gsp-taglib/build.gradle | 1 + grails-gsp/grails-web-gsp/build.gradle | 1 + grails-gsp/grails-web-jsp/build.gradle | 1 + grails-gsp/grails-web-taglib/build.gradle | 1 + grails-gsp/plugin/build.gradle | 1 + grails-gsp/spring-boot/build.gradle | 1 + grails-i18n/build.gradle | 1 + grails-interceptors/build.gradle | 1 + grails-logging/build.gradle | 1 + grails-mimetypes/build.gradle | 1 + grails-rest-transforms/build.gradle | 1 + grails-scaffolding/build.gradle | 1 + grails-services/build.gradle | 1 + grails-shell-cli/build.gradle | 1 + grails-spring/build.gradle | 1 + grails-test-core/build.gradle | 1 + grails-test-suite-base/build.gradle | 1 + grails-testing-support-core/build.gradle | 1 + .../build.gradle | 1 + grails-testing-support-mongodb/build.gradle | 1 + .../build.gradle | 1 + grails-testing-support-web/build.gradle | 1 + grails-url-mappings/build.gradle | 1 + grails-validation/build.gradle | 1 + grails-views-core/build.gradle | 1 + grails-views-gson/build.gradle | 1 + grails-views-markup/build.gradle | 1 + grails-web-boot/build.gradle | 1 + grails-web-common/build.gradle | 1 + grails-web-core/build.gradle | 1 + grails-web-databinding/build.gradle | 1 + grails-web-mvc/build.gradle | 1 + grails-web-url-mappings/build.gradle | 1 + grails-wrapper/build.gradle | 1 + 100 files changed, 261 insertions(+) create mode 100644 etc/config/checkstyle/checkstyle-suppressions.xml create mode 100644 etc/config/checkstyle/checkstyle.xml create mode 100644 etc/config/codenarc/codenarc.groovy create mode 100644 gradle/code-style-config.gradle create mode 100644 grails-gradle/gradle/code-style-config.gradle diff --git a/etc/config/checkstyle/checkstyle-suppressions.xml b/etc/config/checkstyle/checkstyle-suppressions.xml new file mode 100644 index 00000000000..58ee65cc408 --- /dev/null +++ b/etc/config/checkstyle/checkstyle-suppressions.xml @@ -0,0 +1,22 @@ + + + + + diff --git a/etc/config/checkstyle/checkstyle.xml b/etc/config/checkstyle/checkstyle.xml new file mode 100644 index 00000000000..ff91576794a --- /dev/null +++ b/etc/config/checkstyle/checkstyle.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/etc/config/codenarc/codenarc.groovy b/etc/config/codenarc/codenarc.groovy new file mode 100644 index 00000000000..b37db30d75a --- /dev/null +++ b/etc/config/codenarc/codenarc.groovy @@ -0,0 +1,5 @@ +ruleset { + + description 'A Codenarc ruleset for the Grails codebase' + +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 35a79651ccb..53fd5d6435e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -62,6 +62,10 @@ micronautVersion=4.6.5 micronautSerdeJacksonVersion=2.11.0 grailsSpringSecurityVersion=7.0.0-SNAPSHOT +# build dependencies for code quality checks +checkstyleVersion=10.26.1 +codenarcVersion=3.6.0 + # This prevents the Grails Gradle Plugin from unnecessarily excluding slf4j-simple in the generated POMs # https://github.com/apache/grails-gradle-plugin/issues/222 slf4jPreventExclusion=true diff --git a/gradle/code-style-config.gradle b/gradle/code-style-config.gradle new file mode 100644 index 00000000000..1d7bce357cb --- /dev/null +++ b/gradle/code-style-config.gradle @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +apply plugin: 'checkstyle' +apply plugin: 'codenarc' + +extensions.configure(CheckstyleExtension) { + // Explicit `it` is required in extension configuration + it.configDirectory = rootProject.layout.projectDirectory.dir('etc/config/checkstyle').asFile + it.maxWarnings = 0 + it.showViolations = true + it.ignoreFailures = false + it.toolVersion = checkstyleVersion +} + +extensions.configure(CodeNarcExtension) { + // Explicit `it` is required in extension configuration + it.configFile = rootProject.layout.projectDirectory.file('etc/config/codenarc/codenarc.groovy').asFile + it.toolVersion = codenarcVersion +} + +tasks.named('checkstyleMain') { + group = 'verification' +} + +tasks.named('checkstyleTest') { + group = 'verification' + enabled = false // Do not check test sources at this time +} + +tasks.named('codenarcMain') { + group = 'verification' +} + +tasks.named('codenarcTest') { + group = 'verification' + enabled = false // Do not check test sources at this time +} \ No newline at end of file diff --git a/grails-async/core/build.gradle b/grails-async/core/build.gradle index 6a4f2b96791..a9f35631a1e 100644 --- a/grails-async/core/build.gradle +++ b/grails-async/core/build.gradle @@ -47,6 +47,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-async/gpars/build.gradle b/grails-async/gpars/build.gradle index ab599f3da30..daeb08a9222 100644 --- a/grails-async/gpars/build.gradle +++ b/grails-async/gpars/build.gradle @@ -47,6 +47,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-async/plugin/build.gradle b/grails-async/plugin/build.gradle index f8ff94c033a..f4078b32cfe 100644 --- a/grails-async/plugin/build.gradle +++ b/grails-async/plugin/build.gradle @@ -57,6 +57,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-async/rxjava/build.gradle b/grails-async/rxjava/build.gradle index b15111a3952..00a583c67fb 100644 --- a/grails-async/rxjava/build.gradle +++ b/grails-async/rxjava/build.gradle @@ -43,6 +43,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-async/rxjava2/build.gradle b/grails-async/rxjava2/build.gradle index 41732df8d9b..9f1cff3f12a 100644 --- a/grails-async/rxjava2/build.gradle +++ b/grails-async/rxjava2/build.gradle @@ -43,6 +43,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-async/rxjava3/build.gradle b/grails-async/rxjava3/build.gradle index 3c62cff0dd9..2cd8942622e 100644 --- a/grails-async/rxjava3/build.gradle +++ b/grails-async/rxjava3/build.gradle @@ -43,6 +43,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-bootstrap/build.gradle b/grails-bootstrap/build.gradle index b42df191c80..15017ca16b2 100644 --- a/grails-bootstrap/build.gradle +++ b/grails-bootstrap/build.gradle @@ -81,6 +81,7 @@ processResources { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-cache/build.gradle b/grails-cache/build.gradle index 2575e34f182..89e5a3e35e3 100644 --- a/grails-cache/build.gradle +++ b/grails-cache/build.gradle @@ -60,6 +60,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-codecs-core/build.gradle b/grails-codecs-core/build.gradle index 4fa52b2bb49..662060b41dd 100644 --- a/grails-codecs-core/build.gradle +++ b/grails-codecs-core/build.gradle @@ -54,6 +54,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-codecs/build.gradle b/grails-codecs/build.gradle index a109b376add..26eab116b06 100644 --- a/grails-codecs/build.gradle +++ b/grails-codecs/build.gradle @@ -64,6 +64,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-common/build.gradle b/grails-common/build.gradle index 3dadf85c547..bbc3256ff22 100644 --- a/grails-common/build.gradle +++ b/grails-common/build.gradle @@ -53,6 +53,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-console/build.gradle b/grails-console/build.gradle index e2d0cc792da..a83ac41a461 100644 --- a/grails-console/build.gradle +++ b/grails-console/build.gradle @@ -67,6 +67,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-controllers/build.gradle b/grails-controllers/build.gradle index 457a8f9748b..3d88b08a4ef 100644 --- a/grails-controllers/build.gradle +++ b/grails-controllers/build.gradle @@ -74,6 +74,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-converters/build.gradle b/grails-converters/build.gradle index c9a0d65d310..182b6d6ed7f 100644 --- a/grails-converters/build.gradle +++ b/grails-converters/build.gradle @@ -73,6 +73,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-core/build.gradle b/grails-core/build.gradle index e1d525c1790..79a030fc6e1 100644 --- a/grails-core/build.gradle +++ b/grails-core/build.gradle @@ -92,6 +92,7 @@ tasks.named('processResources', ProcessResources).configure { ProcessResources i apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-data-hibernate5/boot-plugin/build.gradle b/grails-data-hibernate5/boot-plugin/build.gradle index 5a054dca254..52e6497737d 100644 --- a/grails-data-hibernate5/boot-plugin/build.gradle +++ b/grails-data-hibernate5/boot-plugin/build.gradle @@ -59,6 +59,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/hibernate5-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-hibernate5/core/build.gradle b/grails-data-hibernate5/core/build.gradle index 33fb9277d4c..db4d955201b 100644 --- a/grails-data-hibernate5/core/build.gradle +++ b/grails-data-hibernate5/core/build.gradle @@ -89,6 +89,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/hibernate5-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/grails-data-tck-config.gradle') diff --git a/grails-data-hibernate5/dbmigration/build.gradle b/grails-data-hibernate5/dbmigration/build.gradle index 9fd197a1fd0..790cc41c23a 100644 --- a/grails-data-hibernate5/dbmigration/build.gradle +++ b/grails-data-hibernate5/dbmigration/build.gradle @@ -106,6 +106,7 @@ tasks.withType(Test).configureEach { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/hibernate5-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-hibernate5/grails-plugin/build.gradle b/grails-data-hibernate5/grails-plugin/build.gradle index d9a30d22ae2..892d01db72f 100644 --- a/grails-data-hibernate5/grails-plugin/build.gradle +++ b/grails-data-hibernate5/grails-plugin/build.gradle @@ -85,6 +85,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/hibernate5-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-mongodb/boot-plugin/build.gradle b/grails-data-mongodb/boot-plugin/build.gradle index 11b97e45c48..84074347a87 100644 --- a/grails-data-mongodb/boot-plugin/build.gradle +++ b/grails-data-mongodb/boot-plugin/build.gradle @@ -104,6 +104,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/mongodb-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-mongodb/bson/build.gradle b/grails-data-mongodb/bson/build.gradle index 646d1fe3186..dda142f5671 100644 --- a/grails-data-mongodb/bson/build.gradle +++ b/grails-data-mongodb/bson/build.gradle @@ -98,6 +98,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/mongodb-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-mongodb/core/build.gradle b/grails-data-mongodb/core/build.gradle index f7ac7978c80..6c89d156661 100644 --- a/grails-data-mongodb/core/build.gradle +++ b/grails-data-mongodb/core/build.gradle @@ -151,6 +151,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/mongodb-forked-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/grails-data-tck-config.gradle') diff --git a/grails-data-mongodb/ext/build.gradle b/grails-data-mongodb/ext/build.gradle index 86bcaa1539a..e9ba4cd7626 100644 --- a/grails-data-mongodb/ext/build.gradle +++ b/grails-data-mongodb/ext/build.gradle @@ -87,6 +87,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/mongodb-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-mongodb/grails-plugin/build.gradle b/grails-data-mongodb/grails-plugin/build.gradle index db68de1d369..4d633438027 100644 --- a/grails-data-mongodb/grails-plugin/build.gradle +++ b/grails-data-mongodb/grails-plugin/build.gradle @@ -129,6 +129,7 @@ tasks.named('groovydoc') { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/mongodb-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-mongodb/gson-templates/build.gradle b/grails-data-mongodb/gson-templates/build.gradle index f276cd8ca40..d821432f531 100644 --- a/grails-data-mongodb/gson-templates/build.gradle +++ b/grails-data-mongodb/gson-templates/build.gradle @@ -69,6 +69,7 @@ tasks.named('classes').configure { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/mongodb-test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-data-simple/build.gradle b/grails-data-simple/build.gradle index a603bcff0f6..df43a6fef72 100644 --- a/grails-data-simple/build.gradle +++ b/grails-data-simple/build.gradle @@ -93,6 +93,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-databinding-core/build.gradle b/grails-databinding-core/build.gradle index 4efb0bfcfb7..28a0551fbb3 100644 --- a/grails-databinding-core/build.gradle +++ b/grails-databinding-core/build.gradle @@ -57,6 +57,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-databinding/build.gradle b/grails-databinding/build.gradle index 49e1646bf26..6261cef74a6 100644 --- a/grails-databinding/build.gradle +++ b/grails-databinding/build.gradle @@ -70,6 +70,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-datamapping-async/build.gradle b/grails-datamapping-async/build.gradle index 81458a5169e..9e707b50bbb 100644 --- a/grails-datamapping-async/build.gradle +++ b/grails-datamapping-async/build.gradle @@ -74,6 +74,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datamapping-core-test/build.gradle b/grails-datamapping-core-test/build.gradle index e55f775f238..970426d2f45 100644 --- a/grails-datamapping-core-test/build.gradle +++ b/grails-datamapping-core-test/build.gradle @@ -134,6 +134,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/grails-data-tck-config.gradle') diff --git a/grails-datamapping-core/build.gradle b/grails-datamapping-core/build.gradle index 52ef07e4b8c..8295b2e69e6 100644 --- a/grails-datamapping-core/build.gradle +++ b/grails-datamapping-core/build.gradle @@ -118,6 +118,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datamapping-rx/build.gradle b/grails-datamapping-rx/build.gradle index 12ec2fef9f3..fcaf4b5b6d9 100644 --- a/grails-datamapping-rx/build.gradle +++ b/grails-datamapping-rx/build.gradle @@ -64,6 +64,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datamapping-support/build.gradle b/grails-datamapping-support/build.gradle index 01c740d8a22..b4cec37d891 100644 --- a/grails-datamapping-support/build.gradle +++ b/grails-datamapping-support/build.gradle @@ -119,6 +119,7 @@ tasks.withType(Jar).configureEach { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datamapping-tck/build.gradle b/grails-datamapping-tck/build.gradle index e89fc3067d8..b6ace68d757 100644 --- a/grails-datamapping-tck/build.gradle +++ b/grails-datamapping-tck/build.gradle @@ -114,6 +114,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') // do NOT do test configuration here, this is a TCK module diff --git a/grails-datamapping-validation/build.gradle b/grails-datamapping-validation/build.gradle index 544cf7dc745..cabf5e7304f 100644 --- a/grails-datamapping-validation/build.gradle +++ b/grails-datamapping-validation/build.gradle @@ -86,6 +86,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datasource/build.gradle b/grails-datasource/build.gradle index c5fb199e6ac..969a788109d 100644 --- a/grails-datasource/build.gradle +++ b/grails-datasource/build.gradle @@ -71,6 +71,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-datastore-async/build.gradle b/grails-datastore-async/build.gradle index 1b1838e4ae0..6ad2d35cb47 100644 --- a/grails-datastore-async/build.gradle +++ b/grails-datastore-async/build.gradle @@ -61,6 +61,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datastore-core/build.gradle b/grails-datastore-core/build.gradle index 7a70a7915e8..87a2d913455 100644 --- a/grails-datastore-core/build.gradle +++ b/grails-datastore-core/build.gradle @@ -98,6 +98,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-datastore-web/build.gradle b/grails-datastore-web/build.gradle index a177a1fb389..995de819b8a 100644 --- a/grails-datastore-web/build.gradle +++ b/grails-datastore-web/build.gradle @@ -88,6 +88,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-domain-class/build.gradle b/grails-domain-class/build.gradle index c53f0d33ddb..a329240c962 100644 --- a/grails-domain-class/build.gradle +++ b/grails-domain-class/build.gradle @@ -74,6 +74,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-encoder/build.gradle b/grails-encoder/build.gradle index 73504efd32d..90ad28fbcc4 100644 --- a/grails-encoder/build.gradle +++ b/grails-encoder/build.gradle @@ -58,6 +58,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/compat/build.gradle b/grails-events/compat/build.gradle index 892c32cd608..d9385c97dcd 100644 --- a/grails-events/compat/build.gradle +++ b/grails-events/compat/build.gradle @@ -38,6 +38,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-events/core/build.gradle b/grails-events/core/build.gradle index 38d91983584..6e72243d77f 100644 --- a/grails-events/core/build.gradle +++ b/grails-events/core/build.gradle @@ -44,6 +44,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/gpars/build.gradle b/grails-events/gpars/build.gradle index c94fee9aa65..6db7a2796be 100644 --- a/grails-events/gpars/build.gradle +++ b/grails-events/gpars/build.gradle @@ -45,6 +45,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/plugin/build.gradle b/grails-events/plugin/build.gradle index 1530d737686..cdd78d8d50e 100644 --- a/grails-events/plugin/build.gradle +++ b/grails-events/plugin/build.gradle @@ -51,6 +51,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/rxjava/build.gradle b/grails-events/rxjava/build.gradle index ebb69b7437e..f5421639f95 100644 --- a/grails-events/rxjava/build.gradle +++ b/grails-events/rxjava/build.gradle @@ -48,6 +48,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/rxjava2/build.gradle b/grails-events/rxjava2/build.gradle index 0697285af6b..da07f0bad5b 100644 --- a/grails-events/rxjava2/build.gradle +++ b/grails-events/rxjava2/build.gradle @@ -44,6 +44,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/rxjava3/build.gradle b/grails-events/rxjava3/build.gradle index 040c9bb1629..836342bd77f 100644 --- a/grails-events/rxjava3/build.gradle +++ b/grails-events/rxjava3/build.gradle @@ -44,6 +44,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/spring/build.gradle b/grails-events/spring/build.gradle index abdba357213..94bcb756993 100644 --- a/grails-events/spring/build.gradle +++ b/grails-events/spring/build.gradle @@ -44,6 +44,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-events/transforms/build.gradle b/grails-events/transforms/build.gradle index 6a43d17adf3..8312249c118 100644 --- a/grails-events/transforms/build.gradle +++ b/grails-events/transforms/build.gradle @@ -61,6 +61,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-fields/build.gradle b/grails-fields/build.gradle index 74b4fd64e52..98bd1f6af41 100644 --- a/grails-fields/build.gradle +++ b/grails-fields/build.gradle @@ -60,6 +60,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-geb/build.gradle b/grails-geb/build.gradle index 51758839afa..52428c07ddd 100644 --- a/grails-geb/build.gradle +++ b/grails-geb/build.gradle @@ -65,6 +65,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gradle/docs-core/build.gradle b/grails-gradle/docs-core/build.gradle index ffbc3df0aaf..ea59a0b852c 100644 --- a/grails-gradle/docs-core/build.gradle +++ b/grails-gradle/docs-core/build.gradle @@ -151,6 +151,7 @@ publishing { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/checksum-config.gradle') diff --git a/grails-gradle/gradle/code-style-config.gradle b/grails-gradle/gradle/code-style-config.gradle new file mode 100644 index 00000000000..02aef714d9f --- /dev/null +++ b/grails-gradle/gradle/code-style-config.gradle @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +apply plugin: 'checkstyle' +apply plugin: 'codenarc' + +extensions.configure(CheckstyleExtension) { + // Explicit `it` is required in extension configuration + it.configDirectory = rootProject.layout.projectDirectory.dir('../etc/config/checkstyle').asFile + it.maxWarnings = 0 + it.showViolations = true + it.ignoreFailures = false + it.toolVersion = checkstyleVersion +} + +extensions.configure(CodeNarcExtension) { + // Explicit `it` is required in extension configuration + it.configFile = rootProject.layout.projectDirectory.file('../etc/config/codenarc/codenarc.groovy').asFile + it.toolVersion = codenarcVersion +} + +tasks.named('checkstyleMain') { + group = 'verification' +} + +tasks.named('checkstyleTest') { + group = 'verification' + enabled = false // Do not check test sources at this time +} + +tasks.named('codenarcMain') { + group = 'verification' +} + +tasks.named('codenarcTest') { + group = 'verification' + enabled = false // Do not check test sources at this time +} \ No newline at end of file diff --git a/grails-gradle/model/build.gradle b/grails-gradle/model/build.gradle index f410d572628..c160d3ff711 100644 --- a/grails-gradle/model/build.gradle +++ b/grails-gradle/model/build.gradle @@ -130,6 +130,7 @@ publishing { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/checksum-config.gradle') diff --git a/grails-gradle/plugins/build.gradle b/grails-gradle/plugins/build.gradle index e2f8e8fd3a2..84cbfa1a998 100644 --- a/grails-gradle/plugins/build.gradle +++ b/grails-gradle/plugins/build.gradle @@ -183,6 +183,7 @@ publishing { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/e2eTest.gradle') from rootProject.layout.projectDirectory.file('gradle/checksum-config.gradle') diff --git a/grails-gradle/tasks/build.gradle b/grails-gradle/tasks/build.gradle index 107b785f258..0e781d66f20 100644 --- a/grails-gradle/tasks/build.gradle +++ b/grails-gradle/tasks/build.gradle @@ -109,6 +109,7 @@ publishing { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/checksum-config.gradle') diff --git a/grails-gsp/core/build.gradle b/grails-gsp/core/build.gradle index 30362e0b1fd..07b4d5a5f15 100644 --- a/grails-gsp/core/build.gradle +++ b/grails-gsp/core/build.gradle @@ -90,6 +90,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-layout/build.gradle b/grails-gsp/grails-layout/build.gradle index df50bddb78e..0b2442e94d9 100644 --- a/grails-gsp/grails-layout/build.gradle +++ b/grails-gsp/grails-layout/build.gradle @@ -61,6 +61,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-sitemesh3/build.gradle b/grails-gsp/grails-sitemesh3/build.gradle index b78dc048c1a..5453a52427f 100644 --- a/grails-gsp/grails-sitemesh3/build.gradle +++ b/grails-gsp/grails-sitemesh3/build.gradle @@ -82,6 +82,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-taglib/build.gradle b/grails-gsp/grails-taglib/build.gradle index fdb81e6d1cf..ca0d47a9aa5 100644 --- a/grails-gsp/grails-taglib/build.gradle +++ b/grails-gsp/grails-taglib/build.gradle @@ -81,6 +81,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-web-gsp-taglib/build.gradle b/grails-gsp/grails-web-gsp-taglib/build.gradle index 6c2deb3629b..a566d7346bf 100644 --- a/grails-gsp/grails-web-gsp-taglib/build.gradle +++ b/grails-gsp/grails-web-gsp-taglib/build.gradle @@ -60,6 +60,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-web-gsp/build.gradle b/grails-gsp/grails-web-gsp/build.gradle index ffc612da768..5fdf1575030 100644 --- a/grails-gsp/grails-web-gsp/build.gradle +++ b/grails-gsp/grails-web-gsp/build.gradle @@ -128,6 +128,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-web-jsp/build.gradle b/grails-gsp/grails-web-jsp/build.gradle index 63dbc6b172b..d2ac2fcedfc 100644 --- a/grails-gsp/grails-web-jsp/build.gradle +++ b/grails-gsp/grails-web-jsp/build.gradle @@ -109,6 +109,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/grails-web-taglib/build.gradle b/grails-gsp/grails-web-taglib/build.gradle index ad099e75528..3e646f238ae 100644 --- a/grails-gsp/grails-web-taglib/build.gradle +++ b/grails-gsp/grails-web-taglib/build.gradle @@ -113,6 +113,7 @@ sourceSets { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/plugin/build.gradle b/grails-gsp/plugin/build.gradle index 7963f65bd67..5b2320d89ed 100644 --- a/grails-gsp/plugin/build.gradle +++ b/grails-gsp/plugin/build.gradle @@ -181,6 +181,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-gsp/spring-boot/build.gradle b/grails-gsp/spring-boot/build.gradle index b73dc4330e4..a13d3bf709c 100644 --- a/grails-gsp/spring-boot/build.gradle +++ b/grails-gsp/spring-boot/build.gradle @@ -40,6 +40,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') //TODO: no docs until this is a publish project (its docs likely will need to be handled differently) // from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-i18n/build.gradle b/grails-i18n/build.gradle index a07554dfbbc..fae78864ec1 100644 --- a/grails-i18n/build.gradle +++ b/grails-i18n/build.gradle @@ -64,6 +64,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-interceptors/build.gradle b/grails-interceptors/build.gradle index 9e74dd99d2e..178cc862cbc 100644 --- a/grails-interceptors/build.gradle +++ b/grails-interceptors/build.gradle @@ -63,6 +63,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-logging/build.gradle b/grails-logging/build.gradle index 075f390df5b..beef4f22685 100644 --- a/grails-logging/build.gradle +++ b/grails-logging/build.gradle @@ -54,6 +54,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-mimetypes/build.gradle b/grails-mimetypes/build.gradle index 127f78d775c..4fb2f63bec4 100644 --- a/grails-mimetypes/build.gradle +++ b/grails-mimetypes/build.gradle @@ -62,6 +62,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-rest-transforms/build.gradle b/grails-rest-transforms/build.gradle index fa3402b68ce..40e93a75632 100644 --- a/grails-rest-transforms/build.gradle +++ b/grails-rest-transforms/build.gradle @@ -74,6 +74,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-scaffolding/build.gradle b/grails-scaffolding/build.gradle index 91f90085426..c21a4e5c044 100644 --- a/grails-scaffolding/build.gradle +++ b/grails-scaffolding/build.gradle @@ -44,6 +44,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-services/build.gradle b/grails-services/build.gradle index 47b9df936c1..b4da45e80d8 100644 --- a/grails-services/build.gradle +++ b/grails-services/build.gradle @@ -65,6 +65,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-shell-cli/build.gradle b/grails-shell-cli/build.gradle index 407e326c0c2..ee789751961 100644 --- a/grails-shell-cli/build.gradle +++ b/grails-shell-cli/build.gradle @@ -124,6 +124,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-spring/build.gradle b/grails-spring/build.gradle index da9ddbfcf0e..ef54cccd23e 100644 --- a/grails-spring/build.gradle +++ b/grails-spring/build.gradle @@ -58,6 +58,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-test-core/build.gradle b/grails-test-core/build.gradle index 14b625c5e31..d6985226174 100644 --- a/grails-test-core/build.gradle +++ b/grails-test-core/build.gradle @@ -85,6 +85,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-test-suite-base/build.gradle b/grails-test-suite-base/build.gradle index e810fd5457a..41b68acd404 100644 --- a/grails-test-suite-base/build.gradle +++ b/grails-test-suite-base/build.gradle @@ -75,4 +75,5 @@ tasks.withType(Groovydoc).configureEach { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') } diff --git a/grails-testing-support-core/build.gradle b/grails-testing-support-core/build.gradle index e5089181875..4a816f0f60e 100644 --- a/grails-testing-support-core/build.gradle +++ b/grails-testing-support-core/build.gradle @@ -75,6 +75,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-testing-support-datamapping/build.gradle b/grails-testing-support-datamapping/build.gradle index cd25137390c..eed573a2866 100755 --- a/grails-testing-support-datamapping/build.gradle +++ b/grails-testing-support-datamapping/build.gradle @@ -136,6 +136,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-testing-support-mongodb/build.gradle b/grails-testing-support-mongodb/build.gradle index ef7c10c8f7e..7f480cebb22 100644 --- a/grails-testing-support-mongodb/build.gradle +++ b/grails-testing-support-mongodb/build.gradle @@ -44,6 +44,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-testing-support-views-gson/build.gradle b/grails-testing-support-views-gson/build.gradle index 1b9b9e9feca..b8f42edf2e0 100644 --- a/grails-testing-support-views-gson/build.gradle +++ b/grails-testing-support-views-gson/build.gradle @@ -50,6 +50,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') diff --git a/grails-testing-support-web/build.gradle b/grails-testing-support-web/build.gradle index 2f77702a85b..e5f8bc99381 100755 --- a/grails-testing-support-web/build.gradle +++ b/grails-testing-support-web/build.gradle @@ -50,6 +50,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-url-mappings/build.gradle b/grails-url-mappings/build.gradle index 7b3f7144a80..2d917cee1f8 100644 --- a/grails-url-mappings/build.gradle +++ b/grails-url-mappings/build.gradle @@ -65,6 +65,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') } \ No newline at end of file diff --git a/grails-validation/build.gradle b/grails-validation/build.gradle index d3a7c7f2f2d..26e5bb34347 100644 --- a/grails-validation/build.gradle +++ b/grails-validation/build.gradle @@ -63,6 +63,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-views-core/build.gradle b/grails-views-core/build.gradle index b97851c866f..a54475a5f9b 100644 --- a/grails-views-core/build.gradle +++ b/grails-views-core/build.gradle @@ -53,6 +53,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-views-gson/build.gradle b/grails-views-gson/build.gradle index 3347c259d14..c7fbbdcbe0c 100644 --- a/grails-views-gson/build.gradle +++ b/grails-views-gson/build.gradle @@ -65,6 +65,7 @@ tasks.named('sourcesJar', Jar).configure { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-views-markup/build.gradle b/grails-views-markup/build.gradle index c74317e8a5f..4530280e2e6 100644 --- a/grails-views-markup/build.gradle +++ b/grails-views-markup/build.gradle @@ -54,6 +54,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-web-boot/build.gradle b/grails-web-boot/build.gradle index c2fe2aaf837..adaa00d995c 100644 --- a/grails-web-boot/build.gradle +++ b/grails-web-boot/build.gradle @@ -68,6 +68,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-web-common/build.gradle b/grails-web-common/build.gradle index 703eaac6ce3..189b9677a6a 100644 --- a/grails-web-common/build.gradle +++ b/grails-web-common/build.gradle @@ -78,6 +78,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-web-core/build.gradle b/grails-web-core/build.gradle index 027588c5139..a434004036d 100644 --- a/grails-web-core/build.gradle +++ b/grails-web-core/build.gradle @@ -72,6 +72,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-web-databinding/build.gradle b/grails-web-databinding/build.gradle index 1d6e8d4e7ff..73f47df1395 100644 --- a/grails-web-databinding/build.gradle +++ b/grails-web-databinding/build.gradle @@ -71,6 +71,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-web-mvc/build.gradle b/grails-web-mvc/build.gradle index 6f9bad0ba5c..0f4923c7649 100644 --- a/grails-web-mvc/build.gradle +++ b/grails-web-mvc/build.gradle @@ -63,6 +63,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-web-url-mappings/build.gradle b/grails-web-url-mappings/build.gradle index f9b3bf36ef1..7e67bdb7489 100644 --- a/grails-web-url-mappings/build.gradle +++ b/grails-web-url-mappings/build.gradle @@ -76,6 +76,7 @@ dependencies { apply { // java-configuration must be applied first since tasks are now lazy registered from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') diff --git a/grails-wrapper/build.gradle b/grails-wrapper/build.gradle index 62c4cf83ead..f7f32c2fe94 100644 --- a/grails-wrapper/build.gradle +++ b/grails-wrapper/build.gradle @@ -50,6 +50,7 @@ dependencies { apply { from rootProject.layout.projectDirectory.file('gradle/java-config.gradle') + from rootProject.layout.projectDirectory.file('gradle/code-style-config.gradle') from rootProject.layout.projectDirectory.file('gradle/test-config.gradle') from rootProject.layout.projectDirectory.file('gradle/docs-config.gradle') from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle') From e421851d8d903b2fabf3d5083c7b29f33cb0ab91 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Jul 2025 14:17:19 +0200 Subject: [PATCH 02/38] style: enforce newline at end of file Add the `NewlineAtEndOfFile` Checkstyle rule and `FileEndsWithoutNewline` Codenarc rule to ensure all source files end with a single newline character. This is a long-standing POSIX convention and is assumed by many Unix tools. It also helps avoid unnecessary noise in version control diffs and ensures consistent formatting across editors and operating systems. Most modern IDEs can be configured to add the final newline automatically. https://checkstyle.sourceforge.io/checks/misc/newlineatendoffile.html https://codenarc.org/codenarc-rules-formatting.html#fileendswithoutnewline-rule --- etc/config/checkstyle/checkstyle.xml | 3 +++ etc/config/codenarc/codenarc.groovy | 2 ++ .../grails/async/factory/future/ExecutorPromiseFactory.groovy | 2 +- .../groovy/org/grails/async/factory/gpars/GparsPromise.groovy | 2 +- .../src/main/groovy/grails/codegen/model/Model.groovy | 2 +- .../src/main/groovy/grails/config/ConfigMap.groovy | 2 +- .../src/main/groovy/grails/plugins/VersionComparator.groovy | 2 +- grails-bootstrap/src/main/groovy/grails/util/Described.groovy | 2 +- .../org/grails/exceptions/reporting/CodeSnippetPrinter.groovy | 2 +- .../src/main/groovy/grails/plugin/cache/CacheException.groovy | 2 +- .../groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy | 2 +- .../apache/grails/common/compiler/GroovyTransformOrder.groovy | 2 +- .../groovy/org/apache/grails/common/compiler/asm/Context.java | 2 +- .../grails/ui/shell/support/GroovyshApplicationContext.groovy | 2 +- .../grails/artefact/controller/support/RequestForwarder.groovy | 2 +- .../artefact/controller/support/ResponseRedirector.groovy | 2 +- .../src/main/groovy/grails/web/Controller.groovy | 2 +- .../org/grails/web/converters/ConfigurableConverter.groovy | 2 +- .../org/grails/web/converters/IncludeExcludeConverter.groovy | 2 +- .../grails/web/converters/marshaller/xml/ArrayMarshaller.java | 2 +- .../src/main/groovy/grails/boot/GrailsPluginApplication.groovy | 2 +- .../src/main/groovy/grails/compiler/DelegatingMethod.groovy | 2 +- .../main/groovy/grails/compiler/ast/GlobalClassInjector.groovy | 2 +- grails-core/src/main/groovy/grails/config/Config.groovy | 2 +- .../src/main/groovy/grails/core/GrailsApplicationClass.groovy | 2 +- .../main/groovy/grails/core/GrailsApplicationLifeCycle.groovy | 2 +- .../main/groovy/grails/dev/commands/ApplicationCommand.groovy | 2 +- .../groovy/grails/dev/commands/io/FileSystemInteraction.groovy | 2 +- .../grails/dev/commands/template/TemplateRenderer.groovy | 2 +- .../grails/dev/commands/template/TemplateRendererImpl.groovy | 2 +- .../src/main/groovy/grails/plugins/PluginManagerLoader.groovy | 2 +- .../main/groovy/grails/util/GrailsMessageSourceUtils.groovy | 2 +- .../src/main/groovy/grails/util/MixinTargetAware.groovy | 2 +- .../main/groovy/org/grails/beans/support/PropertiesEditor.java | 2 +- .../compiler/injection/GroovyEclipseCompilationHelper.groovy | 2 +- .../groovy/org/grails/core/cfg/CustomSafeConstructor.groovy | 2 +- .../core/support/GrailsApplicationDiscoveryStrategy.groovy | 2 +- .../grails/validation/discovery/ConstrainedDiscovery.groovy | 2 +- .../gorm/boot/compiler/GormCompilerAutoConfiguration.groovy | 2 +- .../main/groovy/grails/orm/hibernate/HibernateEntity.groovy | 2 +- .../org/grails/orm/hibernate/EventListenerIntegrator.java | 2 +- .../hibernate/compiler/HibernateEntityTransformation.groovy | 2 +- .../exceptions/CouldNotDetermineHibernateDialectException.java | 2 +- .../hibernate/transaction/PlatformTransactionManagerProxy.java | 2 +- .../dbmigration/grails-app/domain/testapp/Account.groovy | 2 +- .../dbmigration/grails-app/domain/testapp/Person.groovy | 2 +- .../databasemigration/liquibase/ChangelogXml2Groovy.groovy | 2 +- ...ltipleDataSourceAggregatePersistenceContextInterceptor.java | 2 +- .../org/grails/datastore/bson/codecs/CodecRegistryAware.groovy | 2 +- .../grails/datastore/bson/codecs/CodecRegistryProvider.groovy | 2 +- .../org/grails/datastore/bson/codecs/InstantCodec.groovy | 2 +- .../groovy/org/grails/datastore/bson/codecs/PeriodCodec.groovy | 2 +- .../org/grails/datastore/bson/codecs/ZonedDateTimeCodec.groovy | 2 +- .../bson/codecs/decoders/BasicCollectionTypeDecoder.groovy | 2 +- .../datastore/bson/codecs/decoders/CustomTypeDecoder.groovy | 2 +- .../bson/codecs/decoders/EmbeddedCollectionDecoder.groovy | 2 +- .../datastore/bson/codecs/decoders/EmbeddedDecoder.groovy | 2 +- .../datastore/bson/codecs/decoders/IdentityDecoder.groovy | 2 +- .../datastore/bson/codecs/encoders/CustomTypeEncoder.groovy | 2 +- .../bson/codecs/encoders/EmbeddedCollectionEncoder.groovy | 2 +- .../datastore/bson/codecs/encoders/EmbeddedEncoder.groovy | 2 +- .../datastore/bson/codecs/encoders/InstantEncoder.groovy | 2 +- .../datastore/bson/codecs/encoders/LocalDateTimeEncoder.groovy | 2 +- .../datastore/bson/codecs/encoders/LocalTimeEncoder.groovy | 2 +- .../bson/codecs/encoders/OffsetDateTimeEncoder.groovy | 2 +- .../datastore/bson/codecs/encoders/OffsetTimeEncoder.groovy | 2 +- .../grails/datastore/bson/codecs/encoders/PeriodEncoder.groovy | 2 +- .../grails/datastore/bson/codecs/encoders/SimpleEncoder.groovy | 2 +- .../datastore/bson/codecs/encoders/ZonedDateTimeEncoder.groovy | 2 +- .../datastore/bson/codecs/temporal/InstantBsonConverter.groovy | 2 +- .../bson/codecs/temporal/LocalDateBsonConverter.groovy | 2 +- .../bson/codecs/temporal/LocalDateTimeBsonConverter.groovy | 2 +- .../bson/codecs/temporal/LocalTimeBsonConverter.groovy | 2 +- .../bson/codecs/temporal/OffsetTimeBsonConverter.groovy | 2 +- .../datastore/bson/codecs/temporal/PeriodBsonConverter.groovy | 2 +- .../bson/codecs/temporal/TemporalBsonConverter.groovy | 2 +- .../core/src/main/groovy/grails/mongodb/MongoEntity.groovy | 2 +- .../main/groovy/grails/mongodb/api/MongoAllOperations.groovy | 2 +- .../groovy/grails/mongodb/api/MongoInstanceOperations.groovy | 2 +- .../groovy/grails/mongodb/api/MongoStaticOperations.groovy | 2 +- .../core/src/main/groovy/grails/mongodb/geo/GeoJSON.groovy | 2 +- .../core/src/main/groovy/grails/mongodb/geo/Metric.groovy | 2 +- .../core/src/main/groovy/grails/mongodb/geo/Shape.groovy | 2 +- .../org/grails/datastore/gorm/mongo/geo/MultiPointType.groovy | 2 +- .../org/grails/datastore/gorm/mongo/simple/EnumType.groovy | 2 +- .../grails/datastore/mapping/mongo/config/MongoSettings.groovy | 2 +- .../org/grails/databinding/ClosureValueInitializer.groovy | 2 +- .../converters/Jsr310ConvertersConfiguration.groovy | 2 +- .../src/main/groovy/grails/gorm/async/AsyncEntity.groovy | 2 +- .../org/grails/datastore/gorm/async/GormAsyncStaticApi.groovy | 2 +- .../src/main/groovy/grails/gorm/Entity.groovy | 2 +- .../src/main/groovy/grails/gorm/MultiTenant.groovy | 2 +- .../src/main/groovy/grails/gorm/api/GormAllOperations.groovy | 2 +- .../main/groovy/grails/gorm/api/GormInstanceOperations.groovy | 2 +- .../main/groovy/grails/gorm/api/GormStaticOperations.groovy | 2 +- .../main/groovy/grails/gorm/dirty/checking/DirtyCheck.groovy | 2 +- .../grails/gorm/dirty/checking/DirtyCheckedProperty.groovy | 2 +- .../main/groovy/grails/gorm/multitenancy/TenantService.groovy | 2 +- .../src/main/groovy/grails/gorm/services/Query.groovy | 2 +- .../src/main/groovy/grails/gorm/time/LocalDateConverter.groovy | 2 +- .../src/main/groovy/grails/gorm/time/LocalTimeConverter.groovy | 2 +- .../main/groovy/grails/gorm/time/OffsetTimeConverter.groovy | 2 +- .../src/main/groovy/grails/gorm/transactions/Rollback.groovy | 2 +- .../groovy/grails/gorm/transactions/TransactionService.groovy | 2 +- .../main/groovy/grails/gorm/transactions/Transactional.java | 2 +- .../compiler/gorm/AdditionalGormEntityTransformation.groovy | 2 +- .../org/grails/compiler/gorm/GormEntityTraitProvider.groovy | 2 +- .../main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy | 2 +- .../groovy/org/grails/datastore/gorm/GormValidateable.groovy | 2 +- .../gorm/events/ConfigurableApplicationEventPublisher.groovy | 2 +- .../gorm/internal/InstanceMethodInvokingClosure.groovy | 2 +- .../datastore/gorm/internal/MethodInvokingClosure.groovy | 2 +- .../org/grails/datastore/gorm/jdbc/DataSourceBuilder.java | 2 +- .../groovy/org/grails/datastore/gorm/jdbc/DatabaseDriver.java | 2 +- .../grails/datastore/gorm/jdbc/OriginCapablePropertyValue.java | 2 +- .../groovy/org/grails/datastore/gorm/jdbc/PropertyOrigin.java | 2 +- .../grails/datastore/gorm/jdbc/RelaxedConversionService.java | 2 +- .../org/grails/datastore/gorm/jdbc/RelaxedDataBinder.java | 2 +- .../groovy/org/grails/datastore/gorm/jdbc/RelaxedNames.java | 2 +- .../datastore/gorm/jdbc/connections/DataSourceSettings.groovy | 2 +- .../org/grails/datastore/gorm/jdbc/schema/SchemaHandler.groovy | 2 +- .../grails/datastore/gorm/schemaless/DynamicAttributes.groovy | 2 +- .../org/grails/datastore/gorm/services/Implemented.groovy | 2 +- .../org/grails/datastore/gorm/services/ServiceEnhancer.groovy | 2 +- .../grails/datastore/gorm/services/ServiceImplementer.groovy | 2 +- .../datastore/gorm/services/ServiceImplementerAdapter.groovy | 2 +- .../gorm/services/implementers/AdaptedImplementer.groovy | 2 +- .../services/implementers/AnnotatedServiceImplementer.groovy | 2 +- .../services/implementers/InterfaceProjectionBuilder.groovy | 2 +- .../implementers/IterableInterfaceProjectionBuilder.groovy | 2 +- .../services/implementers/IterableServiceImplementer.groovy | 2 +- .../services/implementers/NoResultServiceImplementer.groovy | 2 +- .../services/implementers/PrefixedServiceImplementer.groovy | 2 +- .../gorm/services/implementers/QueryStringImplementer.groovy | 2 +- .../implementers/SingleResultInterfaceProjectionBuilder.groovy | 2 +- .../implementers/SingleResultServiceImplementer.groovy | 2 +- .../grails/datastore/gorm/validation/ValidatorProvider.groovy | 2 +- .../gorm/validation/jakarta/services/ValidatedService.groovy | 2 +- .../grails/data/testing/tck/base/GrailsDataTckManager.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Card.groovy | 2 +- .../apache/grails/data/testing/tck/domains/CardProfile.groovy | 2 +- .../apache/grails/data/testing/tck/domains/ChildEntity.groovy | 2 +- .../data/testing/tck/domains/ClassWithHungarianNotation.groovy | 2 +- .../testing/tck/domains/ClassWithListArgBeforeValidate.groovy | 2 +- .../testing/tck/domains/ClassWithNoArgBeforeValidate.groovy | 2 +- .../tck/domains/ClassWithOverloadedBeforeValidate.groovy | 2 +- .../grails/data/testing/tck/domains/ContactDetails.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Dog.groovy | 2 +- .../apache/grails/data/testing/tck/domains/GroupWithin.groovy | 2 +- .../grails/data/testing/tck/domains/OptLockVersioned.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Parent.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Patient.groovy | 2 +- .../data/testing/tck/domains/PersonWithCompositeKey.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Product.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Record.groovy | 2 +- .../apache/grails/data/testing/tck/domains/SimpleWidget.groovy | 2 +- .../testing/tck/domains/SimpleWidgetWithNonStandardId.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/Simples.groovy | 2 +- .../apache/grails/data/testing/tck/domains/TestAuthor.groovy | 2 +- .../org/apache/grails/data/testing/tck/domains/TestBook.groovy | 2 +- .../apache/grails/data/testing/tck/domains/TestPlayer.groovy | 2 +- .../apache/grails/data/testing/tck/domains/UniqueGroup.groovy | 2 +- .../grails/data/testing/tck/tests/CircularOneToManySpec.groovy | 2 +- .../testing/tck/tests/DirtyCheckingAfterListenerSpec.groovy | 2 +- .../grails/data/testing/tck/tests/DomainEventsSpec.groovy | 2 +- .../org/apache/grails/data/testing/tck/tests/EnumSpec.groovy | 2 +- .../src/main/groovy/grails/gorm/validation/Constrained.groovy | 2 +- .../groovy/grails/gorm/validation/ConstrainedEntity.groovy | 2 +- .../src/main/groovy/grails/gorm/validation/Constraint.java | 2 +- .../grails/datastore/gorm/support/BeforeValidateHelper.java | 2 +- .../org/grails/datastore/gorm/support/EventTriggerCaller.java | 2 +- .../datastore/gorm/validation/constraints/MaxConstraint.java | 2 +- .../validation/constraints/eval/ConstraintsEvaluator.groovy | 2 +- .../validation/constraints/factory/ConstraintFactory.groovy | 2 +- .../validation/constraints/registry/ConstraintRegistry.groovy | 2 +- .../org/grails/datastore/mapping/collection/PersistentSet.java | 2 +- .../org/grails/datastore/mapping/column/ColumnDatastore.java | 2 +- .../grails/datastore/mapping/config/MappingDefinition.groovy | 2 +- .../mapping/config/groovy/MappingConfigurationBuilder.groovy | 2 +- .../main/groovy/org/grails/datastore/mapping/core/Ordered.java | 2 +- .../mapping/core/connections/ConnectionSourcesListener.groovy | 2 +- .../MultipleConnectionSourceCapableDatastore.groovy | 2 +- .../grails/datastore/mapping/document/DocumentDatastore.java | 2 +- .../org/grails/datastore/mapping/graph/GraphDatastore.java | 2 +- .../datastore/mapping/multitenancy/AllTenantsResolver.groovy | 2 +- .../datastore/mapping/multitenancy/TenantResolver.groovy | 2 +- .../grails/datastore/mapping/rdbms/RelationalDatastore.java | 2 +- .../org/grails/datastore/mapping/reflect/EntityReflector.java | 2 +- .../org/grails/datastore/mapping/services/Service.groovy | 2 +- .../grails/datastore/mapping/services/ServiceRegistry.groovy | 2 +- .../mapping/transactions/TransactionCapableDatastore.groovy | 2 +- .../mapping/multitenancy/web/HttpHeaderTenantResolver.groovy | 2 +- .../groovy/org/grails/charsequences/CharArrayCharSequence.java | 2 +- .../org/grails/charsequences/SingleCharCharSequence.java | 2 +- .../main/groovy/org/grails/charsequences/SubCharSequence.java | 2 +- .../groovy/org/grails/encoder/CombinedCodecIdentifier.java | 2 +- .../compat/src/main/groovy/grails/artefact/Service.groovy | 2 +- .../compat/src/main/groovy/grails/events/Events.groovy | 2 +- .../src/main/groovy/reactor/bus/registry/Registration.groovy | 2 +- .../src/main/groovy/reactor/bus/registry/Subscription.groovy | 2 +- .../groovy/reactor/spring/context/annotation/Consumer.groovy | 2 +- .../groovy/reactor/spring/context/annotation/Selector.groovy | 2 +- .../core/src/main/groovy/grails/events/EventPublisher.groovy | 2 +- .../src/main/groovy/grails/events/bus/EventBusAware.groovy | 2 +- .../src/main/groovy/grails/events/emitter/EventEmitter.groovy | 2 +- .../src/main/groovy/grails/events/subscriber/Subjects.groovy | 2 +- .../src/main/groovy/grails/events/subscriber/Subscriber.groovy | 2 +- .../main/groovy/grails/events/subscriber/Subscription.groovy | 2 +- .../src/main/groovy/grails/events/trigger/EventTrigger.groovy | 2 +- .../org/grails/events/registry/ClosureSubscription.groovy | 2 +- .../src/main/groovy/grails/events/annotation/Events.groovy | 2 +- .../src/main/groovy/grails/events/annotation/Publisher.groovy | 2 +- .../src/main/groovy/grails/events/annotation/Subscriber.groovy | 2 +- .../main/groovy/grails/events/annotation/gorm/Listener.groovy | 2 +- .../org/grails/events/transform/AnnotatedSubscriber.groovy | 2 +- .../init/grails/plugin/formfields/Application.groovy | 2 +- .../org/grails/scaffolding/markup/ContextMarkupRenderer.groovy | 2 +- .../org/grails/scaffolding/markup/DomainMarkupRenderer.groovy | 2 +- .../grails/scaffolding/markup/PropertyMarkupRenderer.groovy | 2 +- .../grails/scaffolding/model/property/DomainProperty.groovy | 2 +- .../scaffolding/registry/DomainInputRendererRegistry.groovy | 2 +- .../org/grails/scaffolding/registry/DomainRenderer.groovy | 2 +- .../scaffolding/registry/input/MapToSelectInputRenderer.groovy | 2 +- .../org/apache/grails/gradle/tasks/bom/CoordinateHolder.groovy | 2 +- .../grails/gradle/tasks/bom/CoordinateVersionHolder.groovy | 2 +- .../model/src/main/groovy/grails/util/Metadata.groovy | 2 +- .../main/groovy/org/grails/io/support/MainClassHolder.groovy | 2 +- .../gradle/plugin/commands/ApplicationContextScriptTask.groovy | 2 +- .../groovy/org/grails/gradle/plugin/core/PluginDefiner.groovy | 2 +- .../gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy | 2 +- .../org/apache/grails/web/layout/EmbeddedGrailsLayoutView.java | 2 +- .../groovy/org/apache/grails/web/layout/FactoryHolder.java | 2 +- .../org/apache/grails/web/layout/GSPGrailsLayoutPage.java | 2 +- .../groovy/org/apache/grails/web/layout/GrailsLayoutView.java | 2 +- .../groovy/org/apache/grails/web/layout/GrailsNoDecorator.java | 2 +- .../apache/grails/web/layout/GrailsPageResponseWrapper.java | 2 +- .../apache/grails/web/layout/GrailsViewBufferingResponse.java | 2 +- .../org/apache/grails/web/layout/GroovyPageLayoutFinder.java | 2 +- .../apache/grails/web/layout/TokenizedHTMLPage2Content.java | 2 +- .../grails/plugins/sitemesh3/GrailsLayoutHandlerMapping.java | 2 +- .../org/grails/plugins/sitemesh3/Sitemesh3GrailsPlugin.groovy | 2 +- .../org/grails/web/pages/StandaloneTagLibraryLookup.java | 2 +- .../org/grails/web/pages/GroovyPageForkedCompiler.groovy | 2 +- .../main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy | 2 +- .../groovy/org/grails/plugins/web/GrailsTagDateHelper.groovy | 2 +- .../src/main/groovy/grails/artefact/Interceptor.groovy | 2 +- .../src/main/groovy/grails/interceptors/Matcher.groovy | 2 +- .../src/main/groovy/grails/rest/Resource.groovy | 2 +- .../init/grails/plugin/scaffolding/Application.groovy | 2 +- .../groovy/grails/plugin/scaffolding/CommandLineHelper.groovy | 2 +- .../main/groovy/grails/plugin/scaffolding/GormService.groovy | 2 +- .../grails/plugin/scaffolding/RestfulServiceController.groovy | 2 +- .../grails/plugin/scaffolding/ScaffoldingViewResolver.groovy | 2 +- .../main/groovy/grails/plugin/scaffolding/SkipBootstrap.groovy | 2 +- .../cli/boot/GrailsApplicationCompilerAutoConfiguration.java | 2 +- .../src/main/groovy/org/grails/cli/command/run/RunCommand.java | 2 +- .../org/grails/cli/compiler/GrailsBomAstTransformation.java | 2 +- .../autoconfigure/GrailsCompilerAutoConfiguration.java | 2 +- .../grails/cli/gradle/FetchAllTaskSelectorsBuildAction.java | 2 +- .../grails/cli/interactive/completers/StringsCompleter.java | 2 +- .../src/main/groovy/org/grails/cli/profile/Command.groovy | 2 +- .../src/main/groovy/org/grails/cli/profile/Feature.groovy | 2 +- .../main/groovy/org/grails/cli/profile/ProfileCommand.groovy | 2 +- .../groovy/org/grails/cli/profile/ProfileRepository.groovy | 2 +- .../org/grails/cli/profile/ProfileRepositoryAware.groovy | 2 +- .../main/groovy/org/grails/cli/profile/ProjectCommand.groovy | 2 +- .../src/main/groovy/org/grails/cli/profile/Step.groovy | 2 +- .../grails/cli/profile/commands/events/CommandEvents.groovy | 2 +- .../grails/cli/profile/commands/factory/CommandFactory.groovy | 2 +- .../profile/commands/factory/CommandResourceResolver.groovy | 2 +- .../cli/profile/commands/io/FileSystemInteraction.groovy | 2 +- .../grails/cli/profile/commands/io/ServerInteraction.groovy | 2 +- .../cli/profile/commands/templates/TemplateRenderer.groovy | 2 +- .../cli/profile/commands/templates/TemplateRendererImpl.groovy | 2 +- .../groovy/org/grails/cli/profile/steps/StepFactory.groovy | 2 +- .../groovy/org/grails/test/io/MultiplexingOutputStream.groovy | 2 +- .../groovy/org/grails/test/io/SystemOutAndErrSwapper.groovy | 2 +- .../groovy/org/grails/test/support/GrailsTestAutowirer.groovy | 2 +- .../main/groovy/org/grails/test/support/GrailsTestMode.groovy | 2 +- .../support/GrailsTestRequestEnvironmentInterceptor.groovy | 2 +- .../controllers/functionaltests/BookRestfulController.groovy | 2 +- .../app1/grails-app/init/functionaltests/Application.groovy | 2 +- .../functionaltests/scaffolding/BarFunctionalSpec.groovy | 2 +- .../app2/grails-app/init/app2/Application.groovy | 2 +- .../app3/grails-app/init/app3/Application.groovy | 2 +- .../grails-app/domain/pubsub/demo/Book.groovy | 2 +- .../grails-app/init/pubsub/demo/Application.groovy | 2 +- .../grails-app/services/pubsub/demo/BookService.groovy | 2 +- .../datasources/grails-app/init/datasources/Application.groovy | 2 +- .../demo33/grails-app/services/demo/ConfigService.groovy | 2 +- .../grails-app/init/test/app/Application.groovy | 2 +- .../geb/grails-app/init/org/demo/spock/BootStrap.groovy | 2 +- .../org/demo/spock/ContainerFileDetectorAnnotationSpec.groovy | 2 +- .../org/demo/spock/ContainerFileDetectorDefaultSpec.groovy | 2 +- .../org/demo/spock/ContainerFileDetectorSpockSpec.groovy | 2 +- .../gorm/grails-app/init/gorm/Application.groovy | 2 +- .../org/example/grails/layout/DemoController.groovy | 2 +- .../grails-app/init/example/Application.groovy | 2 +- .../grails-app/init/datasources/Application.groovy | 2 +- .../grails-app/init/datasources/Application.groovy | 2 +- .../grails-app/init/functional/tests/Application.groovy | 2 +- .../grails-app/services/functional/tests/BookService.groovy | 2 +- .../grails-app/init/datasources/Application.groovy | 2 +- .../grails-app/init/schemapertenant/Application.groovy | 2 +- .../grails-app/services/schemapertenant/BookService.groovy | 2 +- .../controllers/multitenantcomposite/BookController.groovy | 2 +- .../grails-app/domain/multitenantcomposite/Book.groovy | 2 +- .../grails-app/init/multitenantcomposite/Application.groovy | 2 +- .../grails-app/init/multitenantcomposite/BootStrap.groovy | 2 +- .../services/multitenantcomposite/BookService.groovy | 2 +- .../integration-test/groovy/example/BookControllerSpec.groovy | 2 +- .../spring-boot-hibernate/src/main/groovy/example/Book.groovy | 2 +- .../src/main/groovy/example/BookService.groovy | 2 +- .../hyphenated/grails-app/init/hyphenated/Application.groovy | 2 +- .../issue-11102/grails-app/init/issue11102/Application.groovy | 2 +- .../init/grails301/domain/save/npe/Application.groovy | 2 +- .../grails-app/init/issueviews182/Application.groovy | 2 +- .../base/grails-app/init/functional/tests/Application.groovy | 2 +- .../base/src/main/groovy/functional/tests/Birthday.groovy | 2 +- .../base/src/main/groovy/functional/tests/BirthdayCodec.groovy | 2 +- .../grails-app/init/examples/mongo/tenant/Application.groovy | 2 +- .../grails-app/init/functional/tests/Application.groovy | 2 +- .../grails-app/init/functional/tests/Application.groovy | 2 +- .../springboot/src/main/groovy/example/Application.groovy | 2 +- .../springboot/src/main/groovy/example/BookService.groovy | 2 +- .../grails-app/init/example/Application.groovy | 2 +- .../namespaces/grails-app/init/namespaces/Application.groovy | 2 +- .../issue11005/grails-app/init/issue11005/Application.groovy | 2 +- .../loadafter/grails-app/init/loadafter/Application.groovy | 2 +- .../loadfirst/grails-app/init/loadfirst/Application.groovy | 2 +- .../loadsecond/grails-app/init/loadsecond/Application.groovy | 2 +- .../grails-app/init/functional/tests/plugin/Application.groovy | 2 +- .../controllers/functional/tests/api/BookController.groovy | 2 +- .../grails-app/init/functional/tests/Application.groovy | 2 +- .../groovy/grails/testing/mixin/integration/Integration.groovy | 2 +- .../grails/testing/context/junit4/GrailsTestConfiguration.java | 2 +- .../org/grails/testing/spock/AutowiredInterceptor.groovy | 2 +- .../apache/grails/testing/mongo/MongoContainerHolder.groovy | 2 +- .../main/groovy/grails/views/json/test/JsonViewUnitTest.groovy | 2 +- .../grails/testing/web/interceptor/InterceptorUnitTest.groovy | 2 +- .../testing/runtime/support/ActionSettingMethodHandler.groovy | 2 +- .../grails/testing/runtime/support/LazyTagLibraryLookup.java | 2 +- .../groovy/grails/views/ResolvableGroovyTemplateEngine.groovy | 2 +- .../src/main/groovy/grails/views/TemplateResolver.groovy | 2 +- .../src/main/groovy/grails/views/ViewConfiguration.groovy | 2 +- .../src/main/groovy/grails/views/ViewUriResolver.groovy | 2 +- .../src/main/groovy/grails/views/WritableScript.groovy | 2 +- .../src/main/groovy/grails/views/WriterProvider.groovy | 2 +- .../src/main/groovy/grails/views/api/GrailsView.groovy | 2 +- .../src/main/groovy/grails/views/api/GrailsViewHelper.groovy | 2 +- .../src/main/groovy/grails/views/api/HttpView.groovy | 2 +- grails-views-core/src/main/groovy/grails/views/api/View.groovy | 2 +- .../src/main/groovy/grails/views/api/http/Parameters.groovy | 2 +- .../src/main/groovy/grails/views/api/http/Request.groovy | 2 +- .../src/main/groovy/grails/views/api/http/Response.groovy | 2 +- .../main/groovy/grails/plugin/json/builder/JsonGenerator.java | 2 +- .../grails/plugin/json/converters/InstantJsonConverter.groovy | 2 +- .../grails/plugin/json/view/api/GrailsJsonViewHelper.groovy | 2 +- .../groovy/grails/plugin/json/view/api/HalViewHelper.groovy | 2 +- .../groovy/grails/plugin/json/view/test/JsonViewTest.groovy | 2 +- .../groovy/grails/plugin/markup/view/api/MarkupView.groovy | 2 +- .../groovy/grails/web/context/WebRequestServletHolder.java | 2 +- .../src/main/groovy/grails/web/mime/MimeTypeResolver.groovy | 2 +- .../main/groovy/grails/web/mvc/GrailsResponseMutator.groovy | 2 +- .../main/groovy/org/grails/web/config/http/GrailsFilters.java | 2 +- .../src/main/groovy/org/grails/web/json/JSONArray.java | 2 +- .../src/main/groovy/org/grails/web/json/JSONTokener.java | 2 +- .../web/databinding/DataBindingEventMulticastListener.groovy | 2 +- .../bindingsource/JsonApiDataBindingSourceCreator.groovy | 2 +- .../web/mapping/mvc/exceptions/CannotRedirectException.java | 2 +- .../grails/web/mapping/reporting/UrlMappingsRenderer.groovy | 2 +- .../main/java/grails/proxy/SystemPropertiesAuthenticator.java | 2 +- 372 files changed, 375 insertions(+), 370 deletions(-) diff --git a/etc/config/checkstyle/checkstyle.xml b/etc/config/checkstyle/checkstyle.xml index ff91576794a..d1e1f65ff9e 100644 --- a/etc/config/checkstyle/checkstyle.xml +++ b/etc/config/checkstyle/checkstyle.xml @@ -25,4 +25,7 @@ + + + \ No newline at end of file diff --git a/etc/config/codenarc/codenarc.groovy b/etc/config/codenarc/codenarc.groovy index b37db30d75a..4ac1273668b 100644 --- a/etc/config/codenarc/codenarc.groovy +++ b/etc/config/codenarc/codenarc.groovy @@ -2,4 +2,6 @@ ruleset { description 'A Codenarc ruleset for the Grails codebase' + FileEndsWithoutNewline + } \ No newline at end of file diff --git a/grails-async/core/src/main/groovy/org/grails/async/factory/future/ExecutorPromiseFactory.groovy b/grails-async/core/src/main/groovy/org/grails/async/factory/future/ExecutorPromiseFactory.groovy index 7167d9e4eae..122e6787c3f 100644 --- a/grails-async/core/src/main/groovy/org/grails/async/factory/future/ExecutorPromiseFactory.groovy +++ b/grails-async/core/src/main/groovy/org/grails/async/factory/future/ExecutorPromiseFactory.groovy @@ -29,4 +29,4 @@ import java.util.concurrent.ExecutorService * @author Graeme Rocher * @since 3.3 */ -interface ExecutorPromiseFactory extends PromiseFactory, ExecutorService {} \ No newline at end of file +interface ExecutorPromiseFactory extends PromiseFactory, ExecutorService {} diff --git a/grails-async/gpars/src/main/groovy/org/grails/async/factory/gpars/GparsPromise.groovy b/grails-async/gpars/src/main/groovy/org/grails/async/factory/gpars/GparsPromise.groovy index ed1731ea112..fb733471108 100644 --- a/grails-async/gpars/src/main/groovy/org/grails/async/factory/gpars/GparsPromise.groovy +++ b/grails-async/gpars/src/main/groovy/org/grails/async/factory/gpars/GparsPromise.groovy @@ -114,4 +114,4 @@ class GparsPromise implements Promise { def decoratedCallable = promiseFactory.applyDecorators(callable, null) return new GparsPromise(promiseFactory, internalPromise.then(decoratedCallable)) } -} \ No newline at end of file +} diff --git a/grails-bootstrap/src/main/groovy/grails/codegen/model/Model.groovy b/grails-bootstrap/src/main/groovy/grails/codegen/model/Model.groovy index 7f68ac8a883..dda6dcfbedc 100644 --- a/grails-bootstrap/src/main/groovy/grails/codegen/model/Model.groovy +++ b/grails-bootstrap/src/main/groovy/grails/codegen/model/Model.groovy @@ -84,4 +84,4 @@ interface Model { * @return The model as a map */ Map asMap() -} \ No newline at end of file +} diff --git a/grails-bootstrap/src/main/groovy/grails/config/ConfigMap.groovy b/grails-bootstrap/src/main/groovy/grails/config/ConfigMap.groovy index 7c90ded4019..ff80a14dc0e 100644 --- a/grails-bootstrap/src/main/groovy/grails/config/ConfigMap.groovy +++ b/grails-bootstrap/src/main/groovy/grails/config/ConfigMap.groovy @@ -73,4 +73,4 @@ interface ConfigMap extends Iterable>, Map { protected boolean isSnapshot(String version) { SNAPSHOT_SUFFIXES.any { String it -> version?.endsWith(it) } } -} \ No newline at end of file +} diff --git a/grails-bootstrap/src/main/groovy/grails/util/Described.groovy b/grails-bootstrap/src/main/groovy/grails/util/Described.groovy index d7febf70d25..a5597bc30f1 100644 --- a/grails-bootstrap/src/main/groovy/grails/util/Described.groovy +++ b/grails-bootstrap/src/main/groovy/grails/util/Described.groovy @@ -33,4 +33,4 @@ interface Described { */ String getDescription() -} \ No newline at end of file +} diff --git a/grails-bootstrap/src/main/groovy/org/grails/exceptions/reporting/CodeSnippetPrinter.groovy b/grails-bootstrap/src/main/groovy/org/grails/exceptions/reporting/CodeSnippetPrinter.groovy index cc08a8ee6cd..58c39810e46 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/exceptions/reporting/CodeSnippetPrinter.groovy +++ b/grails-bootstrap/src/main/groovy/org/grails/exceptions/reporting/CodeSnippetPrinter.groovy @@ -37,4 +37,4 @@ interface CodeSnippetPrinter { @Deprecated String prettyPrintCodeSnippet(Throwable exception) -} \ No newline at end of file +} diff --git a/grails-cache/src/main/groovy/grails/plugin/cache/CacheException.groovy b/grails-cache/src/main/groovy/grails/plugin/cache/CacheException.groovy index b17b721b55f..c6750021b7e 100644 --- a/grails-cache/src/main/groovy/grails/plugin/cache/CacheException.groovy +++ b/grails-cache/src/main/groovy/grails/plugin/cache/CacheException.groovy @@ -81,4 +81,4 @@ class CacheException extends RuntimeException { CacheException(Throwable cause) { super(cause) } -} \ No newline at end of file +} diff --git a/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy b/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy index 403897ba7f8..8a66d1d4806 100644 --- a/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy +++ b/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy @@ -49,4 +49,4 @@ class CodecsGrailsPlugin extends Plugin { codecLookup(DefaultCodecLookup) } } -} \ No newline at end of file +} diff --git a/grails-common/src/main/groovy/org/apache/grails/common/compiler/GroovyTransformOrder.groovy b/grails-common/src/main/groovy/org/apache/grails/common/compiler/GroovyTransformOrder.groovy index 88804912f30..3c1635c3e07 100644 --- a/grails-common/src/main/groovy/org/apache/grails/common/compiler/GroovyTransformOrder.groovy +++ b/grails-common/src/main/groovy/org/apache/grails/common/compiler/GroovyTransformOrder.groovy @@ -214,4 +214,4 @@ interface GroovyTransformOrder { * Transforms a method to non-block IO */ static final int RX_SCHEDULER_ORDER = LINK_ORDER + DECREMENT_PRIORITY -} \ No newline at end of file +} diff --git a/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/Context.java b/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/Context.java index 2ad9692aa05..6d00b5f52a8 100644 --- a/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/Context.java +++ b/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/Context.java @@ -143,4 +143,4 @@ class Context { * The stack values of the latest stack map frame that has been parsed. */ Object[] stack; -} \ No newline at end of file +} diff --git a/grails-console/src/main/groovy/grails/ui/shell/support/GroovyshApplicationContext.groovy b/grails-console/src/main/groovy/grails/ui/shell/support/GroovyshApplicationContext.groovy index 9b44bec9ca2..6e817bda6d6 100644 --- a/grails-console/src/main/groovy/grails/ui/shell/support/GroovyshApplicationContext.groovy +++ b/grails-console/src/main/groovy/grails/ui/shell/support/GroovyshApplicationContext.groovy @@ -44,4 +44,4 @@ class GroovyshApplicationContext extends GenericApplicationContext { new Groovysh(binding, new IO()).run("") } -} \ No newline at end of file +} diff --git a/grails-controllers/src/main/groovy/grails/artefact/controller/support/RequestForwarder.groovy b/grails-controllers/src/main/groovy/grails/artefact/controller/support/RequestForwarder.groovy index 365215dccfd..19531b4d456 100644 --- a/grails-controllers/src/main/groovy/grails/artefact/controller/support/RequestForwarder.groovy +++ b/grails-controllers/src/main/groovy/grails/artefact/controller/support/RequestForwarder.groovy @@ -145,4 +145,4 @@ trait RequestForwarder implements WebAttributes { private String convert(String value) { (urlConverter) ? urlConverter.toUrlElement(value) : value } -} \ No newline at end of file +} diff --git a/grails-controllers/src/main/groovy/grails/artefact/controller/support/ResponseRedirector.groovy b/grails-controllers/src/main/groovy/grails/artefact/controller/support/ResponseRedirector.groovy index 49913dcdfec..5972972c017 100644 --- a/grails-controllers/src/main/groovy/grails/artefact/controller/support/ResponseRedirector.groovy +++ b/grails-controllers/src/main/groovy/grails/artefact/controller/support/ResponseRedirector.groovy @@ -202,4 +202,4 @@ trait ResponseRedirector implements WebAttributes { void setUseJsessionId(boolean useJsessionId) { this.useJsessionId = useJsessionId } -} \ No newline at end of file +} diff --git a/grails-controllers/src/main/groovy/grails/web/Controller.groovy b/grails-controllers/src/main/groovy/grails/web/Controller.groovy index 03c7a37bae3..6cf95faffc7 100644 --- a/grails-controllers/src/main/groovy/grails/web/Controller.groovy +++ b/grails-controllers/src/main/groovy/grails/web/Controller.groovy @@ -33,4 +33,4 @@ import java.lang.annotation.Target @Target( [ ElementType.TYPE ] ) @GroovyASTTransformationClass("org.grails.compiler.web.ControllerArtefactTypeTransformation") public @interface Controller { -} \ No newline at end of file +} diff --git a/grails-converters/src/main/groovy/org/grails/web/converters/ConfigurableConverter.groovy b/grails-converters/src/main/groovy/org/grails/web/converters/ConfigurableConverter.groovy index 70ac8040652..b5c1d952738 100644 --- a/grails-converters/src/main/groovy/org/grails/web/converters/ConfigurableConverter.groovy +++ b/grails-converters/src/main/groovy/org/grails/web/converters/ConfigurableConverter.groovy @@ -64,4 +64,4 @@ public interface ConfigurableConverter extends Converter{ * @return The includes */ List getIncludes(Class type) -} \ No newline at end of file +} diff --git a/grails-converters/src/main/groovy/org/grails/web/converters/IncludeExcludeConverter.groovy b/grails-converters/src/main/groovy/org/grails/web/converters/IncludeExcludeConverter.groovy index b599d90872a..007b8eb85d9 100644 --- a/grails-converters/src/main/groovy/org/grails/web/converters/IncludeExcludeConverter.groovy +++ b/grails-converters/src/main/groovy/org/grails/web/converters/IncludeExcludeConverter.groovy @@ -30,4 +30,4 @@ public interface IncludeExcludeConverter extends ConfigurableConverter { void setExcludes(List excludes) -} \ No newline at end of file +} diff --git a/grails-converters/src/main/groovy/org/grails/web/converters/marshaller/xml/ArrayMarshaller.java b/grails-converters/src/main/groovy/org/grails/web/converters/marshaller/xml/ArrayMarshaller.java index 2088b13b8ab..916f46154b4 100644 --- a/grails-converters/src/main/groovy/org/grails/web/converters/marshaller/xml/ArrayMarshaller.java +++ b/grails-converters/src/main/groovy/org/grails/web/converters/marshaller/xml/ArrayMarshaller.java @@ -55,4 +55,4 @@ public void marshalObject(Object o, XML xml) throws ConverterException { public String getElementName(Object o) { return "array"; } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/boot/GrailsPluginApplication.groovy b/grails-core/src/main/groovy/grails/boot/GrailsPluginApplication.groovy index 9796880c683..144b2252d36 100644 --- a/grails-core/src/main/groovy/grails/boot/GrailsPluginApplication.groovy +++ b/grails-core/src/main/groovy/grails/boot/GrailsPluginApplication.groovy @@ -26,4 +26,4 @@ package grails.boot */ interface GrailsPluginApplication { -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/compiler/DelegatingMethod.groovy b/grails-core/src/main/groovy/grails/compiler/DelegatingMethod.groovy index 8e3308a5991..96b161b0011 100644 --- a/grails-core/src/main/groovy/grails/compiler/DelegatingMethod.groovy +++ b/grails-core/src/main/groovy/grails/compiler/DelegatingMethod.groovy @@ -36,4 +36,4 @@ import java.lang.annotation.Target @Target([ElementType.METHOD]) @interface DelegatingMethod { -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/compiler/ast/GlobalClassInjector.groovy b/grails-core/src/main/groovy/grails/compiler/ast/GlobalClassInjector.groovy index f44f65a7deb..01a6dcb748a 100644 --- a/grails-core/src/main/groovy/grails/compiler/ast/GlobalClassInjector.groovy +++ b/grails-core/src/main/groovy/grails/compiler/ast/GlobalClassInjector.groovy @@ -27,4 +27,4 @@ package grails.compiler.ast */ public interface GlobalClassInjector extends ClassInjector{ -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/config/Config.groovy b/grails-core/src/main/groovy/grails/config/Config.groovy index f5f74e92294..dd1dac844d9 100644 --- a/grails-core/src/main/groovy/grails/config/Config.groovy +++ b/grails-core/src/main/groovy/grails/config/Config.groovy @@ -59,4 +59,4 @@ interface Config extends PropertyResolver, ConfigMap { * @see #getRequiredProperty(String, Class) */ public T getProperty(String key, Class targetType, T defaultValue, List allowedValues); -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/core/GrailsApplicationClass.groovy b/grails-core/src/main/groovy/grails/core/GrailsApplicationClass.groovy index f8e50d80f3b..27cbfd14a2c 100644 --- a/grails-core/src/main/groovy/grails/core/GrailsApplicationClass.groovy +++ b/grails-core/src/main/groovy/grails/core/GrailsApplicationClass.groovy @@ -27,4 +27,4 @@ package grails.core trait GrailsApplicationClass implements GrailsApplicationLifeCycle { -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/core/GrailsApplicationLifeCycle.groovy b/grails-core/src/main/groovy/grails/core/GrailsApplicationLifeCycle.groovy index 41a03be5792..7f3ca551ec3 100644 --- a/grails-core/src/main/groovy/grails/core/GrailsApplicationLifeCycle.groovy +++ b/grails-core/src/main/groovy/grails/core/GrailsApplicationLifeCycle.groovy @@ -63,4 +63,4 @@ interface GrailsApplicationLifeCycle { * @param event The event */ void onShutdown(Map event) -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/dev/commands/ApplicationCommand.groovy b/grails-core/src/main/groovy/grails/dev/commands/ApplicationCommand.groovy index d56d756305a..a63dbd01b16 100644 --- a/grails-core/src/main/groovy/grails/dev/commands/ApplicationCommand.groovy +++ b/grails-core/src/main/groovy/grails/dev/commands/ApplicationCommand.groovy @@ -64,4 +64,4 @@ trait ApplicationCommand implements Named, Described { */ abstract boolean handle(ExecutionContext executionContext) -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/dev/commands/io/FileSystemInteraction.groovy b/grails-core/src/main/groovy/grails/dev/commands/io/FileSystemInteraction.groovy index 3a9f461240e..1b62acd67ed 100644 --- a/grails-core/src/main/groovy/grails/dev/commands/io/FileSystemInteraction.groovy +++ b/grails-core/src/main/groovy/grails/dev/commands/io/FileSystemInteraction.groovy @@ -142,4 +142,4 @@ interface FileSystemInteraction { this.into = path } } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRenderer.groovy b/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRenderer.groovy index 7a6d928d584..b39904a2602 100644 --- a/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRenderer.groovy +++ b/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRenderer.groovy @@ -169,4 +169,4 @@ interface TemplateRenderer { * @return The resource or null if it doesn't exist */ Resource template(Object location) -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRendererImpl.groovy b/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRendererImpl.groovy index 2400ccd2bf8..2c3567c8194 100644 --- a/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRendererImpl.groovy +++ b/grails-core/src/main/groovy/grails/dev/commands/template/TemplateRendererImpl.groovy @@ -231,4 +231,4 @@ class TemplateRendererImpl implements TemplateRenderer { w.flush() } } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/plugins/PluginManagerLoader.groovy b/grails-core/src/main/groovy/grails/plugins/PluginManagerLoader.groovy index 85abd45086d..8a2352c8458 100644 --- a/grails-core/src/main/groovy/grails/plugins/PluginManagerLoader.groovy +++ b/grails-core/src/main/groovy/grails/plugins/PluginManagerLoader.groovy @@ -33,4 +33,4 @@ public interface PluginManagerLoader { */ GrailsPluginManager loadPlugins() -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/util/GrailsMessageSourceUtils.groovy b/grails-core/src/main/groovy/grails/util/GrailsMessageSourceUtils.groovy index c36fe2918e9..2f505a78027 100644 --- a/grails-core/src/main/groovy/grails/util/GrailsMessageSourceUtils.groovy +++ b/grails-core/src/main/groovy/grails/util/GrailsMessageSourceUtils.groovy @@ -56,4 +56,4 @@ class GrailsMessageSourceUtils { // return the first MessageSource from the list return messageSources.get(0) } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/grails/util/MixinTargetAware.groovy b/grails-core/src/main/groovy/grails/util/MixinTargetAware.groovy index 78e20b97e6b..42a9739a8ee 100644 --- a/grails-core/src/main/groovy/grails/util/MixinTargetAware.groovy +++ b/grails-core/src/main/groovy/grails/util/MixinTargetAware.groovy @@ -29,4 +29,4 @@ package grails.util public interface MixinTargetAware { void setTarget(T targetObject) -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/org/grails/beans/support/PropertiesEditor.java b/grails-core/src/main/groovy/org/grails/beans/support/PropertiesEditor.java index 91ac4018c5a..305ebe42aee 100644 --- a/grails-core/src/main/groovy/org/grails/beans/support/PropertiesEditor.java +++ b/grails-core/src/main/groovy/org/grails/beans/support/PropertiesEditor.java @@ -47,4 +47,4 @@ public void setValue(Object value) { super.setValue(value); } } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy b/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy index 5eec1f772ee..39ea50ce337 100644 --- a/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy +++ b/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy @@ -64,4 +64,4 @@ class GroovyEclipseCompilationHelper { } return null } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/org/grails/core/cfg/CustomSafeConstructor.groovy b/grails-core/src/main/groovy/org/grails/core/cfg/CustomSafeConstructor.groovy index 09ac2b95e3f..387d6219eaa 100644 --- a/grails-core/src/main/groovy/org/grails/core/cfg/CustomSafeConstructor.groovy +++ b/grails-core/src/main/groovy/org/grails/core/cfg/CustomSafeConstructor.groovy @@ -64,4 +64,4 @@ class CustomSafeConstructor extends SafeConstructor { @Override void construct2ndStep(Node node, Object data) {} } -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/org/grails/core/support/GrailsApplicationDiscoveryStrategy.groovy b/grails-core/src/main/groovy/org/grails/core/support/GrailsApplicationDiscoveryStrategy.groovy index 04eaa25b9f4..828f743a200 100644 --- a/grails-core/src/main/groovy/org/grails/core/support/GrailsApplicationDiscoveryStrategy.groovy +++ b/grails-core/src/main/groovy/org/grails/core/support/GrailsApplicationDiscoveryStrategy.groovy @@ -42,4 +42,4 @@ public interface GrailsApplicationDiscoveryStrategy { */ ApplicationContext findApplicationContext() -} \ No newline at end of file +} diff --git a/grails-core/src/main/groovy/org/grails/validation/discovery/ConstrainedDiscovery.groovy b/grails-core/src/main/groovy/org/grails/validation/discovery/ConstrainedDiscovery.groovy index be94bb37637..f443568457c 100644 --- a/grails-core/src/main/groovy/org/grails/validation/discovery/ConstrainedDiscovery.groovy +++ b/grails-core/src/main/groovy/org/grails/validation/discovery/ConstrainedDiscovery.groovy @@ -37,4 +37,4 @@ interface ConstrainedDiscovery { * @return The constrained properties */ Map findConstrainedProperties(PersistentEntity entity) -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/boot-plugin/src/main/groovy/org/grails/datastore/gorm/boot/compiler/GormCompilerAutoConfiguration.groovy b/grails-data-hibernate5/boot-plugin/src/main/groovy/org/grails/datastore/gorm/boot/compiler/GormCompilerAutoConfiguration.groovy index 860c85cbec0..2e505d5d67a 100644 --- a/grails-data-hibernate5/boot-plugin/src/main/groovy/org/grails/datastore/gorm/boot/compiler/GormCompilerAutoConfiguration.groovy +++ b/grails-data-hibernate5/boot-plugin/src/main/groovy/org/grails/datastore/gorm/boot/compiler/GormCompilerAutoConfiguration.groovy @@ -47,4 +47,4 @@ class GormCompilerAutoConfiguration extends CompilerAutoConfiguration{ void applyImports(ImportCustomizer imports) throws CompilationFailedException { imports.addStarImports("grails.gorm", "grails.gorm.annotation") } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/core/src/main/groovy/grails/orm/hibernate/HibernateEntity.groovy b/grails-data-hibernate5/core/src/main/groovy/grails/orm/hibernate/HibernateEntity.groovy index 7339430b01a..687b73fb27b 100644 --- a/grails-data-hibernate5/core/src/main/groovy/grails/orm/hibernate/HibernateEntity.groovy +++ b/grails-data-hibernate5/core/src/main/groovy/grails/orm/hibernate/HibernateEntity.groovy @@ -84,4 +84,4 @@ trait HibernateEntity extends GormEntity { private static AbstractHibernateGormStaticApi currentHibernateStaticApi() { (AbstractHibernateGormStaticApi)GormEnhancer.findStaticApi(this) } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/EventListenerIntegrator.java b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/EventListenerIntegrator.java index 6ce47135104..2d009b325d8 100644 --- a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/EventListenerIntegrator.java +++ b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/EventListenerIntegrator.java @@ -151,4 +151,4 @@ protected void appendListeners(final EventListenerRegistry listenerRegistry, public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) { // nothing to do } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/compiler/HibernateEntityTransformation.groovy b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/compiler/HibernateEntityTransformation.groovy index 572cd473c15..eee1e9cd266 100644 --- a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/compiler/HibernateEntityTransformation.groovy +++ b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/compiler/HibernateEntityTransformation.groovy @@ -321,4 +321,4 @@ class HibernateEntityTransformation implements ASTTransformation, CompilationUni int priority() { GroovyTransformOrder.HIBERNATE5_ORDER } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/exceptions/CouldNotDetermineHibernateDialectException.java b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/exceptions/CouldNotDetermineHibernateDialectException.java index 5333dd30f5b..40ecc9a2339 100644 --- a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/exceptions/CouldNotDetermineHibernateDialectException.java +++ b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/exceptions/CouldNotDetermineHibernateDialectException.java @@ -35,4 +35,4 @@ public CouldNotDetermineHibernateDialectException(String message, Throwable caus super(message, cause); } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/transaction/PlatformTransactionManagerProxy.java b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/transaction/PlatformTransactionManagerProxy.java index 8e90d0d345c..ae7b8ccee57 100644 --- a/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/transaction/PlatformTransactionManagerProxy.java +++ b/grails-data-hibernate5/core/src/main/groovy/org/grails/orm/hibernate/transaction/PlatformTransactionManagerProxy.java @@ -56,4 +56,4 @@ public PlatformTransactionManager getTargetTransactionManager() { public void setTargetTransactionManager(PlatformTransactionManager targetTransactionManager) { this.targetTransactionManager = targetTransactionManager; } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Account.groovy b/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Account.groovy index 943771e5b40..9d110d77af2 100644 --- a/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Account.groovy +++ b/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Account.groovy @@ -22,4 +22,4 @@ package testapp class Account { String name String number -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Person.groovy b/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Person.groovy index 4ff21fe7f5d..181d7185f76 100644 --- a/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Person.groovy +++ b/grails-data-hibernate5/dbmigration/grails-app/domain/testapp/Person.groovy @@ -27,4 +27,4 @@ class Person { String emailAddress String cell -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/liquibase/ChangelogXml2Groovy.groovy b/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/liquibase/ChangelogXml2Groovy.groovy index ab4c897edfd..fab95c84c32 100644 --- a/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/liquibase/ChangelogXml2Groovy.groovy +++ b/grails-data-hibernate5/dbmigration/src/main/groovy/org/grails/plugins/databasemigration/liquibase/ChangelogXml2Groovy.groovy @@ -108,4 +108,4 @@ class ChangelogXml2Groovy { indentLevel.times { groovy.append ' ' } groovy.append s } -} \ No newline at end of file +} diff --git a/grails-data-hibernate5/grails-plugin/src/main/groovy/org/grails/plugin/hibernate/support/AbstractMultipleDataSourceAggregatePersistenceContextInterceptor.java b/grails-data-hibernate5/grails-plugin/src/main/groovy/org/grails/plugin/hibernate/support/AbstractMultipleDataSourceAggregatePersistenceContextInterceptor.java index 92564870738..e847ae26f1f 100644 --- a/grails-data-hibernate5/grails-plugin/src/main/groovy/org/grails/plugin/hibernate/support/AbstractMultipleDataSourceAggregatePersistenceContextInterceptor.java +++ b/grails-data-hibernate5/grails-plugin/src/main/groovy/org/grails/plugin/hibernate/support/AbstractMultipleDataSourceAggregatePersistenceContextInterceptor.java @@ -117,4 +117,4 @@ public void setReadWrite() { protected abstract SessionFactoryAwarePersistenceContextInterceptor createPersistenceContextInterceptor(String dataSourceName); -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryAware.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryAware.groovy index b5150a1b6ec..f1d1ae242eb 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryAware.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryAware.groovy @@ -29,4 +29,4 @@ import org.bson.codecs.configuration.CodecRegistry */ interface CodecRegistryAware { void setCodecRegistry(CodecRegistry codecRegistry) -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryProvider.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryProvider.groovy index e60ef1ffdb0..4b219291fae 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryProvider.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/CodecRegistryProvider.groovy @@ -29,4 +29,4 @@ import org.bson.codecs.configuration.CodecRegistry */ interface CodecRegistryProvider { CodecRegistry getCodecRegistry() -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/InstantCodec.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/InstantCodec.groovy index afe1d6c1f57..66c8c7ba054 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/InstantCodec.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/InstantCodec.groovy @@ -49,4 +49,4 @@ class InstantCodec implements Codec, InstantBsonConverter { @Override Class getEncoderClass() { Instant } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/PeriodCodec.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/PeriodCodec.groovy index 23b004cba04..a3e9456acda 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/PeriodCodec.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/PeriodCodec.groovy @@ -49,4 +49,4 @@ class PeriodCodec implements Codec, PeriodBsonConverter { @Override Class getEncoderClass() { Period } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/ZonedDateTimeCodec.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/ZonedDateTimeCodec.groovy index e2d4c30ea14..f0fa7e48eef 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/ZonedDateTimeCodec.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/ZonedDateTimeCodec.groovy @@ -49,4 +49,4 @@ class ZonedDateTimeCodec implements Codec, ZonedDateTimeBsonConve @Override Class getEncoderClass() { ZonedDateTime } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/BasicCollectionTypeDecoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/BasicCollectionTypeDecoder.groovy index 197ce133d89..32a3dcf3b6e 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/BasicCollectionTypeDecoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/BasicCollectionTypeDecoder.groovy @@ -83,4 +83,4 @@ class BasicCollectionTypeDecoder implements PropertyDecoder { } } } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/CustomTypeDecoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/CustomTypeDecoder.groovy index c9c7f3d89bc..4d5f5bc0cc4 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/CustomTypeDecoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/CustomTypeDecoder.groovy @@ -76,4 +76,4 @@ class CustomTypeDecoder implements PropertyDecoder { } } } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedCollectionDecoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedCollectionDecoder.groovy index 0986fa8bb99..4bd6b10daf7 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedCollectionDecoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedCollectionDecoder.groovy @@ -104,4 +104,4 @@ class EmbeddedCollectionDecoder implements PropertyDecoder { protected BsonPersistentEntityCodec createEmbeddedEntityCodec(CodecRegistry codecRegistry, PersistentEntity associatedEntity) { new BsonPersistentEntityCodec(codecRegistry, associatedEntity) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedDecoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedDecoder.groovy index b18c3d251c2..63649b41aad 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedDecoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/EmbeddedDecoder.groovy @@ -68,4 +68,4 @@ class EmbeddedDecoder implements PropertyDecoder { protected BsonPersistentEntityCodec createEmbeddedEntityCodec(CodecRegistry codecRegistry, PersistentEntity associatedEntity) { new BsonPersistentEntityCodec(codecRegistry, associatedEntity) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/IdentityDecoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/IdentityDecoder.groovy index 01c381847ee..f2aab195a9f 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/IdentityDecoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/decoders/IdentityDecoder.groovy @@ -166,4 +166,4 @@ class IdentityDecoder implements PropertyDecoder { void decode(BsonReader bsonReader, Identity property, EntityAccess access) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/CustomTypeEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/CustomTypeEncoder.groovy index 27a3db74a51..473b692c75b 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/CustomTypeEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/CustomTypeEncoder.groovy @@ -67,4 +67,4 @@ class CustomTypeEncoder implements PropertyEncoder { } } } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedCollectionEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedCollectionEncoder.groovy index 92db34380f2..4c80514073e 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedCollectionEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedCollectionEncoder.groovy @@ -115,4 +115,4 @@ class EmbeddedCollectionEncoder implements PropertyEncoder { protected BsonPersistentEntityCodec createEmbeddedEntityCodec(CodecRegistry codecRegistry, PersistentEntity associatedEntity) { new BsonPersistentEntityCodec(codecRegistry, associatedEntity) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedEncoder.groovy index a4a436373a4..61a0ab23d52 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/EmbeddedEncoder.groovy @@ -62,4 +62,4 @@ class EmbeddedEncoder implements PropertyEncoder { protected BsonPersistentEntityCodec createEmbeddedEntityCodec(CodecRegistry codecRegistry, PersistentEntity associatedEntity) { new BsonPersistentEntityCodec(codecRegistry, associatedEntity) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/InstantEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/InstantEncoder.groovy index 68f93c4cdf8..6367faaa0e7 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/InstantEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/InstantEncoder.groovy @@ -40,4 +40,4 @@ class InstantEncoder implements TypeEncoder, InstantBsonConverter { void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (Instant)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalDateTimeEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalDateTimeEncoder.groovy index 5a23bef942f..7a963e2909b 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalDateTimeEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalDateTimeEncoder.groovy @@ -40,4 +40,4 @@ class LocalDateTimeEncoder implements TypeEncoder, LocalDateTimeBsonConverter { void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (LocalDateTime)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalTimeEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalTimeEncoder.groovy index f4dc35dd93b..33e1d855ef8 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalTimeEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/LocalTimeEncoder.groovy @@ -40,4 +40,4 @@ class LocalTimeEncoder implements TypeEncoder, LocalTimeBsonConverter { void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (LocalTime)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetDateTimeEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetDateTimeEncoder.groovy index e8f5b56d057..74f6390020f 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetDateTimeEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetDateTimeEncoder.groovy @@ -40,4 +40,4 @@ class OffsetDateTimeEncoder implements TypeEncoder, OffsetDateTimeBsonConverter void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (OffsetDateTime)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetTimeEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetTimeEncoder.groovy index 80ef0944e71..e809ed12b59 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetTimeEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/OffsetTimeEncoder.groovy @@ -40,4 +40,4 @@ class OffsetTimeEncoder implements TypeEncoder, OffsetTimeBsonConverter { void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (OffsetTime)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/PeriodEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/PeriodEncoder.groovy index b033b3cc9dc..a7ec2725a4a 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/PeriodEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/PeriodEncoder.groovy @@ -40,4 +40,4 @@ class PeriodEncoder implements TypeEncoder, PeriodBsonConverter { void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (Period)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/SimpleEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/SimpleEncoder.groovy index 2fbc85bcb24..f07794a42c4 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/SimpleEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/SimpleEncoder.groovy @@ -200,4 +200,4 @@ class SimpleEncoder implements PropertyEncoder { } } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/ZonedDateTimeEncoder.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/ZonedDateTimeEncoder.groovy index 590d719799d..c1334dd779b 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/ZonedDateTimeEncoder.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/encoders/ZonedDateTimeEncoder.groovy @@ -38,4 +38,4 @@ class ZonedDateTimeEncoder implements SimpleEncoder.TypeEncoder, ZonedDateTimeBs void encode(BsonWriter writer, PersistentProperty property, Object value) { write(writer, (ZonedDateTime)value) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/InstantBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/InstantBsonConverter.groovy index 7d348ffeac8..7a5f614ad33 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/InstantBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/InstantBsonConverter.groovy @@ -50,4 +50,4 @@ trait InstantBsonConverter implements TemporalBsonConverter, InstantCon BsonType.INT64 } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateBsonConverter.groovy index f23479ef5e8..5e07bb7bb6a 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateBsonConverter.groovy @@ -49,4 +49,4 @@ trait LocalDateBsonConverter implements TemporalBsonConverter, LocalD BsonType bsonType() { BsonType.DATE_TIME } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateTimeBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateTimeBsonConverter.groovy index 11b28d70336..a5fa226a571 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateTimeBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalDateTimeBsonConverter.groovy @@ -49,4 +49,4 @@ trait LocalDateTimeBsonConverter implements TemporalBsonConverter BsonType bsonType() { BsonType.DATE_TIME } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalTimeBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalTimeBsonConverter.groovy index b4f8ce1c262..9317b7b3df7 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalTimeBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/LocalTimeBsonConverter.groovy @@ -49,4 +49,4 @@ trait LocalTimeBsonConverter implements TemporalBsonConverter, LocalT BsonType bsonType() { BsonType.INT64 } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/OffsetTimeBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/OffsetTimeBsonConverter.groovy index cb66e629778..2dbb7dfaf74 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/OffsetTimeBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/OffsetTimeBsonConverter.groovy @@ -49,4 +49,4 @@ trait OffsetTimeBsonConverter implements TemporalBsonConverter, Offs BsonType bsonType() { BsonType.INT64 } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/PeriodBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/PeriodBsonConverter.groovy index e98fe33fb65..06fa74af3fe 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/PeriodBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/PeriodBsonConverter.groovy @@ -50,4 +50,4 @@ trait PeriodBsonConverter implements TemporalBsonConverter, PeriodConver BsonType.STRING } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/TemporalBsonConverter.groovy b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/TemporalBsonConverter.groovy index b6032141c37..c8c7d49eb04 100644 --- a/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/TemporalBsonConverter.groovy +++ b/grails-data-mongodb/bson/src/main/groovy/org/grails/datastore/bson/codecs/temporal/TemporalBsonConverter.groovy @@ -37,4 +37,4 @@ trait TemporalBsonConverter { abstract T read(BsonReader reader) abstract BsonType bsonType() -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/MongoEntity.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/MongoEntity.groovy index 0dc9b11ef57..b454333c56b 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/MongoEntity.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/MongoEntity.groovy @@ -290,4 +290,4 @@ trait MongoEntity implements GormEntity, DynamicAttributes { (MongoStaticApi)GormEnhancer.findStaticApi(this) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoAllOperations.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoAllOperations.groovy index 6f0a6ad0bb0..3a0f57742c4 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoAllOperations.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoAllOperations.groovy @@ -26,4 +26,4 @@ package grails.mongodb.api * @since 6.0 */ interface MongoAllOperations extends MongoInstanceOperations, MongoStaticOperations { -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoInstanceOperations.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoInstanceOperations.groovy index 9aaab8d0f40..8460729b539 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoInstanceOperations.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoInstanceOperations.groovy @@ -38,4 +38,4 @@ interface MongoInstanceOperations extends GormInstanceOperations { */ @Deprecated Document getDbo(D instance) -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoStaticOperations.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoStaticOperations.groovy index 053d7707874..cfb62b39c9b 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoStaticOperations.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/api/MongoStaticOperations.groovy @@ -190,4 +190,4 @@ interface MongoStaticOperations extends GormStaticOperations { * @return The results */ List searchTop(String query, int limit, Map options ) -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/GeoJSON.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/GeoJSON.groovy index 5b3b6d403cc..7b72e4423dd 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/GeoJSON.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/GeoJSON.groovy @@ -28,4 +28,4 @@ public interface GeoJSON { * @return The coordinate list */ abstract List asList(); -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Metric.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Metric.groovy index 06d45d4b6be..9ccd469dc21 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Metric.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Metric.groovy @@ -42,4 +42,4 @@ public class Metric { Metric(double multiplier) { this.multiplier = multiplier } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Shape.groovy b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Shape.groovy index b106c942de2..2cf3194ffc8 100644 --- a/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Shape.groovy +++ b/grails-data-mongodb/core/src/main/groovy/grails/mongodb/geo/Shape.groovy @@ -28,4 +28,4 @@ public abstract class Shape { * @return The coordinate list */ abstract List asList(); -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/geo/MultiPointType.groovy b/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/geo/MultiPointType.groovy index e5bd9a1b60c..297e797d92f 100644 --- a/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/geo/MultiPointType.groovy +++ b/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/geo/MultiPointType.groovy @@ -34,4 +34,4 @@ class MultiPointType extends GeoJSONType { MultiPoint createFromCoords(List coords) { MultiPoint.valueOf(coords) } -} \ No newline at end of file +} diff --git a/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy b/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy index 893881e6dfe..a3dd0864422 100644 --- a/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy +++ b/grails-data-mongodb/core/src/main/groovy/org/grails/datastore/gorm/mongo/simple/EnumType.groovy @@ -297,4 +297,4 @@ class EnumType extends AbstractMappingAwareCustomTypeMarshaller extends AbstractStructuredDateBindingEditor implements TypedStructuredBindingEditor { } -} \ No newline at end of file +} diff --git a/grails-datamapping-async/src/main/groovy/grails/gorm/async/AsyncEntity.groovy b/grails-datamapping-async/src/main/groovy/grails/gorm/async/AsyncEntity.groovy index 0d8fcfcca3b..966777e89cf 100644 --- a/grails-datamapping-async/src/main/groovy/grails/gorm/async/AsyncEntity.groovy +++ b/grails-datamapping-async/src/main/groovy/grails/gorm/async/AsyncEntity.groovy @@ -38,4 +38,4 @@ trait AsyncEntity extends GormEntity { static GormAsyncStaticApi getAsync() { return new GormAsyncStaticApi(GormEnhancer.findStaticApi(this)) } -} \ No newline at end of file +} diff --git a/grails-datamapping-async/src/main/groovy/org/grails/datastore/gorm/async/GormAsyncStaticApi.groovy b/grails-datamapping-async/src/main/groovy/org/grails/datastore/gorm/async/GormAsyncStaticApi.groovy index 627c2e81551..c8c7ef6c7ca 100644 --- a/grails-datamapping-async/src/main/groovy/org/grails/datastore/gorm/async/GormAsyncStaticApi.groovy +++ b/grails-datamapping-async/src/main/groovy/org/grails/datastore/gorm/async/GormAsyncStaticApi.groovy @@ -60,4 +60,4 @@ class GormAsyncStaticApi implements PromiseDecoratorProvider{ callable.delegate = staticApi.gormPersistentEntity.javaClass (Promise)Promises.createPromise(callable, decorators) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/Entity.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/Entity.groovy index 4e6c46e19d1..22f6ff2ef78 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/Entity.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/Entity.groovy @@ -27,4 +27,4 @@ package grails.gorm */ trait Entity { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/MultiTenant.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/MultiTenant.groovy index 8f179e517be..064cbc4b9d8 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/MultiTenant.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/MultiTenant.groovy @@ -63,4 +63,4 @@ trait MultiTenant extends Entity { static GormAllOperations withTenant(Serializable tenantId) { (GormAllOperations)GormEnhancer.findStaticApi(this).withTenant(tenantId) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormAllOperations.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormAllOperations.groovy index ccd7fa21645..28577b9dd7a 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormAllOperations.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormAllOperations.groovy @@ -27,4 +27,4 @@ package grails.gorm.api */ interface GormAllOperations extends GormStaticOperations, GormInstanceOperations { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormInstanceOperations.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormInstanceOperations.groovy index bf46951760e..dd7640ddd29 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormInstanceOperations.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormInstanceOperations.groovy @@ -138,4 +138,4 @@ interface GormInstanceOperations { * Deletes an instance from the datastore */ void delete(D instance, Map params) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormStaticOperations.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormStaticOperations.groovy index 79b6d8034d8..4292fc4a250 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormStaticOperations.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/api/GormStaticOperations.groovy @@ -798,4 +798,4 @@ interface GormStaticOperations { * @return The operations */ GormAllOperations withTenant(Serializable tenantId) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheck.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheck.groovy index ae340a91a5d..28a8e8046f3 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheck.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheck.groovy @@ -36,4 +36,4 @@ import java.lang.annotation.Target @GroovyASTTransformationClass("org.grails.compiler.gorm.DirtyCheckTransformation") public @interface DirtyCheck { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheckedProperty.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheckedProperty.groovy index f60299e8f69..6f9b67ef2ad 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheckedProperty.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/dirty/checking/DirtyCheckedProperty.groovy @@ -33,4 +33,4 @@ import java.lang.annotation.Target @Retention(RetentionPolicy.RUNTIME) @Target([ElementType.METHOD]) @interface DirtyCheckedProperty { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/multitenancy/TenantService.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/multitenancy/TenantService.groovy index 9875013d273..1232a2a8ad3 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/multitenancy/TenantService.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/multitenancy/TenantService.groovy @@ -67,4 +67,4 @@ interface TenantService { * @return The result of the closure */ public T withId(Serializable tenantId, Closure callable) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/services/Query.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/services/Query.groovy index 0a307210be5..bf0e62ff110 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/services/Query.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/services/Query.groovy @@ -34,4 +34,4 @@ import java.lang.annotation.Target @Target(ElementType.METHOD) @interface Query { String value() -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalDateConverter.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalDateConverter.groovy index 84ae6f88f1b..1522d0aee5b 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalDateConverter.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalDateConverter.groovy @@ -42,4 +42,4 @@ trait LocalDateConverter extends TemporalConverter { Instant instant = Instant.ofEpochMilli(value) LocalDateTime.ofInstant(instant, ZoneId.of('UTC')).toLocalDate() } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalTimeConverter.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalTimeConverter.groovy index d1c83b6c021..92ecb291d57 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalTimeConverter.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/time/LocalTimeConverter.groovy @@ -40,4 +40,4 @@ trait LocalTimeConverter implements TemporalConverter { LocalTime convert(Long value) { LocalTime.ofNanoOfDay(value) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/time/OffsetTimeConverter.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/time/OffsetTimeConverter.groovy index 96831b12e97..282835794f3 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/time/OffsetTimeConverter.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/time/OffsetTimeConverter.groovy @@ -42,4 +42,4 @@ trait OffsetTimeConverter implements TemporalConverter { OffsetTime convert(Long value) { OffsetTime.of(LocalTime.ofNanoOfDay(value), ZoneOffset.UTC).withOffsetSameInstant(systemOffset) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Rollback.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Rollback.groovy index c695a446b4a..d1ef280bca5 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Rollback.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Rollback.groovy @@ -47,4 +47,4 @@ import java.lang.annotation.Target * The connection to rollback for */ String value() default "" -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/TransactionService.groovy b/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/TransactionService.groovy index 8aa0039df5a..13a67528b92 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/TransactionService.groovy +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/TransactionService.groovy @@ -88,4 +88,4 @@ interface TransactionService { * @return The result */ public T withNewTransaction(TransactionDefinition definition, @ClosureParams(value=SimpleType.class, options="org.springframework.transaction.TransactionStatus") Closure callable) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Transactional.java b/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Transactional.java index b72009cbeb0..6e2281eda46 100644 --- a/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Transactional.java +++ b/grails-datamapping-core/src/main/groovy/grails/gorm/transactions/Transactional.java @@ -172,4 +172,4 @@ */ String connection() default ConnectionSource.DEFAULT; -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/AdditionalGormEntityTransformation.groovy b/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/AdditionalGormEntityTransformation.groovy index 22058ff21d8..4ab8204fb17 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/AdditionalGormEntityTransformation.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/AdditionalGormEntityTransformation.groovy @@ -45,4 +45,4 @@ interface AdditionalGormEntityTransformation extends ASTTransformation, Compilat * @param sourceUnit The source unit */ void visit(ClassNode classNode, SourceUnit sourceUnit) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/GormEntityTraitProvider.groovy b/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/GormEntityTraitProvider.groovy index 5b712dc8e95..70f52f6a6a1 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/GormEntityTraitProvider.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/compiler/gorm/GormEntityTraitProvider.groovy @@ -32,4 +32,4 @@ interface GormEntityTraitProvider { * @return Whether this trait provided is available */ boolean isAvailable() -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy index 8768b56631e..bd73aed694a 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEntityApi.groovy @@ -130,4 +130,4 @@ trait GormEntityApi { * @return true if it is dirty */ abstract boolean isDirty() -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormValidateable.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormValidateable.groovy index 59e3e4858be..cf3af03c42b 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormValidateable.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormValidateable.groovy @@ -125,4 +125,4 @@ trait GormValidateable { private GormValidationApi currentGormValidationApi() { GormEnhancer.findValidationApi(getClass()) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/events/ConfigurableApplicationEventPublisher.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/events/ConfigurableApplicationEventPublisher.groovy index 868d557cbb5..57ea9a82440 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/events/ConfigurableApplicationEventPublisher.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/events/ConfigurableApplicationEventPublisher.groovy @@ -36,4 +36,4 @@ interface ConfigurableApplicationEventPublisher extends ApplicationEventPublishe * @param listener The application listener */ void addApplicationListener(ApplicationListener listener) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/InstanceMethodInvokingClosure.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/InstanceMethodInvokingClosure.groovy index b5fe4a8df04..e69fc84e8ce 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/InstanceMethodInvokingClosure.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/InstanceMethodInvokingClosure.groovy @@ -47,4 +47,4 @@ class InstanceMethodInvokingClosure extends MethodInvokingClosure { } metaMethod.invoke(apiDelegate, arguments) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/MethodInvokingClosure.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/MethodInvokingClosure.groovy index dfdadad7bc8..c9aa3090e62 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/MethodInvokingClosure.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/internal/MethodInvokingClosure.groovy @@ -71,4 +71,4 @@ abstract class MethodInvokingClosure extends Closure { } } } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DataSourceBuilder.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DataSourceBuilder.java index b7d6d0d9f08..24d399a10d6 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DataSourceBuilder.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DataSourceBuilder.java @@ -203,4 +203,4 @@ protected Connection getConnectionFromDriverManager(final String url, final Prop return connection; } } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DatabaseDriver.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DatabaseDriver.java index 7c449e4c1f0..3ebacae1086 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DatabaseDriver.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/DatabaseDriver.java @@ -242,4 +242,4 @@ public static DatabaseDriver fromProductName(String productName) { return UNKNOWN; } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/OriginCapablePropertyValue.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/OriginCapablePropertyValue.java index 58e414bfe17..ad190fab065 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/OriginCapablePropertyValue.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/OriginCapablePropertyValue.java @@ -61,4 +61,4 @@ static PropertyOrigin getOrigin(PropertyValue propertyValue) { return new OriginCapablePropertyValue(propertyValue).getOrigin(); } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/PropertyOrigin.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/PropertyOrigin.java index 679d5c9f46f..ab410b8d486 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/PropertyOrigin.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/PropertyOrigin.java @@ -47,4 +47,4 @@ public String getName() { return this.name; } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedConversionService.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedConversionService.java index 7dfbf9a55eb..865b806a6b4 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedConversionService.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedConversionService.java @@ -154,4 +154,4 @@ public char[] convert(String source) { return source.toCharArray(); } } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedDataBinder.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedDataBinder.java index d399dcf50e4..d26730097d7 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedDataBinder.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedDataBinder.java @@ -591,4 +591,4 @@ public String toString() { } } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedNames.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedNames.java index 017074556d6..4560e54981c 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedNames.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/RelaxedNames.java @@ -203,4 +203,4 @@ private static String separatedToCamelCase(String value, } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/connections/DataSourceSettings.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/connections/DataSourceSettings.groovy index c4b11aeeeed..e48165d96bc 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/connections/DataSourceSettings.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/connections/DataSourceSettings.groovy @@ -153,4 +153,4 @@ class DataSourceSettings extends ConnectionSourceSettings { } return properties } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/schema/SchemaHandler.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/schema/SchemaHandler.groovy index e2bf2cdcf6d..a1f9ced128c 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/schema/SchemaHandler.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/jdbc/schema/SchemaHandler.groovy @@ -49,4 +49,4 @@ interface SchemaHandler { * Creates the given schema. Defaults to "CREATE SCHEMA %s" */ void createSchema(Connection connection, String name) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/schemaless/DynamicAttributes.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/schemaless/DynamicAttributes.groovy index 39188919278..e164f8f1773 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/schemaless/DynamicAttributes.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/schemaless/DynamicAttributes.groovy @@ -96,4 +96,4 @@ trait DynamicAttributes { } return dynamicAttributes } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/Implemented.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/Implemented.groovy index 49ac7b0160b..042561bf19a 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/Implemented.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/Implemented.groovy @@ -35,4 +35,4 @@ import java.lang.annotation.Target @Target(ElementType.METHOD) @interface Implemented { Class by() -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceEnhancer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceEnhancer.groovy index f1e28791312..1f13dad38fc 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceEnhancer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceEnhancer.groovy @@ -49,4 +49,4 @@ interface ServiceEnhancer extends ServiceImplementer { * @param newMethodNode The new method node being implemented */ void enhance(ClassNode domainClassNode, MethodNode abstractMethodNode, MethodNode newMethodNode, ClassNode targetClassNode) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementer.groovy index ca1eb3df35c..6f30ec8f5d6 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementer.groovy @@ -55,4 +55,4 @@ interface ServiceImplementer { * @param newMethodNode The new method node being implemented */ void implement(ClassNode domainClassNode, MethodNode abstractMethodNode, MethodNode newMethodNode, ClassNode targetClassNode) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementerAdapter.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementerAdapter.groovy index cc47c7e4598..e11e6b51d0b 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementerAdapter.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/ServiceImplementerAdapter.groovy @@ -33,4 +33,4 @@ interface ServiceImplementerAdapter { * @return The adapted implementer or null */ ServiceImplementer adapt(ServiceImplementer implementer) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AdaptedImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AdaptedImplementer.groovy index a74849e34fe..d04b7d4b947 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AdaptedImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AdaptedImplementer.groovy @@ -29,4 +29,4 @@ import org.grails.datastore.gorm.services.ServiceImplementer */ interface AdaptedImplementer { ServiceImplementer getAdapted() -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AnnotatedServiceImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AnnotatedServiceImplementer.groovy index 946539df44b..48804db234a 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AnnotatedServiceImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/AnnotatedServiceImplementer.groovy @@ -36,4 +36,4 @@ interface AnnotatedServiceImplementer extends PrefixedServiceImplementer { * @return Whether it is annotated */ boolean isAnnotated(ClassNode domainClass, MethodNode methodNode) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/InterfaceProjectionBuilder.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/InterfaceProjectionBuilder.groovy index 93bddfde85d..73d7c1cff9b 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/InterfaceProjectionBuilder.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/InterfaceProjectionBuilder.groovy @@ -106,4 +106,4 @@ trait InterfaceProjectionBuilder { } return methodTarget } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableInterfaceProjectionBuilder.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableInterfaceProjectionBuilder.groovy index cc9de16a382..a3e9733f038 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableInterfaceProjectionBuilder.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableInterfaceProjectionBuilder.groovy @@ -108,4 +108,4 @@ trait IterableInterfaceProjectionBuilder extends InterfaceProjectionBuilder{ stmt(collectCall) } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableServiceImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableServiceImplementer.groovy index ab23c115eab..a2eb201c0d5 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableServiceImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/IterableServiceImplementer.groovy @@ -26,4 +26,4 @@ package org.grails.datastore.gorm.services.implementers */ interface IterableServiceImplementer extends PrefixedServiceImplementer { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/NoResultServiceImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/NoResultServiceImplementer.groovy index d2cfe627168..9125cc25b5b 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/NoResultServiceImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/NoResultServiceImplementer.groovy @@ -26,4 +26,4 @@ package org.grails.datastore.gorm.services.implementers * @since 6.1.1 */ interface NoResultServiceImplementer extends PrefixedServiceImplementer { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/PrefixedServiceImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/PrefixedServiceImplementer.groovy index 196c8affeaf..d76b2ebefd6 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/PrefixedServiceImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/PrefixedServiceImplementer.groovy @@ -37,4 +37,4 @@ interface PrefixedServiceImplementer extends ServiceImplementer { * @return The prefix used or null if it isn't used */ String resolvePrefix(MethodNode mn) -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/QueryStringImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/QueryStringImplementer.groovy index 0c996c8d18a..73debb30ba7 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/QueryStringImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/QueryStringImplementer.groovy @@ -24,4 +24,4 @@ package org.grails.datastore.gorm.services.implementers */ interface QueryStringImplementer { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultInterfaceProjectionBuilder.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultInterfaceProjectionBuilder.groovy index 81463660992..7cdf0b7d656 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultInterfaceProjectionBuilder.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultInterfaceProjectionBuilder.groovy @@ -67,4 +67,4 @@ trait SingleResultInterfaceProjectionBuilder extends InterfaceProjectionBuilder } -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultServiceImplementer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultServiceImplementer.groovy index e4705fe6dca..1dcb6ed7976 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultServiceImplementer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/services/implementers/SingleResultServiceImplementer.groovy @@ -26,4 +26,4 @@ package org.grails.datastore.gorm.services.implementers */ interface SingleResultServiceImplementer extends PrefixedServiceImplementer { -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/ValidatorProvider.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/ValidatorProvider.groovy index 5b962807d10..7674b23ac57 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/ValidatorProvider.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/ValidatorProvider.groovy @@ -32,4 +32,4 @@ interface ValidatorProvider { * @return The validator */ Validator getValidator() -} \ No newline at end of file +} diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/jakarta/services/ValidatedService.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/jakarta/services/ValidatedService.groovy index 28a17bdfb1e..e9462a8835e 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/jakarta/services/ValidatedService.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/validation/jakarta/services/ValidatedService.groovy @@ -138,4 +138,4 @@ trait ValidatedService extends Service { Errors asErrors(Object object, Set constraintViolations) { ConstraintViolationUtils.asErrors(object, constraintViolations) } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/base/GrailsDataTckManager.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/base/GrailsDataTckManager.groovy index e41d28112e4..d66b46ba225 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/base/GrailsDataTckManager.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/base/GrailsDataTckManager.groovy @@ -128,4 +128,4 @@ abstract class GrailsDataTckManager { void destroy() { // noop } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Card.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Card.groovy index 94e876d97ff..df9c71bc4ad 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Card.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Card.groovy @@ -27,4 +27,4 @@ class Card implements Serializable { Long id String cardNumber static hasOne = [cardProfile: CardProfile] -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/CardProfile.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/CardProfile.groovy index 142625af02b..54d0acd31b1 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/CardProfile.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/CardProfile.groovy @@ -31,4 +31,4 @@ class CardProfile implements Serializable { static constraints = { card nullable: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ChildEntity.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ChildEntity.groovy index a386c7ffe1a..894a4d405a1 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ChildEntity.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ChildEntity.groovy @@ -35,4 +35,4 @@ class ChildEntity implements Serializable { } static belongsTo = [TestEntity] -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithHungarianNotation.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithHungarianNotation.groovy index b67e0d99a49..1adf2037a63 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithHungarianNotation.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithHungarianNotation.groovy @@ -31,4 +31,4 @@ class ClassWithHungarianNotation implements Serializable { static constraints = { iSize nullable: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithListArgBeforeValidate.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithListArgBeforeValidate.groovy index cc703c149aa..14bdd5bbf9a 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithListArgBeforeValidate.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithListArgBeforeValidate.groovy @@ -37,4 +37,4 @@ class ClassWithListArgBeforeValidate implements Serializable { static constraints = { name blank: false } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithNoArgBeforeValidate.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithNoArgBeforeValidate.groovy index a510f50d56f..13afb8b8e52 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithNoArgBeforeValidate.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithNoArgBeforeValidate.groovy @@ -35,4 +35,4 @@ class ClassWithNoArgBeforeValidate implements Serializable { static constraints = { name blank: false } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithOverloadedBeforeValidate.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithOverloadedBeforeValidate.groovy index a6d72d59751..3085c9b553b 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithOverloadedBeforeValidate.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ClassWithOverloadedBeforeValidate.groovy @@ -42,4 +42,4 @@ class ClassWithOverloadedBeforeValidate implements Serializable { static constraints = { name blank: false } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ContactDetails.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ContactDetails.groovy index 81ef305d9a5..28187ee116c 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ContactDetails.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/ContactDetails.groovy @@ -29,4 +29,4 @@ class ContactDetails implements Serializable { static constraints = { phoneNumber nullable: false, unique: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Dog.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Dog.groovy index cc6d6e0497e..52229ab4409 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Dog.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Dog.groovy @@ -32,4 +32,4 @@ class Dog implements Serializable { age index: true name index: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/GroupWithin.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/GroupWithin.groovy index 77c84d0fed6..34d4172e0b0 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/GroupWithin.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/GroupWithin.groovy @@ -31,4 +31,4 @@ class GroupWithin implements Serializable { name unique: "org", index: true org index: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/OptLockVersioned.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/OptLockVersioned.groovy index 81982af712b..eb93b76f157 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/OptLockVersioned.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/OptLockVersioned.groovy @@ -27,4 +27,4 @@ class OptLockVersioned implements Serializable { Long version String name -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Parent.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Parent.groovy index 8ee72373530..3a490f867ed 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Parent.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Parent.groovy @@ -28,4 +28,4 @@ class Parent implements Serializable { String name Set children = [] static hasMany = [children: Child] -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Patient.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Patient.groovy index cf81e5abaee..c7f4f7e3cbf 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Patient.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Patient.groovy @@ -33,4 +33,4 @@ class Patient implements Serializable { static mapping = { contactDetails lazy: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/PersonWithCompositeKey.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/PersonWithCompositeKey.groovy index cb84b3b8676..3627127262c 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/PersonWithCompositeKey.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/PersonWithCompositeKey.groovy @@ -30,4 +30,4 @@ class PersonWithCompositeKey implements Serializable { static mapping = { id composite: ['lastName', 'firstName'] } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Product.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Product.groovy index 2f77843e1ae..29aad8bebe9 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Product.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Product.groovy @@ -36,4 +36,4 @@ class Product { static Number updateAll(String givenColor) { whereLazy { color == givenColor }.updateAll([name: 't-shirt ' + givenColor]) } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Record.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Record.groovy index 848e81ae6bb..215153f5d08 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Record.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Record.groovy @@ -35,4 +35,4 @@ class Record { static mapping = { autoTimestamp false } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidget.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidget.groovy index 98b135259c7..ba5632e7889 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidget.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidget.groovy @@ -27,4 +27,4 @@ class SimpleWidget implements Serializable { Long version String name String spanishName -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidgetWithNonStandardId.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidgetWithNonStandardId.groovy index f53b01856ae..bdd03764469 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidgetWithNonStandardId.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/SimpleWidgetWithNonStandardId.groovy @@ -29,4 +29,4 @@ class SimpleWidgetWithNonStandardId implements Serializable { static mapping = { id name: 'myIdentifier' } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Simples.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Simples.groovy index 0eeedbf233b..147467bb36a 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Simples.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/Simples.groovy @@ -25,4 +25,4 @@ import grails.persistence.Entity class Simples implements Serializable { Long id String name -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestAuthor.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestAuthor.groovy index cb4231f5b9a..db098a96bce 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestAuthor.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestAuthor.groovy @@ -35,4 +35,4 @@ class TestAuthor implements Serializable { if (id != null && that.id != null) return id == that.id return false } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestBook.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestBook.groovy index 9af8fb7203c..f6f8debac69 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestBook.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestBook.groovy @@ -27,4 +27,4 @@ class TestBook implements Serializable { Long id String title TestAuthor author -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestPlayer.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestPlayer.groovy index 05f2022388e..34f6568629d 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestPlayer.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/TestPlayer.groovy @@ -27,4 +27,4 @@ class TestPlayer implements Serializable { String name List attributes -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/UniqueGroup.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/UniqueGroup.groovy index 2bf26c7808d..5f928dca8ca 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/UniqueGroup.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/domains/UniqueGroup.groovy @@ -32,4 +32,4 @@ class UniqueGroup implements Serializable, DirtyCheckable { name unique: true, index: true desc nullable: true } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/CircularOneToManySpec.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/CircularOneToManySpec.groovy index 71cc4921790..b37e215caed 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/CircularOneToManySpec.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/CircularOneToManySpec.groovy @@ -40,4 +40,4 @@ class CircularOneToManySpec extends GrailsDataTckSpec { parent.task == null child.task.id == parent.id } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DirtyCheckingAfterListenerSpec.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DirtyCheckingAfterListenerSpec.groovy index 9877ec8a034..e552ec73391 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DirtyCheckingAfterListenerSpec.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DirtyCheckingAfterListenerSpec.groovy @@ -92,4 +92,4 @@ class TestSaveOrUpdateEventListener extends AbstractPersistenceEventListener { boolean supportsEventType(Class eventType) { return eventType == PreUpdateEvent || eventType == PreInsertEvent } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DomainEventsSpec.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DomainEventsSpec.groovy index 585b5437e7b..52e09d2799c 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DomainEventsSpec.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DomainEventsSpec.groovy @@ -313,4 +313,4 @@ class DomainEventsSpec extends GrailsDataTckSpec { def cleanup() { manager.session.datastore.applicationContext?.beanFactory?.destroySingleton 'personService' } -} \ No newline at end of file +} diff --git a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy index 529b1655987..f81c7d93fa9 100644 --- a/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy +++ b/grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy @@ -182,4 +182,4 @@ class EnumSpec extends GrailsDataTckSpec { 1 == v2Count 0 == v3Count } -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constrained.groovy b/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constrained.groovy index d652d534682..50b7b48c7dc 100644 --- a/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constrained.groovy +++ b/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constrained.groovy @@ -133,4 +133,4 @@ interface Constrained { * @return The owning class */ Class getOwner() -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/ConstrainedEntity.groovy b/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/ConstrainedEntity.groovy index 7d61750f437..a8af73c202c 100644 --- a/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/ConstrainedEntity.groovy +++ b/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/ConstrainedEntity.groovy @@ -31,4 +31,4 @@ interface ConstrainedEntity { * @return The constrained property instances */ Map getConstrainedProperties() -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constraint.java b/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constraint.java index c2ddaa8707a..feeb6e67954 100644 --- a/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constraint.java +++ b/grails-datamapping-validation/src/main/groovy/grails/gorm/validation/Constraint.java @@ -71,4 +71,4 @@ public interface Constraint { */ String getPropertyName(); -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/BeforeValidateHelper.java b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/BeforeValidateHelper.java index fc04a8aa256..d1621673de0 100644 --- a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/BeforeValidateHelper.java +++ b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/BeforeValidateHelper.java @@ -68,4 +68,4 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE in.defaultReadObject(); eventTriggerCallerCache = new ConcurrentHashMap, BeforeValidateEventTriggerCaller>(); } -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/EventTriggerCaller.java b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/EventTriggerCaller.java index e027acb6443..aa2b59f490d 100644 --- a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/EventTriggerCaller.java +++ b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/support/EventTriggerCaller.java @@ -238,4 +238,4 @@ public boolean call(Object entity, Object[] argumentArray) { return false; } } -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/MaxConstraint.java b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/MaxConstraint.java index 42ecbe6f44b..394e5aaad25 100644 --- a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/MaxConstraint.java +++ b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/MaxConstraint.java @@ -94,4 +94,4 @@ protected void processValidate(Object target, Object propertyValue, Errors error ConstrainedProperty.MAX_CONSTRAINT + ConstrainedProperty.EXCEEDED_SUFFIX, args); } } -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/eval/ConstraintsEvaluator.groovy b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/eval/ConstraintsEvaluator.groovy index 9ca15050943..cced5695edb 100644 --- a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/eval/ConstraintsEvaluator.groovy +++ b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/eval/ConstraintsEvaluator.groovy @@ -75,4 +75,4 @@ interface ConstraintsEvaluator { * @return The builder */ ConstrainedPropertyBuilder newConstrainedPropertyBuilder(Class theClass) -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/factory/ConstraintFactory.groovy b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/factory/ConstraintFactory.groovy index 0dd507e2ff3..d16265cae3e 100644 --- a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/factory/ConstraintFactory.groovy +++ b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/factory/ConstraintFactory.groovy @@ -57,4 +57,4 @@ interface ConstraintFactory { * @return A constraint instance */ T build(Class owner, String property, Object constrainingValue) -} \ No newline at end of file +} diff --git a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/registry/ConstraintRegistry.groovy b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/registry/ConstraintRegistry.groovy index 82c5532b771..adb49cf8fc8 100644 --- a/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/registry/ConstraintRegistry.groovy +++ b/grails-datamapping-validation/src/main/groovy/org/grails/datastore/gorm/validation/constraints/registry/ConstraintRegistry.groovy @@ -70,4 +70,4 @@ interface ConstraintRegistry { * @return The constraint */ public List> findConstraintFactories(Class constraintType) -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/collection/PersistentSet.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/collection/PersistentSet.java index a82224fdc55..267ccd54ff5 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/collection/PersistentSet.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/collection/PersistentSet.java @@ -60,4 +60,4 @@ public PersistentSet(Serializable associationKey, Session session, AssociationQu super(associationKey, session, indexer, createCollection()); } -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/column/ColumnDatastore.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/column/ColumnDatastore.java index 4872e3cac97..9988f305b4e 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/column/ColumnDatastore.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/column/ColumnDatastore.java @@ -23,4 +23,4 @@ /** * @author Guillaume Laforge */ -public interface ColumnDatastore extends Datastore {} \ No newline at end of file +public interface ColumnDatastore extends Datastore {} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/MappingDefinition.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/MappingDefinition.groovy index 381eb010490..d2e7cf926a7 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/MappingDefinition.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/MappingDefinition.groovy @@ -42,4 +42,4 @@ interface MappingDefinition { */ E build() -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/groovy/MappingConfigurationBuilder.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/groovy/MappingConfigurationBuilder.groovy index 8e7164123cf..241f15ed550 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/groovy/MappingConfigurationBuilder.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/config/groovy/MappingConfigurationBuilder.groovy @@ -53,4 +53,4 @@ interface MappingConfigurationBuilder { * @return The build property definitions */ Map getProperties() -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/Ordered.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/Ordered.java index 286bae42da3..91a15097a2c 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/Ordered.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/Ordered.java @@ -35,4 +35,4 @@ public interface Ordered { default int getOrder() { return 0; } -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/ConnectionSourcesListener.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/ConnectionSourcesListener.groovy index 01dc513fc36..df557c5d1ef 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/ConnectionSourcesListener.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/ConnectionSourcesListener.groovy @@ -34,4 +34,4 @@ interface ConnectionSourcesListener { * @param connectionSource The connection source */ void newConnectionSource(ConnectionSource connectionSource) -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/MultipleConnectionSourceCapableDatastore.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/MultipleConnectionSourceCapableDatastore.groovy index 5742fe0f68b..12f0952882d 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/MultipleConnectionSourceCapableDatastore.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/core/connections/MultipleConnectionSourceCapableDatastore.groovy @@ -36,4 +36,4 @@ interface MultipleConnectionSourceCapableDatastore extends Datastore { * @return The {@link Datastore} */ Datastore getDatastoreForConnection(String connectionName) -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/document/DocumentDatastore.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/document/DocumentDatastore.java index 248be893d9f..6f0927701c7 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/document/DocumentDatastore.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/document/DocumentDatastore.java @@ -23,4 +23,4 @@ /** * @author Guillaume Laforge */ -public interface DocumentDatastore extends Datastore {} \ No newline at end of file +public interface DocumentDatastore extends Datastore {} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/graph/GraphDatastore.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/graph/GraphDatastore.java index ce7ba8d9f02..d98c1ce0fc2 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/graph/GraphDatastore.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/graph/GraphDatastore.java @@ -28,4 +28,4 @@ * * @since 1.0 */ -public interface GraphDatastore extends Datastore {} \ No newline at end of file +public interface GraphDatastore extends Datastore {} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/AllTenantsResolver.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/AllTenantsResolver.groovy index d5e3e7f09db..1e45225ab52 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/AllTenantsResolver.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/AllTenantsResolver.groovy @@ -33,4 +33,4 @@ interface AllTenantsResolver extends TenantResolver { * @return Resolves all tenant ids */ Iterable resolveTenantIds(); -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/TenantResolver.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/TenantResolver.groovy index c52cf425cb4..f6aa031be56 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/TenantResolver.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/multitenancy/TenantResolver.groovy @@ -40,4 +40,4 @@ interface TenantResolver { * */ public Serializable resolveTenantIdentifier() throws TenantNotFoundException -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/rdbms/RelationalDatastore.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/rdbms/RelationalDatastore.java index ac2b8df8c79..27502fa143c 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/rdbms/RelationalDatastore.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/rdbms/RelationalDatastore.java @@ -23,4 +23,4 @@ /** * @author Guillaume Laforge */ -public interface RelationalDatastore extends Datastore {} \ No newline at end of file +public interface RelationalDatastore extends Datastore {} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect/EntityReflector.java b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect/EntityReflector.java index 09ad2f8e330..e3f85787963 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect/EntityReflector.java +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/reflect/EntityReflector.java @@ -173,4 +173,4 @@ interface PropertyWriter { */ void write(Object object, Object value); } -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/Service.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/Service.groovy index 10ffc6c7051..61754b85e9f 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/Service.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/Service.groovy @@ -34,4 +34,4 @@ trait Service { * The datastore that this service is related to */ Datastore datastore -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/ServiceRegistry.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/ServiceRegistry.groovy index 24c9ef448f1..e4739b7151e 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/ServiceRegistry.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/ServiceRegistry.groovy @@ -38,4 +38,4 @@ interface ServiceRegistry { * @return */ public T getService(Class interfaceType) throws ServiceNotFoundException -} \ No newline at end of file +} diff --git a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/transactions/TransactionCapableDatastore.groovy b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/transactions/TransactionCapableDatastore.groovy index c8665f2f725..68ab2298f58 100644 --- a/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/transactions/TransactionCapableDatastore.groovy +++ b/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/transactions/TransactionCapableDatastore.groovy @@ -33,4 +33,4 @@ interface TransactionCapableDatastore extends Datastore { * @return The transaction manager for this datastore */ PlatformTransactionManager getTransactionManager() -} \ No newline at end of file +} diff --git a/grails-datastore-web/src/main/groovy/org/grails/datastore/mapping/multitenancy/web/HttpHeaderTenantResolver.groovy b/grails-datastore-web/src/main/groovy/org/grails/datastore/mapping/multitenancy/web/HttpHeaderTenantResolver.groovy index 58ff9bfd5ce..4af7d5be903 100644 --- a/grails-datastore-web/src/main/groovy/org/grails/datastore/mapping/multitenancy/web/HttpHeaderTenantResolver.groovy +++ b/grails-datastore-web/src/main/groovy/org/grails/datastore/mapping/multitenancy/web/HttpHeaderTenantResolver.groovy @@ -59,4 +59,4 @@ class HttpHeaderTenantResolver implements TenantResolver { } throw new TenantNotFoundException("Tenant could not be resolved outside a web request") } -} \ No newline at end of file +} diff --git a/grails-encoder/src/main/groovy/org/grails/charsequences/CharArrayCharSequence.java b/grails-encoder/src/main/groovy/org/grails/charsequences/CharArrayCharSequence.java index e7601fcc916..5475177c149 100644 --- a/grails-encoder/src/main/groovy/org/grails/charsequences/CharArrayCharSequence.java +++ b/grails-encoder/src/main/groovy/org/grails/charsequences/CharArrayCharSequence.java @@ -76,4 +76,4 @@ public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) { throw new StringIndexOutOfBoundsException("srcBegin > srcEnd"); System.arraycopy(chars, start + srcBegin, dst, dstBegin, srcEnd - srcBegin); } -} \ No newline at end of file +} diff --git a/grails-encoder/src/main/groovy/org/grails/charsequences/SingleCharCharSequence.java b/grails-encoder/src/main/groovy/org/grails/charsequences/SingleCharCharSequence.java index aec66a3ed1f..99683f86d15 100644 --- a/grails-encoder/src/main/groovy/org/grails/charsequences/SingleCharCharSequence.java +++ b/grails-encoder/src/main/groovy/org/grails/charsequences/SingleCharCharSequence.java @@ -71,4 +71,4 @@ public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) { throw new StringIndexOutOfBoundsException("srcBegin > srcEnd"); dst[dstBegin] = ch; } -} \ No newline at end of file +} diff --git a/grails-encoder/src/main/groovy/org/grails/charsequences/SubCharSequence.java b/grails-encoder/src/main/groovy/org/grails/charsequences/SubCharSequence.java index f148e35723e..9e526154aab 100644 --- a/grails-encoder/src/main/groovy/org/grails/charsequences/SubCharSequence.java +++ b/grails-encoder/src/main/groovy/org/grails/charsequences/SubCharSequence.java @@ -76,4 +76,4 @@ public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) { throw new StringIndexOutOfBoundsException("srcBegin > srcEnd"); CharSequences.getChars(str, start + srcBegin, start + srcEnd, dst, dstBegin); } -} \ No newline at end of file +} diff --git a/grails-encoder/src/main/groovy/org/grails/encoder/CombinedCodecIdentifier.java b/grails-encoder/src/main/groovy/org/grails/encoder/CombinedCodecIdentifier.java index 77256fa52d8..82d3e6d8ef5 100644 --- a/grails-encoder/src/main/groovy/org/grails/encoder/CombinedCodecIdentifier.java +++ b/grails-encoder/src/main/groovy/org/grails/encoder/CombinedCodecIdentifier.java @@ -65,4 +65,4 @@ public boolean isEquivalent(CodecIdentifier other) { } return false; } -} \ No newline at end of file +} diff --git a/grails-events/compat/src/main/groovy/grails/artefact/Service.groovy b/grails-events/compat/src/main/groovy/grails/artefact/Service.groovy index dde5f3949e7..9b49a5d7379 100644 --- a/grails-events/compat/src/main/groovy/grails/artefact/Service.groovy +++ b/grails-events/compat/src/main/groovy/grails/artefact/Service.groovy @@ -29,4 +29,4 @@ import grails.events.Events */ @Deprecated trait Service extends Events { -} \ No newline at end of file +} diff --git a/grails-events/compat/src/main/groovy/grails/events/Events.groovy b/grails-events/compat/src/main/groovy/grails/events/Events.groovy index 2291720e005..c9064409d64 100644 --- a/grails-events/compat/src/main/groovy/grails/events/Events.groovy +++ b/grails-events/compat/src/main/groovy/grails/events/Events.groovy @@ -197,4 +197,4 @@ trait Events { return false } -} \ No newline at end of file +} diff --git a/grails-events/compat/src/main/groovy/reactor/bus/registry/Registration.groovy b/grails-events/compat/src/main/groovy/reactor/bus/registry/Registration.groovy index 18efa30b7e3..4b03a3651ce 100644 --- a/grails-events/compat/src/main/groovy/reactor/bus/registry/Registration.groovy +++ b/grails-events/compat/src/main/groovy/reactor/bus/registry/Registration.groovy @@ -24,4 +24,4 @@ package reactor.bus.registry */ @Deprecated interface Registration extends grails.events.subscriber.Subscription{ -} \ No newline at end of file +} diff --git a/grails-events/compat/src/main/groovy/reactor/bus/registry/Subscription.groovy b/grails-events/compat/src/main/groovy/reactor/bus/registry/Subscription.groovy index ab79793252a..9a47fab3025 100644 --- a/grails-events/compat/src/main/groovy/reactor/bus/registry/Subscription.groovy +++ b/grails-events/compat/src/main/groovy/reactor/bus/registry/Subscription.groovy @@ -22,4 +22,4 @@ package reactor.bus.registry * @deprecated Here for compatibility only. Do not use directly */ @Deprecated -interface Subscription extends Registration{} \ No newline at end of file +interface Subscription extends Registration{} diff --git a/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Consumer.groovy b/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Consumer.groovy index 06dfae18a02..a3157208763 100644 --- a/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Consumer.groovy +++ b/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Consumer.groovy @@ -34,4 +34,4 @@ import java.lang.annotation.Target @Inherited @Documented @interface Consumer { -} \ No newline at end of file +} diff --git a/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Selector.groovy b/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Selector.groovy index e1bda706c49..c4b18083554 100644 --- a/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Selector.groovy +++ b/grails-events/compat/src/main/groovy/reactor/spring/context/annotation/Selector.groovy @@ -41,4 +41,4 @@ import java.lang.annotation.Target * @return The id of the event */ String value() -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/EventPublisher.groovy b/grails-events/core/src/main/groovy/grails/events/EventPublisher.groovy index 46baf82779f..5ec3bb7c8de 100644 --- a/grails-events/core/src/main/groovy/grails/events/EventPublisher.groovy +++ b/grails-events/core/src/main/groovy/grails/events/EventPublisher.groovy @@ -98,4 +98,4 @@ trait EventPublisher extends EventBusAware implements EventEmitter { EventEmitter sendAndReceive(CharSequence eventId, Object data, Closure reply) { return eventBus.sendAndReceive(eventId, data, reply) } -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/bus/EventBusAware.groovy b/grails-events/core/src/main/groovy/grails/events/bus/EventBusAware.groovy index bcae822f34f..bd692938677 100644 --- a/grails-events/core/src/main/groovy/grails/events/bus/EventBusAware.groovy +++ b/grails-events/core/src/main/groovy/grails/events/bus/EventBusAware.groovy @@ -54,4 +54,4 @@ trait EventBusAware { } return this.eventBus } -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/emitter/EventEmitter.groovy b/grails-events/core/src/main/groovy/grails/events/emitter/EventEmitter.groovy index e6e8245da06..d464c98b7e0 100644 --- a/grails-events/core/src/main/groovy/grails/events/emitter/EventEmitter.groovy +++ b/grails-events/core/src/main/groovy/grails/events/emitter/EventEmitter.groovy @@ -90,4 +90,4 @@ interface EventEmitter { * @return This emitter */ EventEmitter sendAndReceive(CharSequence eventId, Object data, Closure reply) -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/subscriber/Subjects.groovy b/grails-events/core/src/main/groovy/grails/events/subscriber/Subjects.groovy index fe84dc719dc..928da728e8f 100644 --- a/grails-events/core/src/main/groovy/grails/events/subscriber/Subjects.groovy +++ b/grails-events/core/src/main/groovy/grails/events/subscriber/Subjects.groovy @@ -61,4 +61,4 @@ interface Subjects { Subjects unsubscribeAll(CharSequence event) -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/subscriber/Subscriber.groovy b/grails-events/core/src/main/groovy/grails/events/subscriber/Subscriber.groovy index b2bc4619114..85e918c54cb 100644 --- a/grails-events/core/src/main/groovy/grails/events/subscriber/Subscriber.groovy +++ b/grails-events/core/src/main/groovy/grails/events/subscriber/Subscriber.groovy @@ -35,4 +35,4 @@ interface Subscriber { * @return The result */ R call(T arg) -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/subscriber/Subscription.groovy b/grails-events/core/src/main/groovy/grails/events/subscriber/Subscription.groovy index 56663aabd01..7038865fac8 100644 --- a/grails-events/core/src/main/groovy/grails/events/subscriber/Subscription.groovy +++ b/grails-events/core/src/main/groovy/grails/events/subscriber/Subscription.groovy @@ -48,4 +48,4 @@ interface Subscription { * @return Builds a trigger */ EventTrigger buildTrigger(Event event, Closure reply) -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/grails/events/trigger/EventTrigger.groovy b/grails-events/core/src/main/groovy/grails/events/trigger/EventTrigger.groovy index 6c9b6ee8516..526e53b7fad 100644 --- a/grails-events/core/src/main/groovy/grails/events/trigger/EventTrigger.groovy +++ b/grails-events/core/src/main/groovy/grails/events/trigger/EventTrigger.groovy @@ -44,4 +44,4 @@ interface EventTrigger { * @return Proceed to trigger the event */ Object proceed() -} \ No newline at end of file +} diff --git a/grails-events/core/src/main/groovy/org/grails/events/registry/ClosureSubscription.groovy b/grails-events/core/src/main/groovy/org/grails/events/registry/ClosureSubscription.groovy index e9d84adf663..7bcdc714406 100644 --- a/grails-events/core/src/main/groovy/org/grails/events/registry/ClosureSubscription.groovy +++ b/grails-events/core/src/main/groovy/org/grails/events/registry/ClosureSubscription.groovy @@ -47,4 +47,4 @@ class ClosureSubscription extends AbstractSubscription { EventTrigger buildTrigger(Event event, Closure reply = null) { return new ClosureEventTrigger(event, listener, reply) } -} \ No newline at end of file +} diff --git a/grails-events/transforms/src/main/groovy/grails/events/annotation/Events.groovy b/grails-events/transforms/src/main/groovy/grails/events/annotation/Events.groovy index 0f6b8625011..2280eeb7548 100644 --- a/grails-events/transforms/src/main/groovy/grails/events/annotation/Events.groovy +++ b/grails-events/transforms/src/main/groovy/grails/events/annotation/Events.groovy @@ -53,4 +53,4 @@ import java.lang.annotation.Target * @return The id of the event to notify in the case of an error */ String error() default "" -} \ No newline at end of file +} diff --git a/grails-events/transforms/src/main/groovy/grails/events/annotation/Publisher.groovy b/grails-events/transforms/src/main/groovy/grails/events/annotation/Publisher.groovy index 33c900581cf..d3e83d4f1dc 100644 --- a/grails-events/transforms/src/main/groovy/grails/events/annotation/Publisher.groovy +++ b/grails-events/transforms/src/main/groovy/grails/events/annotation/Publisher.groovy @@ -57,4 +57,4 @@ import java.lang.annotation.Target */ String error() default "" -} \ No newline at end of file +} diff --git a/grails-events/transforms/src/main/groovy/grails/events/annotation/Subscriber.groovy b/grails-events/transforms/src/main/groovy/grails/events/annotation/Subscriber.groovy index c9089b7f2a5..50048583f0a 100644 --- a/grails-events/transforms/src/main/groovy/grails/events/annotation/Subscriber.groovy +++ b/grails-events/transforms/src/main/groovy/grails/events/annotation/Subscriber.groovy @@ -44,4 +44,4 @@ import java.lang.annotation.Target * @return The id of the event */ String value() default "" -} \ No newline at end of file +} diff --git a/grails-events/transforms/src/main/groovy/grails/events/annotation/gorm/Listener.groovy b/grails-events/transforms/src/main/groovy/grails/events/annotation/gorm/Listener.groovy index 7a6ef928471..0d5389f12d5 100644 --- a/grails-events/transforms/src/main/groovy/grails/events/annotation/gorm/Listener.groovy +++ b/grails-events/transforms/src/main/groovy/grails/events/annotation/gorm/Listener.groovy @@ -44,4 +44,4 @@ import java.lang.annotation.Target * @return The types this listener listens for */ Class[] value() default [] -} \ No newline at end of file +} diff --git a/grails-events/transforms/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy b/grails-events/transforms/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy index b551ae94398..c65bbcc0cae 100644 --- a/grails-events/transforms/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy +++ b/grails-events/transforms/src/main/groovy/org/grails/events/transform/AnnotatedSubscriber.groovy @@ -79,4 +79,4 @@ trait AnnotatedSubscriber extends EventBusAware { } } } -} \ No newline at end of file +} diff --git a/grails-fields/grails-app/init/grails/plugin/formfields/Application.groovy b/grails-fields/grails-app/init/grails/plugin/formfields/Application.groovy index e5fa1418dd4..7122ab7409e 100644 --- a/grails-fields/grails-app/init/grails/plugin/formfields/Application.groovy +++ b/grails-fields/grails-app/init/grails/plugin/formfields/Application.groovy @@ -31,4 +31,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/markup/ContextMarkupRenderer.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/markup/ContextMarkupRenderer.groovy index 908161074b1..609d825f9e5 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/markup/ContextMarkupRenderer.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/markup/ContextMarkupRenderer.groovy @@ -106,4 +106,4 @@ interface ContextMarkupRenderer { */ Closure embeddedInputContext(DomainProperty property, Closure content) -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/markup/DomainMarkupRenderer.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/markup/DomainMarkupRenderer.groovy index a3716853741..048eb9bbe85 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/markup/DomainMarkupRenderer.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/markup/DomainMarkupRenderer.groovy @@ -53,4 +53,4 @@ interface DomainMarkupRenderer { */ String renderInput(PersistentEntity domainClass) -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/markup/PropertyMarkupRenderer.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/markup/PropertyMarkupRenderer.groovy index 6717cf87a29..269ba6ef59e 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/markup/PropertyMarkupRenderer.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/markup/PropertyMarkupRenderer.groovy @@ -71,4 +71,4 @@ trait PropertyMarkupRenderer { * @return The closure to be passed to an instance of {@link groovy.xml.MarkupBuilder} */ abstract Closure renderInput(DomainProperty property) -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/model/property/DomainProperty.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/model/property/DomainProperty.groovy index 432fa4ff811..401e6a3083b 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/model/property/DomainProperty.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/model/property/DomainProperty.groovy @@ -97,4 +97,4 @@ interface DomainProperty extends PersistentProperty, Comparable */ String getDefaultLabel() -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainInputRendererRegistry.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainInputRendererRegistry.groovy index c3fb1cfaea1..90d6e0a713c 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainInputRendererRegistry.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainInputRendererRegistry.groovy @@ -29,4 +29,4 @@ import groovy.transform.CompileStatic @CompileStatic class DomainInputRendererRegistry extends DomainRendererRegistry { -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainRenderer.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainRenderer.groovy index c219af649e6..d7f89805072 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainRenderer.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/registry/DomainRenderer.groovy @@ -36,4 +36,4 @@ interface DomainRenderer { */ boolean supports(DomainProperty property) -} \ No newline at end of file +} diff --git a/grails-fields/src/main/groovy/org/grails/scaffolding/registry/input/MapToSelectInputRenderer.groovy b/grails-fields/src/main/groovy/org/grails/scaffolding/registry/input/MapToSelectInputRenderer.groovy index b8248255834..481e23aa659 100644 --- a/grails-fields/src/main/groovy/org/grails/scaffolding/registry/input/MapToSelectInputRenderer.groovy +++ b/grails-fields/src/main/groovy/org/grails/scaffolding/registry/input/MapToSelectInputRenderer.groovy @@ -76,4 +76,4 @@ trait MapToSelectInputRenderer implements DomainInputRenderer { } } -} \ No newline at end of file +} diff --git a/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateHolder.groovy b/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateHolder.groovy index 7308e1bc25d..5f2198ca686 100644 --- a/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateHolder.groovy +++ b/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateHolder.groovy @@ -33,4 +33,4 @@ class CoordinateHolder { String getCoordinatesWithoutVersion() { "$groupId:$artifactId" as String } -} \ No newline at end of file +} diff --git a/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateVersionHolder.groovy b/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateVersionHolder.groovy index 629c1ff2114..e1627660b25 100644 --- a/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateVersionHolder.groovy +++ b/grails-gradle/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/CoordinateVersionHolder.groovy @@ -41,4 +41,4 @@ class CoordinateVersionHolder extends CoordinateHolder { "$groupId:$artifactId:$version" as String } -} \ No newline at end of file +} diff --git a/grails-gradle/model/src/main/groovy/grails/util/Metadata.groovy b/grails-gradle/model/src/main/groovy/grails/util/Metadata.groovy index bb7f9776be6..734a34f29b4 100644 --- a/grails-gradle/model/src/main/groovy/grails/util/Metadata.groovy +++ b/grails-gradle/model/src/main/groovy/grails/util/Metadata.groovy @@ -363,4 +363,4 @@ class Metadata { propertySources.addLast(propertySource) } } -} \ No newline at end of file +} diff --git a/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassHolder.groovy b/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassHolder.groovy index 4258b028dc8..cfa4d392307 100644 --- a/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassHolder.groovy +++ b/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassHolder.groovy @@ -25,4 +25,4 @@ import groovy.transform.CompileStatic class MainClassHolder { File classFile String className -} \ No newline at end of file +} diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/ApplicationContextScriptTask.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/ApplicationContextScriptTask.groovy index 830271e38f0..d21ec080ec3 100644 --- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/ApplicationContextScriptTask.groovy +++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/commands/ApplicationContextScriptTask.groovy @@ -30,4 +30,4 @@ class ApplicationContextScriptTask extends JavaExec { systemProperties(System.properties.findAll { it.key.toString().startsWith('grails.') } as Map) } -} \ No newline at end of file +} diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/PluginDefiner.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/PluginDefiner.groovy index a258302eb75..80e87b880a8 100644 --- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/PluginDefiner.groovy +++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/PluginDefiner.groovy @@ -79,4 +79,4 @@ class PluginDefiner { project.dependencies.project(path:path) } } -} \ No newline at end of file +} diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy index 70b668ceca1..e4027c5aed0 100644 --- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy +++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy @@ -251,4 +251,4 @@ class GrailsProfileGradlePlugin implements Plugin { jar.group = BUILD_GROUP } } -} \ No newline at end of file +} diff --git a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/EmbeddedGrailsLayoutView.java b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/EmbeddedGrailsLayoutView.java index a03ebcfa372..a7a4c8a9ca2 100644 --- a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/EmbeddedGrailsLayoutView.java +++ b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/EmbeddedGrailsLayoutView.java @@ -169,4 +169,4 @@ public Template getTemplate() { public View getInnerView() { return innerView; } -} \ No newline at end of file +} diff --git a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/FactoryHolder.java b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/FactoryHolder.java index eaf52001d7a..6bb2ca8d005 100644 --- a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/FactoryHolder.java +++ b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/FactoryHolder.java @@ -49,4 +49,4 @@ public static Factory getGrailsLayoutFactory() { public static synchronized void setFactory(Factory factory) { holder.set(factory); } -} \ No newline at end of file +} diff --git a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GSPGrailsLayoutPage.java b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GSPGrailsLayoutPage.java index 8c954f6b803..915f6dac8fd 100644 --- a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GSPGrailsLayoutPage.java +++ b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GSPGrailsLayoutPage.java @@ -234,4 +234,4 @@ public boolean isTitleCaptured() { public void setTitleCaptured(boolean titleCaptured) { this.titleCaptured = titleCaptured; } -} \ No newline at end of file +} diff --git a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GrailsLayoutView.java b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GrailsLayoutView.java index e515280cb40..d37aa03641a 100644 --- a/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GrailsLayoutView.java +++ b/grails-gsp/grails-layout/src/main/groovy/org/apache/grails/web/layout/GrailsLayoutView.java @@ -44,4 +44,4 @@ protected GrailsContentBufferingResponse createContentBufferingResponse(Map event) {} void onShutdown(Map event) {} -} \ No newline at end of file +} diff --git a/grails-gsp/grails-web-gsp-taglib/src/main/groovy/org/grails/web/pages/StandaloneTagLibraryLookup.java b/grails-gsp/grails-web-gsp-taglib/src/main/groovy/org/grails/web/pages/StandaloneTagLibraryLookup.java index 92df55b3b96..e822ef06ec1 100644 --- a/grails-gsp/grails-web-gsp-taglib/src/main/groovy/org/grails/web/pages/StandaloneTagLibraryLookup.java +++ b/grails-gsp/grails-web-gsp-taglib/src/main/groovy/org/grails/web/pages/StandaloneTagLibraryLookup.java @@ -86,4 +86,4 @@ public void detectAndRegisterTabLibBeans() { } } } -} \ No newline at end of file +} diff --git a/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/pages/GroovyPageForkedCompiler.groovy b/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/pages/GroovyPageForkedCompiler.groovy index 54f2cafe83a..894376abf9c 100644 --- a/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/pages/GroovyPageForkedCompiler.groovy +++ b/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/pages/GroovyPageForkedCompiler.groovy @@ -148,4 +148,4 @@ Usage: java -cp CLASSPATH GroovyPageForkedCompiler [srcDir] [destDir] [tmpDir] [ } compiler.compile(allFiles) } -} \ No newline at end of file +} diff --git a/grails-gsp/grails-web-taglib/src/main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy b/grails-gsp/grails-web-taglib/src/main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy index f97ef04505c..0520e7f554e 100644 --- a/grails-gsp/grails-web-taglib/src/main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy +++ b/grails-gsp/grails-web-taglib/src/main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy @@ -133,4 +133,4 @@ trait TagLibraryInvoker extends WebAttributes{ } -} \ No newline at end of file +} diff --git a/grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/GrailsTagDateHelper.groovy b/grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/GrailsTagDateHelper.groovy index 780cb2da6b5..17ee4287e08 100644 --- a/grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/GrailsTagDateHelper.groovy +++ b/grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/GrailsTagDateHelper.groovy @@ -93,4 +93,4 @@ interface GrailsTagDateHelper { * @return A GregorianCalendar instance */ GregorianCalendar buildCalendar(Object date) -} \ No newline at end of file +} diff --git a/grails-interceptors/src/main/groovy/grails/artefact/Interceptor.groovy b/grails-interceptors/src/main/groovy/grails/artefact/Interceptor.groovy index 4e2ca3dc1cb..ebe121fec11 100644 --- a/grails-interceptors/src/main/groovy/grails/artefact/Interceptor.groovy +++ b/grails-interceptors/src/main/groovy/grails/artefact/Interceptor.groovy @@ -308,4 +308,4 @@ trait Interceptor implements ResponseRenderer, ResponseRedirector, RequestForwar Collection getMatchers() { return matchers } -} \ No newline at end of file +} diff --git a/grails-interceptors/src/main/groovy/grails/interceptors/Matcher.groovy b/grails-interceptors/src/main/groovy/grails/interceptors/Matcher.groovy index baf24271e87..4fbfb406f59 100644 --- a/grails-interceptors/src/main/groovy/grails/interceptors/Matcher.groovy +++ b/grails-interceptors/src/main/groovy/grails/interceptors/Matcher.groovy @@ -92,4 +92,4 @@ interface Matcher { * Checks whether the current matcher is a exclude matcher or not */ boolean isExclude() -} \ No newline at end of file +} diff --git a/grails-rest-transforms/src/main/groovy/grails/rest/Resource.groovy b/grails-rest-transforms/src/main/groovy/grails/rest/Resource.groovy index dff87ab4b2b..33228005691 100644 --- a/grails-rest-transforms/src/main/groovy/grails/rest/Resource.groovy +++ b/grails-rest-transforms/src/main/groovy/grails/rest/Resource.groovy @@ -63,4 +63,4 @@ public @interface Resource { * @return The super class to use for the generated controller class */ Class superClass() default RestfulController -} \ No newline at end of file +} diff --git a/grails-scaffolding/grails-app/init/grails/plugin/scaffolding/Application.groovy b/grails-scaffolding/grails-app/init/grails/plugin/scaffolding/Application.groovy index f300ab34a28..a2be13fbdf2 100644 --- a/grails-scaffolding/grails-app/init/grails/plugin/scaffolding/Application.groovy +++ b/grails-scaffolding/grails-app/init/grails/plugin/scaffolding/Application.groovy @@ -30,4 +30,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/CommandLineHelper.groovy b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/CommandLineHelper.groovy index b6db7331e6e..4280a31f8a0 100644 --- a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/CommandLineHelper.groovy +++ b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/CommandLineHelper.groovy @@ -39,4 +39,4 @@ trait CommandLineHelper { } } -} \ No newline at end of file +} diff --git a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/GormService.groovy b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/GormService.groovy index 900c292f999..be9178550eb 100644 --- a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/GormService.groovy +++ b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/GormService.groovy @@ -76,4 +76,4 @@ class GormService> { } (T) ((GormEntityApi) instance).save(flush: true) } -} \ No newline at end of file +} diff --git a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy index 563903b2451..d591f61e367 100644 --- a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy +++ b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/RestfulServiceController.groovy @@ -60,4 +60,4 @@ class RestfulServiceController extends RestfulController { protected void deleteResource(T resource) { getService().delete(((GormEntityApi) resource).ident()) } -} \ No newline at end of file +} diff --git a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/ScaffoldingViewResolver.groovy b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/ScaffoldingViewResolver.groovy index e2fa9bc7100..339bf0c4cc6 100644 --- a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/ScaffoldingViewResolver.groovy +++ b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/ScaffoldingViewResolver.groovy @@ -170,4 +170,4 @@ class ScaffoldingViewResolver extends GroovyPageViewResolver implements Resource } return view } -} \ No newline at end of file +} diff --git a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/SkipBootstrap.groovy b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/SkipBootstrap.groovy index 42c5285c5c7..3c846d6087c 100644 --- a/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/SkipBootstrap.groovy +++ b/grails-scaffolding/src/main/groovy/grails/plugin/scaffolding/SkipBootstrap.groovy @@ -23,4 +23,4 @@ trait SkipBootstrap { boolean skipBootstrap = true -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/boot/GrailsApplicationCompilerAutoConfiguration.java b/grails-shell-cli/src/main/groovy/org/grails/cli/boot/GrailsApplicationCompilerAutoConfiguration.java index e6318ab6234..c9889021085 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/boot/GrailsApplicationCompilerAutoConfiguration.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/boot/GrailsApplicationCompilerAutoConfiguration.java @@ -192,4 +192,4 @@ public Dependency find(String artifactId) { // } } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/command/run/RunCommand.java b/grails-shell-cli/src/main/groovy/org/grails/cli/command/run/RunCommand.java index 90334ee2ed9..cc7f480a968 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/command/run/RunCommand.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/command/run/RunCommand.java @@ -142,4 +142,4 @@ public boolean isQuiet() { } } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/GrailsBomAstTransformation.java b/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/GrailsBomAstTransformation.java index c63bd293fb8..1775ae1ba1f 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/GrailsBomAstTransformation.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/GrailsBomAstTransformation.java @@ -35,4 +35,4 @@ public int getOrder() { return 0; } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/autoconfigure/GrailsCompilerAutoConfiguration.java b/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/autoconfigure/GrailsCompilerAutoConfiguration.java index afff8fd4462..e291f63522a 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/autoconfigure/GrailsCompilerAutoConfiguration.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/compiler/autoconfigure/GrailsCompilerAutoConfiguration.java @@ -49,4 +49,4 @@ public void applyImports(ImportCustomizer imports) { imports.addImports("groovy.transform.CompileStatic"); } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/gradle/FetchAllTaskSelectorsBuildAction.java b/grails-shell-cli/src/main/groovy/org/grails/cli/gradle/FetchAllTaskSelectorsBuildAction.java index 9c3f2b1ab3d..1749f3d1c59 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/gradle/FetchAllTaskSelectorsBuildAction.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/gradle/FetchAllTaskSelectorsBuildAction.java @@ -85,4 +85,4 @@ public static class AllTasksModel implements Serializable { public Map projectPaths; public String currentProject; } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/interactive/completers/StringsCompleter.java b/grails-shell-cli/src/main/groovy/org/grails/cli/interactive/completers/StringsCompleter.java index 4d5f6fcebb4..6261f8a9074 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/interactive/completers/StringsCompleter.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/interactive/completers/StringsCompleter.java @@ -76,4 +76,4 @@ public int complete(final String buffer, final int cursor, final List findCommands( Profile profile, boolean inherited ) -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/factory/CommandResourceResolver.groovy b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/factory/CommandResourceResolver.groovy index c1ef563accd..9f739022d62 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/factory/CommandResourceResolver.groovy +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/factory/CommandResourceResolver.groovy @@ -42,4 +42,4 @@ interface CommandResourceResolver { */ Collection getMatchingFileExtensions() -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/FileSystemInteraction.groovy b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/FileSystemInteraction.groovy index e7d7b130b66..e76ff2ea49a 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/FileSystemInteraction.groovy +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/FileSystemInteraction.groovy @@ -141,4 +141,4 @@ interface FileSystemInteraction { this.into = path } } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/ServerInteraction.groovy b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/ServerInteraction.groovy index a1ddb5aebb1..e098007c5ba 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/ServerInteraction.groovy +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/io/ServerInteraction.groovy @@ -61,4 +61,4 @@ trait ServerInteraction { return false } } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRenderer.groovy b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRenderer.groovy index 450b43041c3..c21b70e01ac 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRenderer.groovy +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRenderer.groovy @@ -169,4 +169,4 @@ interface TemplateRenderer { * @return The resource or null if it doesn't exist */ Resource template(Object location) -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRendererImpl.groovy b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRendererImpl.groovy index 76dbb18567c..e62f3dde9f8 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRendererImpl.groovy +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/commands/templates/TemplateRendererImpl.groovy @@ -277,4 +277,4 @@ class TemplateRendererImpl implements TemplateRenderer, ProfileRepositoryAware { ClassNameCompleter.refreshAll() } -} \ No newline at end of file +} diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/steps/StepFactory.groovy b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/steps/StepFactory.groovy index 122fe1c7b3c..c3a97b216bf 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/profile/steps/StepFactory.groovy +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/profile/steps/StepFactory.groovy @@ -40,4 +40,4 @@ interface StepFactory { * @return The step instance */ Step createStep(String name, Command command, Map parameters) -} \ No newline at end of file +} diff --git a/grails-test-core/src/main/groovy/org/grails/test/io/MultiplexingOutputStream.groovy b/grails-test-core/src/main/groovy/org/grails/test/io/MultiplexingOutputStream.groovy index 41fcfffa4c3..a8f252d9ceb 100644 --- a/grails-test-core/src/main/groovy/org/grails/test/io/MultiplexingOutputStream.groovy +++ b/grails-test-core/src/main/groovy/org/grails/test/io/MultiplexingOutputStream.groovy @@ -34,4 +34,4 @@ class MultiplexingOutputStream extends OutputStream { out.write(b) } } -} \ No newline at end of file +} diff --git a/grails-test-core/src/main/groovy/org/grails/test/io/SystemOutAndErrSwapper.groovy b/grails-test-core/src/main/groovy/org/grails/test/io/SystemOutAndErrSwapper.groovy index f62cbdec488..f3383b3f0f0 100644 --- a/grails-test-core/src/main/groovy/org/grails/test/io/SystemOutAndErrSwapper.groovy +++ b/grails-test-core/src/main/groovy/org/grails/test/io/SystemOutAndErrSwapper.groovy @@ -169,4 +169,4 @@ class SystemOutAndErrSwapper { } } } -} \ No newline at end of file +} diff --git a/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestAutowirer.groovy b/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestAutowirer.groovy index 6de18c25b06..77849331ca6 100644 --- a/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestAutowirer.groovy +++ b/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestAutowirer.groovy @@ -50,4 +50,4 @@ class GrailsTestAutowirer { bean.setApplicationContext(applicationContext) } } -} \ No newline at end of file +} diff --git a/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestMode.groovy b/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestMode.groovy index 1220d6519ca..7aeb150a24b 100644 --- a/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestMode.groovy +++ b/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestMode.groovy @@ -28,4 +28,4 @@ class GrailsTestMode { GrailsTestInterceptor createInterceptor(Object test, ApplicationContext appCtx, String[] testClassSuffixes) { new GrailsTestInterceptor(test, this, appCtx, testClassSuffixes) } -} \ No newline at end of file +} diff --git a/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestRequestEnvironmentInterceptor.groovy b/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestRequestEnvironmentInterceptor.groovy index 7851b573525..6eb80151524 100644 --- a/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestRequestEnvironmentInterceptor.groovy +++ b/grails-test-core/src/main/groovy/org/grails/test/support/GrailsTestRequestEnvironmentInterceptor.groovy @@ -80,4 +80,4 @@ class GrailsTestRequestEnvironmentInterceptor { destroy() } } -} \ No newline at end of file +} diff --git a/grails-test-examples/app1/grails-app/controllers/functionaltests/BookRestfulController.groovy b/grails-test-examples/app1/grails-app/controllers/functionaltests/BookRestfulController.groovy index 48e88572d0b..7d89bb11c89 100644 --- a/grails-test-examples/app1/grails-app/controllers/functionaltests/BookRestfulController.groovy +++ b/grails-test-examples/app1/grails-app/controllers/functionaltests/BookRestfulController.groovy @@ -31,4 +31,4 @@ class BookRestfulController extends RestfulController { BookRestfulController() { super(Book) } -} \ No newline at end of file +} diff --git a/grails-test-examples/app1/grails-app/init/functionaltests/Application.groovy b/grails-test-examples/app1/grails-app/init/functionaltests/Application.groovy index 52784974015..dcc99a5d58b 100644 --- a/grails-test-examples/app1/grails-app/init/functionaltests/Application.groovy +++ b/grails-test-examples/app1/grails-app/init/functionaltests/Application.groovy @@ -30,4 +30,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/scaffolding/BarFunctionalSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/scaffolding/BarFunctionalSpec.groovy index 03d25e38e72..457193c3b2e 100644 --- a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/scaffolding/BarFunctionalSpec.groovy +++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/scaffolding/BarFunctionalSpec.groovy @@ -35,4 +35,4 @@ class BarFunctionalSpec extends ContainerGebSpec { then: title == "Bar List" } -} \ No newline at end of file +} diff --git a/grails-test-examples/app2/grails-app/init/app2/Application.groovy b/grails-test-examples/app2/grails-app/init/app2/Application.groovy index ddbb3cffa0b..d50fed24a4d 100644 --- a/grails-test-examples/app2/grails-app/init/app2/Application.groovy +++ b/grails-test-examples/app2/grails-app/init/app2/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/app3/grails-app/init/app3/Application.groovy b/grails-test-examples/app3/grails-app/init/app3/Application.groovy index 015c3fbee12..2c8e46b552d 100755 --- a/grails-test-examples/app3/grails-app/init/app3/Application.groovy +++ b/grails-test-examples/app3/grails-app/init/app3/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/async-events-pubsub-demo/grails-app/domain/pubsub/demo/Book.groovy b/grails-test-examples/async-events-pubsub-demo/grails-app/domain/pubsub/demo/Book.groovy index 9eea918ce70..e80b30c6c06 100644 --- a/grails-test-examples/async-events-pubsub-demo/grails-app/domain/pubsub/demo/Book.groovy +++ b/grails-test-examples/async-events-pubsub-demo/grails-app/domain/pubsub/demo/Book.groovy @@ -26,4 +26,4 @@ class Book { String title -} \ No newline at end of file +} diff --git a/grails-test-examples/async-events-pubsub-demo/grails-app/init/pubsub/demo/Application.groovy b/grails-test-examples/async-events-pubsub-demo/grails-app/init/pubsub/demo/Application.groovy index 5339e0f1d3f..c0fd9626600 100644 --- a/grails-test-examples/async-events-pubsub-demo/grails-app/init/pubsub/demo/Application.groovy +++ b/grails-test-examples/async-events-pubsub-demo/grails-app/init/pubsub/demo/Application.groovy @@ -30,4 +30,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/async-events-pubsub-demo/grails-app/services/pubsub/demo/BookService.groovy b/grails-test-examples/async-events-pubsub-demo/grails-app/services/pubsub/demo/BookService.groovy index a52e12a7c9e..40f7173d363 100644 --- a/grails-test-examples/async-events-pubsub-demo/grails-app/services/pubsub/demo/BookService.groovy +++ b/grails-test-examples/async-events-pubsub-demo/grails-app/services/pubsub/demo/BookService.groovy @@ -27,4 +27,4 @@ interface BookService { @Publisher('newBook') Book saveBook(String title) -} \ No newline at end of file +} diff --git a/grails-test-examples/datasources/grails-app/init/datasources/Application.groovy b/grails-test-examples/datasources/grails-app/init/datasources/Application.groovy index 66eb42ec4ed..771599bbfc7 100644 --- a/grails-test-examples/datasources/grails-app/init/datasources/Application.groovy +++ b/grails-test-examples/datasources/grails-app/init/datasources/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/demo33/grails-app/services/demo/ConfigService.groovy b/grails-test-examples/demo33/grails-app/services/demo/ConfigService.groovy index 86bedc0bfc1..081609e336d 100644 --- a/grails-test-examples/demo33/grails-app/services/demo/ConfigService.groovy +++ b/grails-test-examples/demo33/grails-app/services/demo/ConfigService.groovy @@ -36,4 +36,4 @@ class ConfigService implements GrailsConfigurationAware { boolean isSignupAllowed() { allowSignup } -} \ No newline at end of file +} diff --git a/grails-test-examples/external-configuration/grails-app/init/test/app/Application.groovy b/grails-test-examples/external-configuration/grails-app/init/test/app/Application.groovy index 7564ff9c146..1d7e4b7f577 100644 --- a/grails-test-examples/external-configuration/grails-app/init/test/app/Application.groovy +++ b/grails-test-examples/external-configuration/grails-app/init/test/app/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/geb/grails-app/init/org/demo/spock/BootStrap.groovy b/grails-test-examples/geb/grails-app/init/org/demo/spock/BootStrap.groovy index 5d4b18e5921..f1599f9bf53 100644 --- a/grails-test-examples/geb/grails-app/init/org/demo/spock/BootStrap.groovy +++ b/grails-test-examples/geb/grails-app/init/org/demo/spock/BootStrap.groovy @@ -26,4 +26,4 @@ class BootStrap { def destroy = { } -} \ No newline at end of file +} diff --git a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorAnnotationSpec.groovy b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorAnnotationSpec.groovy index ab3def66449..371a4837615 100644 --- a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorAnnotationSpec.groovy +++ b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorAnnotationSpec.groovy @@ -48,4 +48,4 @@ class ContainerFileDetectorAnnotationSpec extends ContainerGebSpec { def e = thrown(WebDriverException) e.message.contains('File not found') } -} \ No newline at end of file +} diff --git a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorDefaultSpec.groovy b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorDefaultSpec.groovy index 32c9a0ee233..88586b54173 100644 --- a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorDefaultSpec.groovy +++ b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorDefaultSpec.groovy @@ -45,4 +45,4 @@ class ContainerFileDetectorDefaultSpec extends ContainerGebSpec { title == 'File Uploaded' pageSource.contains('File uploaded successfully') } -} \ No newline at end of file +} diff --git a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorSpockSpec.groovy b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorSpockSpec.groovy index 731489a3d6e..7754097cb19 100644 --- a/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorSpockSpec.groovy +++ b/grails-test-examples/geb/src/integration-test/groovy/org/demo/spock/ContainerFileDetectorSpockSpec.groovy @@ -57,4 +57,4 @@ class ContainerFileDetectorSpockSpec extends ContainerGebSpec { def e = thrown(WebDriverException) e.message.contains('File not found') } -} \ No newline at end of file +} diff --git a/grails-test-examples/gorm/grails-app/init/gorm/Application.groovy b/grails-test-examples/gorm/grails-app/init/gorm/Application.groovy index 8def06c3ba5..c0281536666 100644 --- a/grails-test-examples/gorm/grails-app/init/gorm/Application.groovy +++ b/grails-test-examples/gorm/grails-app/init/gorm/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/gsp-layout/grails-app/controllers/org/example/grails/layout/DemoController.groovy b/grails-test-examples/gsp-layout/grails-app/controllers/org/example/grails/layout/DemoController.groovy index ed4e61e3423..37b1d7fc948 100644 --- a/grails-test-examples/gsp-layout/grails-app/controllers/org/example/grails/layout/DemoController.groovy +++ b/grails-test-examples/gsp-layout/grails-app/controllers/org/example/grails/layout/DemoController.groovy @@ -46,4 +46,4 @@ class DemoController { } respond model, view:'/error' } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-data-service/grails-app/init/example/Application.groovy b/grails-test-examples/hibernate5/grails-data-service/grails-app/init/example/Application.groovy index 4f2de4f0e4f..bd5bc3f50b7 100644 --- a/grails-test-examples/hibernate5/grails-data-service/grails-app/init/example/Application.groovy +++ b/grails-test-examples/hibernate5/grails-data-service/grails-app/init/example/Application.groovy @@ -29,4 +29,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-database-per-tenant/grails-app/init/datasources/Application.groovy b/grails-test-examples/hibernate5/grails-database-per-tenant/grails-app/init/datasources/Application.groovy index 7a25cd651c0..34d7f7cdd99 100644 --- a/grails-test-examples/hibernate5/grails-database-per-tenant/grails-app/init/datasources/Application.groovy +++ b/grails-test-examples/hibernate5/grails-database-per-tenant/grails-app/init/datasources/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-hibernate-groovy-proxy/grails-app/init/datasources/Application.groovy b/grails-test-examples/hibernate5/grails-hibernate-groovy-proxy/grails-app/init/datasources/Application.groovy index 7a25cd651c0..34d7f7cdd99 100644 --- a/grails-test-examples/hibernate5/grails-hibernate-groovy-proxy/grails-app/init/datasources/Application.groovy +++ b/grails-test-examples/hibernate5/grails-hibernate-groovy-proxy/grails-app/init/datasources/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-hibernate/grails-app/init/functional/tests/Application.groovy b/grails-test-examples/hibernate5/grails-hibernate/grails-app/init/functional/tests/Application.groovy index 75d89d9e38f..5cc0a29996c 100644 --- a/grails-test-examples/hibernate5/grails-hibernate/grails-app/init/functional/tests/Application.groovy +++ b/grails-test-examples/hibernate5/grails-hibernate/grails-app/init/functional/tests/Application.groovy @@ -33,4 +33,4 @@ class Application extends GrailsAutoConfiguration { Collection packageNames() { [Application.package.name, "another"] } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-hibernate/grails-app/services/functional/tests/BookService.groovy b/grails-test-examples/hibernate5/grails-hibernate/grails-app/services/functional/tests/BookService.groovy index ac2772bbdff..c8b40200b27 100644 --- a/grails-test-examples/hibernate5/grails-hibernate/grails-app/services/functional/tests/BookService.groovy +++ b/grails-test-examples/hibernate5/grails-hibernate/grails-app/services/functional/tests/BookService.groovy @@ -28,4 +28,4 @@ import grails.gorm.services.Service interface BookService { Book getBook(Serializable id) -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-partitioned-multi-tenancy/grails-app/init/datasources/Application.groovy b/grails-test-examples/hibernate5/grails-partitioned-multi-tenancy/grails-app/init/datasources/Application.groovy index 66eb42ec4ed..771599bbfc7 100644 --- a/grails-test-examples/hibernate5/grails-partitioned-multi-tenancy/grails-app/init/datasources/Application.groovy +++ b/grails-test-examples/hibernate5/grails-partitioned-multi-tenancy/grails-app/init/datasources/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/init/schemapertenant/Application.groovy b/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/init/schemapertenant/Application.groovy index 3d49e14ea25..b61cb6011d8 100644 --- a/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/init/schemapertenant/Application.groovy +++ b/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/init/schemapertenant/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/services/schemapertenant/BookService.groovy b/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/services/schemapertenant/BookService.groovy index 75b99009757..398d7de00d7 100644 --- a/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/services/schemapertenant/BookService.groovy +++ b/grails-test-examples/hibernate5/grails-schema-per-tenant/grails-app/services/schemapertenant/BookService.groovy @@ -40,4 +40,4 @@ interface BookService { Book updateBook(Serializable id, String title) Book deleteBook(Serializable id) -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/issue450/grails-app/controllers/multitenantcomposite/BookController.groovy b/grails-test-examples/hibernate5/issue450/grails-app/controllers/multitenantcomposite/BookController.groovy index 597f33a9cca..d59fcd1a9b5 100644 --- a/grails-test-examples/hibernate5/issue450/grails-app/controllers/multitenantcomposite/BookController.groovy +++ b/grails-test-examples/hibernate5/issue450/grails-app/controllers/multitenantcomposite/BookController.groovy @@ -43,4 +43,4 @@ class BookController { bookService.find() }] } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/issue450/grails-app/domain/multitenantcomposite/Book.groovy b/grails-test-examples/hibernate5/issue450/grails-app/domain/multitenantcomposite/Book.groovy index 889ac79c278..73fbc684ea1 100644 --- a/grails-test-examples/hibernate5/issue450/grails-app/domain/multitenantcomposite/Book.groovy +++ b/grails-test-examples/hibernate5/issue450/grails-app/domain/multitenantcomposite/Book.groovy @@ -30,4 +30,4 @@ class Book implements MultiTenant, Serializable { static mapping = { id composite: ['id', 'tenantId'] } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/Application.groovy b/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/Application.groovy index 0815b8d9674..c340266bff4 100644 --- a/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/Application.groovy +++ b/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/Application.groovy @@ -29,4 +29,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/BootStrap.groovy b/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/BootStrap.groovy index 7b73b74430b..27c764b8046 100644 --- a/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/BootStrap.groovy +++ b/grails-test-examples/hibernate5/issue450/grails-app/init/multitenantcomposite/BootStrap.groovy @@ -40,4 +40,4 @@ class BootStrap { def destroy = { } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/issue450/grails-app/services/multitenantcomposite/BookService.groovy b/grails-test-examples/hibernate5/issue450/grails-app/services/multitenantcomposite/BookService.groovy index 313393dc971..7dd79e700ce 100644 --- a/grails-test-examples/hibernate5/issue450/grails-app/services/multitenantcomposite/BookService.groovy +++ b/grails-test-examples/hibernate5/issue450/grails-app/services/multitenantcomposite/BookService.groovy @@ -27,4 +27,4 @@ import grails.gorm.services.Service interface BookService { Book save(String id, String title) List find() -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/issue450/src/integration-test/groovy/example/BookControllerSpec.groovy b/grails-test-examples/hibernate5/issue450/src/integration-test/groovy/example/BookControllerSpec.groovy index 22e75aadd79..cd9bd452ebb 100644 --- a/grails-test-examples/hibernate5/issue450/src/integration-test/groovy/example/BookControllerSpec.groovy +++ b/grails-test-examples/hibernate5/issue450/src/integration-test/groovy/example/BookControllerSpec.groovy @@ -45,4 +45,4 @@ class BookControllerSpec extends Specification { client.toBlocking().retrieve('/book/groovy').contains('Groovy in Action') !client.toBlocking().retrieve('/book/groovy').contains('The definitive Guide to Grails 2') } -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/Book.groovy b/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/Book.groovy index 40acf93b8f3..0028f0aeef7 100644 --- a/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/Book.groovy +++ b/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/Book.groovy @@ -24,4 +24,4 @@ import grails.gorm.annotation.Entity @Entity class Book { String title -} \ No newline at end of file +} diff --git a/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/BookService.groovy b/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/BookService.groovy index d2295b993d6..38aef97d98d 100644 --- a/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/BookService.groovy +++ b/grails-test-examples/hibernate5/spring-boot-hibernate/src/main/groovy/example/BookService.groovy @@ -24,4 +24,4 @@ import grails.gorm.services.Service @Service(Book) interface BookService { List find(String title) -} \ No newline at end of file +} diff --git a/grails-test-examples/hyphenated/grails-app/init/hyphenated/Application.groovy b/grails-test-examples/hyphenated/grails-app/init/hyphenated/Application.groovy index 37471c4fdfd..ca35ad8dd2e 100644 --- a/grails-test-examples/hyphenated/grails-app/init/hyphenated/Application.groovy +++ b/grails-test-examples/hyphenated/grails-app/init/hyphenated/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/issue-11102/grails-app/init/issue11102/Application.groovy b/grails-test-examples/issue-11102/grails-app/init/issue11102/Application.groovy index aa6eea55ed9..20b861b65a6 100644 --- a/grails-test-examples/issue-11102/grails-app/init/issue11102/Application.groovy +++ b/grails-test-examples/issue-11102/grails-app/init/issue11102/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/issue-698-domain-save-npe/grails-app/init/grails301/domain/save/npe/Application.groovy b/grails-test-examples/issue-698-domain-save-npe/grails-app/init/grails301/domain/save/npe/Application.groovy index 24c16163a9f..cd43343b80f 100644 --- a/grails-test-examples/issue-698-domain-save-npe/grails-app/init/grails301/domain/save/npe/Application.groovy +++ b/grails-test-examples/issue-698-domain-save-npe/grails-app/init/grails301/domain/save/npe/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/issue-views-182/grails-app/init/issueviews182/Application.groovy b/grails-test-examples/issue-views-182/grails-app/init/issueviews182/Application.groovy index da5ffd86f2d..4c6ef16f685 100644 --- a/grails-test-examples/issue-views-182/grails-app/init/issueviews182/Application.groovy +++ b/grails-test-examples/issue-views-182/grails-app/init/issueviews182/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/base/grails-app/init/functional/tests/Application.groovy b/grails-test-examples/mongodb/base/grails-app/init/functional/tests/Application.groovy index 45342422e52..19139e6c379 100644 --- a/grails-test-examples/mongodb/base/grails-app/init/functional/tests/Application.groovy +++ b/grails-test-examples/mongodb/base/grails-app/init/functional/tests/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/Birthday.groovy b/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/Birthday.groovy index 387ea407807..fc12af2b96e 100644 --- a/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/Birthday.groovy +++ b/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/Birthday.groovy @@ -32,4 +32,4 @@ class Birthday implements Comparable { int compareTo(t) { date.compareTo(t.date) } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/BirthdayCodec.groovy b/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/BirthdayCodec.groovy index 9137bc58659..00e0f0db70c 100644 --- a/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/BirthdayCodec.groovy +++ b/grails-test-examples/mongodb/base/src/main/groovy/functional/tests/BirthdayCodec.groovy @@ -36,4 +36,4 @@ class BirthdayCodec implements Codec { writer.writeDateTime(value.date.time) } Class getEncoderClass() { Birthday } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/database-per-tenant/grails-app/init/examples/mongo/tenant/Application.groovy b/grails-test-examples/mongodb/database-per-tenant/grails-app/init/examples/mongo/tenant/Application.groovy index 451538d4dd7..442cbad805c 100644 --- a/grails-test-examples/mongodb/database-per-tenant/grails-app/init/examples/mongo/tenant/Application.groovy +++ b/grails-test-examples/mongodb/database-per-tenant/grails-app/init/examples/mongo/tenant/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/gson-templates/grails-app/init/functional/tests/Application.groovy b/grails-test-examples/mongodb/gson-templates/grails-app/init/functional/tests/Application.groovy index 18b97b1f422..4c211cb2ae3 100644 --- a/grails-test-examples/mongodb/gson-templates/grails-app/init/functional/tests/Application.groovy +++ b/grails-test-examples/mongodb/gson-templates/grails-app/init/functional/tests/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/hibernate5/grails-app/init/functional/tests/Application.groovy b/grails-test-examples/mongodb/hibernate5/grails-app/init/functional/tests/Application.groovy index 45342422e52..19139e6c379 100644 --- a/grails-test-examples/mongodb/hibernate5/grails-app/init/functional/tests/Application.groovy +++ b/grails-test-examples/mongodb/hibernate5/grails-app/init/functional/tests/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/springboot/src/main/groovy/example/Application.groovy b/grails-test-examples/mongodb/springboot/src/main/groovy/example/Application.groovy index 37dd5ba2527..9065d79ec07 100644 --- a/grails-test-examples/mongodb/springboot/src/main/groovy/example/Application.groovy +++ b/grails-test-examples/mongodb/springboot/src/main/groovy/example/Application.groovy @@ -38,4 +38,4 @@ class Application implements CommandLineRunner{ new Book(title: "The Shining").save() new Book(title: "It").save() } -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/springboot/src/main/groovy/example/BookService.groovy b/grails-test-examples/mongodb/springboot/src/main/groovy/example/BookService.groovy index 7bcf7f39b59..c6c1e276c04 100644 --- a/grails-test-examples/mongodb/springboot/src/main/groovy/example/BookService.groovy +++ b/grails-test-examples/mongodb/springboot/src/main/groovy/example/BookService.groovy @@ -25,4 +25,4 @@ import grails.gorm.services.Service interface BookService { Book find(String title) -} \ No newline at end of file +} diff --git a/grails-test-examples/mongodb/test-data-service/grails-app/init/example/Application.groovy b/grails-test-examples/mongodb/test-data-service/grails-app/init/example/Application.groovy index a6f4e7e002f..329b5538d32 100644 --- a/grails-test-examples/mongodb/test-data-service/grails-app/init/example/Application.groovy +++ b/grails-test-examples/mongodb/test-data-service/grails-app/init/example/Application.groovy @@ -51,4 +51,4 @@ class Application extends GrailsAutoConfiguration { dbContainer.start() } } -} \ No newline at end of file +} diff --git a/grails-test-examples/namespaces/grails-app/init/namespaces/Application.groovy b/grails-test-examples/namespaces/grails-app/init/namespaces/Application.groovy index 4fcfe3f2ab0..623e53dbb2c 100644 --- a/grails-test-examples/namespaces/grails-app/init/namespaces/Application.groovy +++ b/grails-test-examples/namespaces/grails-app/init/namespaces/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/plugins/issue11005/grails-app/init/issue11005/Application.groovy b/grails-test-examples/plugins/issue11005/grails-app/init/issue11005/Application.groovy index f07f039ea99..22c8382d438 100644 --- a/grails-test-examples/plugins/issue11005/grails-app/init/issue11005/Application.groovy +++ b/grails-test-examples/plugins/issue11005/grails-app/init/issue11005/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/plugins/loadafter/grails-app/init/loadafter/Application.groovy b/grails-test-examples/plugins/loadafter/grails-app/init/loadafter/Application.groovy index e74950833dc..0983475f125 100755 --- a/grails-test-examples/plugins/loadafter/grails-app/init/loadafter/Application.groovy +++ b/grails-test-examples/plugins/loadafter/grails-app/init/loadafter/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/plugins/loadfirst/grails-app/init/loadfirst/Application.groovy b/grails-test-examples/plugins/loadfirst/grails-app/init/loadfirst/Application.groovy index 12851e7122d..4858f72f8a2 100644 --- a/grails-test-examples/plugins/loadfirst/grails-app/init/loadfirst/Application.groovy +++ b/grails-test-examples/plugins/loadfirst/grails-app/init/loadfirst/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/plugins/loadsecond/grails-app/init/loadsecond/Application.groovy b/grails-test-examples/plugins/loadsecond/grails-app/init/loadsecond/Application.groovy index 88abc3276d4..80282e76fe4 100644 --- a/grails-test-examples/plugins/loadsecond/grails-app/init/loadsecond/Application.groovy +++ b/grails-test-examples/plugins/loadsecond/grails-app/init/loadsecond/Application.groovy @@ -26,4 +26,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application) } -} \ No newline at end of file +} diff --git a/grails-test-examples/views-functional-tests-plugin/grails-app/init/functional/tests/plugin/Application.groovy b/grails-test-examples/views-functional-tests-plugin/grails-app/init/functional/tests/plugin/Application.groovy index f84f9f0bd13..2b961ef5720 100644 --- a/grails-test-examples/views-functional-tests-plugin/grails-app/init/functional/tests/plugin/Application.groovy +++ b/grails-test-examples/views-functional-tests-plugin/grails-app/init/functional/tests/plugin/Application.groovy @@ -30,4 +30,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-test-examples/views-functional-tests/grails-app/controllers/functional/tests/api/BookController.groovy b/grails-test-examples/views-functional-tests/grails-app/controllers/functional/tests/api/BookController.groovy index cf5b35f699e..13e481c9a14 100644 --- a/grails-test-examples/views-functional-tests/grails-app/controllers/functional/tests/api/BookController.groovy +++ b/grails-test-examples/views-functional-tests/grails-app/controllers/functional/tests/api/BookController.groovy @@ -51,4 +51,4 @@ class BookController { def message() { [value: 'Hello API'] } -} \ No newline at end of file +} diff --git a/grails-test-examples/views-functional-tests/grails-app/init/functional/tests/Application.groovy b/grails-test-examples/views-functional-tests/grails-app/init/functional/tests/Application.groovy index 18b97b1f422..4c211cb2ae3 100644 --- a/grails-test-examples/views-functional-tests/grails-app/init/functional/tests/Application.groovy +++ b/grails-test-examples/views-functional-tests/grails-app/init/functional/tests/Application.groovy @@ -28,4 +28,4 @@ class Application extends GrailsAutoConfiguration { static void main(String[] args) { GrailsApp.run(Application, args) } -} \ No newline at end of file +} diff --git a/grails-testing-support-core/src/main/groovy/grails/testing/mixin/integration/Integration.groovy b/grails-testing-support-core/src/main/groovy/grails/testing/mixin/integration/Integration.groovy index dd11e484ae0..72ce0af98f7 100644 --- a/grails-testing-support-core/src/main/groovy/grails/testing/mixin/integration/Integration.groovy +++ b/grails-testing-support-core/src/main/groovy/grails/testing/mixin/integration/Integration.groovy @@ -46,4 +46,4 @@ public @interface Integration { * multiple Application classes may exist. */ Class applicationClass() default {} -} \ No newline at end of file +} diff --git a/grails-testing-support-core/src/main/groovy/org/grails/testing/context/junit4/GrailsTestConfiguration.java b/grails-testing-support-core/src/main/groovy/org/grails/testing/context/junit4/GrailsTestConfiguration.java index 35030542e73..7c5bba809e6 100644 --- a/grails-testing-support-core/src/main/groovy/org/grails/testing/context/junit4/GrailsTestConfiguration.java +++ b/grails-testing-support-core/src/main/groovy/org/grails/testing/context/junit4/GrailsTestConfiguration.java @@ -66,4 +66,4 @@ */ String name() default ""; -} \ No newline at end of file +} diff --git a/grails-testing-support-core/src/main/groovy/org/grails/testing/spock/AutowiredInterceptor.groovy b/grails-testing-support-core/src/main/groovy/org/grails/testing/spock/AutowiredInterceptor.groovy index 7d6c1e80495..b12a4321257 100644 --- a/grails-testing-support-core/src/main/groovy/org/grails/testing/spock/AutowiredInterceptor.groovy +++ b/grails-testing-support-core/src/main/groovy/org/grails/testing/spock/AutowiredInterceptor.groovy @@ -34,4 +34,4 @@ class AutowiredInterceptor implements IMethodInterceptor { ((AutowiredTest)invocation.instance).autowire() invocation.proceed() } -} \ No newline at end of file +} diff --git a/grails-testing-support-mongodb/src/main/groovy/org/apache/grails/testing/mongo/MongoContainerHolder.groovy b/grails-testing-support-mongodb/src/main/groovy/org/apache/grails/testing/mongo/MongoContainerHolder.groovy index 9a6481a23f7..89531a95574 100644 --- a/grails-testing-support-mongodb/src/main/groovy/org/apache/grails/testing/mongo/MongoContainerHolder.groovy +++ b/grails-testing-support-mongodb/src/main/groovy/org/apache/grails/testing/mongo/MongoContainerHolder.groovy @@ -57,4 +57,4 @@ class MongoContainerHolder { containers.get()?.stop() containers.remove() } -} \ No newline at end of file +} diff --git a/grails-testing-support-views-gson/src/main/groovy/grails/views/json/test/JsonViewUnitTest.groovy b/grails-testing-support-views-gson/src/main/groovy/grails/views/json/test/JsonViewUnitTest.groovy index 10820f3bf47..fa417e2f20c 100644 --- a/grails-testing-support-views-gson/src/main/groovy/grails/views/json/test/JsonViewUnitTest.groovy +++ b/grails-testing-support-views-gson/src/main/groovy/grails/views/json/test/JsonViewUnitTest.groovy @@ -225,4 +225,4 @@ trait JsonViewUnitTest extends GrailsUnitTest { result.message = message } } -} \ No newline at end of file +} diff --git a/grails-testing-support-web/src/main/groovy/grails/testing/web/interceptor/InterceptorUnitTest.groovy b/grails-testing-support-web/src/main/groovy/grails/testing/web/interceptor/InterceptorUnitTest.groovy index e9d71bb8c9b..adf89734fd5 100644 --- a/grails-testing-support-web/src/main/groovy/grails/testing/web/interceptor/InterceptorUnitTest.groovy +++ b/grails-testing-support-web/src/main/groovy/grails/testing/web/interceptor/InterceptorUnitTest.groovy @@ -154,4 +154,4 @@ trait InterceptorUnitTest implements ParameterizedGrailsUnitTest, GrailsWe hasBeenMocked = true } } -} \ No newline at end of file +} diff --git a/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/ActionSettingMethodHandler.groovy b/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/ActionSettingMethodHandler.groovy index 132f503e7e2..c9a82f3f122 100644 --- a/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/ActionSettingMethodHandler.groovy +++ b/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/ActionSettingMethodHandler.groovy @@ -50,4 +50,4 @@ class ActionSettingMethodHandler implements MethodHandler { throw e.cause ?: e } } -} \ No newline at end of file +} diff --git a/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/LazyTagLibraryLookup.java b/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/LazyTagLibraryLookup.java index abce851f2ea..0298217bd6a 100644 --- a/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/LazyTagLibraryLookup.java +++ b/grails-testing-support-web/src/main/groovy/org/grails/testing/runtime/support/LazyTagLibraryLookup.java @@ -135,4 +135,4 @@ protected void putTagLib(Map tags, String name, GrailsTagLibClas super.putTagLib(tags, name, taglib); } } -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/ResolvableGroovyTemplateEngine.groovy b/grails-views-core/src/main/groovy/grails/views/ResolvableGroovyTemplateEngine.groovy index de22bb14d66..2e4b71d8862 100644 --- a/grails-views-core/src/main/groovy/grails/views/ResolvableGroovyTemplateEngine.groovy +++ b/grails-views-core/src/main/groovy/grails/views/ResolvableGroovyTemplateEngine.groovy @@ -493,4 +493,4 @@ abstract class ResolvableGroovyTemplateEngine extends TemplateEngine { protected ViewsTransform newViewsTransform() { new ViewsTransform(extension, dynamicTemplatePrefix) } -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/TemplateResolver.groovy b/grails-views-core/src/main/groovy/grails/views/TemplateResolver.groovy index 316a74e4387..0697f581cea 100644 --- a/grails-views-core/src/main/groovy/grails/views/TemplateResolver.groovy +++ b/grails-views-core/src/main/groovy/grails/views/TemplateResolver.groovy @@ -55,4 +55,4 @@ interface TemplateResolver { * @return The Class or null if it cannot be found */ Class resolveTemplateClass(String packageName, String path) -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/ViewConfiguration.groovy b/grails-views-core/src/main/groovy/grails/views/ViewConfiguration.groovy index 39fc61ba142..ad8877e8cf7 100644 --- a/grails-views-core/src/main/groovy/grails/views/ViewConfiguration.groovy +++ b/grails-views-core/src/main/groovy/grails/views/ViewConfiguration.groovy @@ -98,4 +98,4 @@ interface ViewConfiguration { * @return The default encoding to use to render views */ String getEncoding() -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/ViewUriResolver.groovy b/grails-views-core/src/main/groovy/grails/views/ViewUriResolver.groovy index e5f1e78ef59..628c03fc310 100644 --- a/grails-views-core/src/main/groovy/grails/views/ViewUriResolver.groovy +++ b/grails-views-core/src/main/groovy/grails/views/ViewUriResolver.groovy @@ -51,4 +51,4 @@ interface ViewUriResolver { * @return The template URI */ String resolveTemplateUri(String controllerNamespace, String controllerName, String templateName) -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/WritableScript.groovy b/grails-views-core/src/main/groovy/grails/views/WritableScript.groovy index 5b1475df38b..c54d911361b 100644 --- a/grails-views-core/src/main/groovy/grails/views/WritableScript.groovy +++ b/grails-views-core/src/main/groovy/grails/views/WritableScript.groovy @@ -57,4 +57,4 @@ interface WritableScript extends Writable, WriterProvider { * @return The result */ Object run() -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/WriterProvider.groovy b/grails-views-core/src/main/groovy/grails/views/WriterProvider.groovy index 962d3675ea5..5c4060745d9 100644 --- a/grails-views-core/src/main/groovy/grails/views/WriterProvider.groovy +++ b/grails-views-core/src/main/groovy/grails/views/WriterProvider.groovy @@ -33,4 +33,4 @@ interface WriterProvider { * @return The current writer */ Writer getOut() -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/GrailsView.groovy b/grails-views-core/src/main/groovy/grails/views/api/GrailsView.groovy index f2c1352b76c..b1d11e2e307 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/GrailsView.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/GrailsView.groovy @@ -128,4 +128,4 @@ trait GrailsView extends HttpView implements WriterProvider, WritableScript { void model(Closure modelDefinition) { // no-op, added at compile time } -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/GrailsViewHelper.groovy b/grails-views-core/src/main/groovy/grails/views/api/GrailsViewHelper.groovy index d5aed6ad121..fd73144048d 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/GrailsViewHelper.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/GrailsViewHelper.groovy @@ -37,4 +37,4 @@ interface GrailsViewHelper extends LinkGenerator { * @return The message */ String message(Map arguments) -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/HttpView.groovy b/grails-views-core/src/main/groovy/grails/views/api/HttpView.groovy index 4d02a607753..0790fb0cd62 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/HttpView.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/HttpView.groovy @@ -55,4 +55,4 @@ trait HttpView extends View { * The parameters */ Parameters params = new EmptyParameters() -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/View.groovy b/grails-views-core/src/main/groovy/grails/views/api/View.groovy index 353de7f7ce2..36cd88b67ec 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/View.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/View.groovy @@ -37,4 +37,4 @@ trait View { * The output stream */ Writer out -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/http/Parameters.groovy b/grails-views-core/src/main/groovy/grails/views/api/http/Parameters.groovy index d6927b21656..d24082b88b4 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/http/Parameters.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/http/Parameters.groovy @@ -241,4 +241,4 @@ interface Parameters { * @return Whether there are any parameters */ boolean isEmpty() -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/http/Request.groovy b/grails-views-core/src/main/groovy/grails/views/api/http/Request.groovy index b81ff2153d8..967d1fe1234 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/http/Request.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/http/Request.groovy @@ -83,4 +83,4 @@ interface Request { * @return All of the attribute names */ Collection getAttributeNames() -} \ No newline at end of file +} diff --git a/grails-views-core/src/main/groovy/grails/views/api/http/Response.groovy b/grails-views-core/src/main/groovy/grails/views/api/http/Response.groovy index 946aa8f3647..65a106fb8bd 100644 --- a/grails-views-core/src/main/groovy/grails/views/api/http/Response.groovy +++ b/grails-views-core/src/main/groovy/grails/views/api/http/Response.groovy @@ -90,4 +90,4 @@ interface Response { * @param status The status */ void status(HttpStatus status, String message) -} \ No newline at end of file +} diff --git a/grails-views-gson/src/main/groovy/grails/plugin/json/builder/JsonGenerator.java b/grails-views-gson/src/main/groovy/grails/plugin/json/builder/JsonGenerator.java index 13aeef47f20..e560a04cf99 100644 --- a/grails-views-gson/src/main/groovy/grails/plugin/json/builder/JsonGenerator.java +++ b/grails-views-gson/src/main/groovy/grails/plugin/json/builder/JsonGenerator.java @@ -323,4 +323,4 @@ public JsonGenerator build() { } } -} \ No newline at end of file +} diff --git a/grails-views-gson/src/main/groovy/grails/plugin/json/converters/InstantJsonConverter.groovy b/grails-views-gson/src/main/groovy/grails/plugin/json/converters/InstantJsonConverter.groovy index 286baf559f7..a9ac91aae95 100644 --- a/grails-views-gson/src/main/groovy/grails/plugin/json/converters/InstantJsonConverter.groovy +++ b/grails-views-gson/src/main/groovy/grails/plugin/json/converters/InstantJsonConverter.groovy @@ -41,4 +41,4 @@ class InstantJsonConverter implements JsonGenerator.Converter { Object convert(Object value, String key) { ((Instant)value).toEpochMilli() } -} \ No newline at end of file +} diff --git a/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/GrailsJsonViewHelper.groovy b/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/GrailsJsonViewHelper.groovy index 85463bf66f7..c51dfa2e980 100644 --- a/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/GrailsJsonViewHelper.groovy +++ b/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/GrailsJsonViewHelper.groovy @@ -121,4 +121,4 @@ interface GrailsJsonViewHelper extends GrailsViewHelper { * @param object The object to render */ void inline(Object object) -} \ No newline at end of file +} diff --git a/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/HalViewHelper.groovy b/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/HalViewHelper.groovy index 72d52fe975d..bf1359c8c40 100644 --- a/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/HalViewHelper.groovy +++ b/grails-views-gson/src/main/groovy/grails/plugin/json/view/api/HalViewHelper.groovy @@ -196,4 +196,4 @@ interface HalViewHelper { void embedded(String contentType, @DelegatesTo(StreamingJsonBuilder.StreamingJsonDelegate) Closure callable) void setDelegate(StreamingJsonBuilder.StreamingJsonDelegate jsonDelegate) -} \ No newline at end of file +} diff --git a/grails-views-gson/src/main/groovy/grails/plugin/json/view/test/JsonViewTest.groovy b/grails-views-gson/src/main/groovy/grails/plugin/json/view/test/JsonViewTest.groovy index d29df11524f..3b228569391 100644 --- a/grails-views-gson/src/main/groovy/grails/plugin/json/view/test/JsonViewTest.groovy +++ b/grails-views-gson/src/main/groovy/grails/plugin/json/view/test/JsonViewTest.groovy @@ -276,4 +276,4 @@ trait JsonViewTest { result.message = message } } -} \ No newline at end of file +} diff --git a/grails-views-markup/src/main/groovy/grails/plugin/markup/view/api/MarkupView.groovy b/grails-views-markup/src/main/groovy/grails/plugin/markup/view/api/MarkupView.groovy index d7952cb9eb6..59e316be0d8 100644 --- a/grails-views-markup/src/main/groovy/grails/plugin/markup/view/api/MarkupView.groovy +++ b/grails-views-markup/src/main/groovy/grails/plugin/markup/view/api/MarkupView.groovy @@ -28,4 +28,4 @@ import grails.views.api.GrailsView */ trait MarkupView extends GrailsView { -} \ No newline at end of file +} diff --git a/grails-web-common/src/main/groovy/grails/web/context/WebRequestServletHolder.java b/grails-web-common/src/main/groovy/grails/web/context/WebRequestServletHolder.java index e2ff62cb0de..04cedf1c4f7 100644 --- a/grails-web-common/src/main/groovy/grails/web/context/WebRequestServletHolder.java +++ b/grails-web-common/src/main/groovy/grails/web/context/WebRequestServletHolder.java @@ -38,4 +38,4 @@ protected ServletContext lookupSecondary() { GrailsWebRequest webRequest = GrailsWebRequest.lookup(); return webRequest == null ? null : webRequest.getServletContext(); } -} \ No newline at end of file +} diff --git a/grails-web-common/src/main/groovy/grails/web/mime/MimeTypeResolver.groovy b/grails-web-common/src/main/groovy/grails/web/mime/MimeTypeResolver.groovy index 0bb90773e5d..e68ac900c98 100644 --- a/grails-web-common/src/main/groovy/grails/web/mime/MimeTypeResolver.groovy +++ b/grails-web-common/src/main/groovy/grails/web/mime/MimeTypeResolver.groovy @@ -51,4 +51,4 @@ public interface MimeTypeResolver { * @return The request format sent by the client */ MimeType resolveRequestMimeType(GrailsWebRequest request) -} \ No newline at end of file +} diff --git a/grails-web-common/src/main/groovy/grails/web/mvc/GrailsResponseMutator.groovy b/grails-web-common/src/main/groovy/grails/web/mvc/GrailsResponseMutator.groovy index df97ad84074..21a92f94513 100644 --- a/grails-web-common/src/main/groovy/grails/web/mvc/GrailsResponseMutator.groovy +++ b/grails-web-common/src/main/groovy/grails/web/mvc/GrailsResponseMutator.groovy @@ -28,4 +28,4 @@ interface GrailsResponseMutator { * Do not mutate the response & stop any processing of it. */ void deactivateResponseMutator(); -} \ No newline at end of file +} diff --git a/grails-web-common/src/main/groovy/org/grails/web/config/http/GrailsFilters.java b/grails-web-common/src/main/groovy/org/grails/web/config/http/GrailsFilters.java index b82d26c6956..321bb05cc3f 100644 --- a/grails-web-common/src/main/groovy/org/grails/web/config/http/GrailsFilters.java +++ b/grails-web-common/src/main/groovy/org/grails/web/config/http/GrailsFilters.java @@ -49,4 +49,4 @@ public int getOrder() { return this.order; } -} \ No newline at end of file +} diff --git a/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java b/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java index baae7020711..99d6a02b4d3 100644 --- a/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java +++ b/grails-web-common/src/main/groovy/org/grails/web/json/JSONArray.java @@ -935,4 +935,4 @@ public Object[] toArray(Object[] objects) { public Writer writeTo(Writer out) throws IOException { return write(out); } -} \ No newline at end of file +} diff --git a/grails-web-common/src/main/groovy/org/grails/web/json/JSONTokener.java b/grails-web-common/src/main/groovy/org/grails/web/json/JSONTokener.java index 26268f7642a..b778b219d86 100644 --- a/grails-web-common/src/main/groovy/org/grails/web/json/JSONTokener.java +++ b/grails-web-common/src/main/groovy/org/grails/web/json/JSONTokener.java @@ -493,4 +493,4 @@ public String toRegexSafeString() { return Matcher.quoteReplacement(output.toString()); } -} \ No newline at end of file +} diff --git a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/DataBindingEventMulticastListener.groovy b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/DataBindingEventMulticastListener.groovy index fefebc1a0e4..7ba22e7ffbe 100644 --- a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/DataBindingEventMulticastListener.groovy +++ b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/DataBindingEventMulticastListener.groovy @@ -109,4 +109,4 @@ class DataBindingEventMulticastListener implements DataBindingListener { } } } -} \ No newline at end of file +} diff --git a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/JsonApiDataBindingSourceCreator.groovy b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/JsonApiDataBindingSourceCreator.groovy index 5f05261bcca..fd0151a29a5 100644 --- a/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/JsonApiDataBindingSourceCreator.groovy +++ b/grails-web-databinding/src/main/groovy/org/grails/web/databinding/bindingsource/JsonApiDataBindingSourceCreator.groovy @@ -80,4 +80,4 @@ class JsonApiDataBindingSourceCreator extends JsonDataBindingSourceCreator { } } -} \ No newline at end of file +} diff --git a/grails-web-url-mappings/src/main/groovy/grails/web/mapping/mvc/exceptions/CannotRedirectException.java b/grails-web-url-mappings/src/main/groovy/grails/web/mapping/mvc/exceptions/CannotRedirectException.java index 1da1439b794..311049a5f78 100644 --- a/grails-web-url-mappings/src/main/groovy/grails/web/mapping/mvc/exceptions/CannotRedirectException.java +++ b/grails-web-url-mappings/src/main/groovy/grails/web/mapping/mvc/exceptions/CannotRedirectException.java @@ -38,4 +38,4 @@ public CannotRedirectException(String message, Throwable t) { public CannotRedirectException(String message) { super(message); } -} \ No newline at end of file +} diff --git a/grails-web-url-mappings/src/main/groovy/grails/web/mapping/reporting/UrlMappingsRenderer.groovy b/grails-web-url-mappings/src/main/groovy/grails/web/mapping/reporting/UrlMappingsRenderer.groovy index 67758a9db2a..d098202d958 100644 --- a/grails-web-url-mappings/src/main/groovy/grails/web/mapping/reporting/UrlMappingsRenderer.groovy +++ b/grails-web-url-mappings/src/main/groovy/grails/web/mapping/reporting/UrlMappingsRenderer.groovy @@ -34,4 +34,4 @@ public interface UrlMappingsRenderer { * @param urlMappings The URL mappings */ void render(List urlMappings) -} \ No newline at end of file +} diff --git a/grails-wrapper/src/main/java/grails/proxy/SystemPropertiesAuthenticator.java b/grails-wrapper/src/main/java/grails/proxy/SystemPropertiesAuthenticator.java index ca9496d1b01..2fa7b5b770e 100644 --- a/grails-wrapper/src/main/java/grails/proxy/SystemPropertiesAuthenticator.java +++ b/grails-wrapper/src/main/java/grails/proxy/SystemPropertiesAuthenticator.java @@ -30,4 +30,4 @@ protected PasswordAuthentication getPasswordAuthentication() { } return null; } -} \ No newline at end of file +} From d3676cca9323b2936e8bd794881302c3c29d7748 Mon Sep 17 00:00:00 2001 From: Mattias Reichel Date: Tue, 22 Jul 2025 14:28:22 +0200 Subject: [PATCH 03/38] style: enforce no tab characters Add the `FileTabCharacter` Checkstyle rule and `NoTabCharacter` Codenarc rule to ensure that source files use spaces instead of tabs. This helps maintain consistent indentation and avoids formatting issues across different editors and environments. https://checkstyle.sourceforge.io/checks/whitespace/filetabcharacter.html https://codenarc.org/codenarc-rules-convention.html#notabcharacter-rule --- etc/config/checkstyle/checkstyle.xml | 1 + etc/config/codenarc/codenarc.groovy | 2 +- .../io/watch/AbstractDirectoryWatcher.java | 6 +- .../org/grails/io/watch/DirectoryWatcher.java | 32 +- .../MacOsWatchServiceDirectoryWatcher.java | 134 +- .../io/watch/PollingDirectoryWatcher.java | 28 +- .../watch/WatchServiceDirectoryWatcher.java | 262 +-- .../grails/plugin/cache/CacheTagLib.groovy | 312 +-- .../grails/plugin/cache/GrailsCache.java | 2 +- .../cache/GrailsConcurrentMapCache.java | 44 +- .../GrailsConcurrentMapCacheManager.groovy | 58 +- .../plugin/cache/GrailsValueWrapper.java | 16 +- .../common/compiler/asm/ClassReader.java | 4 +- .../compiler/ast/SupportsClassNode.java | 2 +- .../ArtefactTypeAstTransformation.java | 8 +- .../GroovyEclipseCompilationHelper.groovy | 34 +- ...ReloadableResourceBundleMessageSource.java | 1064 +++++----- .../ChainedTransactionManager.java | 356 ++-- .../transaction/MultiTransactionStatus.java | 338 +-- ...ringTransactionSynchronizationManager.java | 44 +- .../transaction/SynchronizationManager.java | 6 +- .../BindingFormatASTTransformation.java | 56 +- .../grails/datastore/gorm/GormEnhancer.groovy | 2 +- .../criteria/AbstractCriteriaBuilder.java | 12 +- .../main/groovy/grails/events/Events.groovy | 6 +- .../plugin/formfields/FormFieldsTagLib.groovy | 1868 ++++++++--------- .../BeanPropertyAccessorFactory.groovy | 42 +- .../grails/gsp/GroovyPageSourceDecorator.java | 2 +- .../grails/gsp/GroovyPagesTemplateEngine.java | 48 +- .../io/GrailsConventionGroovyPageLocator.java | 10 +- .../PackagedSpringApplicationLauncher.java | 82 +- .../cli/boot/SpringApplicationLauncher.java | 84 +- ...gApplicationWebApplicationInitializer.java | 82 +- .../grails/cli/command/AbstractCommand.java | 70 +- .../org/grails/cli/command/Command.java | 80 +- .../grails/cli/command/CommandException.java | 168 +- .../grails/cli/command/CommandFactory.java | 10 +- .../org/grails/cli/command/CommandRunner.java | 464 ++-- .../org/grails/cli/command/HelpExample.java | 34 +- .../cli/command/NoArgumentsException.java | 2 +- .../NoHelpCommandArgumentsException.java | 8 +- .../cli/command/NoSuchCommandException.java | 8 +- .../cli/command/OptionParsingCommand.java | 40 +- .../cli/command/archive/ArchiveCommand.java | 484 ++--- .../cli/command/archive/JarCommand.java | 24 +- .../cli/command/archive/ResourceMatcher.java | 352 ++-- .../cli/command/archive/WarCommand.java | 50 +- .../grails/cli/command/grab/GrabCommand.java | 38 +- .../command/install/DependencyResolver.java | 16 +- .../install/GroovyGrabDependencyResolver.java | 86 +- .../cli/command/install/InstallCommand.java | 48 +- .../grails/cli/command/install/Installer.java | 220 +- .../cli/command/install/UninstallCommand.java | 74 +- .../options/CompilerOptionHandler.java | 60 +- .../OptionSetGroovyCompilerConfiguration.java | 118 +- .../cli/command/options/SourceOptions.java | 204 +- .../grails/cli/command/run/RunCommand.java | 202 +- .../command/run/SpringApplicationRunner.java | 448 ++-- .../SpringApplicationRunnerConfiguration.java | 22 +- .../AnnotatedNodeASTTransformation.java | 164 +- .../org/grails/cli/compiler/AstUtils.java | 254 +-- .../compiler/CompilerAutoConfiguration.java | 108 +- ...ndencyAutoConfigurationTransformation.java | 66 +- .../cli/compiler/DependencyCustomizer.java | 404 ++-- ...DependencyManagementBomTransformation.java | 344 +-- .../compiler/ExtendedGroovyClassLoader.java | 384 ++-- .../compiler/GenericBomAstTransformation.java | 132 +- .../compiler/GroovyBeansTransformation.java | 142 +- .../grails/cli/compiler/GroovyCompiler.java | 480 ++--- .../compiler/GroovyCompilerConfiguration.java | 82 +- .../cli/compiler/GroovyCompilerScope.java | 18 +- .../RepositoryConfigurationFactory.java | 166 +- ...veDependencyCoordinatesTransformation.java | 110 +- .../cli/compiler/SmartImportCustomizer.java | 40 +- .../CachingCompilerAutoConfiguration.java | 26 +- ...ovyTemplatesCompilerAutoConfiguration.java | 28 +- .../JdbcCompilerAutoConfiguration.java | 28 +- .../JmsCompilerAutoConfiguration.java | 30 +- .../RabbitCompilerAutoConfiguration.java | 38 +- .../SpringBatchCompilerAutoConfiguration.java | 50 +- .../SpringBootCompilerAutoConfiguration.java | 94 +- ...gIntegrationCompilerAutoConfiguration.java | 46 +- .../SpringMvcCompilerAutoConfiguration.java | 36 +- .../SpringRetryCompilerAutoConfiguration.java | 26 +- ...ringSecurityCompilerAutoConfiguration.java | 42 +- .../SpringTestCompilerAutoConfiguration.java | 56 +- ...ingWebsocketCompilerAutoConfiguration.java | 38 +- ...onManagementCompilerAutoConfiguration.java | 30 +- .../ArtifactCoordinatesResolver.java | 42 +- .../CompositeDependencyManagement.java | 64 +- .../cli/compiler/dependencies/Dependency.java | 330 +-- .../dependencies/DependencyManagement.java | 32 +- ...ManagementArtifactCoordinatesResolver.java | 70 +- .../MavenModelDependencyManagement.java | 66 +- ...gBootDependenciesDependencyManagement.java | 30 +- .../cli/compiler/grape/AetherGrapeEngine.java | 10 +- .../grape/AetherGrapeEngineFactory.java | 72 +- .../grape/CompositeProxySelector.java | 28 +- ...ositorySystemSessionAutoConfiguration.java | 52 +- .../grape/DependencyResolutionContext.java | 126 +- .../DependencyResolutionFailedException.java | 16 +- .../grape/DetailedProgressReporter.java | 48 +- .../compiler/grape/GrapeEngineInstaller.java | 24 +- ...ositorySystemSessionAutoConfiguration.java | 30 +- .../grape/MavenResolverGrapeEngine.java | 546 ++--- .../MavenResolverGrapeEngineFactory.java | 74 +- .../cli/compiler/grape/ProgressReporter.java | 8 +- .../grape/RepositoryConfiguration.java | 118 +- ...ositorySystemSessionAutoConfiguration.java | 12 +- ...ositorySystemSessionAutoConfiguration.java | 34 +- .../grape/SummaryProgressReporter.java | 120 +- .../cli/compiler/maven/MavenSettings.java | 476 ++--- .../compiler/maven/MavenSettingsReader.java | 76 +- .../cli/groovy/DependencyManagementBom.java | 16 +- .../org/grails/cli/groovy/GroovyTemplate.java | 54 +- .../org/grails/cli/util/ResourceUtils.java | 248 +-- .../DefaultGrailsApplicationAttributes.java | 2 +- 117 files changed, 7332 insertions(+), 7331 deletions(-) diff --git a/etc/config/checkstyle/checkstyle.xml b/etc/config/checkstyle/checkstyle.xml index d1e1f65ff9e..680ad0cb041 100644 --- a/etc/config/checkstyle/checkstyle.xml +++ b/etc/config/checkstyle/checkstyle.xml @@ -27,5 +27,6 @@ + \ No newline at end of file diff --git a/etc/config/codenarc/codenarc.groovy b/etc/config/codenarc/codenarc.groovy index 4ac1273668b..03c2bb81c39 100644 --- a/etc/config/codenarc/codenarc.groovy +++ b/etc/config/codenarc/codenarc.groovy @@ -3,5 +3,5 @@ ruleset { description 'A Codenarc ruleset for the Grails codebase' FileEndsWithoutNewline - + NoTabCharacter } \ No newline at end of file diff --git a/grails-bootstrap/src/main/groovy/org/grails/io/watch/AbstractDirectoryWatcher.java b/grails-bootstrap/src/main/groovy/org/grails/io/watch/AbstractDirectoryWatcher.java index 83ff54b689d..f69db24de85 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/io/watch/AbstractDirectoryWatcher.java +++ b/grails-bootstrap/src/main/groovy/org/grails/io/watch/AbstractDirectoryWatcher.java @@ -44,7 +44,7 @@ abstract class AbstractDirectoryWatcher implements Runnable { * @param active False if you want to stop watching */ public void setActive(boolean active) { - this.active = active; + this.active = active; } /** @@ -103,7 +103,7 @@ protected void fireOnNew(File file) { } protected boolean isValidDirectoryToMonitor(File file){ - return file.isDirectory() && ! file.isHidden() && !file.getName().startsWith("."); + return file.isDirectory() && ! file.isHidden() && !file.getName().startsWith("."); } protected boolean isValidFileToMonitor(File file, Collection fileExtensions) { @@ -111,7 +111,7 @@ protected boolean isValidFileToMonitor(File file, Collection fileExtensi String path = file.getAbsolutePath(); boolean isSvnFile = path.indexOf(File.separator + DirectoryWatcher.SVN_DIR_NAME + File.separator) > 0; return !isSvnFile && - !file.isDirectory() && + !file.isDirectory() && !file.isHidden() && !file.getName().startsWith(".") && (fileExtensions.contains("*") || fileExtensions.contains(getFilenameExtension(name))); diff --git a/grails-bootstrap/src/main/groovy/org/grails/io/watch/DirectoryWatcher.java b/grails-bootstrap/src/main/groovy/org/grails/io/watch/DirectoryWatcher.java index 52a56dfd8d3..19719f575ec 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/io/watch/DirectoryWatcher.java +++ b/grails-bootstrap/src/main/groovy/org/grails/io/watch/DirectoryWatcher.java @@ -34,9 +34,9 @@ */ public class DirectoryWatcher extends Thread { - private static final Logger LOG = LoggerFactory.getLogger(DirectoryWatcher.class); + private static final Logger LOG = LoggerFactory.getLogger(DirectoryWatcher.class); - private final AbstractDirectoryWatcher directoryWatcherDelegate; + private final AbstractDirectoryWatcher directoryWatcherDelegate; public static final String SVN_DIR_NAME = ".svn"; @@ -66,10 +66,10 @@ public DirectoryWatcher() { } else { directoryWatcherDelegate = (AbstractDirectoryWatcher) Class.forName("org.grails.io.watch.WatchServiceDirectoryWatcher").newInstance(); } - } catch (Throwable e) { - LOG.info("Exception while trying to load WatchServiceDirectoryWatcher (this is probably Java 6 and WatchService isn't available). Falling back to PollingDirectoryWatcher.", e); - directoryWatcherDelegate = new PollingDirectoryWatcher(); - } + } catch (Throwable e) { + LOG.info("Exception while trying to load WatchServiceDirectoryWatcher (this is probably Java 6 and WatchService isn't available). Falling back to PollingDirectoryWatcher.", e); + directoryWatcherDelegate = new PollingDirectoryWatcher(); + } this.directoryWatcherDelegate = directoryWatcherDelegate; } @@ -79,7 +79,7 @@ public DirectoryWatcher() { * @param active False if you want to stop watching */ public void setActive(boolean active) { - directoryWatcherDelegate.setActive(active); + directoryWatcherDelegate.setActive(active); } /** @@ -88,7 +88,7 @@ public void setActive(boolean active) { * @param sleepTime The sleep time */ public void setSleepTime(long sleepTime) { - directoryWatcherDelegate.setSleepTime(sleepTime); + directoryWatcherDelegate.setSleepTime(sleepTime); } /** @@ -97,7 +97,7 @@ public void setSleepTime(long sleepTime) { * @param listener The file listener */ public void addListener(FileChangeListener listener) { - directoryWatcherDelegate.addListener(listener); + directoryWatcherDelegate.addListener(listener); } /** @@ -115,7 +115,7 @@ public void removeListener(FileChangeListener listener) { * @param fileToWatch The file to watch */ public void addWatchFile(File fileToWatch) { - directoryWatcherDelegate.addWatchFile(fileToWatch); + directoryWatcherDelegate.addWatchFile(fileToWatch); } /** @@ -125,11 +125,11 @@ public void addWatchFile(File fileToWatch) { * @param fileExtensions The extensions */ public void addWatchDirectory(File dir, List fileExtensions) { - List fileExtensionsWithoutDot = new ArrayList(fileExtensions.size()); - for(String fileExtension : fileExtensions){ - fileExtensionsWithoutDot.add(removeStartingDotIfPresent(fileExtension)); - } - directoryWatcherDelegate.addWatchDirectory(dir, fileExtensions); + List fileExtensionsWithoutDot = new ArrayList(fileExtensions.size()); + for(String fileExtension : fileExtensions){ + fileExtensionsWithoutDot.add(removeStartingDotIfPresent(fileExtension)); + } + directoryWatcherDelegate.addWatchDirectory(dir, fileExtensions); } /** @@ -138,7 +138,7 @@ public void addWatchDirectory(File dir, List fileExtensions) { * @param dir The directory */ public void addWatchDirectory(File dir) { - addWatchDirectory(dir, "*"); + addWatchDirectory(dir, "*"); } /** diff --git a/grails-bootstrap/src/main/groovy/org/grails/io/watch/MacOsWatchServiceDirectoryWatcher.java b/grails-bootstrap/src/main/groovy/org/grails/io/watch/MacOsWatchServiceDirectoryWatcher.java index 9120c534c54..07819ec6a34 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/io/watch/MacOsWatchServiceDirectoryWatcher.java +++ b/grails-bootstrap/src/main/groovy/org/grails/io/watch/MacOsWatchServiceDirectoryWatcher.java @@ -42,29 +42,29 @@ */ class MacOsWatchServiceDirectoryWatcher extends AbstractDirectoryWatcher { - private static final Logger LOG = LoggerFactory.getLogger(MacOsWatchServiceDirectoryWatcher.class); + private static final Logger LOG = LoggerFactory.getLogger(MacOsWatchServiceDirectoryWatcher.class); private Map> watchKeyToExtensionsMap = new ConcurrentHashMap>(); private Set individualWatchedFiles = new HashSet(); - private final WatchService watchService; + private final WatchService watchService; @SuppressWarnings("unchecked") private static WatchEvent cast(WatchEvent event) { return (WatchEvent)event; } - public MacOsWatchServiceDirectoryWatcher(){ - try { - watchService = new MacOSXListeningWatchService(); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + public MacOsWatchServiceDirectoryWatcher(){ + try { + watchService = new MacOSXListeningWatchService(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } - @Override - public void run() { + @Override + public void run() { while (active) { - try { + try { WatchKey watchKey; try { watchKey = watchService.take(); @@ -130,70 +130,70 @@ public void run() { } } watchKey.reset(); - } catch (Exception e) { + } catch (Exception e) { LOG.error(e.toString()); // ignore - } + } } try { - watchService.close(); - } catch (IOException e) { - LOG.debug("Exception while closing watchService", e); - } - } + watchService.close(); + } catch (IOException e) { + LOG.debug("Exception while closing watchService", e); + } + } - @Override - public void addWatchFile(File fileToWatch) { - if(!isValidFileToMonitor(fileToWatch, Arrays.asList("*"))) return; - try { + @Override + public void addWatchFile(File fileToWatch) { + if(!isValidFileToMonitor(fileToWatch, Arrays.asList("*"))) return; + try { if(!fileToWatch.exists()) return; - Path pathToWatch = fileToWatch.toPath().toAbsolutePath(); - individualWatchedFiles.add(pathToWatch); + Path pathToWatch = fileToWatch.toPath().toAbsolutePath(); + individualWatchedFiles.add(pathToWatch); WatchablePath watchPath = new WatchablePath(pathToWatch); - Kind[] events = new Kind[] { StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }; - watchPath.register(watchService, events); - } catch (IOException e) { - throw new RuntimeException(e); - } - } + Kind[] events = new Kind[] { StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }; + watchPath.register(watchService, events); + } catch (IOException e) { + throw new RuntimeException(e); + } + } - @Override - public void addWatchDirectory(File dir, final List fileExtensions) { - Path dirPath = dir.toPath(); - addWatchDirectory(dirPath, fileExtensions); - } + @Override + public void addWatchDirectory(File dir, final List fileExtensions) { + Path dirPath = dir.toPath(); + addWatchDirectory(dirPath, fileExtensions); + } - private void addWatchDirectory(Path dir, final List fileExtensions) { - if(!isValidDirectoryToMonitor(dir.toFile())){ - return; - } - try { - //add the subdirectories too - Files.walkFileTree(dir, new SimpleFileVisitor() { - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) - throws IOException - { - if(!isValidDirectoryToMonitor(dir.toFile())){ - return FileVisitResult.SKIP_SUBTREE; - } + private void addWatchDirectory(Path dir, final List fileExtensions) { + if(!isValidDirectoryToMonitor(dir.toFile())){ + return; + } + try { + //add the subdirectories too + Files.walkFileTree(dir, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException + { + if(!isValidDirectoryToMonitor(dir.toFile())){ + return FileVisitResult.SKIP_SUBTREE; + } WatchablePath watchPath = new WatchablePath(dir); - Kind[] events = new Kind[] { StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }; - WatchKey watchKey = watchPath.register(watchService, events); - final List originalFileExtensions = watchKeyToExtensionsMap.get(watchKey); - if(originalFileExtensions==null){ - watchKeyToExtensionsMap.put(watchKey, fileExtensions); - }else{ - final HashSet newFileExtensions = new HashSet(originalFileExtensions); - newFileExtensions.addAll(fileExtensions); - watchKeyToExtensionsMap.put(watchKey, Collections.unmodifiableList(new ArrayList(newFileExtensions))); - } - return FileVisitResult.CONTINUE; - } - }); - } catch (IOException e) { - throw new RuntimeException(e); - } - } + Kind[] events = new Kind[] { StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY }; + WatchKey watchKey = watchPath.register(watchService, events); + final List originalFileExtensions = watchKeyToExtensionsMap.get(watchKey); + if(originalFileExtensions==null){ + watchKeyToExtensionsMap.put(watchKey, fileExtensions); + }else{ + final HashSet newFileExtensions = new HashSet(originalFileExtensions); + newFileExtensions.addAll(fileExtensions); + watchKeyToExtensionsMap.put(watchKey, Collections.unmodifiableList(new ArrayList(newFileExtensions))); + } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } diff --git a/grails-bootstrap/src/main/groovy/org/grails/io/watch/PollingDirectoryWatcher.java b/grails-bootstrap/src/main/groovy/org/grails/io/watch/PollingDirectoryWatcher.java index 94090900f8c..eeec45ee8c9 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/io/watch/PollingDirectoryWatcher.java +++ b/grails-bootstrap/src/main/groovy/org/grails/io/watch/PollingDirectoryWatcher.java @@ -44,8 +44,8 @@ class PollingDirectoryWatcher extends AbstractDirectoryWatcher { private Map> directoryToExtensionsMap = new ConcurrentHashMap>(); private Map directoryWatch = new ConcurrentHashMap(); - @Override - public void run() { + @Override + public void run() { int count = 0; while (active) { Set files = lastModifiedMap.keySet(); @@ -68,21 +68,21 @@ public void run() { // ignore } } - } + } - @Override - public void addWatchFile(File fileToWatch) { + @Override + public void addWatchFile(File fileToWatch) { lastModifiedMap.put(fileToWatch, fileToWatch.lastModified()); - } + } - @Override - public void addWatchDirectory(File dir, List fileExtensions) { - if(!isValidDirectoryToMonitor(dir)){ - return; - } + @Override + public void addWatchDirectory(File dir, List fileExtensions) { + if(!isValidDirectoryToMonitor(dir)){ + return; + } trackDirectoryExtensions(dir, fileExtensions); cacheFilesForDirectory(dir, fileExtensions, false); - } + } private void trackDirectoryExtensions(File dir, List fileExtensions) { Collection existingExtensions = directoryToExtensionsMap.get(dir); @@ -118,9 +118,9 @@ private void cacheFilesForDirectory(File directory, Collection fileExten } for (File file : files) { - if(isValidDirectoryToMonitor(file)) { + if(isValidDirectoryToMonitor(file)) { cacheFilesForDirectory(file, fileExtensions, fireEvent); - } + } else if (isValidFileToMonitor(file, fileExtensions)) { if (!lastModifiedMap.containsKey(file) && fireEvent) { fireOnNew(file); diff --git a/grails-bootstrap/src/main/groovy/org/grails/io/watch/WatchServiceDirectoryWatcher.java b/grails-bootstrap/src/main/groovy/org/grails/io/watch/WatchServiceDirectoryWatcher.java index 60dc0bb8b99..8b676d99311 100644 --- a/grails-bootstrap/src/main/groovy/org/grails/io/watch/WatchServiceDirectoryWatcher.java +++ b/grails-bootstrap/src/main/groovy/org/grails/io/watch/WatchServiceDirectoryWatcher.java @@ -54,153 +54,153 @@ */ class WatchServiceDirectoryWatcher extends AbstractDirectoryWatcher { - private static final Logger LOG = LoggerFactory.getLogger(WatchServiceDirectoryWatcher.class); + private static final Logger LOG = LoggerFactory.getLogger(WatchServiceDirectoryWatcher.class); private Map> watchKeyToExtensionsMap = new ConcurrentHashMap>(); private Set individualWatchedFiles = new HashSet(); - private final WatchService watchService; + private final WatchService watchService; @SuppressWarnings("unchecked") private static WatchEvent cast(WatchEvent event) { return (WatchEvent)event; } - public WatchServiceDirectoryWatcher(){ - try { - watchService = FileSystems.getDefault().newWatchService(); - } catch (IOException e) { - throw new RuntimeException(e); - } - } + public WatchServiceDirectoryWatcher(){ + try { + watchService = FileSystems.getDefault().newWatchService(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } - @Override - public void run() { + @Override + public void run() { while (active) { - try { - WatchKey watchKey = watchService.poll(sleepTime, TimeUnit.MILLISECONDS); - if(watchKey!=null){ - List> watchEvents = watchKey.pollEvents(); - for(WatchEvent watchEvent : watchEvents){ - WatchEvent.Kind kind = watchEvent.kind(); - if (kind == StandardWatchEventKinds.OVERFLOW) { - // TODO how is this supposed to be handled? I think the best thing to do is ignore it, but I'm not positive - LOG.warn("WatchService Overflow occurred"); - continue; - } - WatchEvent pathWatchEvent = cast(watchEvent); - Path name = pathWatchEvent.context(); - Path dir = (Path) watchKey.watchable(); - Path child = dir.resolve(name).toAbsolutePath(); - File childFile = child.toFile(); - if(individualWatchedFiles.contains(child) || individualWatchedFiles.contains(child.normalize())){ - if(kind == StandardWatchEventKinds.ENTRY_CREATE){ - fireOnNew(childFile); - }else if(kind == StandardWatchEventKinds.ENTRY_MODIFY){ - fireOnChange(childFile); - }else if(kind == StandardWatchEventKinds.ENTRY_DELETE){ - // do nothing... there's no way to communicate deletions - } - }else{ - List fileExtensions = watchKeyToExtensionsMap.get(watchKey); - if(fileExtensions==null){ - // this event didn't match a file in individualWatchedFiles so it's a not an individual file we're interested in - // this event also didn't match a directory that we're interested in (if it did, fileExtentions wouldn't be null) - // so it must be event for a file we're not interested in. An example of how this can happen is: - // there's a directory with files in it like this: - // /images/a.png - // /images/b.png - // by using the addWatchFile method, /images/a.png is watched. - // Now, /images/b.png is changed. Because java.nio.file.WatchService watches directories, it gets a WatchEvent - // for /images/b.png. But we aren't interested in that. - LOG.debug("WatchService received an event for a file/directory that it's not interested in."); - }else{ - if(kind==StandardWatchEventKinds.ENTRY_CREATE){ - // new directory created, so watch its contents - addWatchDirectory(child,fileExtensions); - if(childFile.isDirectory() && childFile.exists()) { - final File[] files = childFile.listFiles(); - if(files != null) { - for (File newFile : files) { - if(isValidFileToMonitor(newFile, fileExtensions)) { - fireOnNew(newFile); - } - } - } - } - } - if(isValidFileToMonitor(childFile,fileExtensions)){ - if(kind == StandardWatchEventKinds.ENTRY_CREATE){ - fireOnNew(childFile); - }else if(kind == StandardWatchEventKinds.ENTRY_MODIFY){ - fireOnChange(childFile); - }else if(kind == StandardWatchEventKinds.ENTRY_DELETE){ - // do nothing... there's no way to communicate deletions - } - } - } - } - } - watchKey.reset(); - } - } catch (InterruptedException e) { - // ignore - } + try { + WatchKey watchKey = watchService.poll(sleepTime, TimeUnit.MILLISECONDS); + if(watchKey!=null){ + List> watchEvents = watchKey.pollEvents(); + for(WatchEvent watchEvent : watchEvents){ + WatchEvent.Kind kind = watchEvent.kind(); + if (kind == StandardWatchEventKinds.OVERFLOW) { + // TODO how is this supposed to be handled? I think the best thing to do is ignore it, but I'm not positive + LOG.warn("WatchService Overflow occurred"); + continue; + } + WatchEvent pathWatchEvent = cast(watchEvent); + Path name = pathWatchEvent.context(); + Path dir = (Path) watchKey.watchable(); + Path child = dir.resolve(name).toAbsolutePath(); + File childFile = child.toFile(); + if(individualWatchedFiles.contains(child) || individualWatchedFiles.contains(child.normalize())){ + if(kind == StandardWatchEventKinds.ENTRY_CREATE){ + fireOnNew(childFile); + }else if(kind == StandardWatchEventKinds.ENTRY_MODIFY){ + fireOnChange(childFile); + }else if(kind == StandardWatchEventKinds.ENTRY_DELETE){ + // do nothing... there's no way to communicate deletions + } + }else{ + List fileExtensions = watchKeyToExtensionsMap.get(watchKey); + if(fileExtensions==null){ + // this event didn't match a file in individualWatchedFiles so it's a not an individual file we're interested in + // this event also didn't match a directory that we're interested in (if it did, fileExtentions wouldn't be null) + // so it must be event for a file we're not interested in. An example of how this can happen is: + // there's a directory with files in it like this: + // /images/a.png + // /images/b.png + // by using the addWatchFile method, /images/a.png is watched. + // Now, /images/b.png is changed. Because java.nio.file.WatchService watches directories, it gets a WatchEvent + // for /images/b.png. But we aren't interested in that. + LOG.debug("WatchService received an event for a file/directory that it's not interested in."); + }else{ + if(kind==StandardWatchEventKinds.ENTRY_CREATE){ + // new directory created, so watch its contents + addWatchDirectory(child,fileExtensions); + if(childFile.isDirectory() && childFile.exists()) { + final File[] files = childFile.listFiles(); + if(files != null) { + for (File newFile : files) { + if(isValidFileToMonitor(newFile, fileExtensions)) { + fireOnNew(newFile); + } + } + } + } + } + if(isValidFileToMonitor(childFile,fileExtensions)){ + if(kind == StandardWatchEventKinds.ENTRY_CREATE){ + fireOnNew(childFile); + }else if(kind == StandardWatchEventKinds.ENTRY_MODIFY){ + fireOnChange(childFile); + }else if(kind == StandardWatchEventKinds.ENTRY_DELETE){ + // do nothing... there's no way to communicate deletions + } + } + } + } + } + watchKey.reset(); + } + } catch (InterruptedException e) { + // ignore + } } try { - watchService.close(); - } catch (IOException e) { - LOG.debug("Exception while closing watchService", e); - } - } + watchService.close(); + } catch (IOException e) { + LOG.debug("Exception while closing watchService", e); + } + } - @Override - public void addWatchFile(File fileToWatch) { - if(!isValidFileToMonitor(fileToWatch, Arrays.asList("*"))) return; - try { + @Override + public void addWatchFile(File fileToWatch) { + if(!isValidFileToMonitor(fileToWatch, Arrays.asList("*"))) return; + try { if(!fileToWatch.exists()) return; - Path pathToWatch = fileToWatch.toPath().toAbsolutePath(); - individualWatchedFiles.add(pathToWatch); - pathToWatch.getParent().register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); - } catch (IOException e) { - throw new RuntimeException(e); - } - } + Path pathToWatch = fileToWatch.toPath().toAbsolutePath(); + individualWatchedFiles.add(pathToWatch); + pathToWatch.getParent().register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); + } catch (IOException e) { + throw new RuntimeException(e); + } + } - @Override - public void addWatchDirectory(File dir, final List fileExtensions) { - Path dirPath = dir.toPath(); - addWatchDirectory(dirPath, fileExtensions); - } + @Override + public void addWatchDirectory(File dir, final List fileExtensions) { + Path dirPath = dir.toPath(); + addWatchDirectory(dirPath, fileExtensions); + } - private void addWatchDirectory(Path dir, final List fileExtensions) { - if(!isValidDirectoryToMonitor(dir.toFile())){ - return; - } - try { - //add the subdirectories too - Files.walkFileTree(dir, new SimpleFileVisitor() { - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) - throws IOException - { - if(!isValidDirectoryToMonitor(dir.toFile())){ - return FileVisitResult.SKIP_SUBTREE; - } - WatchKey watchKey = dir.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); - final List originalFileExtensions = watchKeyToExtensionsMap.get(watchKey); - if(originalFileExtensions==null){ - watchKeyToExtensionsMap.put(watchKey, fileExtensions); - }else{ - final HashSet newFileExtensions = new HashSet(originalFileExtensions); - newFileExtensions.addAll(fileExtensions); - watchKeyToExtensionsMap.put(watchKey, Collections.unmodifiableList(new ArrayList(newFileExtensions))); - } - return FileVisitResult.CONTINUE; - } - }); - } catch (IOException e) { - throw new RuntimeException(e); - } - } + private void addWatchDirectory(Path dir, final List fileExtensions) { + if(!isValidDirectoryToMonitor(dir.toFile())){ + return; + } + try { + //add the subdirectories too + Files.walkFileTree(dir, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException + { + if(!isValidDirectoryToMonitor(dir.toFile())){ + return FileVisitResult.SKIP_SUBTREE; + } + WatchKey watchKey = dir.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY); + final List originalFileExtensions = watchKeyToExtensionsMap.get(watchKey); + if(originalFileExtensions==null){ + watchKeyToExtensionsMap.put(watchKey, fileExtensions); + }else{ + final HashSet newFileExtensions = new HashSet(originalFileExtensions); + newFileExtensions.addAll(fileExtensions); + watchKeyToExtensionsMap.put(watchKey, Collections.unmodifiableList(new ArrayList(newFileExtensions))); + } + return FileVisitResult.CONTINUE; + } + }); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } diff --git a/grails-cache/grails-app/taglib/grails/plugin/cache/CacheTagLib.groovy b/grails-cache/grails-app/taglib/grails/plugin/cache/CacheTagLib.groovy index 6d57ea3b3d4..671389bc528 100644 --- a/grails-cache/grails-app/taglib/grails/plugin/cache/CacheTagLib.groovy +++ b/grails-cache/grails-app/taglib/grails/plugin/cache/CacheTagLib.groovy @@ -32,160 +32,160 @@ import org.springframework.web.context.request.RequestContextHolder class CacheTagLib { - static namespace = 'cache' - - GrailsCacheManager grailsCacheManager - GroovyPagesTemplateRenderer groovyPagesTemplateRenderer - - /** - * Renders a block of markup and caches the result so the next time the same block - * is rendered, it does not need to be evaluated again. - * - * @attr key An optional cache key allowing the same block to be cached with different content - * @attr cache Cache name ("grailsBlocksCache" is used if not specified) - */ - def block = { attrs, body -> - if (!grailsCacheManager) { - out << body() - return - } - - try { - def cache = grailsCacheManager.getCache(attrs.cache ?: 'grailsBlocksCache') - def bodyClosure = ClassUtils.getPropertyOrFieldValue(body, 'bodyClosure') - def closureClass = bodyClosure.getClass() - def key = closureClass.getName() - def expired = false - - if (attrs.key) { - key += ':' + attrs.key - } - - if (attrs.ttl) { - expired = honorTTL(key, attrs.ttl.toLong()) - } - - def content = cache.get(key) - if (content == null || expired) { - content = cloneIfNecessary(body()) - cache.put(key, content) - } else { - content = content.get() - } - - out << content - } catch (RuntimeException e) { - log.error("Cache block experienced an error, ignoring cache and outputting the body content instead.", e) - out << body() - } - } - - /** - * Renders a GSP template and caches the result so the next time the same template - * is rendered, it does not need to be evaluated again. - * - * @attr template REQUIRED The name of the template to apply - * @attr key An optional cache key allowing the same template to be cached with different content - * @attr contextPath the context path to use (relative to the application context path). Defaults to "" or path to the plugin for a plugin view or template. - * @attr bean The bean to apply the template against - * @attr model The model to apply the template against as a java.util.Map - * @attr collection A collection of model objects to apply the template to - * @attr var The variable name of the bean to be referenced in the template - * @attr plugin The plugin to look for the template in - * @attr cache Cache name ("grailsTemplatesCache" is used if not specified) - */ - def render = { attrs -> - if (!grailsCacheManager) { - out << g.render(attrs) - return - } - - try { - //Make this empty string to save error later in grails gsp core - attrs.plugin = attrs.plugin ?: '' - - def cache = grailsCacheManager.getCache(attrs.cache ?: 'grailsTemplatesCache') - def key = calculateFullKey(attrs.template, attrs.contextPath, attrs.plugin) - def expired = false - - if (attrs.key) { - key += ':' + attrs.key - } - - if (attrs.ttl) { - expired = honorTTL(key, attrs.ttl.toLong()) - } - - def content = cache.get(key) - if (content == null || expired) { - content = cloneIfNecessary(g.render(attrs)) - cache.put(key, content) - } else { - content = content.get() - } - out << content - } catch (RuntimeException e) { - log.error("Cache render experienced an error, ignoring cache and outputting the template un-cached.", e) - out << cloneIfNecessary(g.render(attrs)) - } - } - - @Memoized(maxCacheSize = 100) - protected String calculateFullKey(String templateName, String contextPath, String pluginName) { - GrailsWebRequest webRequest = RequestContextHolder.currentRequestAttributes() - String uri = webRequest.attributes.getTemplateUri(templateName, webRequest.request) - def artefact = grailsApplication.getArtefactByLogicalPropertyName("Controller", controllerName) - def controller = grailsApplication.mainContext.getBean(artefact?.clazz?.name) - - GroovyPageTemplate t = groovyPagesTemplateRenderer.findAndCacheTemplate( - controller, webRequest, pageScope, templateName, contextPath, pluginName, uri) - if (!t) { - throwTagError("Template not found for name [$templateName] and path [$uri]") - } - - return t.metaInfo.pageClass.name - } - - protected static cloneIfNecessary(content) { - if (content instanceof StreamCharBuffer) { - if (content instanceof Cloneable) { - content = content.clone() - } else { - // pre Grails 2.3 - content = content.toString() - } - } - content - } - - /** - * updates the ttl and returns whether the content is expired - * @param key - * @param ttl in seconds comes form the view - * @return boolean whether we wrote the a new ttl in or not - */ - protected Boolean honorTTL(String key, Long ttl) { - def cache = grailsCacheManager.getCache("TagLibTTLCache") - String ttlKey = key + ":ttl" - Long ttlInMilliseconds = ttl * 1000 - Long currentTime = System.currentTimeMillis() - Boolean expired - def valueInCache - Long cacheInsertionTime - - try { - valueInCache = cache.get(ttlKey) - cacheInsertionTime = valueInCache ? valueInCache.get().toLong() : 0 - expired = valueInCache && ((currentTime - cacheInsertionTime) > ttlInMilliseconds) - } catch (Exception e) { - cache.put(ttlKey, currentTime) - return true // we overwrote the cache key - } - - if (expired || !valueInCache) { - cache.put(ttlKey, currentTime) - } - - return expired - } + static namespace = 'cache' + + GrailsCacheManager grailsCacheManager + GroovyPagesTemplateRenderer groovyPagesTemplateRenderer + + /** + * Renders a block of markup and caches the result so the next time the same block + * is rendered, it does not need to be evaluated again. + * + * @attr key An optional cache key allowing the same block to be cached with different content + * @attr cache Cache name ("grailsBlocksCache" is used if not specified) + */ + def block = { attrs, body -> + if (!grailsCacheManager) { + out << body() + return + } + + try { + def cache = grailsCacheManager.getCache(attrs.cache ?: 'grailsBlocksCache') + def bodyClosure = ClassUtils.getPropertyOrFieldValue(body, 'bodyClosure') + def closureClass = bodyClosure.getClass() + def key = closureClass.getName() + def expired = false + + if (attrs.key) { + key += ':' + attrs.key + } + + if (attrs.ttl) { + expired = honorTTL(key, attrs.ttl.toLong()) + } + + def content = cache.get(key) + if (content == null || expired) { + content = cloneIfNecessary(body()) + cache.put(key, content) + } else { + content = content.get() + } + + out << content + } catch (RuntimeException e) { + log.error("Cache block experienced an error, ignoring cache and outputting the body content instead.", e) + out << body() + } + } + + /** + * Renders a GSP template and caches the result so the next time the same template + * is rendered, it does not need to be evaluated again. + * + * @attr template REQUIRED The name of the template to apply + * @attr key An optional cache key allowing the same template to be cached with different content + * @attr contextPath the context path to use (relative to the application context path). Defaults to "" or path to the plugin for a plugin view or template. + * @attr bean The bean to apply the template against + * @attr model The model to apply the template against as a java.util.Map + * @attr collection A collection of model objects to apply the template to + * @attr var The variable name of the bean to be referenced in the template + * @attr plugin The plugin to look for the template in + * @attr cache Cache name ("grailsTemplatesCache" is used if not specified) + */ + def render = { attrs -> + if (!grailsCacheManager) { + out << g.render(attrs) + return + } + + try { + //Make this empty string to save error later in grails gsp core + attrs.plugin = attrs.plugin ?: '' + + def cache = grailsCacheManager.getCache(attrs.cache ?: 'grailsTemplatesCache') + def key = calculateFullKey(attrs.template, attrs.contextPath, attrs.plugin) + def expired = false + + if (attrs.key) { + key += ':' + attrs.key + } + + if (attrs.ttl) { + expired = honorTTL(key, attrs.ttl.toLong()) + } + + def content = cache.get(key) + if (content == null || expired) { + content = cloneIfNecessary(g.render(attrs)) + cache.put(key, content) + } else { + content = content.get() + } + out << content + } catch (RuntimeException e) { + log.error("Cache render experienced an error, ignoring cache and outputting the template un-cached.", e) + out << cloneIfNecessary(g.render(attrs)) + } + } + + @Memoized(maxCacheSize = 100) + protected String calculateFullKey(String templateName, String contextPath, String pluginName) { + GrailsWebRequest webRequest = RequestContextHolder.currentRequestAttributes() + String uri = webRequest.attributes.getTemplateUri(templateName, webRequest.request) + def artefact = grailsApplication.getArtefactByLogicalPropertyName("Controller", controllerName) + def controller = grailsApplication.mainContext.getBean(artefact?.clazz?.name) + + GroovyPageTemplate t = groovyPagesTemplateRenderer.findAndCacheTemplate( + controller, webRequest, pageScope, templateName, contextPath, pluginName, uri) + if (!t) { + throwTagError("Template not found for name [$templateName] and path [$uri]") + } + + return t.metaInfo.pageClass.name + } + + protected static cloneIfNecessary(content) { + if (content instanceof StreamCharBuffer) { + if (content instanceof Cloneable) { + content = content.clone() + } else { + // pre Grails 2.3 + content = content.toString() + } + } + content + } + + /** + * updates the ttl and returns whether the content is expired + * @param key + * @param ttl in seconds comes form the view + * @return boolean whether we wrote the a new ttl in or not + */ + protected Boolean honorTTL(String key, Long ttl) { + def cache = grailsCacheManager.getCache("TagLibTTLCache") + String ttlKey = key + ":ttl" + Long ttlInMilliseconds = ttl * 1000 + Long currentTime = System.currentTimeMillis() + Boolean expired + def valueInCache + Long cacheInsertionTime + + try { + valueInCache = cache.get(ttlKey) + cacheInsertionTime = valueInCache ? valueInCache.get().toLong() : 0 + expired = valueInCache && ((currentTime - cacheInsertionTime) > ttlInMilliseconds) + } catch (Exception e) { + cache.put(ttlKey, currentTime) + return true // we overwrote the cache key + } + + if (expired || !valueInCache) { + cache.put(ttlKey, currentTime) + } + + return expired + } } diff --git a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsCache.java b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsCache.java index da62b521c75..ca2e048b26c 100644 --- a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsCache.java +++ b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsCache.java @@ -28,5 +28,5 @@ */ public interface GrailsCache extends Cache { - Collection getAllKeys(); + Collection getAllKeys(); } diff --git a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCache.java b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCache.java index 67421ec98fe..981290983f9 100644 --- a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCache.java +++ b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCache.java @@ -34,26 +34,26 @@ */ public class GrailsConcurrentMapCache extends ConcurrentMapCache implements GrailsCache { - public GrailsConcurrentMapCache(String name) { - super(name); - } - - public GrailsConcurrentMapCache(String name, boolean allowNullValues) { - super(name, allowNullValues); - } - - public GrailsConcurrentMapCache(String name, ConcurrentMap store, boolean allowNullValues) { - super(name, store, allowNullValues); - } - - @Override - public GrailsValueWrapper get(Object key) { - Object value = getNativeCache().get(key); - return value == null ? null : new GrailsValueWrapper(fromStoreValue(value), null); - } - - @SuppressWarnings("unchecked") - public Collection getAllKeys() { - return getNativeCache().keySet(); - } + public GrailsConcurrentMapCache(String name) { + super(name); + } + + public GrailsConcurrentMapCache(String name, boolean allowNullValues) { + super(name, allowNullValues); + } + + public GrailsConcurrentMapCache(String name, ConcurrentMap store, boolean allowNullValues) { + super(name, store, allowNullValues); + } + + @Override + public GrailsValueWrapper get(Object key) { + Object value = getNativeCache().get(key); + return value == null ? null : new GrailsValueWrapper(fromStoreValue(value), null); + } + + @SuppressWarnings("unchecked") + public Collection getAllKeys() { + return getNativeCache().keySet(); + } } diff --git a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCacheManager.groovy b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCacheManager.groovy index 6a6d7a5ab92..64510553331 100644 --- a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCacheManager.groovy +++ b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsConcurrentMapCacheManager.groovy @@ -34,39 +34,39 @@ import org.springframework.cache.Cache @CompileStatic class GrailsConcurrentMapCacheManager implements GrailsCacheManager { - protected final ConcurrentMap cacheMap = new ConcurrentHashMap() + protected final ConcurrentMap cacheMap = new ConcurrentHashMap() - Collection getCacheNames() { - Collections.unmodifiableSet(cacheMap.keySet()) - } + Collection getCacheNames() { + Collections.unmodifiableSet(cacheMap.keySet()) + } - Cache getCache(String name) { - Cache cache = cacheMap.get(name) - if (cache == null) { - cache = createConcurrentMapCache(name) - Cache existing = cacheMap.putIfAbsent(name, cache) - if (existing != null) { - cache = existing - } - } - cache - } + Cache getCache(String name) { + Cache cache = cacheMap.get(name) + if (cache == null) { + cache = createConcurrentMapCache(name) + Cache existing = cacheMap.putIfAbsent(name, cache) + if (existing != null) { + cache = existing + } + } + cache + } - boolean cacheExists(String name) { - getCacheNames().contains(name) - } + boolean cacheExists(String name) { + getCacheNames().contains(name) + } - boolean destroyCache(String name) { - cacheMap.remove(name) != null - } + boolean destroyCache(String name) { + cacheMap.remove(name) != null + } - protected GrailsConcurrentMapCache createConcurrentMapCache(String name) { - new GrailsConcurrentMapCache(name) - } + protected GrailsConcurrentMapCache createConcurrentMapCache(String name) { + new GrailsConcurrentMapCache(name) + } - void setConfiguration(CachePluginConfiguration configuration) { - configuration.caches.each { String key, CachePluginConfiguration.CacheConfig value -> - getCache(key) - } - } + void setConfiguration(CachePluginConfiguration configuration) { + configuration.caches.each { String key, CachePluginConfiguration.CacheConfig value -> + getCache(key) + } + } } diff --git a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsValueWrapper.java b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsValueWrapper.java index 6b74a361e67..8ff0708b918 100644 --- a/grails-cache/src/main/groovy/grails/plugin/cache/GrailsValueWrapper.java +++ b/grails-cache/src/main/groovy/grails/plugin/cache/GrailsValueWrapper.java @@ -27,14 +27,14 @@ */ public class GrailsValueWrapper extends SimpleValueWrapper { - protected Object nativeWrapper; + protected Object nativeWrapper; - public GrailsValueWrapper(Object value, Object nativeWrapper) { - super(value); - this.nativeWrapper = nativeWrapper; - } + public GrailsValueWrapper(Object value, Object nativeWrapper) { + super(value); + this.nativeWrapper = nativeWrapper; + } - public Object getNativeWrapper() { - return nativeWrapper; - } + public Object getNativeWrapper() { + return nativeWrapper; + } } diff --git a/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/ClassReader.java b/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/ClassReader.java index e7afd738836..8b143236174 100644 --- a/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/ClassReader.java +++ b/grails-common/src/main/groovy/org/apache/grails/common/compiler/asm/ClassReader.java @@ -202,11 +202,11 @@ private ClassReader(final byte[] b) { public ClassReader(final byte[] b, final int off, final int len) { this.b = b; // checks the class version - /* SPRING PATCH: REMOVED FOR FORWARD COMPATIBILITY WITH JDK 9 + /* SPRING PATCH: REMOVED FOR FORWARD COMPATIBILITY WITH JDK 9 if (readShort(off + 6) > Opcodes.V1_8) { throw new IllegalArgumentException(); } - */ + */ // parses the constant pool items = new int[readUnsignedShort(off + 8)]; int n = items.length; diff --git a/grails-core/src/main/groovy/grails/compiler/ast/SupportsClassNode.java b/grails-core/src/main/groovy/grails/compiler/ast/SupportsClassNode.java index afffb0733cb..69ad741a8ce 100644 --- a/grails-core/src/main/groovy/grails/compiler/ast/SupportsClassNode.java +++ b/grails-core/src/main/groovy/grails/compiler/ast/SupportsClassNode.java @@ -28,6 +28,6 @@ */ public interface SupportsClassNode { - boolean supports(ClassNode classNode); + boolean supports(ClassNode classNode); } diff --git a/grails-core/src/main/groovy/org/grails/compiler/injection/ArtefactTypeAstTransformation.java b/grails-core/src/main/groovy/org/grails/compiler/injection/ArtefactTypeAstTransformation.java index 481fb319841..b99f155d489 100644 --- a/grails-core/src/main/groovy/org/grails/compiler/injection/ArtefactTypeAstTransformation.java +++ b/grails-core/src/main/groovy/org/grails/compiler/injection/ArtefactTypeAstTransformation.java @@ -223,10 +223,10 @@ public static boolean hasArtefactType(String artefactType, GrailsArtefactClassIn return false; } - @Override - public void setCompilationUnit(CompilationUnit unit) { - compilationUnit = unit; - } + @Override + public void setCompilationUnit(CompilationUnit unit) { + compilationUnit = unit; + } @Override public int priority() { diff --git a/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy b/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy index 39ea50ce337..81797488546 100644 --- a/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy +++ b/grails-core/src/main/groovy/org/grails/compiler/injection/GroovyEclipseCompilationHelper.groovy @@ -40,23 +40,23 @@ class GroovyEclipseCompilationHelper { context.setTypeLocator(new StandardTypeLocator(sourceUnit.getClass().getClassLoader())) context.setRootObject(sourceUnit) try { - // Honour the targetDirectory within the source configuration directory. - File targetDirectory = sourceUnit.configuration.targetDirectory - - if (targetDirectory == null) { - - // Resolve as before. - targetDirectory = ((File) new SpelExpressionParser().parseExpression("eclipseFile.project.getFolder(T(org.eclipse.jdt.core.JavaCore).create(eclipseFile.project).outputLocation).rawLocation.makeAbsolute().toFile().absoluteFile").getValue(context)) - - } else if (!targetDirectory.isAbsolute()) { - // Target directory is set and is not absolute. - // We should assume that this is a path relative to the current eclipse project, - // and needs resolving appropriately. - targetDirectory = ((File) new SpelExpressionParser().parseExpression("eclipseFile.project.getFolder('${targetDirectory.path}').rawLocation.makeAbsolute().toFile().absoluteFile").getValue(context)) - - } - // Else absolute file location. We should return as-is. - return targetDirectory + // Honour the targetDirectory within the source configuration directory. + File targetDirectory = sourceUnit.configuration.targetDirectory + + if (targetDirectory == null) { + + // Resolve as before. + targetDirectory = ((File) new SpelExpressionParser().parseExpression("eclipseFile.project.getFolder(T(org.eclipse.jdt.core.JavaCore).create(eclipseFile.project).outputLocation).rawLocation.makeAbsolute().toFile().absoluteFile").getValue(context)) + + } else if (!targetDirectory.isAbsolute()) { + // Target directory is set and is not absolute. + // We should assume that this is a path relative to the current eclipse project, + // and needs resolving appropriately. + targetDirectory = ((File) new SpelExpressionParser().parseExpression("eclipseFile.project.getFolder('${targetDirectory.path}').rawLocation.makeAbsolute().toFile().absoluteFile").getValue(context)) + + } + // Else absolute file location. We should return as-is. + return targetDirectory } catch (Throwable e) { // Not running Eclipse IDE, probably using the Eclipse compiler with Maven return null diff --git a/grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java b/grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java index 5855f521528..8735a560881 100644 --- a/grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java +++ b/grails-core/src/main/groovy/org/grails/spring/context/support/ReloadableResourceBundleMessageSource.java @@ -99,329 +99,329 @@ * @see java.util.ResourceBundle */ public class ReloadableResourceBundleMessageSource extends AbstractMessageSource - implements ResourceLoaderAware { + implements ResourceLoaderAware { - private static final String PROPERTIES_SUFFIX = ".properties"; + private static final String PROPERTIES_SUFFIX = ".properties"; - private static final String XML_SUFFIX = ".xml"; + private static final String XML_SUFFIX = ".xml"; - private String[] basenames = new String[0]; + private String[] basenames = new String[0]; - private String defaultEncoding; + private String defaultEncoding; - private Properties fileEncodings; + private Properties fileEncodings; - private boolean fallbackToSystemLocale = true; + private boolean fallbackToSystemLocale = true; - protected long cacheMillis = -1; + protected long cacheMillis = -1; protected long fileCacheMillis = Long.MIN_VALUE; - private PropertiesPersister propertiesPersister = new DefaultPropertiesPersister(); - - private ResourceLoader resourceLoader = new DefaultResourceLoader(); - - /** Cache to hold filename lists per Locale */ - private final ConcurrentMap, CacheEntry>>> cachedFilenames = - new ConcurrentHashMap, CacheEntry>>>(); - - /** Cache to hold already loaded properties per filename */ - private final ConcurrentMap> cachedProperties = new ConcurrentHashMap>(); - - /** Cache to hold merged loaded properties per locale */ - private final ConcurrentMap> cachedMergedProperties = new ConcurrentHashMap>(); - - private final ConcurrentMap> cachedResources = new ConcurrentHashMap>(); - - - /** - * Set a single basename, following the basic ResourceBundle convention of - * not specifying file extension or language codes, but in contrast to - * {@link ResourceBundleMessageSource} referring to a Spring resource location: - * e.g. "WEB-INF/messages" for "WEB-INF/messages.properties", - * "WEB-INF/messages_en.properties", etc. - *

XML properties files are also supported: .g. "WEB-INF/messages" will find - * and load "WEB-INF/messages.xml", "WEB-INF/messages_en.xml", etc as well. - * @param basename the single basename - * @see #setBasenames - * @see org.springframework.core.io.ResourceEditor - * @see java.util.ResourceBundle - */ - public void setBasename(String basename) { - setBasenames(basename); - } - - /** - * Retrieves all codes from one or multiple basenames - * @param locale the locale - * @param basenames the basenames of the bundle - * @return a list with all codes from valid registered bundles - */ - public Set getBundleCodes(Locale locale,String...basenames){ - List validBaseNames = getValidBasenames(basenames); - - Set codes = new HashSet<>(); - for(String basename: validBaseNames){ - List> filenamesAndResources = calculateAllFilenames(basename,locale); - for (Pair filenameAndResource : filenamesAndResources) { - if(filenameAndResource.getbValue() != null) { - PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); - codes.addAll(propHolder.getProperties().stringPropertyNames()); - } - } - } - return codes; - } - - protected List getValidBasenames(String[] basenames){ - List validBaseNames = new LinkedList<>(); - for(String basename:basenames){ - for(int i=0;iXML properties files are also supported: .g. "WEB-INF/messages" will find - * and load "WEB-INF/messages.xml", "WEB-INF/messages_en.xml", etc as well. - *

The associated resource bundles will be checked sequentially when resolving - * a message code. Note that message definitions in a previous resource - * bundle will override ones in a later bundle, due to the sequential lookup. - * @param basenames an array of basenames - * @see #setBasename - * @see java.util.ResourceBundle - */ - public void setBasenames(String... basenames) { - if (basenames != null) { - this.basenames = new String[basenames.length]; - for (int i = 0; i < basenames.length; i++) { - String basename = basenames[i]; - Assert.hasText(basename, "Basename must not be empty"); - this.basenames[i] = basename.trim(); - } - } - else { - this.basenames = new String[0]; - } - } - - /** - * Set the default charset to use for parsing properties files. - * Used if no file-specific charset is specified for a file. - *

Default is none, using the {@code java.util.Properties} - * default encoding: ISO-8859-1. - *

Only applies to classic properties files, not to XML files. - * @param defaultEncoding the default charset - * @see #setFileEncodings - * @see org.springframework.util.PropertiesPersister#load - */ - public void setDefaultEncoding(String defaultEncoding) { - this.defaultEncoding = defaultEncoding; - } - - /** - * Set per-file charsets to use for parsing properties files. - *

Only applies to classic properties files, not to XML files. - * @param fileEncodings Properties with filenames as keys and charset - * names as values. Filenames have to match the basename syntax, - * with optional locale-specific appendices: e.g. "WEB-INF/messages" - * or "WEB-INF/messages_en". - * @see #setBasenames - * @see org.springframework.util.PropertiesPersister#load - */ - public void setFileEncodings(Properties fileEncodings) { - this.fileEncodings = fileEncodings; - } - - /** - * Set whether to fall back to the system Locale if no files for a specific - * Locale have been found. Default is "true"; if this is turned off, the only - * fallback will be the default file (e.g. "messages.properties" for - * basename "messages"). - *

Falling back to the system Locale is the default behavior of - * {@code java.util.ResourceBundle}. However, this is often not desirable - * in an application server environment, where the system Locale is not relevant - * to the application at all: Set this flag to "false" in such a scenario. - */ - public void setFallbackToSystemLocale(boolean fallbackToSystemLocale) { - this.fallbackToSystemLocale = fallbackToSystemLocale; - } - - /** - * Set the number of seconds to cache the list of matching properties files. - *

    - *
  • Default is "-1", indicating to cache forever (just like - * {@code java.util.ResourceBundle}). - *
  • A positive number will cache the list of matching properties files for the given - * number of seconds. This is essentially the interval between refresh checks. - *
  • A value of "0" will attemp to list the matching properties files on - * every message access. Do not use this in a production environment! - *
- */ - public void setCacheSeconds(int cacheSeconds) { - this.cacheMillis = (cacheSeconds * 1000); - if(fileCacheMillis==Long.MIN_VALUE) { - this.fileCacheMillis = this.cacheMillis; - } - } - - /** + private PropertiesPersister propertiesPersister = new DefaultPropertiesPersister(); + + private ResourceLoader resourceLoader = new DefaultResourceLoader(); + + /** Cache to hold filename lists per Locale */ + private final ConcurrentMap, CacheEntry>>> cachedFilenames = + new ConcurrentHashMap, CacheEntry>>>(); + + /** Cache to hold already loaded properties per filename */ + private final ConcurrentMap> cachedProperties = new ConcurrentHashMap>(); + + /** Cache to hold merged loaded properties per locale */ + private final ConcurrentMap> cachedMergedProperties = new ConcurrentHashMap>(); + + private final ConcurrentMap> cachedResources = new ConcurrentHashMap>(); + + + /** + * Set a single basename, following the basic ResourceBundle convention of + * not specifying file extension or language codes, but in contrast to + * {@link ResourceBundleMessageSource} referring to a Spring resource location: + * e.g. "WEB-INF/messages" for "WEB-INF/messages.properties", + * "WEB-INF/messages_en.properties", etc. + *

XML properties files are also supported: .g. "WEB-INF/messages" will find + * and load "WEB-INF/messages.xml", "WEB-INF/messages_en.xml", etc as well. + * @param basename the single basename + * @see #setBasenames + * @see org.springframework.core.io.ResourceEditor + * @see java.util.ResourceBundle + */ + public void setBasename(String basename) { + setBasenames(basename); + } + + /** + * Retrieves all codes from one or multiple basenames + * @param locale the locale + * @param basenames the basenames of the bundle + * @return a list with all codes from valid registered bundles + */ + public Set getBundleCodes(Locale locale,String...basenames){ + List validBaseNames = getValidBasenames(basenames); + + Set codes = new HashSet<>(); + for(String basename: validBaseNames){ + List> filenamesAndResources = calculateAllFilenames(basename,locale); + for (Pair filenameAndResource : filenamesAndResources) { + if(filenameAndResource.getbValue() != null) { + PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); + codes.addAll(propHolder.getProperties().stringPropertyNames()); + } + } + } + return codes; + } + + protected List getValidBasenames(String[] basenames){ + List validBaseNames = new LinkedList<>(); + for(String basename:basenames){ + for(int i=0;iXML properties files are also supported: .g. "WEB-INF/messages" will find + * and load "WEB-INF/messages.xml", "WEB-INF/messages_en.xml", etc as well. + *

The associated resource bundles will be checked sequentially when resolving + * a message code. Note that message definitions in a previous resource + * bundle will override ones in a later bundle, due to the sequential lookup. + * @param basenames an array of basenames + * @see #setBasename + * @see java.util.ResourceBundle + */ + public void setBasenames(String... basenames) { + if (basenames != null) { + this.basenames = new String[basenames.length]; + for (int i = 0; i < basenames.length; i++) { + String basename = basenames[i]; + Assert.hasText(basename, "Basename must not be empty"); + this.basenames[i] = basename.trim(); + } + } + else { + this.basenames = new String[0]; + } + } + + /** + * Set the default charset to use for parsing properties files. + * Used if no file-specific charset is specified for a file. + *

Default is none, using the {@code java.util.Properties} + * default encoding: ISO-8859-1. + *

Only applies to classic properties files, not to XML files. + * @param defaultEncoding the default charset + * @see #setFileEncodings + * @see org.springframework.util.PropertiesPersister#load + */ + public void setDefaultEncoding(String defaultEncoding) { + this.defaultEncoding = defaultEncoding; + } + + /** + * Set per-file charsets to use for parsing properties files. + *

Only applies to classic properties files, not to XML files. + * @param fileEncodings Properties with filenames as keys and charset + * names as values. Filenames have to match the basename syntax, + * with optional locale-specific appendices: e.g. "WEB-INF/messages" + * or "WEB-INF/messages_en". + * @see #setBasenames + * @see org.springframework.util.PropertiesPersister#load + */ + public void setFileEncodings(Properties fileEncodings) { + this.fileEncodings = fileEncodings; + } + + /** + * Set whether to fall back to the system Locale if no files for a specific + * Locale have been found. Default is "true"; if this is turned off, the only + * fallback will be the default file (e.g. "messages.properties" for + * basename "messages"). + *

Falling back to the system Locale is the default behavior of + * {@code java.util.ResourceBundle}. However, this is often not desirable + * in an application server environment, where the system Locale is not relevant + * to the application at all: Set this flag to "false" in such a scenario. + */ + public void setFallbackToSystemLocale(boolean fallbackToSystemLocale) { + this.fallbackToSystemLocale = fallbackToSystemLocale; + } + + /** + * Set the number of seconds to cache the list of matching properties files. + *

    + *
  • Default is "-1", indicating to cache forever (just like + * {@code java.util.ResourceBundle}). + *
  • A positive number will cache the list of matching properties files for the given + * number of seconds. This is essentially the interval between refresh checks. + *
  • A value of "0" will attemp to list the matching properties files on + * every message access. Do not use this in a production environment! + *
+ */ + public void setCacheSeconds(int cacheSeconds) { + this.cacheMillis = (cacheSeconds * 1000); + if(fileCacheMillis==Long.MIN_VALUE) { + this.fileCacheMillis = this.cacheMillis; + } + } + + /** * Set the number of seconds to cache loaded properties files. *
    *
  • Default value is the same value as cacheSeconds - *
  • A positive number will cache loaded properties files for the given - * number of seconds. This is essentially the interval between refresh checks. - * Note that a refresh attempt will first check the last-modified timestamp - * of the file before actually reloading it; so if files don't change, this - * interval can be set rather low, as refresh attempts will not actually reload. - *
  • A value of "0" will check the last-modified timestamp of the file on - * every message access. Do not use this in a production environment! - *
- */ - public void setFileCacheSeconds(int fileCacheSeconds) { - this.fileCacheMillis = (fileCacheSeconds * 1000); - } - - /** - * Set the PropertiesPersister to use for parsing properties files. - *

The default is a DefaultPropertiesPersister. - * @see org.springframework.util.DefaultPropertiesPersister - */ - public void setPropertiesPersister(PropertiesPersister propertiesPersister) { - this.propertiesPersister = - (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister()); - } - - /** - * Set the ResourceLoader to use for loading bundle properties files. - *

The default is a DefaultResourceLoader. Will get overridden by the - * ApplicationContext if running in a context, as it implements the - * ResourceLoaderAware interface. Can be manually overridden when - * running outside of an ApplicationContext. - * @see org.springframework.core.io.DefaultResourceLoader - * @see org.springframework.context.ResourceLoaderAware - */ - public void setResourceLoader(ResourceLoader resourceLoader) { - this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader()); - } - - - /** - * Resolves the given message code as key in the retrieved bundle files, - * returning the value found in the bundle as-is (without MessageFormat parsing). - */ - @Override - protected String resolveCodeWithoutArguments(String code, Locale locale) { - if (this.cacheMillis < 0) { - PropertiesHolder propHolder = getMergedProperties(locale); - String result = propHolder.getProperty(code); - if (result != null) { - return result; - } - } - else { - for (String basename : this.basenames) { + *

  • A positive number will cache loaded properties files for the given + * number of seconds. This is essentially the interval between refresh checks. + * Note that a refresh attempt will first check the last-modified timestamp + * of the file before actually reloading it; so if files don't change, this + * interval can be set rather low, as refresh attempts will not actually reload. + *
  • A value of "0" will check the last-modified timestamp of the file on + * every message access. Do not use this in a production environment! + * + */ + public void setFileCacheSeconds(int fileCacheSeconds) { + this.fileCacheMillis = (fileCacheSeconds * 1000); + } + + /** + * Set the PropertiesPersister to use for parsing properties files. + *

    The default is a DefaultPropertiesPersister. + * @see org.springframework.util.DefaultPropertiesPersister + */ + public void setPropertiesPersister(PropertiesPersister propertiesPersister) { + this.propertiesPersister = + (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister()); + } + + /** + * Set the ResourceLoader to use for loading bundle properties files. + *

    The default is a DefaultResourceLoader. Will get overridden by the + * ApplicationContext if running in a context, as it implements the + * ResourceLoaderAware interface. Can be manually overridden when + * running outside of an ApplicationContext. + * @see org.springframework.core.io.DefaultResourceLoader + * @see org.springframework.context.ResourceLoaderAware + */ + public void setResourceLoader(ResourceLoader resourceLoader) { + this.resourceLoader = (resourceLoader != null ? resourceLoader : new DefaultResourceLoader()); + } + + + /** + * Resolves the given message code as key in the retrieved bundle files, + * returning the value found in the bundle as-is (without MessageFormat parsing). + */ + @Override + protected String resolveCodeWithoutArguments(String code, Locale locale) { + if (this.cacheMillis < 0) { + PropertiesHolder propHolder = getMergedProperties(locale); + String result = propHolder.getProperty(code); + if (result != null) { + return result; + } + } + else { + for (String basename : this.basenames) { List> filenamesAndResources = calculateAllFilenames(basename, locale); for (Pair filenameAndResource : filenamesAndResources) { if(filenameAndResource.getbValue() != null) { PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); String result = propHolder.getProperty(code); - if (result != null) { - return result; - } + if (result != null) { + return result; + } + } + } + } + } + return null; + } + + /** + * Resolves the given message code as key in the retrieved bundle files, + * using a cached MessageFormat instance per message code. + */ + @Override + protected MessageFormat resolveCode(String code, Locale locale) { + if (this.cacheMillis < 0) { + PropertiesHolder propHolder = getMergedProperties(locale); + MessageFormat result = propHolder.getMessageFormat(code, locale); + if (result != null) { + return result; + } + } + else { + for (String basename : this.basenames) { + List> filenamesAndResources = calculateAllFilenames(basename, locale); + for (Pair filenameAndResource : filenamesAndResources) { + if(filenameAndResource.getbValue() != null) { + PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); + MessageFormat result = propHolder.getMessageFormat(code, locale); + if (result != null) { + return result; + } } - } - } - } - return null; - } - - /** - * Resolves the given message code as key in the retrieved bundle files, - * using a cached MessageFormat instance per message code. - */ - @Override - protected MessageFormat resolveCode(String code, Locale locale) { - if (this.cacheMillis < 0) { - PropertiesHolder propHolder = getMergedProperties(locale); - MessageFormat result = propHolder.getMessageFormat(code, locale); - if (result != null) { - return result; - } - } - else { - for (String basename : this.basenames) { - List> filenamesAndResources = calculateAllFilenames(basename, locale); - for (Pair filenameAndResource : filenamesAndResources) { - if(filenameAndResource.getbValue() != null) { - PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); - MessageFormat result = propHolder.getMessageFormat(code, locale); - if (result != null) { - return result; - } - } - } - } - } - return null; - } - - - /** - * Get a PropertiesHolder that contains the actually visible properties - * for a Locale, after merging all specified resource bundles. - * Either fetches the holder from the cache or freshly loads it. - *

    Only used when caching resource bundle contents forever, i.e. - * with {@code cacheSeconds < 0}. Therefore, merged properties are always - * cached forever. - */ - protected PropertiesHolder getMergedProperties(final Locale locale) { - return CacheEntry.getValue(cachedMergedProperties, locale, cacheMillis, new Callable() { - @Override - public PropertiesHolder call() throws Exception { - Properties mergedProps = new Properties(); - PropertiesHolder mergedHolder = new PropertiesHolder(mergedProps); - for (int i = basenames.length - 1; i >= 0; i--) { - List> filenamesAndResources = calculateAllFilenames(basenames[i], locale); - for (int j = filenamesAndResources.size() - 1; j >= 0; j--) { - Pair filenameAndResource = filenamesAndResources.get(j); - if(filenameAndResource.getbValue() != null) { - PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); - mergedProps.putAll(propHolder.getProperties()); - } - } - } - return mergedHolder; - } - }); - } - - /** - * Calculate all filenames for the given bundle basename and Locale. - * Will calculate filenames for the given Locale, the system Locale - * (if applicable), and the default file. - * @param basename the basename of the bundle - * @param locale the locale - * @return the List of filenames to check - * @see #setFallbackToSystemLocale - * @see #calculateFilenamesForLocale - */ - protected List> calculateAllFilenames(final String basename, final Locale locale) { - Pair cacheKey = new Pair(basename, locale); - return CacheEntry.getValue(cachedFilenames, cacheKey, cacheMillis, new Callable>>() { - @Override - public List> call() throws Exception { + } + } + } + return null; + } + + + /** + * Get a PropertiesHolder that contains the actually visible properties + * for a Locale, after merging all specified resource bundles. + * Either fetches the holder from the cache or freshly loads it. + *

    Only used when caching resource bundle contents forever, i.e. + * with {@code cacheSeconds < 0}. Therefore, merged properties are always + * cached forever. + */ + protected PropertiesHolder getMergedProperties(final Locale locale) { + return CacheEntry.getValue(cachedMergedProperties, locale, cacheMillis, new Callable() { + @Override + public PropertiesHolder call() throws Exception { + Properties mergedProps = new Properties(); + PropertiesHolder mergedHolder = new PropertiesHolder(mergedProps); + for (int i = basenames.length - 1; i >= 0; i--) { + List> filenamesAndResources = calculateAllFilenames(basenames[i], locale); + for (int j = filenamesAndResources.size() - 1; j >= 0; j--) { + Pair filenameAndResource = filenamesAndResources.get(j); + if(filenameAndResource.getbValue() != null) { + PropertiesHolder propHolder = getProperties(filenameAndResource.getaValue(), filenameAndResource.getbValue()); + mergedProps.putAll(propHolder.getProperties()); + } + } + } + return mergedHolder; + } + }); + } + + /** + * Calculate all filenames for the given bundle basename and Locale. + * Will calculate filenames for the given Locale, the system Locale + * (if applicable), and the default file. + * @param basename the basename of the bundle + * @param locale the locale + * @return the List of filenames to check + * @see #setFallbackToSystemLocale + * @see #calculateFilenamesForLocale + */ + protected List> calculateAllFilenames(final String basename, final Locale locale) { + Pair cacheKey = new Pair(basename, locale); + return CacheEntry.getValue(cachedFilenames, cacheKey, cacheMillis, new Callable>>() { + @Override + public List> call() throws Exception { List filenames = new ArrayList(7); filenames.addAll(calculateFilenamesForLocale(basename, locale)); if (fallbackToSystemLocale && !locale.equals(Locale.getDefault())) { @@ -439,57 +439,57 @@ public List> call() throws Exception { filenamesAndResources.add(new Pair(filename, locateResource(filename))); } return filenamesAndResources; - } - }); - } - - /** - * Calculate the filenames for the given bundle basename and Locale, - * appending language code, country code, and variant code. - * E.g.: basename "messages", Locale "de_AT_oo" -> "messages_de_AT_OO", - * "messages_de_AT", "messages_de". - *

    Follows the rules defined by {@link java.util.Locale#toString()}. - * @param basename the basename of the bundle - * @param locale the locale - * @return the List of filenames to check - */ - protected List calculateFilenamesForLocale(String basename, Locale locale) { - List result = new ArrayList(3); - String language = locale.getLanguage(); - String country = locale.getCountry(); - String variant = locale.getVariant(); - StringBuilder temp = new StringBuilder(basename); - - temp.append('_'); - if (language.length() > 0) { - temp.append(language); - result.add(0, temp.toString()); - } - - temp.append('_'); - if (country.length() > 0) { - temp.append(country); - result.add(0, temp.toString()); - } - - if (variant.length() > 0 && (language.length() > 0 || country.length() > 0)) { - temp.append('_').append(variant); - result.add(0, temp.toString()); - } - - return result; - } - - - /** - * Get a PropertiesHolder for the given filename, either from the - * cache or freshly loaded. - * @param filename the bundle filename (basename + Locale) - * @return the current PropertiesHolder for the bundle - */ - @SuppressWarnings("rawtypes") + } + }); + } + + /** + * Calculate the filenames for the given bundle basename and Locale, + * appending language code, country code, and variant code. + * E.g.: basename "messages", Locale "de_AT_oo" -> "messages_de_AT_OO", + * "messages_de_AT", "messages_de". + *

    Follows the rules defined by {@link java.util.Locale#toString()}. + * @param basename the basename of the bundle + * @param locale the locale + * @return the List of filenames to check + */ + protected List calculateFilenamesForLocale(String basename, Locale locale) { + List result = new ArrayList(3); + String language = locale.getLanguage(); + String country = locale.getCountry(); + String variant = locale.getVariant(); + StringBuilder temp = new StringBuilder(basename); + + temp.append('_'); + if (language.length() > 0) { + temp.append(language); + result.add(0, temp.toString()); + } + + temp.append('_'); + if (country.length() > 0) { + temp.append(country); + result.add(0, temp.toString()); + } + + if (variant.length() > 0 && (language.length() > 0 || country.length() > 0)) { + temp.append('_').append(variant); + result.add(0, temp.toString()); + } + + return result; + } + + + /** + * Get a PropertiesHolder for the given filename, either from the + * cache or freshly loaded. + * @param filename the bundle filename (basename + Locale) + * @return the current PropertiesHolder for the bundle + */ + @SuppressWarnings("rawtypes") protected PropertiesHolder getProperties(final String filename, final Resource resource) { - return CacheEntry.getValue(cachedProperties, filename, fileCacheMillis, new Callable() { + return CacheEntry.getValue(cachedProperties, filename, fileCacheMillis, new Callable() { @Override public PropertiesHolder call() throws Exception { return new PropertiesHolder(filename, resource); @@ -500,8 +500,8 @@ public CacheEntry call() throws Exception { return new PropertiesHolderCacheEntry(); } }, true, null); - } - + } + protected static class PropertiesHolderCacheEntry extends CacheEntry { public PropertiesHolderCacheEntry() { super(); @@ -517,93 +517,93 @@ protected PropertiesHolder updateValue(PropertiesHolder oldValue, Callable() { - @Override - public Resource call() throws Exception { - return locateResourceWithoutCache(filename); - } - }); - } - + } + } + + @Override + public String toString() { + return getClass().getName() + ": basenames=[" + StringUtils.arrayToCommaDelimitedString(this.basenames) + "]"; + } + + protected Resource locateResource(final String filename) { + return CacheEntry.getValue(cachedResources, filename, cacheMillis, new Callable() { + @Override + public Resource call() throws Exception { + return locateResourceWithoutCache(filename); + } + }); + } + protected Resource locateResourceWithoutCache(String filename) { Resource resource = resourceLoader.getResource(org.grails.io.support.ResourceLoader.CLASSPATH_URL_PREFIX + filename + PROPERTIES_SUFFIX); if(!resource.exists()) { @@ -617,40 +617,40 @@ protected Resource locateResourceWithoutCache(String filename) { } else { return null; } - } - - /** - * PropertiesHolder for caching. - * Stores the last-modified timestamp of the source file for efficient - * change detection, and the timestamp of the last refresh attempt - * (updated every time the cache entry gets re-validated). - */ - protected class PropertiesHolder { - private Properties properties; - - private String filename; - private Resource resource; - - private long fileTimestamp = -1; - - /** Cache to hold already generated MessageFormats per message code */ - private final ConcurrentMap, CacheEntry> cachedMessageFormats = - new ConcurrentHashMap, CacheEntry>(); - - public PropertiesHolder(String filename, Resource resource) { - this.filename = filename; - this.resource = resource; - doUpdate(true); - } - - public PropertiesHolder(Properties properties) { - this.properties = properties; - } - - public boolean update() { - return doUpdate(false); - } - + } + + /** + * PropertiesHolder for caching. + * Stores the last-modified timestamp of the source file for efficient + * change detection, and the timestamp of the last refresh attempt + * (updated every time the cache entry gets re-validated). + */ + protected class PropertiesHolder { + private Properties properties; + + private String filename; + private Resource resource; + + private long fileTimestamp = -1; + + /** Cache to hold already generated MessageFormats per message code */ + private final ConcurrentMap, CacheEntry> cachedMessageFormats = + new ConcurrentHashMap, CacheEntry>(); + + public PropertiesHolder(String filename, Resource resource) { + this.filename = filename; + this.resource = resource; + doUpdate(true); + } + + public PropertiesHolder(Properties properties) { + this.properties = properties; + } + + public boolean update() { + return doUpdate(false); + } + private boolean doUpdate(boolean initialization) { if(filename == null) { return false; @@ -669,69 +669,69 @@ private boolean doUpdate(boolean initialization) { } newFileTimestamp = -1; } - if (fileCacheMillis >= 0 && newFileTimestamp == fileTimestamp && this.properties != null) { - return false; - } - try { - this.properties = loadProperties(resource, filename); - this.fileTimestamp = newFileTimestamp; - this.cachedMessageFormats.clear(); - } - catch (IOException ex) { - if (logger.isWarnEnabled()) { - logger.warn("Could not parse properties file [" + resource.getFilename() + "]", ex); - } - } - return true; - } - else { - // Resource does not exist. - if (logger.isDebugEnabled()) { - logger.debug("No properties file found for [" + filename + "] - neither plain properties nor XML"); - } + if (fileCacheMillis >= 0 && newFileTimestamp == fileTimestamp && this.properties != null) { + return false; + } + try { + this.properties = loadProperties(resource, filename); + this.fileTimestamp = newFileTimestamp; + this.cachedMessageFormats.clear(); + } + catch (IOException ex) { + if (logger.isWarnEnabled()) { + logger.warn("Could not parse properties file [" + resource.getFilename() + "]", ex); + } + } + return true; + } + else { + // Resource does not exist. + if (logger.isDebugEnabled()) { + logger.debug("No properties file found for [" + filename + "] - neither plain properties nor XML"); + } this.properties = new Properties(); this.fileTimestamp = -1; this.cachedMessageFormats.clear(); - return true; - } - } + return true; + } + } - public String getFilename() { + public String getFilename() { return filename; } - public Properties getProperties() { - return properties; - } - - public long getFileTimestamp() { - return fileTimestamp; - } - - public String getProperty(String code) { - if (this.properties == null) { - return null; - } - return this.properties.getProperty(code); - } - - public MessageFormat getMessageFormat(final String code, final Locale locale) { - if (this.properties == null) { - return null; - } - Pair cacheKey = new Pair(code, locale); - return CacheEntry.getValue(cachedMessageFormats, cacheKey, -1, new Callable() { - @Override - public MessageFormat call() throws Exception { - String msg = properties.getProperty(code); - if (msg != null) { - return createMessageFormat(msg, locale); - } else { - return null; - } - } - }); - } - } + public Properties getProperties() { + return properties; + } + + public long getFileTimestamp() { + return fileTimestamp; + } + + public String getProperty(String code) { + if (this.properties == null) { + return null; + } + return this.properties.getProperty(code); + } + + public MessageFormat getMessageFormat(final String code, final Locale locale) { + if (this.properties == null) { + return null; + } + Pair cacheKey = new Pair(code, locale); + return CacheEntry.getValue(cachedMessageFormats, cacheKey, -1, new Callable() { + @Override + public MessageFormat call() throws Exception { + String msg = properties.getProperty(code); + if (msg != null) { + return createMessageFormat(msg, locale); + } else { + return null; + } + } + }); + } + } } diff --git a/grails-core/src/main/groovy/org/grails/transaction/ChainedTransactionManager.java b/grails-core/src/main/groovy/org/grails/transaction/ChainedTransactionManager.java index cb57334e153..e3cea7bec32 100644 --- a/grails-core/src/main/groovy/org/grails/transaction/ChainedTransactionManager.java +++ b/grails-core/src/main/groovy/org/grails/transaction/ChainedTransactionManager.java @@ -57,184 +57,184 @@ */ public class ChainedTransactionManager implements PlatformTransactionManager { - private final static Logger LOGGER = LoggerFactory.getLogger(ChainedTransactionManager.class); - - private final List transactionManagers; - private final SynchronizationManager synchronizationManager; - - /** - * Creates a new {@link ChainedTransactionManager} delegating to the given {@link PlatformTransactionManager}s. - * - * @param transactionManagers must not be {@literal null} or empty. - */ - public ChainedTransactionManager(PlatformTransactionManager... transactionManagers) { - this(SpringTransactionSynchronizationManager.INSTANCE, transactionManagers); - } - - /** - * Creates a new {@link ChainedTransactionManager} using the given {@link SynchronizationManager} and - * {@link PlatformTransactionManager}s. - * - * @param synchronizationManager must not be {@literal null}. - * @param transactionManagers must not be {@literal null} or empty. - */ - ChainedTransactionManager(SynchronizationManager synchronizationManager, - PlatformTransactionManager... transactionManagers) { - - Assert.notNull(synchronizationManager, "SynchronizationManager must not be null!"); - Assert.notNull(transactionManagers, "Transaction managers must not be null!"); - Assert.isTrue(transactionManagers.length > 0, "At least one PlatformTransactionManager must be given!"); - - this.synchronizationManager = synchronizationManager; - this.transactionManagers = new ArrayList(); - this.transactionManagers.addAll(Arrays.asList(transactionManagers)); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.PlatformTransactionManager#getTransaction(org.springframework.transaction.TransactionDefinition) - */ - public MultiTransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException { - - MultiTransactionStatus mts = new MultiTransactionStatus(transactionManagers.get(0)); - - if (!synchronizationManager.isSynchronizationActive() && canCreateTransaction(definition)) { - synchronizationManager.initSynchronization(); - mts.setNewSynchronization(); - } - - try { - - for (PlatformTransactionManager transactionManager : transactionManagers) { - mts.registerTransactionManager(definition, transactionManager); - } - - } catch (Exception ex) { - - Map transactionStatuses = mts.getTransactionStatuses(); - - for (PlatformTransactionManager transactionManager : transactionManagers) { - try { - if (transactionStatuses.get(transactionManager) != null) { - transactionManager.rollback(transactionStatuses.get(transactionManager)); - } - } catch (Exception ex2) { - LOGGER.warn("Rollback exception (" + transactionManager + ") " + ex2.getMessage(), ex2); - } - } - - if (mts.isNewSynchronization()) { - synchronizationManager.clearSynchronization(); - } - - throw new CannotCreateTransactionException(ex.getMessage(), ex); - } - - return mts; - } - - protected boolean canCreateTransaction(TransactionDefinition definition) { - return definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_REQUIRED || - definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_REQUIRES_NEW || - definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_NESTED; - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.PlatformTransactionManager#commit(org.springframework.transaction.TransactionStatus) - */ - public void commit(TransactionStatus status) throws TransactionException { - - MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status; - - boolean commit = true; - Exception commitException = null; - PlatformTransactionManager commitExceptionTransactionManager = null; - - for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) { - - if (commit) { - - try { - multiTransactionStatus.commit(transactionManager); - } catch (Exception ex) { - commit = false; - commitException = ex; - commitExceptionTransactionManager = transactionManager; - } - - } else { - - // after unsucessfull commit we must try to rollback remaining transaction managers - - try { - multiTransactionStatus.rollback(transactionManager); - } catch (Exception ex) { - LOGGER.warn("Rollback exception (after commit) (" + transactionManager + ") " + ex.getMessage(), ex); - } - } - } - - if (multiTransactionStatus.isNewSynchronization()) { - synchronizationManager.clearSynchronization(); - } - - if (commitException != null) { - boolean firstTransactionManagerFailed = commitExceptionTransactionManager == getLastTransactionManager(); - int transactionState = firstTransactionManagerFailed ? HeuristicCompletionException.STATE_ROLLED_BACK - : HeuristicCompletionException.STATE_MIXED; - throw new HeuristicCompletionException(transactionState, commitException); - } - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.PlatformTransactionManager#rollback(org.springframework.transaction.TransactionStatus) - */ - public void rollback(TransactionStatus status) throws TransactionException { - - Exception rollbackException = null; - PlatformTransactionManager rollbackExceptionTransactionManager = null; - - MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status; - - for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) { - try { - multiTransactionStatus.rollback(transactionManager); - } catch (Exception ex) { - if (rollbackException == null) { - rollbackException = ex; - rollbackExceptionTransactionManager = transactionManager; - } else { - LOGGER.warn("Rollback exception (" + transactionManager + ") " + ex.getMessage(), ex); - } - } - } - - if (multiTransactionStatus.isNewSynchronization()) { - synchronizationManager.clearSynchronization(); - } - - if (rollbackException != null) { - throw new UnexpectedRollbackException("Rollback exception, originated at (" + rollbackExceptionTransactionManager - + ") " + rollbackException.getMessage(), rollbackException); - } - } - - private Iterable reverse(Collection collection) { - - List list = new ArrayList(collection); - Collections.reverse(list); - return list; - } - - private PlatformTransactionManager getLastTransactionManager() { - return transactionManagers.get(lastTransactionManagerIndex()); - } - - private int lastTransactionManagerIndex() { - return transactionManagers.size() - 1; - } + private final static Logger LOGGER = LoggerFactory.getLogger(ChainedTransactionManager.class); + + private final List transactionManagers; + private final SynchronizationManager synchronizationManager; + + /** + * Creates a new {@link ChainedTransactionManager} delegating to the given {@link PlatformTransactionManager}s. + * + * @param transactionManagers must not be {@literal null} or empty. + */ + public ChainedTransactionManager(PlatformTransactionManager... transactionManagers) { + this(SpringTransactionSynchronizationManager.INSTANCE, transactionManagers); + } + + /** + * Creates a new {@link ChainedTransactionManager} using the given {@link SynchronizationManager} and + * {@link PlatformTransactionManager}s. + * + * @param synchronizationManager must not be {@literal null}. + * @param transactionManagers must not be {@literal null} or empty. + */ + ChainedTransactionManager(SynchronizationManager synchronizationManager, + PlatformTransactionManager... transactionManagers) { + + Assert.notNull(synchronizationManager, "SynchronizationManager must not be null!"); + Assert.notNull(transactionManagers, "Transaction managers must not be null!"); + Assert.isTrue(transactionManagers.length > 0, "At least one PlatformTransactionManager must be given!"); + + this.synchronizationManager = synchronizationManager; + this.transactionManagers = new ArrayList(); + this.transactionManagers.addAll(Arrays.asList(transactionManagers)); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.PlatformTransactionManager#getTransaction(org.springframework.transaction.TransactionDefinition) + */ + public MultiTransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException { + + MultiTransactionStatus mts = new MultiTransactionStatus(transactionManagers.get(0)); + + if (!synchronizationManager.isSynchronizationActive() && canCreateTransaction(definition)) { + synchronizationManager.initSynchronization(); + mts.setNewSynchronization(); + } + + try { + + for (PlatformTransactionManager transactionManager : transactionManagers) { + mts.registerTransactionManager(definition, transactionManager); + } + + } catch (Exception ex) { + + Map transactionStatuses = mts.getTransactionStatuses(); + + for (PlatformTransactionManager transactionManager : transactionManagers) { + try { + if (transactionStatuses.get(transactionManager) != null) { + transactionManager.rollback(transactionStatuses.get(transactionManager)); + } + } catch (Exception ex2) { + LOGGER.warn("Rollback exception (" + transactionManager + ") " + ex2.getMessage(), ex2); + } + } + + if (mts.isNewSynchronization()) { + synchronizationManager.clearSynchronization(); + } + + throw new CannotCreateTransactionException(ex.getMessage(), ex); + } + + return mts; + } + + protected boolean canCreateTransaction(TransactionDefinition definition) { + return definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_REQUIRED || + definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_REQUIRES_NEW || + definition.getPropagationBehavior() == TransactionDefinition.PROPAGATION_NESTED; + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.PlatformTransactionManager#commit(org.springframework.transaction.TransactionStatus) + */ + public void commit(TransactionStatus status) throws TransactionException { + + MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status; + + boolean commit = true; + Exception commitException = null; + PlatformTransactionManager commitExceptionTransactionManager = null; + + for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) { + + if (commit) { + + try { + multiTransactionStatus.commit(transactionManager); + } catch (Exception ex) { + commit = false; + commitException = ex; + commitExceptionTransactionManager = transactionManager; + } + + } else { + + // after unsucessfull commit we must try to rollback remaining transaction managers + + try { + multiTransactionStatus.rollback(transactionManager); + } catch (Exception ex) { + LOGGER.warn("Rollback exception (after commit) (" + transactionManager + ") " + ex.getMessage(), ex); + } + } + } + + if (multiTransactionStatus.isNewSynchronization()) { + synchronizationManager.clearSynchronization(); + } + + if (commitException != null) { + boolean firstTransactionManagerFailed = commitExceptionTransactionManager == getLastTransactionManager(); + int transactionState = firstTransactionManagerFailed ? HeuristicCompletionException.STATE_ROLLED_BACK + : HeuristicCompletionException.STATE_MIXED; + throw new HeuristicCompletionException(transactionState, commitException); + } + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.PlatformTransactionManager#rollback(org.springframework.transaction.TransactionStatus) + */ + public void rollback(TransactionStatus status) throws TransactionException { + + Exception rollbackException = null; + PlatformTransactionManager rollbackExceptionTransactionManager = null; + + MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status; + + for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) { + try { + multiTransactionStatus.rollback(transactionManager); + } catch (Exception ex) { + if (rollbackException == null) { + rollbackException = ex; + rollbackExceptionTransactionManager = transactionManager; + } else { + LOGGER.warn("Rollback exception (" + transactionManager + ") " + ex.getMessage(), ex); + } + } + } + + if (multiTransactionStatus.isNewSynchronization()) { + synchronizationManager.clearSynchronization(); + } + + if (rollbackException != null) { + throw new UnexpectedRollbackException("Rollback exception, originated at (" + rollbackExceptionTransactionManager + + ") " + rollbackException.getMessage(), rollbackException); + } + } + + private Iterable reverse(Collection collection) { + + List list = new ArrayList(collection); + Collections.reverse(list); + return list; + } + + private PlatformTransactionManager getLastTransactionManager() { + return transactionManagers.get(lastTransactionManagerIndex()); + } + + private int lastTransactionManagerIndex() { + return transactionManagers.size() - 1; + } public List getTransactionManagers() { return transactionManagers; diff --git a/grails-core/src/main/groovy/org/grails/transaction/MultiTransactionStatus.java b/grails-core/src/main/groovy/org/grails/transaction/MultiTransactionStatus.java index 8ad3ef72551..e42911a5bc6 100644 --- a/grails-core/src/main/groovy/org/grails/transaction/MultiTransactionStatus.java +++ b/grails-core/src/main/groovy/org/grails/transaction/MultiTransactionStatus.java @@ -38,173 +38,173 @@ */ class MultiTransactionStatus implements TransactionStatus { - private final PlatformTransactionManager mainTransactionManager; - private final Map transactionStatuses = Collections - .synchronizedMap(new HashMap()); - - private boolean newSynchronization; - - /** - * Creates a new {@link MultiTransactionStatus} for the given {@link PlatformTransactionManager}. - * - * @param mainTransactionManager must not be {@literal null}. - */ - public MultiTransactionStatus(PlatformTransactionManager mainTransactionManager) { - - Assert.notNull(mainTransactionManager, "TransactionManager must not be null!"); - this.mainTransactionManager = mainTransactionManager; - } - - public Map getTransactionStatuses() { - return transactionStatuses; - } - - public void setNewSynchronization() { - this.newSynchronization = true; - } - - public boolean isNewSynchronization() { - return newSynchronization; - } - - public void registerTransactionManager(TransactionDefinition definition, PlatformTransactionManager transactionManager) { - getTransactionStatuses().put(transactionManager, transactionManager.getTransaction(definition)); - } - - public void commit(PlatformTransactionManager transactionManager) { - TransactionStatus transactionStatus = getTransactionStatus(transactionManager); - transactionManager.commit(transactionStatus); - } - - /** - * Rolls back the {@link TransactionStatus} registered for the given {@link PlatformTransactionManager}. - * - * @param transactionManager must not be {@literal null}. - */ - public void rollback(PlatformTransactionManager transactionManager) { - transactionManager.rollback(getTransactionStatus(transactionManager)); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.TransactionStatus#isRollbackOnly() - */ - public boolean isRollbackOnly() { - return getMainTransactionStatus().isRollbackOnly(); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.TransactionStatus#isCompleted() - */ - public boolean isCompleted() { - return getMainTransactionStatus().isCompleted(); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.TransactionStatus#isNewTransaction() - */ - public boolean isNewTransaction() { - return getMainTransactionStatus().isNewTransaction(); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.TransactionStatus#hasSavepoint() - */ - public boolean hasSavepoint() { - return getMainTransactionStatus().hasSavepoint(); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.TransactionStatus#setRollbackOnly() - */ - public void setRollbackOnly() { - for (TransactionStatus ts : transactionStatuses.values()) { - ts.setRollbackOnly(); - } - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.SavepointManager#createSavepoint() - */ - public Object createSavepoint() throws TransactionException { - - SavePoints savePoints = new SavePoints(); - - for (TransactionStatus transactionStatus : transactionStatuses.values()) { - savePoints.save(transactionStatus); - } - return savePoints; - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.SavepointManager#rollbackToSavepoint(java.lang.Object) - */ - public void rollbackToSavepoint(Object savepoint) throws TransactionException { - SavePoints savePoints = (SavePoints) savepoint; - savePoints.rollback(); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.SavepointManager#releaseSavepoint(java.lang.Object) - */ - public void releaseSavepoint(Object savepoint) throws TransactionException { - ((SavePoints) savepoint).release(); - } - - /* - * (non-Javadoc) - * @see org.springframework.transaction.TransactionStatus#flush() - */ - public void flush() { - for (TransactionStatus transactionStatus : transactionStatuses.values()) { - transactionStatus.flush(); - } - } - - private TransactionStatus getMainTransactionStatus() { - return transactionStatuses.get(mainTransactionManager); - } - - private TransactionStatus getTransactionStatus(PlatformTransactionManager transactionManager) { - return this.getTransactionStatuses().get(transactionManager); - } - - private static class SavePoints { - - private final Map savepoints = new HashMap(); - - private void addSavePoint(TransactionStatus status, Object savepoint) { - - Assert.notNull(status, "TransactionStatus must not be null!"); - this.savepoints.put(status, savepoint); - } - - private void save(TransactionStatus transactionStatus) { - Object savepoint = transactionStatus.createSavepoint(); - addSavePoint(transactionStatus, savepoint); - } - - public void rollback() { - for (TransactionStatus transactionStatus : savepoints.keySet()) { - transactionStatus.rollbackToSavepoint(savepointFor(transactionStatus)); - } - } - - private Object savepointFor(TransactionStatus transactionStatus) { - return savepoints.get(transactionStatus); - } - - public void release() { - for (TransactionStatus transactionStatus : savepoints.keySet()) { - transactionStatus.releaseSavepoint(savepointFor(transactionStatus)); - } - } - } + private final PlatformTransactionManager mainTransactionManager; + private final Map transactionStatuses = Collections + .synchronizedMap(new HashMap()); + + private boolean newSynchronization; + + /** + * Creates a new {@link MultiTransactionStatus} for the given {@link PlatformTransactionManager}. + * + * @param mainTransactionManager must not be {@literal null}. + */ + public MultiTransactionStatus(PlatformTransactionManager mainTransactionManager) { + + Assert.notNull(mainTransactionManager, "TransactionManager must not be null!"); + this.mainTransactionManager = mainTransactionManager; + } + + public Map getTransactionStatuses() { + return transactionStatuses; + } + + public void setNewSynchronization() { + this.newSynchronization = true; + } + + public boolean isNewSynchronization() { + return newSynchronization; + } + + public void registerTransactionManager(TransactionDefinition definition, PlatformTransactionManager transactionManager) { + getTransactionStatuses().put(transactionManager, transactionManager.getTransaction(definition)); + } + + public void commit(PlatformTransactionManager transactionManager) { + TransactionStatus transactionStatus = getTransactionStatus(transactionManager); + transactionManager.commit(transactionStatus); + } + + /** + * Rolls back the {@link TransactionStatus} registered for the given {@link PlatformTransactionManager}. + * + * @param transactionManager must not be {@literal null}. + */ + public void rollback(PlatformTransactionManager transactionManager) { + transactionManager.rollback(getTransactionStatus(transactionManager)); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.TransactionStatus#isRollbackOnly() + */ + public boolean isRollbackOnly() { + return getMainTransactionStatus().isRollbackOnly(); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.TransactionStatus#isCompleted() + */ + public boolean isCompleted() { + return getMainTransactionStatus().isCompleted(); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.TransactionStatus#isNewTransaction() + */ + public boolean isNewTransaction() { + return getMainTransactionStatus().isNewTransaction(); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.TransactionStatus#hasSavepoint() + */ + public boolean hasSavepoint() { + return getMainTransactionStatus().hasSavepoint(); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.TransactionStatus#setRollbackOnly() + */ + public void setRollbackOnly() { + for (TransactionStatus ts : transactionStatuses.values()) { + ts.setRollbackOnly(); + } + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.SavepointManager#createSavepoint() + */ + public Object createSavepoint() throws TransactionException { + + SavePoints savePoints = new SavePoints(); + + for (TransactionStatus transactionStatus : transactionStatuses.values()) { + savePoints.save(transactionStatus); + } + return savePoints; + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.SavepointManager#rollbackToSavepoint(java.lang.Object) + */ + public void rollbackToSavepoint(Object savepoint) throws TransactionException { + SavePoints savePoints = (SavePoints) savepoint; + savePoints.rollback(); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.SavepointManager#releaseSavepoint(java.lang.Object) + */ + public void releaseSavepoint(Object savepoint) throws TransactionException { + ((SavePoints) savepoint).release(); + } + + /* + * (non-Javadoc) + * @see org.springframework.transaction.TransactionStatus#flush() + */ + public void flush() { + for (TransactionStatus transactionStatus : transactionStatuses.values()) { + transactionStatus.flush(); + } + } + + private TransactionStatus getMainTransactionStatus() { + return transactionStatuses.get(mainTransactionManager); + } + + private TransactionStatus getTransactionStatus(PlatformTransactionManager transactionManager) { + return this.getTransactionStatuses().get(transactionManager); + } + + private static class SavePoints { + + private final Map savepoints = new HashMap(); + + private void addSavePoint(TransactionStatus status, Object savepoint) { + + Assert.notNull(status, "TransactionStatus must not be null!"); + this.savepoints.put(status, savepoint); + } + + private void save(TransactionStatus transactionStatus) { + Object savepoint = transactionStatus.createSavepoint(); + addSavePoint(transactionStatus, savepoint); + } + + public void rollback() { + for (TransactionStatus transactionStatus : savepoints.keySet()) { + transactionStatus.rollbackToSavepoint(savepointFor(transactionStatus)); + } + } + + private Object savepointFor(TransactionStatus transactionStatus) { + return savepoints.get(transactionStatus); + } + + public void release() { + for (TransactionStatus transactionStatus : savepoints.keySet()) { + transactionStatus.releaseSavepoint(savepointFor(transactionStatus)); + } + } + } } diff --git a/grails-core/src/main/groovy/org/grails/transaction/SpringTransactionSynchronizationManager.java b/grails-core/src/main/groovy/org/grails/transaction/SpringTransactionSynchronizationManager.java index 4c0b0cd10c1..bb7934246b6 100644 --- a/grails-core/src/main/groovy/org/grails/transaction/SpringTransactionSynchronizationManager.java +++ b/grails-core/src/main/groovy/org/grails/transaction/SpringTransactionSynchronizationManager.java @@ -29,29 +29,29 @@ */ enum SpringTransactionSynchronizationManager implements SynchronizationManager { - INSTANCE; + INSTANCE; - /* - * (non-Javadoc) - * @see org.grails.transaction.SynchronizationManager#initSynchronization() - */ - public void initSynchronization() { - TransactionSynchronizationManager.initSynchronization(); - } + /* + * (non-Javadoc) + * @see org.grails.transaction.SynchronizationManager#initSynchronization() + */ + public void initSynchronization() { + TransactionSynchronizationManager.initSynchronization(); + } - /* - * (non-Javadoc) - * @see org.grails.transaction.SynchronizationManager#isSynchronizationActive() - */ - public boolean isSynchronizationActive() { - return TransactionSynchronizationManager.isSynchronizationActive(); - } + /* + * (non-Javadoc) + * @see org.grails.transaction.SynchronizationManager#isSynchronizationActive() + */ + public boolean isSynchronizationActive() { + return TransactionSynchronizationManager.isSynchronizationActive(); + } - /* - * (non-Javadoc) - * @see org.grails.transaction.SynchronizationManager#clearSynchronization() - */ - public void clearSynchronization() { - TransactionSynchronizationManager.clear(); - } + /* + * (non-Javadoc) + * @see org.grails.transaction.SynchronizationManager#clearSynchronization() + */ + public void clearSynchronization() { + TransactionSynchronizationManager.clear(); + } } diff --git a/grails-core/src/main/groovy/org/grails/transaction/SynchronizationManager.java b/grails-core/src/main/groovy/org/grails/transaction/SynchronizationManager.java index cb53d9e7752..c2bde3be6b2 100644 --- a/grails-core/src/main/groovy/org/grails/transaction/SynchronizationManager.java +++ b/grails-core/src/main/groovy/org/grails/transaction/SynchronizationManager.java @@ -29,9 +29,9 @@ */ interface SynchronizationManager { - void initSynchronization(); + void initSynchronization(); - boolean isSynchronizationActive(); + boolean isSynchronizationActive(); - void clearSynchronization(); + void clearSynchronization(); } diff --git a/grails-databinding-core/src/main/groovy/org/grails/databinding/compiler/BindingFormatASTTransformation.java b/grails-databinding-core/src/main/groovy/org/grails/databinding/compiler/BindingFormatASTTransformation.java index 48afe367ba8..9f9845c5e7e 100644 --- a/grails-databinding-core/src/main/groovy/org/grails/databinding/compiler/BindingFormatASTTransformation.java +++ b/grails-databinding-core/src/main/groovy/org/grails/databinding/compiler/BindingFormatASTTransformation.java @@ -37,34 +37,34 @@ @GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS) public class BindingFormatASTTransformation implements ASTTransformation, TransformWithPriority { - @Override - public void visit(final ASTNode[] astNodes, final SourceUnit source) { - if (!(astNodes[0] instanceof AnnotationNode) || !(astNodes[1] instanceof FieldNode)) { - throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class"); - } + @Override + public void visit(final ASTNode[] astNodes, final SourceUnit source) { + if (!(astNodes[0] instanceof AnnotationNode) || !(astNodes[1] instanceof FieldNode)) { + throw new RuntimeException("Internal error: wrong types: $node.class / $parent.class"); + } - final AnnotationNode annotationNode = (AnnotationNode) astNodes[0]; - final FieldNode fieldNode = (FieldNode) astNodes[1]; - final Map members = annotationNode.getMembers(); - if(members == null || (!members.containsKey("code") && !members.containsKey("value"))) { - final String message = "The @BindingFormat annotation on the field [" - + fieldNode.getName() + - "] in class [" + - fieldNode.getDeclaringClass().getName() + - "] must provide a value for either the value() or code() attribute."; - - error(source, fieldNode, message); - } - } - - protected void error(final SourceUnit sourceUnit, final ASTNode astNode, final String message) { - final SyntaxException syntaxException = new SyntaxException(message, astNode.getLineNumber(), astNode.getColumnNumber()); - final SyntaxErrorMessage syntaxErrorMessage = new SyntaxErrorMessage(syntaxException, sourceUnit); - sourceUnit.getErrorCollector().addError(syntaxErrorMessage, false); - } + final AnnotationNode annotationNode = (AnnotationNode) astNodes[0]; + final FieldNode fieldNode = (FieldNode) astNodes[1]; + final Map members = annotationNode.getMembers(); + if(members == null || (!members.containsKey("code") && !members.containsKey("value"))) { + final String message = "The @BindingFormat annotation on the field [" + + fieldNode.getName() + + "] in class [" + + fieldNode.getDeclaringClass().getName() + + "] must provide a value for either the value() or code() attribute."; + + error(source, fieldNode, message); + } + } + + protected void error(final SourceUnit sourceUnit, final ASTNode astNode, final String message) { + final SyntaxException syntaxException = new SyntaxException(message, astNode.getLineNumber(), astNode.getColumnNumber()); + final SyntaxErrorMessage syntaxErrorMessage = new SyntaxErrorMessage(syntaxException, sourceUnit); + sourceUnit.getErrorCollector().addError(syntaxErrorMessage, false); + } - @Override - public int priority() { - return GroovyTransformOrder.BINDING_FORMAT_ORDER; - } + @Override + public int priority() { + return GroovyTransformOrder.BINDING_FORMAT_ORDER; + } } diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEnhancer.groovy b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEnhancer.groovy index 9adea3a65e4..f032204a24e 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEnhancer.groovy +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/GormEnhancer.groovy @@ -232,7 +232,7 @@ class GormEnhancer implements Closeable { return null } } - } + } } return buildNamedCriteriaProxy(entity, namedQueries, queryName, args) } diff --git a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/query/criteria/AbstractCriteriaBuilder.java b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/query/criteria/AbstractCriteriaBuilder.java index 6ebd22a57ff..25cfe82af5d 100644 --- a/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/query/criteria/AbstractCriteriaBuilder.java +++ b/grails-datamapping-core/src/main/groovy/org/grails/datastore/gorm/query/criteria/AbstractCriteriaBuilder.java @@ -1053,12 +1053,12 @@ protected void validatePropertyName(String propertyName, String methodName) { } protected void ensureQueryIsInitialized() { - if(query == null) { - query = queryCreator.createQuery(targetClass); - } - if(queryMetaClass == null) { - queryMetaClass = GroovySystem.getMetaClassRegistry().getMetaClass(query.getClass()); - } + if(query == null) { + query = queryCreator.createQuery(targetClass); + } + if(queryMetaClass == null) { + queryMetaClass = GroovySystem.getMetaClassRegistry().getMetaClass(query.getClass()); + } } private boolean isCriteriaConstructionMethod(String name, Object[] args) { diff --git a/grails-events/compat/src/main/groovy/grails/events/Events.groovy b/grails-events/compat/src/main/groovy/grails/events/Events.groovy index c9064409d64..210c8c7b10f 100644 --- a/grails-events/compat/src/main/groovy/grails/events/Events.groovy +++ b/grails-events/compat/src/main/groovy/grails/events/Events.groovy @@ -90,11 +90,11 @@ trait Events { * Selector}. * * @param sel - * The {@literal Selector} to be used for matching + * The {@literal Selector} to be used for matching * @param consumer - * The {@literal Consumer} to be triggered + * The {@literal Consumer} to be triggered * @param - * The type of the {@link Event} + * The type of the {@link Event} * * @return A {@link Subscription} object that allows the caller to interact with the given mapping */ diff --git a/grails-fields/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy b/grails-fields/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy index bafd61130b7..cd9a29d9e54 100644 --- a/grails-fields/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy +++ b/grails-fields/grails-app/taglib/grails/plugin/formfields/FormFieldsTagLib.groovy @@ -51,940 +51,940 @@ import static FormFieldsTemplateService.toPropertyNameFormat @Slf4j class FormFieldsTagLib { - static final namespace = 'f' - - static final String STACK_PAGE_SCOPE_VARIABLE = 'f:with:stack' - private static final List DECIMAL_TYPES = ['double', 'float', 'bigdecimal'] - - private static final String THEME_ATTR = "theme" - private static final String WIDGET_ATTR = "widget" - private static final String WRAPPER_ATTR = "wrapper" - private static final String TEMPLATES_ATTR = "templates" - private static final String PROPERTY_ATTR = "property" - private static final String BEAN_ATTR = "bean" - public static final String DISPLAY_STYLE = 'displayStyle' - - @Value('${grails.plugin.fields.localizeNumbers:true}') - Boolean localizeNumbers - - @Value('${grails.plugin.fields.exclusions.list:#{T(java.util.Arrays).asList("id", "dateCreated", "lastUpdated")}}') - List exclusionsList - @Value('${grails.plugin.fields.exclusions.input:#{T(java.util.Arrays).asList("version", "dateCreated", "lastUpdated")}}') - List exclusionsInput - @Value('${grails.plugin.fields.exclusions.display:#{T(java.util.Arrays).asList("version", "dateCreated", "lastUpdated")}}') - List exclusionsDisplay - - enum ExclusionType { - List, Display, Input - } - - FormFieldsTemplateService formFieldsTemplateService - BeanPropertyAccessorFactory beanPropertyAccessorFactory - DomainPropertyFactory fieldsDomainPropertyFactory - - @Autowired(required = false) - Collection mappingContexts - - DomainModelService domainModelService - LocaleResolver localeResolver - CodecLookup codecLookup - MessageSource messageSource - - static defaultEncodeAs = [taglib: 'raw'] - - class BeanAndPrefix { - Object bean - String prefix - Map innerAttributes = [:] - } - - class BeanAndPrefixStack extends Stack { - Object getBean() { - empty() ? null : peek().bean - } - - String getPrefix() { - empty() ? null : peek().prefix - } - - Map getInnerAttributes() { - empty() ? [:] : peek().innerAttributes - } - - String toString() { - bean?.toString() ?: '' - } - } - - BeanAndPrefixStack getBeanStack() { - if (!pageScope.hasVariable(STACK_PAGE_SCOPE_VARIABLE)) { - pageScope.setVariable(STACK_PAGE_SCOPE_VARIABLE, new BeanAndPrefixStack()) - } - pageScope.variables[STACK_PAGE_SCOPE_VARIABLE] - } - - /** - * @attr bean REQUIRED Name of the source bean in the GSP model. - * @attr prefix Prefix to add to input element names. - */ - def with = { attrs, body -> - if (!attrs[BEAN_ATTR]) throwTagError("Tag [with] is missing required attribute [$BEAN_ATTR]") - BeanAndPrefix beanPrefix = resolveBeanAndPrefix(attrs[BEAN_ATTR], attrs.prefix, attrs) - try { - beanStack.push(beanPrefix) - out << body() - } finally { - beanStack.pop() - } - } - - /** - * @attr bean REQUIRED Name of the source bean in the GSP model. - * @attr order A comma-separated list of properties to include in provided order - * @attr except A comma-separated list of properties to exclude from the generated list of input fields - * @attr prefix Prefix to add to input element names. - */ - def all = { attrs -> - if (!attrs[BEAN_ATTR]) throwTagError("Tag [all] is missing required attribute [$BEAN_ATTR]") - BeanAndPrefix beanPrefix = resolveBeanAndPrefix(attrs[BEAN_ATTR], attrs.prefix, attrs) - try { - beanStack.push(beanPrefix) - def bean = resolveBean(attrs[BEAN_ATTR]) - def prefix = resolvePrefix(attrs.prefix) - def domainClass = resolveDomainClass(bean) - if (domainClass) { - for (property in resolvePersistentProperties(domainClass, attrs)) { - out << field([bean: bean, property: property.name, prefix: prefix]) - } - } else { - throwTagError('Tag [all] currently only supports domain types') - } - } finally { - beanStack.pop() - } - } - - /** - * @attr bean Name of the source bean in the GSP model. - * @attr property REQUIRED The name of the property to display. This is resolved - * against the specified bean or the bean in the current scope. - * @attr value Specifies the initial value to display in the field. The default is - * the current value of the property. - * @attr default A default initial value to display if the actual property value - * evaluates to {@code false}. - * @attr required Specifies whether the user is required to enter a value for this - * property. By default, this is determined by the constraints of the property. - * @attr invalid Specifies whether this property is invalid or not. By default, this - * is determined by whether there are any errors associated with it. - * @attr label Overrides the default label displayed next to the input field. - * @attr prefix Prefix to add to input element names. - * @attr wrapper Specify the folder inside _fields where to look up for the wrapper template. - * @attr widget Specify the folder inside _fields where to look up for the widget template. - * @attr templates Specify the folder inside _fields where to look up for the wrapper and widget template. - * @attr theme Theme name - * @attr css html css attribute for wrapper (default: field-contain) - * @attr divClass class for optional div that will be added if set and contain the widget (default: no div created) - * @attr invalidClass class added to wrapper that if property is invalid. (default: error) Also available for widget. - * @attr requiredClass class added to wrapper when property is required. (default: required) Also available for widget. - */ - def field = { attrs, body -> - attrs = beanStack.innerAttributes + attrs - if (attrs.containsKey(BEAN_ATTR) && !attrs[BEAN_ATTR]) throwTagError("Tag [field] requires a non-null value for attribute [$BEAN_ATTR]") - if (!attrs[PROPERTY_ATTR]) throwTagError("Tag [field] is missing required attribute [$PROPERTY_ATTR]") - - def bean = resolveBean(attrs.remove(BEAN_ATTR)) - String property = attrs.remove(PROPERTY_ATTR) - String templatesFolder = attrs.remove(TEMPLATES_ATTR) - String fieldFolder = attrs.remove(WRAPPER_ATTR) - String widgetFolder = attrs.remove(WIDGET_ATTR) - String theme = attrs.remove(THEME_ATTR) - - BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) - if (propertyAccessor.domainProperty instanceof Embedded) { - renderEmbeddedProperties(bean, propertyAccessor, attrs + [templates: templatesFolder, field: fieldFolder, input: widgetFolder, theme: theme]) - } else { - Map model = buildModel(propertyAccessor, attrs) - Map wrapperAttrs = [:] - Map widgetAttrs = [:] - - String prefixAttribute = formFieldsTemplateService.getWidgetPrefix() ?: 'widget-' - attrs.each { k, v -> - if (k?.startsWith(prefixAttribute)) { - widgetAttrs[k.replace(prefixAttribute, '')] = v - } else { - wrapperAttrs[k] = v - } - } - - List widgetClasses = [widgetAttrs['class'] ?: ''] - String cssClass = widgetAttrs.remove('invalidClass') - if (cssClass && model.invalid) { - widgetClasses << cssClass - } - cssClass = widgetAttrs.remove('requiredClass') - if (cssClass && model.required) { - widgetClasses << cssClass - } - widgetAttrs['class'] = widgetClasses.join(' ').trim() - if (widgetAttrs['class'].isEmpty()) { - widgetAttrs.remove('class') - } - if (hasBody(body)) { - model.widget = raw(body(model + [attrs: widgetAttrs] + widgetAttrs)) - } else { - model.widget = renderWidget(propertyAccessor, model, widgetAttrs, widgetFolder ?: templatesFolder, theme) - } - - String templateName = formFieldsTemplateService.getTemplateFor("wrapper") - Map template = formFieldsTemplateService.findTemplate(propertyAccessor, templateName, fieldFolder ?: templatesFolder, theme) - if (template) { - out << render(template: template.path, plugin: template.plugin, model: model + [attrs: wrapperAttrs] + wrapperAttrs) - } else { - out << renderDefaultField(model, wrapperAttrs) - } - } - } - /** - * Renders a collection of beans in a table - * - * @attr collection REQUIRED The collection of beans to render - * @attr domainClass The FQN of the domain class of the elements in the collection. - * Defaults to the class of the first element in the collection. - * @attr properties OPTIONAL The list of properties to be shown (table columns). - * @attr maxProperties OPTIONAL The number of properties displayed when no explicit properties are given, defaults to 7. - * @attr displayStyle OPTIONAL Determines the display template used for the bean's properties. - * Defaults to 'table', meaning that 'display-table' templates will be used when available. - * @attr order A comma-separated list of properties to include in provided order - * @attr except A comma-separated list of properties to exclude - * @attr theme Theme name - * @attr template OPTIONAL The template used when rendering the collection - */ - def table = { attrs, body -> - def collection = resolveBean(attrs.remove('collection')) - PersistentEntity domainClass - if (attrs.containsKey('domainClass')) { - domainClass = resolveDomainClass((String) attrs.remove('domainClass')) - } else { - domainClass = (collection instanceof Collection) && collection ? resolveDomainClass(collection.iterator().next()) : null - } - - if (domainClass) { - List properties = resolveProperties(domainClass, attrs) - - List columnProperties = properties.collect { propertyAccessor -> - buildColumnModel(propertyAccessor, attrs) - } - - String displayStyle = attrs.remove(DISPLAY_STYLE) - String theme = attrs.remove(THEME_ATTR) - String template = attrs.remove('template') ?: 'table' - - out << render( - template: "/templates/_fields/$template", - model: attrs + [domainClass: domainClass, - domainProperties: columnProperties, - columnProperties: columnProperties, - collection: collection, - displayStyle: displayStyle, - theme: theme]) - } - } - - /** - * @deprecated since version 1.5 - Use widget instead - * @attr bean Name of the source bean in the GSP model. - * @attr property REQUIRED The name of the property to display. This is resolved - * against the specified bean or the bean in the current scope. - */ - def input = { attrs -> - out << widget(attrs) - } - - /** - * @attr bean Name of the source bean in the GSP model. - * @attr property REQUIRED The name of the property to display. This is resolved - * against the specified bean or the bean in the current scope. - * @attr theme Theme name - */ - def widget = { attrs -> - def bean = resolveBean(attrs.remove(BEAN_ATTR)) - if (!bean) throwTagError("Tag [input] is missing required attribute [$BEAN_ATTR]") - if (!attrs.property) throwTagError("Tag [input] is missing required attribute [property]") - - attrs = getPrefixedAttributes(beanStack.innerAttributes) + attrs - - String property = attrs.remove(PROPERTY_ATTR) - String widgetFolder = attrs.remove(WIDGET_ATTR) - String theme = attrs.remove(THEME_ATTR) - - BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) - Map model = buildModel(propertyAccessor, attrs) - - out << renderWidget(propertyAccessor, model, attrs, widgetFolder, theme) - } - - /** - * @attr bean Name of the source bean in the GSP model. - * @attr property REQUIRED The name of the property to display. This is resolved - * against the specified bean or the bean in the current scope. - * @attr theme Theme name - */ - def displayWidget = { attrs -> - def bean = resolveBean(attrs.remove(BEAN_ATTR)) - if (!bean) throwTagError("Tag [displayWidget] is missing required attribute [$BEAN_ATTR]") - if (!attrs[PROPERTY_ATTR]) throwTagError("Tag [displayWidget] is missing required attribute [property]") - - attrs = getPrefixedAttributes(beanStack.innerAttributes) + attrs - - String property = attrs.remove(PROPERTY_ATTR) - String widgetFolder = attrs.remove(WIDGET_ATTR) - String theme = attrs.remove(THEME_ATTR) - - BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) - Map model = buildModel(propertyAccessor, attrs, 'HTML') - - out << renderDisplayWidget(propertyAccessor, model, attrs, widgetFolder, theme) - } - - /** - * @attr bean Name of the source bean in the GSP model. - * @attr property The name of the property to display. This is resolved against the specified bean or the bean in the current scope. - * @attr order A comma-separated list of properties to include in provided order - * @attr except A comma-separated list of properties to exclude - * @attr theme Theme name - * @attr template OPTIONAL The template used when rendering the domainClass - */ - def display = { attrs, body -> - attrs = beanStack.innerAttributes + attrs - def bean = resolveBean(attrs.remove(BEAN_ATTR)) - if (!bean) throwTagError("Tag [display] is missing required attribute [$BEAN_ATTR]") - - String property = attrs.remove(PROPERTY_ATTR) - String templatesFolder = attrs.remove(TEMPLATES_ATTR) - String theme = attrs.remove(THEME_ATTR) - - if (property == null) { - PersistentEntity domainClass = resolveDomainClass(bean) - if (domainClass) { - String template = attrs.remove('template') ?: 'list' - - List properties = resolvePersistentProperties(domainClass, attrs, ExclusionType.Display) - out << render(template: "/templates/_fields/$template", model: attrs + [domainClass: domainClass, domainProperties: properties]) { prop -> - BeanPropertyAccessor propertyAccessor = resolveProperty(bean, prop.name) - Map model = buildModel(propertyAccessor, attrs, 'HTML') - out << raw(renderDisplayWidget(propertyAccessor, model, attrs, templatesFolder, theme)) - } - } - } else { - String displayFolder = attrs.remove(WRAPPER_ATTR) - String widgetFolder = attrs.remove(WIDGET_ATTR) - - BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) - Map model = buildModel(propertyAccessor, attrs, 'HTML') - - Map wrapperAttrs = [:] - Map widgetAttrs = [:] - - String prefixAttribute = formFieldsTemplateService.getWidgetPrefix() ?: 'widget-' - attrs.each { k, v -> - if (k?.startsWith(prefixAttribute)) { - widgetAttrs[k.replace(prefixAttribute, '')] = v - } else { - wrapperAttrs[k] = v - } - } - - - String wrapperFolderTouse = displayFolder ?: templatesFolder - String widgetsFolderToUse = widgetFolder ?: templatesFolder - - if (hasBody(body)) { - model.widget = raw(body(model + [attrs: widgetAttrs] + widgetAttrs)) - model.value = body(model) - } else { - model.widget = renderDisplayWidget(propertyAccessor, model, widgetAttrs, widgetsFolderToUse, theme) - } - - - def displayWrapperTemplateName = formFieldsTemplateService.getTemplateFor("displayWrapper") - def template = formFieldsTemplateService.findTemplate(propertyAccessor, displayWrapperTemplateName, wrapperFolderTouse, theme) - if (template) { - out << render(template: template.path, plugin: template.plugin, model: model + [attrs: wrapperAttrs] + wrapperAttrs) - } else { - out << raw(renderDisplayWidget(propertyAccessor, model, attrs, widgetsFolderToUse, theme)) - } - } - - } - - private Map getPrefixedAttributes(attrs) { - Map widgetAttrs = [:] - attrs.each { k, v -> - String prefixAttribute = formFieldsTemplateService.getWidgetPrefix() - if (k?.startsWith(prefixAttribute)) { - widgetAttrs[k.replace(prefixAttribute, '')] = v - } - } - return widgetAttrs - } - - private void renderEmbeddedProperties(bean, BeanPropertyAccessor propertyAccessor, attrs) { - def legend = resolveMessage(propertyAccessor.labelKeys, propertyAccessor.defaultLabel) - out << applyLayout(name: '_fields/embedded', params: [type: toPropertyNameFormat(propertyAccessor.propertyType), legend: legend]) { - Embedded prop = (Embedded) propertyAccessor.domainProperty - for (embeddedProp in resolvePersistentProperties(prop.associatedEntity, attrs)) { - def propertyPath = "${propertyAccessor.pathFromRoot}.${embeddedProp.name}" - out << field(bean: bean, property: propertyPath, prefix: attrs.prefix, default: attrs.default, field: attrs.field, widget: attrs.widget, theme: attrs[THEME_ATTR]) - } - } - } - - private BeanPropertyAccessor resolveProperty(bean, String propertyPath) { - beanPropertyAccessorFactory.accessorFor(bean, propertyPath) - } - - private List resolveProperties(PersistentEntity domainClass, Map attrs) { - // Starting point for the bean property resolver - def bean = domainClass.javaClass.newInstance() - - List propertyAccessorList = resolvePropertyNames(domainClass, attrs).collect { String propertyPath -> - beanPropertyAccessorFactory.accessorFor(bean, propertyPath) - } - - return propertyAccessorList - - } - - private List resolvePropertyNames(PersistentEntity domainClass, Map attrs) { - if (attrs.containsKey('order')) { - return getList(attrs.order) - } else if (attrs.containsKey('properties')) { - return getList(attrs.remove('properties')) - } else { - List properties = resolvePersistentProperties(domainClass, attrs, ExclusionType.List)*.name - int maxProperties = attrs.containsKey('maxProperties') ? attrs.remove('maxProperties').toInteger() : 7 - if (maxProperties && properties.size() > maxProperties) { - properties = properties[0.. - String errorMsg = null - try { - errorMsg = error instanceof MessageSourceResolvable ? messageSource.getMessage(error, locale) : messageSource.getMessage(error.toString(), null, locale) - } catch (NoSuchMessageException ignored) { - // no-op - } - // unresolved message codes fallback to the defaultMessage and this should - // be escaped as it could be an error message with user input - errorMsg && errorMsg == error.defaultMessage ? message(error: error, encodeAs: "HTML") : message(error: error) - }, - required : attrs.containsKey("required") ? Boolean.valueOf(attrs.remove('required')) : propertyAccessor.required, - invalid : attrs.containsKey("invalid") ? Boolean.valueOf(attrs.remove('invalid')) : propertyAccessor.invalid, - prefix : resolvePrefix(attrs.remove('prefix')), - ] - } - - private CharSequence renderWidget(BeanPropertyAccessor propertyAccessor, Map model, Map attrs = [:], String widgetFolder, String theme) { - String widgetTemplateName = formFieldsTemplateService.getTemplateFor("widget") - Map template = formFieldsTemplateService.findTemplate(propertyAccessor, widgetTemplateName, widgetFolder, theme) - if (template) { - render template: template.path, plugin: template.plugin, model: model + [attrs: attrs] + attrs - } else { - renderDefaultInput propertyAccessor, model, attrs - } - } - - private CharSequence renderDisplayWidget(BeanPropertyAccessor propertyAccessor, Map model, Map attrs = [:], String widgetFolder, String theme) { - String displayStyle = attrs.displayStyle - - Map template = null - if (displayStyle && displayStyle != 'default') { - template = formFieldsTemplateService.findTemplate(propertyAccessor, "displayWidget-$attrs.displayStyle", widgetFolder, theme) - } - if (!template) { - def displayWidgetTemplateName = formFieldsTemplateService.getTemplateFor("displayWidget") - template = formFieldsTemplateService.findTemplate(propertyAccessor, displayWidgetTemplateName, widgetFolder, theme) - } - - if (template) { - render template: template.path, plugin: template.plugin, model: model + [attrs: attrs] + attrs - } else if (!(model.value instanceof CharSequence)) { - renderDefaultDisplay(model, attrs, widgetFolder, theme) - } else { - model.value - } - } - - private resolvePageScopeVariable(attributeName) { - // Tomcat throws NPE if you query pageScope for null/empty values - attributeName?.toString() ? pageScope.variables[attributeName] : null - } - - private BeanAndPrefix resolveBeanAndPrefix(beanAttribute, prefixAttribute, attributes) { - def bean = resolvePageScopeVariable(beanAttribute) ?: beanAttribute - def prefix = resolvePageScopeVariable(prefixAttribute) ?: prefixAttribute - def innerAttributes = attributes.clone() - innerAttributes.remove('bean') - innerAttributes.remove('prefix') - //'except' is a reserved word for the 'all' tag: https://github.com/grails-fields-plugin/grails-fields/issues/12 - innerAttributes.remove('except') - new BeanAndPrefix(bean: bean, prefix: prefix, innerAttributes: innerAttributes) - } - - private Object resolveBean(beanAttribute) { - resolvePageScopeVariable(beanAttribute) ?: beanAttribute ?: beanStack.bean - } - - private String resolvePrefix(prefixAttribute) { - def prefix = resolvePageScopeVariable(prefixAttribute) ?: prefixAttribute ?: beanStack.prefix - if (prefix && !prefix.endsWith('.')) { - prefix = prefix + '.' - } - prefix ?: '' - } - - private PersistentEntity resolveDomainClass(bean) { - resolveDomainClass(bean.getClass()) - } - - private PersistentEntity resolveDomainClass(Class beanClass) { - resolveDomainClass(beanClass.name) - } - - private PersistentEntity resolveDomainClass(String beanClassName) { - mappingContexts.findResult { MappingContext mappingContext -> - mappingContext.getPersistentEntity(beanClassName) - } - } - - private List resolvePersistentProperties(PersistentEntity domainClass, Map attrs, ExclusionType exclusionType = ExclusionType.Input) { - List properties - - boolean list = exclusionType == ExclusionType.List - if (attrs.order) { - def orderBy = getList(attrs.order) - if (attrs.except) { - orderBy = orderBy - getList(attrs.except) - } - properties = orderBy.collect { propertyName -> - fieldsDomainPropertyFactory.build(domainClass.getPropertyByName(propertyName)) - } - } else { - properties = list ? domainModelService.getListOutputProperties(domainClass) : domainModelService.getInputProperties(domainClass, - exclusionType == ExclusionType.Input? exclusionsInput : exclusionsDisplay) - // If 'except' is not set, but 'list' is, exclude 'id', 'dateCreated' and 'lastUpdated' by default - List blacklist = attrs.containsKey('except') ? getList(attrs.except) : (list ? exclusionsList : []) - - properties.removeAll { it.name in blacklist } - } - - return properties - } - - private static List getList(def except, List defaultList = []) { - if (!except) { - return defaultList - } else if (except instanceof String) { - except?.tokenize(',')*.trim() - } else if (except instanceof Collection) { - return except as List - } else { - throw new IllegalArgumentException("Must either be null, comma separated string or java.util.Collection") - } - } - - private boolean hasBody(Closure body) { - return body && !body.is(GroovyPage.EMPTY_BODY_CLOSURE) - } - - private CharSequence resolveLabelText(BeanPropertyAccessor propertyAccessor, Map attrs) { - def labelText - def label = attrs.remove('label') - if (label) { - labelText = message(code: label, default: label) - } - if (!labelText && propertyAccessor.labelKeys) { - labelText = resolveMessage(propertyAccessor.labelKeys, propertyAccessor.defaultLabel) - } - if (!labelText) { - labelText = propertyAccessor.defaultLabel - } - return labelText - } - - private CharSequence resolveMessage(List keysInPreferenceOrder, String defaultMessage) { - def message = keysInPreferenceOrder.findResult { key -> - message(code: key, default: null) ?: null - } - if (log.traceEnabled && !message) { - log.trace("i18n missing translation for one of ${keysInPreferenceOrder}") - } - message ?: defaultMessage - } - - protected CharSequence renderDefaultField(Map model, Map attrs = [:]) { - List classes = [attrs['class'] ?: 'fieldcontain'] - if (model.invalid) classes << (attrs.remove('invalidClass') ?: 'error') - if (model.required) classes << (attrs.remove('requiredClass') ?: 'required') - attrs['class'] = classes.join(' ').trim() - Writer writer = new FastStringWriter() - def mb = new MarkupBuilder(writer) - mb.setDoubleQuotes(true) - mb.div(class: attrs['class']) { - label(class: attrs.labelClass, for: (model.prefix ?: '') + model.property, model.label) { - if (model.required) { - span(class: 'required-indicator', '*') - } - } - if (attrs.divClass) { - div(class: attrs.divClass) { - renderWidget(mkp, model) - } - } else { - renderWidget(mkp, model) - } - } - writer.buffer - } - - private void renderWidget(MarkupBuilderHelper mkp, Map model) { - // TODO: encoding information of widget gets lost - don't use MarkupBuilder - def widget = model.widget - if (widget != null) { - mkp.yieldUnescaped widget - } - } - - CharSequence renderDefaultInput(Map model, Map attrs = [:]) { - renderDefaultInput(null, model, attrs) - } - - CharSequence renderDefaultInput(BeanPropertyAccessor propertyAccessor, Map model, Map attrs = [:]) { - Constrained constrained = (Constrained) model.constraints - attrs.name = (model.prefix ?: '') + model.property - attrs.value = model.value - if (model.required) attrs.required = "" // TODO: configurable how this gets output? Some people prefer required="required" - if (model.invalid) attrs.invalid = "" - if (!isEditable(constrained)) attrs.readonly = "" - - boolean oneToOne = false - boolean manyToOne = false - boolean manyToMany = false - boolean oneToMany = false - if (model.containsKey('persistentProperty')) { - if (model.persistentProperty instanceof PersistentProperty) { - PersistentProperty prop = (PersistentProperty) model.persistentProperty - oneToOne = prop instanceof OneToOne - manyToOne = prop instanceof ManyToOne - manyToMany = prop instanceof ManyToMany - oneToMany = prop instanceof OneToMany - } - } - - // TODO: https://github.com/gpc/fields/issues/392 - boolean datePicker = model.type in [Date, Calendar, java.sql.Date, java.sql.Time, LocalDate, LocalDateTime] - if (!datePicker) { - attrs.remove('selectDateClass') - } - boolean checkBox = model.type in [boolean, Boolean] - String checkBoxClass = attrs.remove('checkBoxClass') - if (checkBox && checkBoxClass) { - attrs['class'] = checkBoxClass - } - - if (model.type in [String, null]) { - return renderStringInput(model, attrs) - } else if (checkBox) { - return g.checkBox(attrs) - } else if (model.type.isPrimitive() || model.type in Number) { - return renderNumericInput(propertyAccessor, model, attrs) - } else if (model.type in URL) { - return g.field(attrs + [type: "url"]) - } else if (model.type.isEnum()) { - return renderEnumInput(model, attrs) - } else if (oneToOne || manyToOne || manyToMany) { - return renderAssociationInput(model, attrs) - } else if (oneToMany) { - return renderOneToManyInput(model, attrs) - } else if (datePicker) { - return renderDateTimeInput(model, attrs) - } else if (model.type in [byte[], Byte[], Blob]) { - return g.field(attrs + [type: "file"]) - } else if (model.type in [TimeZone, Currency, Locale]) { - if (!model.required) attrs.noSelection = ["": ""] - return g."${GrailsStringUtils.uncapitalize(model.type.simpleName)}Select"(attrs) - } else { - return null - } - } - - - CharSequence renderDateTimeInput(Map model, Map attrs) { - attrs.precision = model.type in [java.sql.Time, LocalDateTime]? "minute" : "day" - if (!model.required) { - attrs.noSelection = ["": ""] - attrs.default = "none" - } - return g.datePicker(attrs) - } - - CharSequence renderStringInput(Map model, Map attrs) { - Constrained constrained = (Constrained) model.constraints - - if (!attrs.type) { - if (constrained?.inList) { - attrs.from = constrained.inList - if (!model.required) { - attrs.noSelection = ["": ""] - } - return g.select(attrs) - } else if (constrained?.password) { - attrs.type = "password" - attrs.remove('value') - } else if (constrained?.email) { - attrs.type = "email" - } else if (constrained?.url) { - attrs.type = "url" - } else { - attrs.type = "text" - } - } - - if (constrained?.matches) { attrs.pattern = constrained.matches } - if (constrained?.maxSize) { attrs.maxlength = constrained.maxSize } - - if (constrained?.widget == 'textarea') { - attrs.remove('type') - return g.textArea(attrs) - } - return g.field(attrs) - } - - CharSequence renderNumericInput(BeanPropertyAccessor propertyAccessor, Map model, Map attrs) { - Constrained constrained = (Constrained) model.constraints - - if (!attrs.type && constrained?.inList) { - attrs.from = constrained.inList - if (!model.required) attrs.noSelection = ["": ""] - return g.select(attrs) - } else if (constrained?.range) { - attrs.type = attrs.type ?: "range" - attrs.min = constrained.range.from - attrs.max = constrained.range.to - } else { - attrs.type = attrs.type ?: getDefaultNumberType(model) - if (constrained?.scale != null) attrs.step = "0.${'0' * (constrained.scale - 1)}1" - if (constrained?.min != null) attrs.min = constrained.min - if (constrained?.max != null) attrs.max = constrained.max - } - - if (localizeNumbers && propertyAccessor?.value != null) { - attrs.value = numberFormatter.format(propertyAccessor.value) - } - - return g.field(attrs) - } - - @CompileStatic - protected NumberFormat getNumberFormatter() { - NumberFormat.getInstance(getLocale()) - } - - @CompileStatic - protected Locale getLocale() { - def locale - def request = GrailsWebRequest.lookup()?.currentRequest - if (request instanceof HttpServletRequest) { - locale = localeResolver?.resolveLocale(request) - } - if (locale == null) { - locale = Locale.default - } - return locale - } - - @CompileStatic - protected String getDefaultNumberType(Map model) { - Class modelType = (Class) model.type - - def typeName = modelType.simpleName.toLowerCase() - if (typeName in DECIMAL_TYPES) { - return "number decimal" - } else { - return "number" - } - - } - - private CharSequence renderEnumInput(Map model, Map attrs) { - Constrained constrained = (Constrained) model.constraints - - if (attrs.value instanceof Enum) - attrs.value = attrs.value.name() - if (!model.required) attrs.noSelection = ["": ""] - - if (constrained?.inList) { - attrs.keys = constrained.inList*.name() - attrs.from = constrained.inList - } else { - attrs.keys = model.type.values()*.name() - attrs.from = model.type.values() - } - return g.select(attrs) - } - - private CharSequence renderAssociationInput(Map model, Map attrs) { - attrs.id = (model.prefix ?: '') + model.property - def persistentProperty = model.persistentProperty - Class referencedPropertyType - boolean manyToMany = false - if (persistentProperty instanceof Association) { - Association prop = ((Association) persistentProperty) - PersistentEntity entity = prop.getAssociatedEntity() - if (entity != null) { - referencedPropertyType = entity.getJavaClass() - } else if (prop.isBasic()) { - referencedPropertyType = ((Basic) prop).getComponentType() - } - manyToMany = prop instanceof ManyToMany - } - attrs.from = null != attrs.from ? attrs.from : referencedPropertyType.list() - attrs.optionKey = "id" // TODO: handle alternate id names - if (manyToMany) { - attrs.multiple = "" - attrs.value = model.value*.id - attrs.name = "${model.prefix ?: ''}${model.property}" - } else { - if (!model.required) attrs.noSelection = ["null": ""] - attrs.value = model.value?.id - attrs.name = "${model.prefix ?: ''}${model.property}.id" - } - return g.select(attrs) - } - - private CharSequence renderOneToManyInput(Map model, Map attrs) { - Writer buffer = new FastStringWriter() - buffer << '

      ' - def persistentProperty = model.persistentProperty - def controllerName - def shortName - if (persistentProperty instanceof Association) { - Association prop = ((Association) persistentProperty) - controllerName = prop.associatedEntity.decapitalizedName - shortName = prop.associatedEntity.javaClass.simpleName - } - - attrs.value.each { - buffer << '
    • ' - buffer << g.link(controller: controllerName, action: "show", id: it.id, it.toString().encodeAsHTML()) - buffer << '
    • ' - } - buffer << '
    ' - def referencedTypeLabel = message(code: "${controllerName}.label", default: shortName) - def addLabel = g.message(code: 'default.add.label', args: [referencedTypeLabel]) - PersistentEntity beanClass = (PersistentEntity) model.beanClass - buffer << g.link(controller: controllerName, action: "create", params: [("${beanClass.decapitalizedName}.id".toString()): model.bean.id], addLabel) - buffer.buffer - } - - private CharSequence renderDefaultDisplay(Map model, Map attrs = [:], String templatesFolder, String theme) { - def persistentProperty = model.persistentProperty - if (persistentProperty instanceof Association) { - if (persistentProperty.embedded) { - return (attrs.displayStyle == 'table') ? model.value?.toString().encodeAsHTML() : - displayEmbedded(model.value, persistentProperty.associatedEntity, attrs, templatesFolder, theme) - } else if (persistentProperty instanceof OneToMany || persistentProperty instanceof ManyToMany) { - return displayAssociationList(model.value, ((Association) persistentProperty).associatedEntity) - } else { - return displayAssociation(model.value, ((Association) persistentProperty).associatedEntity) - } - } - - switch (model.type) { - case Boolean.TYPE: - case Boolean: - g.formatBoolean(boolean: model.value) - break - case Calendar: - case Date: - case java.sql.Date: - case java.sql.Time: - case LocalDate: - case LocalDateTime: - g.formatDate(date: model.value) - break - default: - g.fieldValue bean: model.bean, field: model.property - } - } - - private CharSequence displayEmbedded(bean, PersistentEntity domainClass, Map attrs, String templatesFolder, String theme) { - Writer buffer = new FastStringWriter() - def properties = domainModelService.getOutputProperties(domainClass) - buffer << render(template: "/templates/_fields/list", model: [domainClass: domainClass, domainProperties: properties]) { prop -> - def propertyAccessor = resolveProperty(bean, prop.name) - def model = buildModel(propertyAccessor, attrs) - out << raw(renderDisplayWidget(propertyAccessor, model, attrs, templatesFolder, theme)) - } - buffer.buffer - } - - private CharSequence displayAssociationList(values, PersistentEntity referencedDomainClass) { - Writer buffer = new FastStringWriter() - buffer << '
      ' - for (value in values) { - buffer << '
    • ' - buffer << displayAssociation(value, referencedDomainClass) - buffer << '
    • ' - } - buffer << '
    ' - buffer.buffer - } - - private CharSequence displayAssociation(value, PersistentEntity referencedDomainClass) { - if (value && referencedDomainClass) { - g.link(controller: referencedDomainClass.decapitalizedName, action: "show", id: value.id, value.toString().encodeAsHTML()) - } else if (value) { - value.toString() - } - } - - private boolean isEditable(Constrained constraints) { - !constraints || constraints.editable + static final namespace = 'f' + + static final String STACK_PAGE_SCOPE_VARIABLE = 'f:with:stack' + private static final List DECIMAL_TYPES = ['double', 'float', 'bigdecimal'] + + private static final String THEME_ATTR = "theme" + private static final String WIDGET_ATTR = "widget" + private static final String WRAPPER_ATTR = "wrapper" + private static final String TEMPLATES_ATTR = "templates" + private static final String PROPERTY_ATTR = "property" + private static final String BEAN_ATTR = "bean" + public static final String DISPLAY_STYLE = 'displayStyle' + + @Value('${grails.plugin.fields.localizeNumbers:true}') + Boolean localizeNumbers + + @Value('${grails.plugin.fields.exclusions.list:#{T(java.util.Arrays).asList("id", "dateCreated", "lastUpdated")}}') + List exclusionsList + @Value('${grails.plugin.fields.exclusions.input:#{T(java.util.Arrays).asList("version", "dateCreated", "lastUpdated")}}') + List exclusionsInput + @Value('${grails.plugin.fields.exclusions.display:#{T(java.util.Arrays).asList("version", "dateCreated", "lastUpdated")}}') + List exclusionsDisplay + + enum ExclusionType { + List, Display, Input + } + + FormFieldsTemplateService formFieldsTemplateService + BeanPropertyAccessorFactory beanPropertyAccessorFactory + DomainPropertyFactory fieldsDomainPropertyFactory + + @Autowired(required = false) + Collection mappingContexts + + DomainModelService domainModelService + LocaleResolver localeResolver + CodecLookup codecLookup + MessageSource messageSource + + static defaultEncodeAs = [taglib: 'raw'] + + class BeanAndPrefix { + Object bean + String prefix + Map innerAttributes = [:] + } + + class BeanAndPrefixStack extends Stack { + Object getBean() { + empty() ? null : peek().bean + } + + String getPrefix() { + empty() ? null : peek().prefix + } + + Map getInnerAttributes() { + empty() ? [:] : peek().innerAttributes + } + + String toString() { + bean?.toString() ?: '' + } + } + + BeanAndPrefixStack getBeanStack() { + if (!pageScope.hasVariable(STACK_PAGE_SCOPE_VARIABLE)) { + pageScope.setVariable(STACK_PAGE_SCOPE_VARIABLE, new BeanAndPrefixStack()) + } + pageScope.variables[STACK_PAGE_SCOPE_VARIABLE] + } + + /** + * @attr bean REQUIRED Name of the source bean in the GSP model. + * @attr prefix Prefix to add to input element names. + */ + def with = { attrs, body -> + if (!attrs[BEAN_ATTR]) throwTagError("Tag [with] is missing required attribute [$BEAN_ATTR]") + BeanAndPrefix beanPrefix = resolveBeanAndPrefix(attrs[BEAN_ATTR], attrs.prefix, attrs) + try { + beanStack.push(beanPrefix) + out << body() + } finally { + beanStack.pop() + } + } + + /** + * @attr bean REQUIRED Name of the source bean in the GSP model. + * @attr order A comma-separated list of properties to include in provided order + * @attr except A comma-separated list of properties to exclude from the generated list of input fields + * @attr prefix Prefix to add to input element names. + */ + def all = { attrs -> + if (!attrs[BEAN_ATTR]) throwTagError("Tag [all] is missing required attribute [$BEAN_ATTR]") + BeanAndPrefix beanPrefix = resolveBeanAndPrefix(attrs[BEAN_ATTR], attrs.prefix, attrs) + try { + beanStack.push(beanPrefix) + def bean = resolveBean(attrs[BEAN_ATTR]) + def prefix = resolvePrefix(attrs.prefix) + def domainClass = resolveDomainClass(bean) + if (domainClass) { + for (property in resolvePersistentProperties(domainClass, attrs)) { + out << field([bean: bean, property: property.name, prefix: prefix]) + } + } else { + throwTagError('Tag [all] currently only supports domain types') + } + } finally { + beanStack.pop() + } + } + + /** + * @attr bean Name of the source bean in the GSP model. + * @attr property REQUIRED The name of the property to display. This is resolved + * against the specified bean or the bean in the current scope. + * @attr value Specifies the initial value to display in the field. The default is + * the current value of the property. + * @attr default A default initial value to display if the actual property value + * evaluates to {@code false}. + * @attr required Specifies whether the user is required to enter a value for this + * property. By default, this is determined by the constraints of the property. + * @attr invalid Specifies whether this property is invalid or not. By default, this + * is determined by whether there are any errors associated with it. + * @attr label Overrides the default label displayed next to the input field. + * @attr prefix Prefix to add to input element names. + * @attr wrapper Specify the folder inside _fields where to look up for the wrapper template. + * @attr widget Specify the folder inside _fields where to look up for the widget template. + * @attr templates Specify the folder inside _fields where to look up for the wrapper and widget template. + * @attr theme Theme name + * @attr css html css attribute for wrapper (default: field-contain) + * @attr divClass class for optional div that will be added if set and contain the widget (default: no div created) + * @attr invalidClass class added to wrapper that if property is invalid. (default: error) Also available for widget. + * @attr requiredClass class added to wrapper when property is required. (default: required) Also available for widget. + */ + def field = { attrs, body -> + attrs = beanStack.innerAttributes + attrs + if (attrs.containsKey(BEAN_ATTR) && !attrs[BEAN_ATTR]) throwTagError("Tag [field] requires a non-null value for attribute [$BEAN_ATTR]") + if (!attrs[PROPERTY_ATTR]) throwTagError("Tag [field] is missing required attribute [$PROPERTY_ATTR]") + + def bean = resolveBean(attrs.remove(BEAN_ATTR)) + String property = attrs.remove(PROPERTY_ATTR) + String templatesFolder = attrs.remove(TEMPLATES_ATTR) + String fieldFolder = attrs.remove(WRAPPER_ATTR) + String widgetFolder = attrs.remove(WIDGET_ATTR) + String theme = attrs.remove(THEME_ATTR) + + BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) + if (propertyAccessor.domainProperty instanceof Embedded) { + renderEmbeddedProperties(bean, propertyAccessor, attrs + [templates: templatesFolder, field: fieldFolder, input: widgetFolder, theme: theme]) + } else { + Map model = buildModel(propertyAccessor, attrs) + Map wrapperAttrs = [:] + Map widgetAttrs = [:] + + String prefixAttribute = formFieldsTemplateService.getWidgetPrefix() ?: 'widget-' + attrs.each { k, v -> + if (k?.startsWith(prefixAttribute)) { + widgetAttrs[k.replace(prefixAttribute, '')] = v + } else { + wrapperAttrs[k] = v + } + } + + List widgetClasses = [widgetAttrs['class'] ?: ''] + String cssClass = widgetAttrs.remove('invalidClass') + if (cssClass && model.invalid) { + widgetClasses << cssClass + } + cssClass = widgetAttrs.remove('requiredClass') + if (cssClass && model.required) { + widgetClasses << cssClass + } + widgetAttrs['class'] = widgetClasses.join(' ').trim() + if (widgetAttrs['class'].isEmpty()) { + widgetAttrs.remove('class') + } + if (hasBody(body)) { + model.widget = raw(body(model + [attrs: widgetAttrs] + widgetAttrs)) + } else { + model.widget = renderWidget(propertyAccessor, model, widgetAttrs, widgetFolder ?: templatesFolder, theme) + } + + String templateName = formFieldsTemplateService.getTemplateFor("wrapper") + Map template = formFieldsTemplateService.findTemplate(propertyAccessor, templateName, fieldFolder ?: templatesFolder, theme) + if (template) { + out << render(template: template.path, plugin: template.plugin, model: model + [attrs: wrapperAttrs] + wrapperAttrs) + } else { + out << renderDefaultField(model, wrapperAttrs) + } + } + } + /** + * Renders a collection of beans in a table + * + * @attr collection REQUIRED The collection of beans to render + * @attr domainClass The FQN of the domain class of the elements in the collection. + * Defaults to the class of the first element in the collection. + * @attr properties OPTIONAL The list of properties to be shown (table columns). + * @attr maxProperties OPTIONAL The number of properties displayed when no explicit properties are given, defaults to 7. + * @attr displayStyle OPTIONAL Determines the display template used for the bean's properties. + * Defaults to 'table', meaning that 'display-table' templates will be used when available. + * @attr order A comma-separated list of properties to include in provided order + * @attr except A comma-separated list of properties to exclude + * @attr theme Theme name + * @attr template OPTIONAL The template used when rendering the collection + */ + def table = { attrs, body -> + def collection = resolveBean(attrs.remove('collection')) + PersistentEntity domainClass + if (attrs.containsKey('domainClass')) { + domainClass = resolveDomainClass((String) attrs.remove('domainClass')) + } else { + domainClass = (collection instanceof Collection) && collection ? resolveDomainClass(collection.iterator().next()) : null + } + + if (domainClass) { + List properties = resolveProperties(domainClass, attrs) + + List columnProperties = properties.collect { propertyAccessor -> + buildColumnModel(propertyAccessor, attrs) + } + + String displayStyle = attrs.remove(DISPLAY_STYLE) + String theme = attrs.remove(THEME_ATTR) + String template = attrs.remove('template') ?: 'table' + + out << render( + template: "/templates/_fields/$template", + model: attrs + [domainClass: domainClass, + domainProperties: columnProperties, + columnProperties: columnProperties, + collection: collection, + displayStyle: displayStyle, + theme: theme]) + } + } + + /** + * @deprecated since version 1.5 - Use widget instead + * @attr bean Name of the source bean in the GSP model. + * @attr property REQUIRED The name of the property to display. This is resolved + * against the specified bean or the bean in the current scope. + */ + def input = { attrs -> + out << widget(attrs) + } + + /** + * @attr bean Name of the source bean in the GSP model. + * @attr property REQUIRED The name of the property to display. This is resolved + * against the specified bean or the bean in the current scope. + * @attr theme Theme name + */ + def widget = { attrs -> + def bean = resolveBean(attrs.remove(BEAN_ATTR)) + if (!bean) throwTagError("Tag [input] is missing required attribute [$BEAN_ATTR]") + if (!attrs.property) throwTagError("Tag [input] is missing required attribute [property]") + + attrs = getPrefixedAttributes(beanStack.innerAttributes) + attrs + + String property = attrs.remove(PROPERTY_ATTR) + String widgetFolder = attrs.remove(WIDGET_ATTR) + String theme = attrs.remove(THEME_ATTR) + + BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) + Map model = buildModel(propertyAccessor, attrs) + + out << renderWidget(propertyAccessor, model, attrs, widgetFolder, theme) + } + + /** + * @attr bean Name of the source bean in the GSP model. + * @attr property REQUIRED The name of the property to display. This is resolved + * against the specified bean or the bean in the current scope. + * @attr theme Theme name + */ + def displayWidget = { attrs -> + def bean = resolveBean(attrs.remove(BEAN_ATTR)) + if (!bean) throwTagError("Tag [displayWidget] is missing required attribute [$BEAN_ATTR]") + if (!attrs[PROPERTY_ATTR]) throwTagError("Tag [displayWidget] is missing required attribute [property]") + + attrs = getPrefixedAttributes(beanStack.innerAttributes) + attrs + + String property = attrs.remove(PROPERTY_ATTR) + String widgetFolder = attrs.remove(WIDGET_ATTR) + String theme = attrs.remove(THEME_ATTR) + + BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) + Map model = buildModel(propertyAccessor, attrs, 'HTML') + + out << renderDisplayWidget(propertyAccessor, model, attrs, widgetFolder, theme) + } + + /** + * @attr bean Name of the source bean in the GSP model. + * @attr property The name of the property to display. This is resolved against the specified bean or the bean in the current scope. + * @attr order A comma-separated list of properties to include in provided order + * @attr except A comma-separated list of properties to exclude + * @attr theme Theme name + * @attr template OPTIONAL The template used when rendering the domainClass + */ + def display = { attrs, body -> + attrs = beanStack.innerAttributes + attrs + def bean = resolveBean(attrs.remove(BEAN_ATTR)) + if (!bean) throwTagError("Tag [display] is missing required attribute [$BEAN_ATTR]") + + String property = attrs.remove(PROPERTY_ATTR) + String templatesFolder = attrs.remove(TEMPLATES_ATTR) + String theme = attrs.remove(THEME_ATTR) + + if (property == null) { + PersistentEntity domainClass = resolveDomainClass(bean) + if (domainClass) { + String template = attrs.remove('template') ?: 'list' + + List properties = resolvePersistentProperties(domainClass, attrs, ExclusionType.Display) + out << render(template: "/templates/_fields/$template", model: attrs + [domainClass: domainClass, domainProperties: properties]) { prop -> + BeanPropertyAccessor propertyAccessor = resolveProperty(bean, prop.name) + Map model = buildModel(propertyAccessor, attrs, 'HTML') + out << raw(renderDisplayWidget(propertyAccessor, model, attrs, templatesFolder, theme)) + } + } + } else { + String displayFolder = attrs.remove(WRAPPER_ATTR) + String widgetFolder = attrs.remove(WIDGET_ATTR) + + BeanPropertyAccessor propertyAccessor = resolveProperty(bean, property) + Map model = buildModel(propertyAccessor, attrs, 'HTML') + + Map wrapperAttrs = [:] + Map widgetAttrs = [:] + + String prefixAttribute = formFieldsTemplateService.getWidgetPrefix() ?: 'widget-' + attrs.each { k, v -> + if (k?.startsWith(prefixAttribute)) { + widgetAttrs[k.replace(prefixAttribute, '')] = v + } else { + wrapperAttrs[k] = v + } + } + + + String wrapperFolderTouse = displayFolder ?: templatesFolder + String widgetsFolderToUse = widgetFolder ?: templatesFolder + + if (hasBody(body)) { + model.widget = raw(body(model + [attrs: widgetAttrs] + widgetAttrs)) + model.value = body(model) + } else { + model.widget = renderDisplayWidget(propertyAccessor, model, widgetAttrs, widgetsFolderToUse, theme) + } + + + def displayWrapperTemplateName = formFieldsTemplateService.getTemplateFor("displayWrapper") + def template = formFieldsTemplateService.findTemplate(propertyAccessor, displayWrapperTemplateName, wrapperFolderTouse, theme) + if (template) { + out << render(template: template.path, plugin: template.plugin, model: model + [attrs: wrapperAttrs] + wrapperAttrs) + } else { + out << raw(renderDisplayWidget(propertyAccessor, model, attrs, widgetsFolderToUse, theme)) + } + } + + } + + private Map getPrefixedAttributes(attrs) { + Map widgetAttrs = [:] + attrs.each { k, v -> + String prefixAttribute = formFieldsTemplateService.getWidgetPrefix() + if (k?.startsWith(prefixAttribute)) { + widgetAttrs[k.replace(prefixAttribute, '')] = v + } + } + return widgetAttrs + } + + private void renderEmbeddedProperties(bean, BeanPropertyAccessor propertyAccessor, attrs) { + def legend = resolveMessage(propertyAccessor.labelKeys, propertyAccessor.defaultLabel) + out << applyLayout(name: '_fields/embedded', params: [type: toPropertyNameFormat(propertyAccessor.propertyType), legend: legend]) { + Embedded prop = (Embedded) propertyAccessor.domainProperty + for (embeddedProp in resolvePersistentProperties(prop.associatedEntity, attrs)) { + def propertyPath = "${propertyAccessor.pathFromRoot}.${embeddedProp.name}" + out << field(bean: bean, property: propertyPath, prefix: attrs.prefix, default: attrs.default, field: attrs.field, widget: attrs.widget, theme: attrs[THEME_ATTR]) + } + } + } + + private BeanPropertyAccessor resolveProperty(bean, String propertyPath) { + beanPropertyAccessorFactory.accessorFor(bean, propertyPath) + } + + private List resolveProperties(PersistentEntity domainClass, Map attrs) { + // Starting point for the bean property resolver + def bean = domainClass.javaClass.newInstance() + + List propertyAccessorList = resolvePropertyNames(domainClass, attrs).collect { String propertyPath -> + beanPropertyAccessorFactory.accessorFor(bean, propertyPath) + } + + return propertyAccessorList + + } + + private List resolvePropertyNames(PersistentEntity domainClass, Map attrs) { + if (attrs.containsKey('order')) { + return getList(attrs.order) + } else if (attrs.containsKey('properties')) { + return getList(attrs.remove('properties')) + } else { + List properties = resolvePersistentProperties(domainClass, attrs, ExclusionType.List)*.name + int maxProperties = attrs.containsKey('maxProperties') ? attrs.remove('maxProperties').toInteger() : 7 + if (maxProperties && properties.size() > maxProperties) { + properties = properties[0.. + String errorMsg = null + try { + errorMsg = error instanceof MessageSourceResolvable ? messageSource.getMessage(error, locale) : messageSource.getMessage(error.toString(), null, locale) + } catch (NoSuchMessageException ignored) { + // no-op + } + // unresolved message codes fallback to the defaultMessage and this should + // be escaped as it could be an error message with user input + errorMsg && errorMsg == error.defaultMessage ? message(error: error, encodeAs: "HTML") : message(error: error) + }, + required : attrs.containsKey("required") ? Boolean.valueOf(attrs.remove('required')) : propertyAccessor.required, + invalid : attrs.containsKey("invalid") ? Boolean.valueOf(attrs.remove('invalid')) : propertyAccessor.invalid, + prefix : resolvePrefix(attrs.remove('prefix')), + ] + } + + private CharSequence renderWidget(BeanPropertyAccessor propertyAccessor, Map model, Map attrs = [:], String widgetFolder, String theme) { + String widgetTemplateName = formFieldsTemplateService.getTemplateFor("widget") + Map template = formFieldsTemplateService.findTemplate(propertyAccessor, widgetTemplateName, widgetFolder, theme) + if (template) { + render template: template.path, plugin: template.plugin, model: model + [attrs: attrs] + attrs + } else { + renderDefaultInput propertyAccessor, model, attrs + } + } + + private CharSequence renderDisplayWidget(BeanPropertyAccessor propertyAccessor, Map model, Map attrs = [:], String widgetFolder, String theme) { + String displayStyle = attrs.displayStyle + + Map template = null + if (displayStyle && displayStyle != 'default') { + template = formFieldsTemplateService.findTemplate(propertyAccessor, "displayWidget-$attrs.displayStyle", widgetFolder, theme) + } + if (!template) { + def displayWidgetTemplateName = formFieldsTemplateService.getTemplateFor("displayWidget") + template = formFieldsTemplateService.findTemplate(propertyAccessor, displayWidgetTemplateName, widgetFolder, theme) + } + + if (template) { + render template: template.path, plugin: template.plugin, model: model + [attrs: attrs] + attrs + } else if (!(model.value instanceof CharSequence)) { + renderDefaultDisplay(model, attrs, widgetFolder, theme) + } else { + model.value + } + } + + private resolvePageScopeVariable(attributeName) { + // Tomcat throws NPE if you query pageScope for null/empty values + attributeName?.toString() ? pageScope.variables[attributeName] : null + } + + private BeanAndPrefix resolveBeanAndPrefix(beanAttribute, prefixAttribute, attributes) { + def bean = resolvePageScopeVariable(beanAttribute) ?: beanAttribute + def prefix = resolvePageScopeVariable(prefixAttribute) ?: prefixAttribute + def innerAttributes = attributes.clone() + innerAttributes.remove('bean') + innerAttributes.remove('prefix') + //'except' is a reserved word for the 'all' tag: https://github.com/grails-fields-plugin/grails-fields/issues/12 + innerAttributes.remove('except') + new BeanAndPrefix(bean: bean, prefix: prefix, innerAttributes: innerAttributes) + } + + private Object resolveBean(beanAttribute) { + resolvePageScopeVariable(beanAttribute) ?: beanAttribute ?: beanStack.bean + } + + private String resolvePrefix(prefixAttribute) { + def prefix = resolvePageScopeVariable(prefixAttribute) ?: prefixAttribute ?: beanStack.prefix + if (prefix && !prefix.endsWith('.')) { + prefix = prefix + '.' + } + prefix ?: '' + } + + private PersistentEntity resolveDomainClass(bean) { + resolveDomainClass(bean.getClass()) + } + + private PersistentEntity resolveDomainClass(Class beanClass) { + resolveDomainClass(beanClass.name) + } + + private PersistentEntity resolveDomainClass(String beanClassName) { + mappingContexts.findResult { MappingContext mappingContext -> + mappingContext.getPersistentEntity(beanClassName) + } + } + + private List resolvePersistentProperties(PersistentEntity domainClass, Map attrs, ExclusionType exclusionType = ExclusionType.Input) { + List properties + + boolean list = exclusionType == ExclusionType.List + if (attrs.order) { + def orderBy = getList(attrs.order) + if (attrs.except) { + orderBy = orderBy - getList(attrs.except) + } + properties = orderBy.collect { propertyName -> + fieldsDomainPropertyFactory.build(domainClass.getPropertyByName(propertyName)) + } + } else { + properties = list ? domainModelService.getListOutputProperties(domainClass) : domainModelService.getInputProperties(domainClass, + exclusionType == ExclusionType.Input? exclusionsInput : exclusionsDisplay) + // If 'except' is not set, but 'list' is, exclude 'id', 'dateCreated' and 'lastUpdated' by default + List blacklist = attrs.containsKey('except') ? getList(attrs.except) : (list ? exclusionsList : []) + + properties.removeAll { it.name in blacklist } + } + + return properties + } + + private static List getList(def except, List defaultList = []) { + if (!except) { + return defaultList + } else if (except instanceof String) { + except?.tokenize(',')*.trim() + } else if (except instanceof Collection) { + return except as List + } else { + throw new IllegalArgumentException("Must either be null, comma separated string or java.util.Collection") + } + } + + private boolean hasBody(Closure body) { + return body && !body.is(GroovyPage.EMPTY_BODY_CLOSURE) + } + + private CharSequence resolveLabelText(BeanPropertyAccessor propertyAccessor, Map attrs) { + def labelText + def label = attrs.remove('label') + if (label) { + labelText = message(code: label, default: label) + } + if (!labelText && propertyAccessor.labelKeys) { + labelText = resolveMessage(propertyAccessor.labelKeys, propertyAccessor.defaultLabel) + } + if (!labelText) { + labelText = propertyAccessor.defaultLabel + } + return labelText + } + + private CharSequence resolveMessage(List keysInPreferenceOrder, String defaultMessage) { + def message = keysInPreferenceOrder.findResult { key -> + message(code: key, default: null) ?: null + } + if (log.traceEnabled && !message) { + log.trace("i18n missing translation for one of ${keysInPreferenceOrder}") + } + message ?: defaultMessage + } + + protected CharSequence renderDefaultField(Map model, Map attrs = [:]) { + List classes = [attrs['class'] ?: 'fieldcontain'] + if (model.invalid) classes << (attrs.remove('invalidClass') ?: 'error') + if (model.required) classes << (attrs.remove('requiredClass') ?: 'required') + attrs['class'] = classes.join(' ').trim() + Writer writer = new FastStringWriter() + def mb = new MarkupBuilder(writer) + mb.setDoubleQuotes(true) + mb.div(class: attrs['class']) { + label(class: attrs.labelClass, for: (model.prefix ?: '') + model.property, model.label) { + if (model.required) { + span(class: 'required-indicator', '*') + } + } + if (attrs.divClass) { + div(class: attrs.divClass) { + renderWidget(mkp, model) + } + } else { + renderWidget(mkp, model) + } + } + writer.buffer + } + + private void renderWidget(MarkupBuilderHelper mkp, Map model) { + // TODO: encoding information of widget gets lost - don't use MarkupBuilder + def widget = model.widget + if (widget != null) { + mkp.yieldUnescaped widget + } + } + + CharSequence renderDefaultInput(Map model, Map attrs = [:]) { + renderDefaultInput(null, model, attrs) + } + + CharSequence renderDefaultInput(BeanPropertyAccessor propertyAccessor, Map model, Map attrs = [:]) { + Constrained constrained = (Constrained) model.constraints + attrs.name = (model.prefix ?: '') + model.property + attrs.value = model.value + if (model.required) attrs.required = "" // TODO: configurable how this gets output? Some people prefer required="required" + if (model.invalid) attrs.invalid = "" + if (!isEditable(constrained)) attrs.readonly = "" + + boolean oneToOne = false + boolean manyToOne = false + boolean manyToMany = false + boolean oneToMany = false + if (model.containsKey('persistentProperty')) { + if (model.persistentProperty instanceof PersistentProperty) { + PersistentProperty prop = (PersistentProperty) model.persistentProperty + oneToOne = prop instanceof OneToOne + manyToOne = prop instanceof ManyToOne + manyToMany = prop instanceof ManyToMany + oneToMany = prop instanceof OneToMany + } + } + + // TODO: https://github.com/gpc/fields/issues/392 + boolean datePicker = model.type in [Date, Calendar, java.sql.Date, java.sql.Time, LocalDate, LocalDateTime] + if (!datePicker) { + attrs.remove('selectDateClass') + } + boolean checkBox = model.type in [boolean, Boolean] + String checkBoxClass = attrs.remove('checkBoxClass') + if (checkBox && checkBoxClass) { + attrs['class'] = checkBoxClass + } + + if (model.type in [String, null]) { + return renderStringInput(model, attrs) + } else if (checkBox) { + return g.checkBox(attrs) + } else if (model.type.isPrimitive() || model.type in Number) { + return renderNumericInput(propertyAccessor, model, attrs) + } else if (model.type in URL) { + return g.field(attrs + [type: "url"]) + } else if (model.type.isEnum()) { + return renderEnumInput(model, attrs) + } else if (oneToOne || manyToOne || manyToMany) { + return renderAssociationInput(model, attrs) + } else if (oneToMany) { + return renderOneToManyInput(model, attrs) + } else if (datePicker) { + return renderDateTimeInput(model, attrs) + } else if (model.type in [byte[], Byte[], Blob]) { + return g.field(attrs + [type: "file"]) + } else if (model.type in [TimeZone, Currency, Locale]) { + if (!model.required) attrs.noSelection = ["": ""] + return g."${GrailsStringUtils.uncapitalize(model.type.simpleName)}Select"(attrs) + } else { + return null + } + } + + + CharSequence renderDateTimeInput(Map model, Map attrs) { + attrs.precision = model.type in [java.sql.Time, LocalDateTime]? "minute" : "day" + if (!model.required) { + attrs.noSelection = ["": ""] + attrs.default = "none" + } + return g.datePicker(attrs) + } + + CharSequence renderStringInput(Map model, Map attrs) { + Constrained constrained = (Constrained) model.constraints + + if (!attrs.type) { + if (constrained?.inList) { + attrs.from = constrained.inList + if (!model.required) { + attrs.noSelection = ["": ""] + } + return g.select(attrs) + } else if (constrained?.password) { + attrs.type = "password" + attrs.remove('value') + } else if (constrained?.email) { + attrs.type = "email" + } else if (constrained?.url) { + attrs.type = "url" + } else { + attrs.type = "text" + } + } + + if (constrained?.matches) { attrs.pattern = constrained.matches } + if (constrained?.maxSize) { attrs.maxlength = constrained.maxSize } + + if (constrained?.widget == 'textarea') { + attrs.remove('type') + return g.textArea(attrs) + } + return g.field(attrs) + } + + CharSequence renderNumericInput(BeanPropertyAccessor propertyAccessor, Map model, Map attrs) { + Constrained constrained = (Constrained) model.constraints + + if (!attrs.type && constrained?.inList) { + attrs.from = constrained.inList + if (!model.required) attrs.noSelection = ["": ""] + return g.select(attrs) + } else if (constrained?.range) { + attrs.type = attrs.type ?: "range" + attrs.min = constrained.range.from + attrs.max = constrained.range.to + } else { + attrs.type = attrs.type ?: getDefaultNumberType(model) + if (constrained?.scale != null) attrs.step = "0.${'0' * (constrained.scale - 1)}1" + if (constrained?.min != null) attrs.min = constrained.min + if (constrained?.max != null) attrs.max = constrained.max + } + + if (localizeNumbers && propertyAccessor?.value != null) { + attrs.value = numberFormatter.format(propertyAccessor.value) + } + + return g.field(attrs) + } + + @CompileStatic + protected NumberFormat getNumberFormatter() { + NumberFormat.getInstance(getLocale()) + } + + @CompileStatic + protected Locale getLocale() { + def locale + def request = GrailsWebRequest.lookup()?.currentRequest + if (request instanceof HttpServletRequest) { + locale = localeResolver?.resolveLocale(request) + } + if (locale == null) { + locale = Locale.default + } + return locale + } + + @CompileStatic + protected String getDefaultNumberType(Map model) { + Class modelType = (Class) model.type + + def typeName = modelType.simpleName.toLowerCase() + if (typeName in DECIMAL_TYPES) { + return "number decimal" + } else { + return "number" + } + + } + + private CharSequence renderEnumInput(Map model, Map attrs) { + Constrained constrained = (Constrained) model.constraints + + if (attrs.value instanceof Enum) + attrs.value = attrs.value.name() + if (!model.required) attrs.noSelection = ["": ""] + + if (constrained?.inList) { + attrs.keys = constrained.inList*.name() + attrs.from = constrained.inList + } else { + attrs.keys = model.type.values()*.name() + attrs.from = model.type.values() + } + return g.select(attrs) + } + + private CharSequence renderAssociationInput(Map model, Map attrs) { + attrs.id = (model.prefix ?: '') + model.property + def persistentProperty = model.persistentProperty + Class referencedPropertyType + boolean manyToMany = false + if (persistentProperty instanceof Association) { + Association prop = ((Association) persistentProperty) + PersistentEntity entity = prop.getAssociatedEntity() + if (entity != null) { + referencedPropertyType = entity.getJavaClass() + } else if (prop.isBasic()) { + referencedPropertyType = ((Basic) prop).getComponentType() + } + manyToMany = prop instanceof ManyToMany + } + attrs.from = null != attrs.from ? attrs.from : referencedPropertyType.list() + attrs.optionKey = "id" // TODO: handle alternate id names + if (manyToMany) { + attrs.multiple = "" + attrs.value = model.value*.id + attrs.name = "${model.prefix ?: ''}${model.property}" + } else { + if (!model.required) attrs.noSelection = ["null": ""] + attrs.value = model.value?.id + attrs.name = "${model.prefix ?: ''}${model.property}.id" + } + return g.select(attrs) + } + + private CharSequence renderOneToManyInput(Map model, Map attrs) { + Writer buffer = new FastStringWriter() + buffer << '
      ' + def persistentProperty = model.persistentProperty + def controllerName + def shortName + if (persistentProperty instanceof Association) { + Association prop = ((Association) persistentProperty) + controllerName = prop.associatedEntity.decapitalizedName + shortName = prop.associatedEntity.javaClass.simpleName + } + + attrs.value.each { + buffer << '
    • ' + buffer << g.link(controller: controllerName, action: "show", id: it.id, it.toString().encodeAsHTML()) + buffer << '
    • ' + } + buffer << '
    ' + def referencedTypeLabel = message(code: "${controllerName}.label", default: shortName) + def addLabel = g.message(code: 'default.add.label', args: [referencedTypeLabel]) + PersistentEntity beanClass = (PersistentEntity) model.beanClass + buffer << g.link(controller: controllerName, action: "create", params: [("${beanClass.decapitalizedName}.id".toString()): model.bean.id], addLabel) + buffer.buffer + } + + private CharSequence renderDefaultDisplay(Map model, Map attrs = [:], String templatesFolder, String theme) { + def persistentProperty = model.persistentProperty + if (persistentProperty instanceof Association) { + if (persistentProperty.embedded) { + return (attrs.displayStyle == 'table') ? model.value?.toString().encodeAsHTML() : + displayEmbedded(model.value, persistentProperty.associatedEntity, attrs, templatesFolder, theme) + } else if (persistentProperty instanceof OneToMany || persistentProperty instanceof ManyToMany) { + return displayAssociationList(model.value, ((Association) persistentProperty).associatedEntity) + } else { + return displayAssociation(model.value, ((Association) persistentProperty).associatedEntity) + } + } + + switch (model.type) { + case Boolean.TYPE: + case Boolean: + g.formatBoolean(boolean: model.value) + break + case Calendar: + case Date: + case java.sql.Date: + case java.sql.Time: + case LocalDate: + case LocalDateTime: + g.formatDate(date: model.value) + break + default: + g.fieldValue bean: model.bean, field: model.property + } + } + + private CharSequence displayEmbedded(bean, PersistentEntity domainClass, Map attrs, String templatesFolder, String theme) { + Writer buffer = new FastStringWriter() + def properties = domainModelService.getOutputProperties(domainClass) + buffer << render(template: "/templates/_fields/list", model: [domainClass: domainClass, domainProperties: properties]) { prop -> + def propertyAccessor = resolveProperty(bean, prop.name) + def model = buildModel(propertyAccessor, attrs) + out << raw(renderDisplayWidget(propertyAccessor, model, attrs, templatesFolder, theme)) + } + buffer.buffer + } + + private CharSequence displayAssociationList(values, PersistentEntity referencedDomainClass) { + Writer buffer = new FastStringWriter() + buffer << '
      ' + for (value in values) { + buffer << '
    • ' + buffer << displayAssociation(value, referencedDomainClass) + buffer << '
    • ' + } + buffer << '
    ' + buffer.buffer + } + + private CharSequence displayAssociation(value, PersistentEntity referencedDomainClass) { + if (value && referencedDomainClass) { + g.link(controller: referencedDomainClass.decapitalizedName, action: "show", id: value.id, value.toString().encodeAsHTML()) + } else if (value) { + value.toString() + } + } + + private boolean isEditable(Constrained constraints) { + !constraints || constraints.editable } } diff --git a/grails-fields/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorFactory.groovy b/grails-fields/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorFactory.groovy index 72a4df0f399..ef66fbd95d2 100644 --- a/grails-fields/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorFactory.groovy +++ b/grails-fields/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorFactory.groovy @@ -84,10 +84,10 @@ class BeanPropertyAccessorFactory implements GrailsApplicationAware { } private boolean getAddPathFromRoot() { - grailsApplication.config.getProperty('grails.plugin.fields.i18n.addPathFromRoot', Boolean) - } - - private DomainProperty resolvePropertyFromPathComponents(BeanWrapper beanWrapper, List pathElements, Map params) { + grailsApplication.config.getProperty('grails.plugin.fields.i18n.addPathFromRoot', Boolean) + } + + private DomainProperty resolvePropertyFromPathComponents(BeanWrapper beanWrapper, List pathElements, Map params) { String propertyName = pathElements.remove(0) PersistentEntity beanClass = resolveDomainClass(beanWrapper.wrappedClass) Class propertyType = resolvePropertyType(beanWrapper, beanClass, propertyName) @@ -165,25 +165,25 @@ class BeanPropertyAccessorFactory implements GrailsApplicationAware { private static Class resolveNonDomainPropertyType(BeanWrapper beanWrapper, String propertyName) { Class type = beanWrapper.getPropertyType(propertyName) - if (type == null) { - String match = getPropertyMatch(propertyName) - if (match) { + if (type == null) { + String match = getPropertyMatch(propertyName) + if (match) { Type genericType = beanWrapper.getPropertyDescriptor(match).readMethod.genericReturnType - if (genericType instanceof ParameterizedType) { + if (genericType instanceof ParameterizedType) { ParameterizedType parameterizedType = genericType as ParameterizedType - switch (parameterizedType.rawType) { - case Collection: - return parameterizedType.actualTypeArguments[0] as Class - case Map: - return parameterizedType.actualTypeArguments[1] as Class - } - } else { - return Object - } - } - } - return type - } + switch (parameterizedType.rawType) { + case Collection: + return parameterizedType.actualTypeArguments[0] as Class + case Map: + return parameterizedType.actualTypeArguments[1] as Class + } + } else { + return Object + } + } + } + return type + } private BeanWrapper beanWrapperFor(Class type, value) { value ? PropertyAccessorFactory.forBeanPropertyAccess(unwrapIfProxy(value)) : new BeanWrapperImpl(type) diff --git a/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPageSourceDecorator.java b/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPageSourceDecorator.java index 2a0a40206ce..fdda7fa7106 100644 --- a/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPageSourceDecorator.java +++ b/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPageSourceDecorator.java @@ -19,5 +19,5 @@ package org.grails.gsp; public interface GroovyPageSourceDecorator { - StringBuilder decorate(StringBuilder source); + StringBuilder decorate(StringBuilder source); } diff --git a/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPagesTemplateEngine.java b/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPagesTemplateEngine.java index 774e56fc9fc..907ee2e9ab1 100644 --- a/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPagesTemplateEngine.java +++ b/grails-gsp/core/src/main/groovy/org/grails/gsp/GroovyPagesTemplateEngine.java @@ -116,14 +116,14 @@ public class GroovyPagesTemplateEngine extends ResourceAwareTemplateEngine imple } } - private class GroovyPagesTemplateEngineCacheEntry extends CacheEntry{ - private final String pageName; + private class GroovyPagesTemplateEngineCacheEntry extends CacheEntry{ + private final String pageName; - public GroovyPagesTemplateEngineCacheEntry(String pageName){ - this.pageName = pageName; - } + public GroovyPagesTemplateEngineCacheEntry(String pageName){ + this.pageName = pageName; + } - @Override + @Override protected boolean hasExpired(long timeout, Object cacheRequestObject) { GroovyPageMetaInfo meta = getValue(); Resource resource = (Resource)cacheRequestObject; @@ -139,33 +139,33 @@ protected GroovyPageMetaInfo updateValue(GroovyPageMetaInfo oldValue, Callable> { + private static class GroovyPagesTemplateEngineCallable implements Callable> { - private final CacheEntry cacheEntry; + private final CacheEntry cacheEntry; - public GroovyPagesTemplateEngineCallable(CacheEntry cacheEntry){ - this.cacheEntry = cacheEntry; - } + public GroovyPagesTemplateEngineCallable(CacheEntry cacheEntry){ + this.cacheEntry = cacheEntry; + } - @Override - public CacheEntry call() throws Exception { - return cacheEntry; - } + @Override + public CacheEntry call() throws Exception { + return cacheEntry; + } - } + } public GroovyPagesTemplateEngine() { // default } public void setGroovyPageSourceDecorators(List groovyPageSourceDecorators){ - this.groovyPageSourceDecorators = groovyPageSourceDecorators; + this.groovyPageSourceDecorators = groovyPageSourceDecorators; } public List getGroovyPageSourceDecorators(){ - return groovyPageSourceDecorators; + return groovyPageSourceDecorators; } public void setGroovyPageLocator(GroovyPageLocator groovyPageLocator) { @@ -455,10 +455,10 @@ protected GroovyPageMetaInfo buildPageMetaInfo(Resource resource, String pageNam } private StringBuilder decorateGroovyPageSource(StringBuilder source) throws IOException { - for(GroovyPageSourceDecorator groovyPageSourceDecorator : groovyPageSourceDecorators){ - source = groovyPageSourceDecorator.decorate(source); - } - return source; + for(GroovyPageSourceDecorator groovyPageSourceDecorator : groovyPageSourceDecorators){ + source = groovyPageSourceDecorator.decorate(source); + } + return source; } /** @@ -531,7 +531,7 @@ protected GroovyPageMetaInfo buildPageMetaInfo(InputStream inputStream, Resource GroovyPageParser parser; String path = getPathForResource(res); try { - String gspSource = IOUtils.toString(inputStream, getGspEncoding()); + String gspSource = IOUtils.toString(inputStream, getGspEncoding()); parser = new GroovyPageParser(name, path, path, decorateGroovyPageSource(new StringBuilder(gspSource)).toString(), grailsApplication != null? grailsApplication.getConfig() : null); } diff --git a/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/gsp/io/GrailsConventionGroovyPageLocator.java b/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/gsp/io/GrailsConventionGroovyPageLocator.java index ff34b64d933..fe51370a0b3 100644 --- a/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/gsp/io/GrailsConventionGroovyPageLocator.java +++ b/grails-gsp/grails-web-gsp/src/main/groovy/org/grails/web/gsp/io/GrailsConventionGroovyPageLocator.java @@ -151,7 +151,7 @@ public GroovyPageScriptSource findView(Object controller, String viewName) { } } if(scriptSource == null) { - scriptSource = findPage(uriService.getViewURI(controllerName, viewNameWithFormat)); + scriptSource = findPage(uriService.getViewURI(controllerName, viewNameWithFormat)); } if (scriptSource == null) { scriptSource = findPage(uriService.getViewURI(controllerName, viewName)); @@ -344,8 +344,8 @@ protected String getNameForController(Object controller) { return GrailsNameUtils.getLogicalPropertyName(GrailsNameUtils.getFullClassName(cls), ControllerArtefactHandler.TYPE); } - @Override - public void setGrailsApplication(GrailsApplication grailsApplication) { - this.grailsApplication = grailsApplication; - } + @Override + public void setGrailsApplication(GrailsApplication grailsApplication) { + this.grailsApplication = grailsApplication; + } } diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/archive/PackagedSpringApplicationLauncher.java b/grails-shell-cli/src/main/groovy/org/grails/cli/archive/PackagedSpringApplicationLauncher.java index 9be1b972020..48c6993ef93 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/archive/PackagedSpringApplicationLauncher.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/archive/PackagedSpringApplicationLauncher.java @@ -35,53 +35,53 @@ */ public final class PackagedSpringApplicationLauncher { - /** - * The entry containing the source class. - */ - public static final String SOURCE_ENTRY = "Spring-Application-Source-Classes"; + /** + * The entry containing the source class. + */ + public static final String SOURCE_ENTRY = "Spring-Application-Source-Classes"; - /** - * The entry containing the start class. - */ - public static final String START_CLASS_ENTRY = "Start-Class"; + /** + * The entry containing the start class. + */ + public static final String START_CLASS_ENTRY = "Start-Class"; - private PackagedSpringApplicationLauncher() { - } + private PackagedSpringApplicationLauncher() { + } - private void run(String[] args) throws Exception { - URLClassLoader classLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader(); - new SpringApplicationLauncher(classLoader).launch(getSources(classLoader), args); - } + private void run(String[] args) throws Exception { + URLClassLoader classLoader = (URLClassLoader) Thread.currentThread().getContextClassLoader(); + new SpringApplicationLauncher(classLoader).launch(getSources(classLoader), args); + } - private Class[] getSources(URLClassLoader classLoader) throws Exception { - Enumeration urls = classLoader.getResources("META-INF/MANIFEST.MF"); - while (urls.hasMoreElements()) { - URL url = urls.nextElement(); - Manifest manifest = new Manifest(url.openStream()); - if (isCliPackaged(manifest)) { - String sources = manifest.getMainAttributes().getValue(SOURCE_ENTRY); - return loadClasses(classLoader, sources.split(",")); - } - } - throw new IllegalStateException("Cannot locate " + SOURCE_ENTRY + " in MANIFEST.MF"); - } + private Class[] getSources(URLClassLoader classLoader) throws Exception { + Enumeration urls = classLoader.getResources("META-INF/MANIFEST.MF"); + while (urls.hasMoreElements()) { + URL url = urls.nextElement(); + Manifest manifest = new Manifest(url.openStream()); + if (isCliPackaged(manifest)) { + String sources = manifest.getMainAttributes().getValue(SOURCE_ENTRY); + return loadClasses(classLoader, sources.split(",")); + } + } + throw new IllegalStateException("Cannot locate " + SOURCE_ENTRY + " in MANIFEST.MF"); + } - private boolean isCliPackaged(Manifest manifest) { - Attributes attributes = manifest.getMainAttributes(); - String startClass = attributes.getValue(START_CLASS_ENTRY); - return getClass().getName().equals(startClass); - } + private boolean isCliPackaged(Manifest manifest) { + Attributes attributes = manifest.getMainAttributes(); + String startClass = attributes.getValue(START_CLASS_ENTRY); + return getClass().getName().equals(startClass); + } - private Class[] loadClasses(ClassLoader classLoader, String[] names) throws ClassNotFoundException { - Class[] classes = new Class[names.length]; - for (int i = 0; i < names.length; i++) { - classes[i] = Class.forName(names[i], false, classLoader); - } - return classes; - } + private Class[] loadClasses(ClassLoader classLoader, String[] names) throws ClassNotFoundException { + Class[] classes = new Class[names.length]; + for (int i = 0; i < names.length; i++) { + classes[i] = Class.forName(names[i], false, classLoader); + } + return classes; + } - public static void main(String[] args) throws Exception { - new PackagedSpringApplicationLauncher().run(args); - } + public static void main(String[] args) throws Exception { + new PackagedSpringApplicationLauncher().run(args); + } } diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationLauncher.java b/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationLauncher.java index 6d0025d3d62..51c92c713f9 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationLauncher.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationLauncher.java @@ -37,52 +37,52 @@ */ public class SpringApplicationLauncher { - private static final String DEFAULT_SPRING_APPLICATION_CLASS = "org.springframework.boot.SpringApplication"; + private static final String DEFAULT_SPRING_APPLICATION_CLASS = "org.springframework.boot.SpringApplication"; - private final ClassLoader classLoader; + private final ClassLoader classLoader; - /** - * Creates a new launcher that will use the given {@code classLoader} to load the - * configured {@code SpringApplication} class. - * @param classLoader the {@code ClassLoader} to use - */ - public SpringApplicationLauncher(ClassLoader classLoader) { - this.classLoader = classLoader; - } + /** + * Creates a new launcher that will use the given {@code classLoader} to load the + * configured {@code SpringApplication} class. + * @param classLoader the {@code ClassLoader} to use + */ + public SpringApplicationLauncher(ClassLoader classLoader) { + this.classLoader = classLoader; + } - /** - * Launches the application created using the given {@code sources}. The application - * is launched with the given {@code args}. - * @param sources the sources for the application - * @param args the args for the application - * @return the application's {@code ApplicationContext} - * @throws Exception if the launch fails - */ - public Object launch(Class[] sources, String[] args) throws Exception { - Map defaultProperties = new HashMap<>(); - defaultProperties.put("spring.groovy.template.check-template-location", "false"); - Class applicationClass = Class.forName(getSpringApplicationClassName(), false, this.classLoader); - Constructor constructor = applicationClass.getDeclaredConstructor(Class[].class); - constructor.setAccessible(true); - Object application = constructor.newInstance((Object) sources); - applicationClass.getMethod("setDefaultProperties", Map.class).invoke(application, defaultProperties); - Method method = applicationClass.getMethod("run", String[].class); - return method.invoke(application, (Object) args); - } + /** + * Launches the application created using the given {@code sources}. The application + * is launched with the given {@code args}. + * @param sources the sources for the application + * @param args the args for the application + * @return the application's {@code ApplicationContext} + * @throws Exception if the launch fails + */ + public Object launch(Class[] sources, String[] args) throws Exception { + Map defaultProperties = new HashMap<>(); + defaultProperties.put("spring.groovy.template.check-template-location", "false"); + Class applicationClass = Class.forName(getSpringApplicationClassName(), false, this.classLoader); + Constructor constructor = applicationClass.getDeclaredConstructor(Class[].class); + constructor.setAccessible(true); + Object application = constructor.newInstance((Object) sources); + applicationClass.getMethod("setDefaultProperties", Map.class).invoke(application, defaultProperties); + Method method = applicationClass.getMethod("run", String[].class); + return method.invoke(application, (Object) args); + } - private String getSpringApplicationClassName() { - String className = System.getProperty("spring.application.class.name"); - if (className == null) { - className = getEnvironmentVariable("SPRING_APPLICATION_CLASS_NAME"); - } - if (className == null) { - className = DEFAULT_SPRING_APPLICATION_CLASS; - } - return className; - } + private String getSpringApplicationClassName() { + String className = System.getProperty("spring.application.class.name"); + if (className == null) { + className = getEnvironmentVariable("SPRING_APPLICATION_CLASS_NAME"); + } + if (className == null) { + className = DEFAULT_SPRING_APPLICATION_CLASS; + } + return className; + } - protected String getEnvironmentVariable(String name) { - return System.getenv(name); - } + protected String getEnvironmentVariable(String name) { + return System.getenv(name); + } } diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationWebApplicationInitializer.java b/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationWebApplicationInitializer.java index dac31b74a5f..c993cdd6954 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationWebApplicationInitializer.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/boot/SpringApplicationWebApplicationInitializer.java @@ -36,51 +36,51 @@ */ public class SpringApplicationWebApplicationInitializer extends SpringBootServletInitializer { - /** - * The entry containing the source class. - */ - public static final String SOURCE_ENTRY = "Spring-Application-Source-Classes"; + /** + * The entry containing the source class. + */ + public static final String SOURCE_ENTRY = "Spring-Application-Source-Classes"; - private String[] sources; + private String[] sources; - @Override - public void onStartup(ServletContext servletContext) throws ServletException { - try { - this.sources = getSources(servletContext); - } - catch (IOException ex) { - throw new IllegalStateException(ex); - } - super.onStartup(servletContext); - } + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + try { + this.sources = getSources(servletContext); + } + catch (IOException ex) { + throw new IllegalStateException(ex); + } + super.onStartup(servletContext); + } - private String[] getSources(ServletContext servletContext) throws IOException { - Manifest manifest = getManifest(servletContext); - if (manifest == null) { - throw new IllegalStateException("Unable to read manifest"); - } - String sources = manifest.getMainAttributes().getValue(SOURCE_ENTRY); - return sources.split(","); - } + private String[] getSources(ServletContext servletContext) throws IOException { + Manifest manifest = getManifest(servletContext); + if (manifest == null) { + throw new IllegalStateException("Unable to read manifest"); + } + String sources = manifest.getMainAttributes().getValue(SOURCE_ENTRY); + return sources.split(","); + } - private Manifest getManifest(ServletContext servletContext) throws IOException { - InputStream stream = servletContext.getResourceAsStream("/META-INF/MANIFEST.MF"); - return (stream != null) ? new Manifest(stream) : null; - } + private Manifest getManifest(ServletContext servletContext) throws IOException { + InputStream stream = servletContext.getResourceAsStream("/META-INF/MANIFEST.MF"); + return (stream != null) ? new Manifest(stream) : null; + } - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { - try { - ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); - Class[] sourceClasses = new Class[this.sources.length]; - for (int i = 0; i < this.sources.length; i++) { - sourceClasses[i] = Class.forName(this.sources[i], false, classLoader); - } - return builder.sources(sourceClasses).properties("spring.groovy.template.check-template-location=false"); - } - catch (Exception ex) { - throw new IllegalStateException(ex); - } - } + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + try { + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + Class[] sourceClasses = new Class[this.sources.length]; + for (int i = 0; i < this.sources.length; i++) { + sourceClasses[i] = Class.forName(this.sources[i], false, classLoader); + } + return builder.sources(sourceClasses).properties("spring.groovy.template.check-template-location=false"); + } + catch (Exception ex) { + throw new IllegalStateException(ex); + } + } } diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/command/AbstractCommand.java b/grails-shell-cli/src/main/groovy/org/grails/cli/command/AbstractCommand.java index 4c757e94e5a..661218dd9d7 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/command/AbstractCommand.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/command/AbstractCommand.java @@ -34,48 +34,48 @@ */ public abstract class AbstractCommand implements Command { - private final String name; + private final String name; - private final String description; + private final String description; - /** - * Create a new {@link AbstractCommand} instance. - * @param name the name of the command - * @param description the command description - */ - protected AbstractCommand(String name, String description) { - this.name = name; - this.description = description; - } + /** + * Create a new {@link AbstractCommand} instance. + * @param name the name of the command + * @param description the command description + */ + protected AbstractCommand(String name, String description) { + this.name = name; + this.description = description; + } - @Override - public String getName() { - return this.name; - } + @Override + public String getName() { + return this.name; + } - @Override - public String getDescription() { - return this.description; - } + @Override + public String getDescription() { + return this.description; + } - @Override - public String getUsageHelp() { - return null; - } + @Override + public String getUsageHelp() { + return null; + } - @Override - public String getHelp() { - return null; - } + @Override + public String getHelp() { + return null; + } - @Override - public Collection getOptionsHelp() { - return Collections.emptyList(); - } + @Override + public Collection getOptionsHelp() { + return Collections.emptyList(); + } - @Override - public Collection getExamples() { - return null; - } + @Override + public Collection getExamples() { + return null; + } } diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/command/Command.java b/grails-shell-cli/src/main/groovy/org/grails/cli/command/Command.java index 610621f63a4..75f5e55c1e3 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/command/Command.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/command/Command.java @@ -35,51 +35,51 @@ */ public interface Command { - /** - * Returns the name of the command. - * @return the command's name - */ - String getName(); + /** + * Returns the name of the command. + * @return the command's name + */ + String getName(); - /** - * Returns a description of the command. - * @return the command's description - */ - String getDescription(); + /** + * Returns a description of the command. + * @return the command's description + */ + String getDescription(); - /** - * Returns usage help for the command. This should be a simple one-line string - * describing basic usage. e.g. '[options] <file>'. Do not include the name of - * the command in this string. - * @return the command's usage help - */ - String getUsageHelp(); + /** + * Returns usage help for the command. This should be a simple one-line string + * describing basic usage. e.g. '[options] <file>'. Do not include the name of + * the command in this string. + * @return the command's usage help + */ + String getUsageHelp(); - /** - * Gets full help text for the command, e.g. a longer description and one line per - * option. - * @return the command's help text - */ - String getHelp(); + /** + * Gets full help text for the command, e.g. a longer description and one line per + * option. + * @return the command's help text + */ + String getHelp(); - /** - * Returns help for each supported option. - * @return help for each of the command's options - */ - Collection getOptionsHelp(); + /** + * Returns help for each supported option. + * @return help for each of the command's options + */ + Collection getOptionsHelp(); - /** - * Return some examples for the command. - * @return the command's examples - */ - Collection getExamples(); + /** + * Return some examples for the command. + * @return the command's examples + */ + Collection getExamples(); - /** - * Run the command. - * @param args command arguments (this will not include the command itself) - * @return the outcome of the command - * @throws Exception if the command fails - */ - ExitStatus run(String... args) throws Exception; + /** + * Run the command. + * @param args command arguments (this will not include the command itself) + * @return the outcome of the command + * @throws Exception if the command fails + */ + ExitStatus run(String... args) throws Exception; } diff --git a/grails-shell-cli/src/main/groovy/org/grails/cli/command/CommandException.java b/grails-shell-cli/src/main/groovy/org/grails/cli/command/CommandException.java index 505c058ca48..568fa654331 100644 --- a/grails-shell-cli/src/main/groovy/org/grails/cli/command/CommandException.java +++ b/grails-shell-cli/src/main/groovy/org/grails/cli/command/CommandException.java @@ -34,89 +34,89 @@ */ public class CommandException extends RuntimeException { - private static final long serialVersionUID = 0L; - - private final EnumSet