You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ja...@apache.org on 2026/06/01 20:02:44 UTC

(grails-core) branch fix/eol-renormalize-7.0.x created (now ed64fc0af1)

This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a change to branch fix/eol-renormalize-7.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git


      at ed64fc0af1 fix: renormalize CRLF-committed files to LF per .gitattributes

This branch includes the following new commits:

     new ed64fc0af1 fix: renormalize CRLF-committed files to LF per .gitattributes

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(grails-core) 01/01: fix: renormalize CRLF-committed files to LF per .gitattributes

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesfredley pushed a commit to branch fix/eol-renormalize-7.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git

commit ed64fc0af1fe3a8bb9a08a67420b281d5c6bd936
Author: James Fredley <ja...@users.noreply.github.com>
AuthorDate: Mon Jun 1 16:01:33 2026 -0400

    fix: renormalize CRLF-committed files to LF per .gitattributes
    
    PR #15622 added .gitattributes (`* text=auto`, `*.bat text eol=crlf`, and
    `*.sh`/`gradlew`/`KEYS`/`Dockerfile`/`*.properties` `text eol=lf`) but did not
    run `git add --renormalize`, so 11 files committed earlier kept CRLF blobs in
    the index. Under `text`, the canonical (index) form must be LF, so those CRLF
    blobs permanently conflict with the attribute: git normalizes the working copy
    to LF and compares it against the CRLF blob, which never matches. The files
    show as modified the moment any tool (IDE Gradle sync, branch switch, build,
    editor save) busts git's lstat cache, and `git checkout` / `git reset` cannot
    repair it because the wrong bytes live in the committed blob. Mac and Linux
    developers hit this constantly; the root `gradlew.bat` was the most visible
    victim.
    
    This commit runs `git add --renormalize .` to rewrite the affected index blobs
    to LF. It is a pure line-ending change: `git diff --ignore-cr-at-eol` is empty
    (2019 insertions / 2019 deletions, every line re-emitted with CR stripped).
    Working trees are unaffected -- `*.bat` is still checked out as CRLF via
    `eol=crlf`, so Windows behaviour does not change.
    
    Renormalized files:
      LICENSE
      gradlew.bat
      grails-encoder/src/main/groovy/org/grails/buffer/StreamByteBuffer.java
      grails-encoder/src/main/groovy/org/grails/encoder/impl/URLCodecFactory.groovy
      grails-spring/src/main/groovy/org/grails/spring/BeanConfiguration.java
      grails-spring/src/main/groovy/org/grails/spring/DefaultBeanConfiguration.java
      grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java
      grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyHandlerInterceptor.java
      grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyWebRequestInterceptor.java
      grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/web-interceptor-wiring-tests.xml
      grails-test-suite-web/src/test/groovy/org/grails/web/servlet/BindDataMethodTests.groovy
    
    Assisted-by: claude-code:claude-opus-4-8
---
 LICENSE                                            | 486 ++++++------
 gradlew.bat                                        | 188 ++---
 .../groovy/org/grails/buffer/StreamByteBuffer.java | 880 ++++++++++-----------
 .../org/grails/encoder/impl/URLCodecFactory.groovy | 162 ++--
 .../org/grails/spring/BeanConfiguration.java       | 288 +++----
 .../grails/spring/DefaultBeanConfiguration.java    | 640 +++++++--------
 .../spring/DefaultRuntimeSpringConfiguration.java  | 734 ++++++++---------
 .../web/plugins/support/MyHandlerInterceptor.java  |  80 +-
 .../plugins/support/MyWebRequestInterceptor.java   |  76 +-
 .../support/web-interceptor-wiring-tests.xml       | 112 +--
 .../grails/web/servlet/BindDataMethodTests.groovy  | 392 ++++-----
 11 files changed, 2019 insertions(+), 2019 deletions(-)

diff --git a/LICENSE b/LICENSE
index 1e51fd6e2a..c05abb2d83 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,244 +1,244 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.
-
---------------------------------------------------------------------------
-
-Public Domain
-
-The following classes within this product:
-
-    org.grails.web.json.JSONArray
-    org.grails.web.json.JSONElement
-    org.grails.web.json.JSONException
-    org.grails.web.json.JSONObject
-    org.grails.web.json.JSONTokener
-    org.grails.web.json.JSONWriter
-
-Originally from https://github.com/stleary/JSON-java
-
---------------------------------------------------------------------------
-
-The following files are licensed under the Eclipse Public License 2.0:
-
-    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-jsptaglibrary_3_0.xsd
-
-See licenses/LICENSE-EPL2.txt for the full license terms.
-
---------------------------------------------------------------------------
-
-The following files are licensed under the CDDL 1.0:
-
-    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-app_4_0.xsd
-    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-app_5_0.xsd
-    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-app_6_0.xsd
-
-See licenses/LICENSE-CDDL.txt for the full license terms.
-
---------------------------------------------------------------------------
-
-This product includes software developed by the OpenSymphony Group (http://www.opensymphony.com/). It uses Sitemesh2,
-licensed under the OpenSymphony Software License, Version 1.1.
-
-See licenses/LICENSE-opensymphony.txt for the full license terms.
-
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+
+--------------------------------------------------------------------------
+
+Public Domain
+
+The following classes within this product:
+
+    org.grails.web.json.JSONArray
+    org.grails.web.json.JSONElement
+    org.grails.web.json.JSONException
+    org.grails.web.json.JSONObject
+    org.grails.web.json.JSONTokener
+    org.grails.web.json.JSONWriter
+
+Originally from https://github.com/stleary/JSON-java
+
+--------------------------------------------------------------------------
+
+The following files are licensed under the Eclipse Public License 2.0:
+
+    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-jsptaglibrary_3_0.xsd
+
+See licenses/LICENSE-EPL2.txt for the full license terms.
+
+--------------------------------------------------------------------------
+
+The following files are licensed under the CDDL 1.0:
+
+    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-app_4_0.xsd
+    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-app_5_0.xsd
+    grails-gsp/grails-web-jsp/src/main/resources/org/grails/gsp/jsp/web-app_6_0.xsd
+
+See licenses/LICENSE-CDDL.txt for the full license terms.
+
+--------------------------------------------------------------------------
+
+This product includes software developed by the OpenSymphony Group (http://www.opensymphony.com/). It uses Sitemesh2,
+licensed under the OpenSymphony Software License, Version 1.1.
+
+See licenses/LICENSE-opensymphony.txt for the full license terms.
+
 --------------------------------------------------------------------------
\ No newline at end of file
diff --git a/gradlew.bat b/gradlew.bat
index 5eed7ee845..db3a6ac207 100755
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,94 +1,94 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem      https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-@rem SPDX-License-Identifier: Apache-2.0
-@rem
-
-@if "%DEBUG%"=="" @echo off
-@rem ##########################################################################
-@rem
-@rem  Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%"=="" set DIRNAME=.
-@rem This is normally unused
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if %ERRORLEVEL% equ 0 goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo. 1>&2
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
-echo. 1>&2
-echo Please set the JAVA_HOME variable in your environment to match the 1>&2
-echo location of your Java installation. 1>&2
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if %ERRORLEVEL% equ 0 goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-set EXIT_CODE=%ERRORLEVEL%
-if %EXIT_CODE% equ 0 set EXIT_CODE=1
-if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
-exit /b %EXIT_CODE%
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem      https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/grails-encoder/src/main/groovy/org/grails/buffer/StreamByteBuffer.java b/grails-encoder/src/main/groovy/org/grails/buffer/StreamByteBuffer.java
index 2da9d88739..9ba7450ac4 100644
--- a/grails-encoder/src/main/groovy/org/grails/buffer/StreamByteBuffer.java
+++ b/grails-encoder/src/main/groovy/org/grails/buffer/StreamByteBuffer.java
@@ -1,440 +1,440 @@
-/*
- *  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.
- */
-package org.grails.buffer;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import grails.util.GrailsArrayUtils;
-
-/**
- * An in-memory buffer that provides OutputStream and InputStream interfaces.
- *
- * This is more efficient than using ByteArrayOutputStream/ByteArrayInputStream
- *
- * This is not thread-safe, it is intended to be used by a single Thread.
- *
- * @author Lari Hotari, Sagire Software Oy
- */
-public class StreamByteBuffer {
-
-    private static final int DEFAULT_CHUNK_SIZE = 8192;
-
-    private LinkedList<StreamByteBufferChunk> chunks = new LinkedList<>();
-    private StreamByteBufferChunk currentWriteChunk;
-    private StreamByteBufferChunk currentReadChunk = null;
-    private int chunkSize;
-    private StreamByteBufferOutputStream output;
-    private StreamByteBufferInputStream input;
-    private int totalBytesUnreadInList = 0;
-    private int totalBytesUnreadInIterator = 0;
-    private ReadMode readMode;
-    private Iterator<StreamByteBufferChunk> readIterator;
-
-    public enum ReadMode {
-        REMOVE_AFTER_READING,
-        RETAIN_AFTER_READING
-    }
-
-    public StreamByteBuffer() {
-        this(DEFAULT_CHUNK_SIZE);
-    }
-
-    public StreamByteBuffer(int chunkSize) {
-        this(chunkSize, ReadMode.REMOVE_AFTER_READING);
-    }
-
-    public StreamByteBuffer(int chunkSize, ReadMode readMode) {
-        this.chunkSize = chunkSize;
-        this.readMode = readMode;
-        currentWriteChunk = new StreamByteBufferChunk(chunkSize);
-        output = new StreamByteBufferOutputStream();
-        input = new StreamByteBufferInputStream();
-    }
-
-    public OutputStream getOutputStream() {
-        return output;
-    }
-
-    public InputStream getInputStream() {
-        return input;
-    }
-
-    public void writeTo(OutputStream target) throws IOException {
-        while (prepareRead() != -1) {
-            currentReadChunk.writeTo(target);
-        }
-    }
-
-    public byte[] readAsByteArray() {
-        byte[] buf = new byte[totalBytesUnread()];
-        input.readImpl(buf, 0, buf.length);
-        return buf;
-    }
-
-    public String readAsString(String encoding) throws CharacterCodingException {
-        Charset charset = Charset.forName(encoding);
-        return readAsString(charset);
-    }
-
-    public String readAsString(Charset charset) throws CharacterCodingException {
-        int unreadSize = totalBytesUnread();
-        if (unreadSize > 0) {
-            CharsetDecoder decoder = charset.newDecoder().onMalformedInput(
-                    CodingErrorAction.REPLACE).onUnmappableCharacter(
-                    CodingErrorAction.REPLACE);
-            CharBuffer charbuffer = CharBuffer.allocate(unreadSize);
-            ByteBuffer buf = null;
-            while (prepareRead() != -1) {
-                buf = currentReadChunk.readToNioBuffer();
-                boolean endOfInput = (prepareRead() == -1);
-                CoderResult result = decoder.decode(buf, charbuffer, endOfInput);
-                if (endOfInput) {
-                    if (!result.isUnderflow()) {
-                        result.throwException();
-                    }
-                }
-            }
-            CoderResult result = decoder.flush(charbuffer);
-            if (buf.hasRemaining()) {
-                throw new IllegalStateException("There's a bug here, buffer wasn't read fully.");
-            }
-            if (!result.isUnderflow()) {
-                result.throwException();
-            }
-            charbuffer.flip();
-            String str;
-            if (charbuffer.hasArray()) {
-                int len = charbuffer.remaining();
-                char[] ch = charbuffer.array();
-                if (len != ch.length) {
-                    ch = (char[]) GrailsArrayUtils.subarray(ch, 0, len);
-                }
-                str = StringCharArrayAccessor.createString(ch);
-            }
-            else {
-                str = charbuffer.toString();
-            }
-            return str;
-        }
-        return null;
-    }
-
-    public int totalBytesUnread() {
-        int total = 0;
-        if (readMode == ReadMode.REMOVE_AFTER_READING) {
-            total = totalBytesUnreadInList;
-        }
-        else if (readMode == ReadMode.RETAIN_AFTER_READING) {
-            prepareRetainAfterReading();
-            total = totalBytesUnreadInIterator;
-        }
-        if (currentReadChunk != null) {
-            total += currentReadChunk.bytesUnread();
-        }
-        if (currentWriteChunk != currentReadChunk && currentWriteChunk != null) {
-            if (readMode == ReadMode.REMOVE_AFTER_READING) {
-                total += currentWriteChunk.bytesUnread();
-            }
-            else if (readMode == ReadMode.RETAIN_AFTER_READING) {
-                total += currentWriteChunk.bytesUsed();
-            }
-        }
-        return total;
-    }
-
-    protected int allocateSpace() {
-        int spaceLeft = currentWriteChunk.spaceLeft();
-        if (spaceLeft == 0) {
-            chunks.add(currentWriteChunk);
-            totalBytesUnreadInList += currentWriteChunk.bytesUnread();
-            currentWriteChunk = new StreamByteBufferChunk(chunkSize);
-            spaceLeft = currentWriteChunk.spaceLeft();
-        }
-        return spaceLeft;
-    }
-
-    protected int prepareRead() {
-        prepareRetainAfterReading();
-        int bytesUnread = (currentReadChunk != null) ? currentReadChunk.bytesUnread() : 0;
-        if (bytesUnread == 0) {
-            if (readMode == ReadMode.REMOVE_AFTER_READING && !chunks.isEmpty()) {
-                currentReadChunk = chunks.removeFirst();
-                bytesUnread = currentReadChunk.bytesUnread();
-                totalBytesUnreadInList -= bytesUnread;
-            }
-            else if (readMode == ReadMode.RETAIN_AFTER_READING && readIterator.hasNext()) {
-                currentReadChunk = readIterator.next();
-                currentReadChunk.reset();
-                bytesUnread = currentReadChunk.bytesUnread();
-                totalBytesUnreadInIterator -= bytesUnread;
-            }
-            else if (currentReadChunk != currentWriteChunk) {
-                currentReadChunk = currentWriteChunk;
-                bytesUnread = currentReadChunk.bytesUnread();
-            }
-            else {
-                bytesUnread = -1;
-            }
-        }
-        return bytesUnread;
-    }
-
-    public void reset() {
-        if (readMode == ReadMode.RETAIN_AFTER_READING) {
-            readIterator = null;
-            prepareRetainAfterReading();
-            if (currentWriteChunk != null) {
-                currentWriteChunk.reset();
-            }
-        }
-    }
-
-    private void prepareRetainAfterReading() {
-        if (readMode == ReadMode.RETAIN_AFTER_READING && readIterator == null) {
-            readIterator = chunks.iterator();
-            totalBytesUnreadInIterator = totalBytesUnreadInList;
-            currentReadChunk = null;
-        }
-    }
-
-    public ReadMode getReadMode() {
-        return readMode;
-    }
-
-    public void setReadMode(ReadMode readMode) {
-        this.readMode = readMode;
-    }
-
-    public void retainAfterReadingMode() {
-        setReadMode(ReadMode.RETAIN_AFTER_READING);
-    }
-
-    class StreamByteBufferChunk {
-        private int pointer = 0;
-        private byte[] buffer;
-        private int size;
-        private int used = 0;
-
-        public StreamByteBufferChunk(int size) {
-            this.size = size;
-            buffer = new byte[size];
-        }
-
-        public ByteBuffer readToNioBuffer() {
-            if (pointer < used) {
-                ByteBuffer result;
-                if (pointer > 0 || used < size) {
-                    result = ByteBuffer.wrap(buffer, pointer, used - pointer);
-                }
-                else {
-                    result = ByteBuffer.wrap(buffer);
-                }
-                pointer = used;
-                return result;
-            }
-
-            return null;
-        }
-
-        public boolean write(byte b) {
-            if (used < size) {
-                buffer[used++] = b;
-                return true;
-            }
-
-            return false;
-        }
-
-        public void write(byte[] b, int off, int len) {
-            System.arraycopy(b, off, buffer, used, len);
-            used = used + len;
-        }
-
-        public void read(byte[] b, int off, int len) {
-            System.arraycopy(buffer, pointer, b, off, len);
-            pointer = pointer + len;
-        }
-
-        public void writeTo(OutputStream target) throws IOException {
-            if (pointer < used) {
-                target.write(buffer, pointer, used - pointer);
-                pointer = used;
-            }
-        }
-
-        public void reset() {
-            pointer = 0;
-        }
-
-        public int bytesUsed() {
-            return used;
-        }
-
-        public int bytesUnread() {
-            return used - pointer;
-        }
-
-        public int read() {
-            if (pointer < used) {
-                return buffer[pointer++] & 0xff;
-            }
-
-            return -1;
-        }
-
-        public int spaceLeft() {
-            return size - used;
-        }
-    }
-
-    class StreamByteBufferOutputStream extends OutputStream {
-        private boolean closed = false;
-
-        @Override
-        public void write(byte[] b, int off, int len) throws IOException {
-            if (b == null) {
-                throw new NullPointerException();
-            }
-
-            if ((off < 0) || (off > b.length) || (len < 0) ||
-                    ((off + len) > b.length) || ((off + len) < 0)) {
-                throw new IndexOutOfBoundsException();
-            }
-
-            if (len == 0) {
-                return;
-            }
-
-            int bytesLeft = len;
-            int currentOffset = off;
-            while (bytesLeft > 0) {
-                int spaceLeft = allocateSpace();
-                int writeBytes = Math.min(spaceLeft, bytesLeft);
-                currentWriteChunk.write(b, currentOffset, writeBytes);
-                bytesLeft -= writeBytes;
-                currentOffset += writeBytes;
-            }
-        }
-
-        @Override
-        public void close() throws IOException {
-            closed = true;
-        }
-
-        public boolean isClosed() {
-            return closed;
-        }
-
-        @Override
-        public void write(int b) throws IOException {
-            allocateSpace();
-            currentWriteChunk.write((byte) b);
-        }
-
-        public StreamByteBuffer getBuffer() {
-            return StreamByteBuffer.this;
-        }
-    }
-
-    class StreamByteBufferInputStream extends InputStream {
-        @Override
-        public int read() throws IOException {
-            prepareRead();
-            return currentReadChunk.read();
-        }
-
-        @Override
-        public int read(byte[] b, int off, int len) throws IOException {
-            return readImpl(b, off, len);
-        }
-
-        int readImpl(byte[] b, int off, int len) {
-            if (b == null) {
-                throw new NullPointerException();
-            }
-
-            if ((off < 0) || (off > b.length) || (len < 0) ||
-                    ((off + len) > b.length) || ((off + len) < 0)) {
-                throw new IndexOutOfBoundsException();
-            }
-
-            if (len == 0) {
-                return 0;
-            }
-
-            int bytesLeft = len;
-            int currentOffset = off;
-            int bytesUnread = prepareRead();
-            int totalBytesRead = 0;
-            while (bytesLeft > 0 && bytesUnread != -1) {
-                int readBytes = Math.min(bytesUnread, bytesLeft);
-                currentReadChunk.read(b, currentOffset, readBytes);
-                bytesLeft -= readBytes;
-                currentOffset += readBytes;
-                totalBytesRead += readBytes;
-                bytesUnread = prepareRead();
-            }
-            if (totalBytesRead > 0) {
-                return totalBytesRead;
-            }
-
-            return -1;
-        }
-
-        @Override
-        public synchronized void reset() throws IOException {
-            if (readMode == ReadMode.RETAIN_AFTER_READING) {
-                StreamByteBuffer.this.reset();
-            }
-            else {
-                // reset isn't supported in ReadMode.REMOVE_AFTER_READING
-                super.reset();
-            }
-        }
-
-        @Override
-        public int available() throws IOException {
-            return totalBytesUnread();
-        }
-
-        public StreamByteBuffer getBuffer() {
-            return StreamByteBuffer.this;
-        }
-    }
-
-    public void clear() {
-        chunks.clear();
-        currentReadChunk = null;
-        totalBytesUnreadInList = 0;
-        totalBytesUnreadInIterator = 0;
-        currentWriteChunk = new StreamByteBufferChunk(chunkSize);
-        readIterator = null;
-    }
-}
+/*
+ *  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.
+ */
+package org.grails.buffer;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
+import java.nio.charset.Charset;
+import java.nio.charset.CharsetDecoder;
+import java.nio.charset.CoderResult;
+import java.nio.charset.CodingErrorAction;
+import java.util.Iterator;
+import java.util.LinkedList;
+
+import grails.util.GrailsArrayUtils;
+
+/**
+ * An in-memory buffer that provides OutputStream and InputStream interfaces.
+ *
+ * This is more efficient than using ByteArrayOutputStream/ByteArrayInputStream
+ *
+ * This is not thread-safe, it is intended to be used by a single Thread.
+ *
+ * @author Lari Hotari, Sagire Software Oy
+ */
+public class StreamByteBuffer {
+
+    private static final int DEFAULT_CHUNK_SIZE = 8192;
+
+    private LinkedList<StreamByteBufferChunk> chunks = new LinkedList<>();
+    private StreamByteBufferChunk currentWriteChunk;
+    private StreamByteBufferChunk currentReadChunk = null;
+    private int chunkSize;
+    private StreamByteBufferOutputStream output;
+    private StreamByteBufferInputStream input;
+    private int totalBytesUnreadInList = 0;
+    private int totalBytesUnreadInIterator = 0;
+    private ReadMode readMode;
+    private Iterator<StreamByteBufferChunk> readIterator;
+
+    public enum ReadMode {
+        REMOVE_AFTER_READING,
+        RETAIN_AFTER_READING
+    }
+
+    public StreamByteBuffer() {
+        this(DEFAULT_CHUNK_SIZE);
+    }
+
+    public StreamByteBuffer(int chunkSize) {
+        this(chunkSize, ReadMode.REMOVE_AFTER_READING);
+    }
+
+    public StreamByteBuffer(int chunkSize, ReadMode readMode) {
+        this.chunkSize = chunkSize;
+        this.readMode = readMode;
+        currentWriteChunk = new StreamByteBufferChunk(chunkSize);
+        output = new StreamByteBufferOutputStream();
+        input = new StreamByteBufferInputStream();
+    }
+
+    public OutputStream getOutputStream() {
+        return output;
+    }
+
+    public InputStream getInputStream() {
+        return input;
+    }
+
+    public void writeTo(OutputStream target) throws IOException {
+        while (prepareRead() != -1) {
+            currentReadChunk.writeTo(target);
+        }
+    }
+
+    public byte[] readAsByteArray() {
+        byte[] buf = new byte[totalBytesUnread()];
+        input.readImpl(buf, 0, buf.length);
+        return buf;
+    }
+
+    public String readAsString(String encoding) throws CharacterCodingException {
+        Charset charset = Charset.forName(encoding);
+        return readAsString(charset);
+    }
+
+    public String readAsString(Charset charset) throws CharacterCodingException {
+        int unreadSize = totalBytesUnread();
+        if (unreadSize > 0) {
+            CharsetDecoder decoder = charset.newDecoder().onMalformedInput(
+                    CodingErrorAction.REPLACE).onUnmappableCharacter(
+                    CodingErrorAction.REPLACE);
+            CharBuffer charbuffer = CharBuffer.allocate(unreadSize);
+            ByteBuffer buf = null;
+            while (prepareRead() != -1) {
+                buf = currentReadChunk.readToNioBuffer();
+                boolean endOfInput = (prepareRead() == -1);
+                CoderResult result = decoder.decode(buf, charbuffer, endOfInput);
+                if (endOfInput) {
+                    if (!result.isUnderflow()) {
+                        result.throwException();
+                    }
+                }
+            }
+            CoderResult result = decoder.flush(charbuffer);
+            if (buf.hasRemaining()) {
+                throw new IllegalStateException("There's a bug here, buffer wasn't read fully.");
+            }
+            if (!result.isUnderflow()) {
+                result.throwException();
+            }
+            charbuffer.flip();
+            String str;
+            if (charbuffer.hasArray()) {
+                int len = charbuffer.remaining();
+                char[] ch = charbuffer.array();
+                if (len != ch.length) {
+                    ch = (char[]) GrailsArrayUtils.subarray(ch, 0, len);
+                }
+                str = StringCharArrayAccessor.createString(ch);
+            }
+            else {
+                str = charbuffer.toString();
+            }
+            return str;
+        }
+        return null;
+    }
+
+    public int totalBytesUnread() {
+        int total = 0;
+        if (readMode == ReadMode.REMOVE_AFTER_READING) {
+            total = totalBytesUnreadInList;
+        }
+        else if (readMode == ReadMode.RETAIN_AFTER_READING) {
+            prepareRetainAfterReading();
+            total = totalBytesUnreadInIterator;
+        }
+        if (currentReadChunk != null) {
+            total += currentReadChunk.bytesUnread();
+        }
+        if (currentWriteChunk != currentReadChunk && currentWriteChunk != null) {
+            if (readMode == ReadMode.REMOVE_AFTER_READING) {
+                total += currentWriteChunk.bytesUnread();
+            }
+            else if (readMode == ReadMode.RETAIN_AFTER_READING) {
+                total += currentWriteChunk.bytesUsed();
+            }
+        }
+        return total;
+    }
+
+    protected int allocateSpace() {
+        int spaceLeft = currentWriteChunk.spaceLeft();
+        if (spaceLeft == 0) {
+            chunks.add(currentWriteChunk);
+            totalBytesUnreadInList += currentWriteChunk.bytesUnread();
+            currentWriteChunk = new StreamByteBufferChunk(chunkSize);
+            spaceLeft = currentWriteChunk.spaceLeft();
+        }
+        return spaceLeft;
+    }
+
+    protected int prepareRead() {
+        prepareRetainAfterReading();
+        int bytesUnread = (currentReadChunk != null) ? currentReadChunk.bytesUnread() : 0;
+        if (bytesUnread == 0) {
+            if (readMode == ReadMode.REMOVE_AFTER_READING && !chunks.isEmpty()) {
+                currentReadChunk = chunks.removeFirst();
+                bytesUnread = currentReadChunk.bytesUnread();
+                totalBytesUnreadInList -= bytesUnread;
+            }
+            else if (readMode == ReadMode.RETAIN_AFTER_READING && readIterator.hasNext()) {
+                currentReadChunk = readIterator.next();
+                currentReadChunk.reset();
+                bytesUnread = currentReadChunk.bytesUnread();
+                totalBytesUnreadInIterator -= bytesUnread;
+            }
+            else if (currentReadChunk != currentWriteChunk) {
+                currentReadChunk = currentWriteChunk;
+                bytesUnread = currentReadChunk.bytesUnread();
+            }
+            else {
+                bytesUnread = -1;
+            }
+        }
+        return bytesUnread;
+    }
+
+    public void reset() {
+        if (readMode == ReadMode.RETAIN_AFTER_READING) {
+            readIterator = null;
+            prepareRetainAfterReading();
+            if (currentWriteChunk != null) {
+                currentWriteChunk.reset();
+            }
+        }
+    }
+
+    private void prepareRetainAfterReading() {
+        if (readMode == ReadMode.RETAIN_AFTER_READING && readIterator == null) {
+            readIterator = chunks.iterator();
+            totalBytesUnreadInIterator = totalBytesUnreadInList;
+            currentReadChunk = null;
+        }
+    }
+
+    public ReadMode getReadMode() {
+        return readMode;
+    }
+
+    public void setReadMode(ReadMode readMode) {
+        this.readMode = readMode;
+    }
+
+    public void retainAfterReadingMode() {
+        setReadMode(ReadMode.RETAIN_AFTER_READING);
+    }
+
+    class StreamByteBufferChunk {
+        private int pointer = 0;
+        private byte[] buffer;
+        private int size;
+        private int used = 0;
+
+        public StreamByteBufferChunk(int size) {
+            this.size = size;
+            buffer = new byte[size];
+        }
+
+        public ByteBuffer readToNioBuffer() {
+            if (pointer < used) {
+                ByteBuffer result;
+                if (pointer > 0 || used < size) {
+                    result = ByteBuffer.wrap(buffer, pointer, used - pointer);
+                }
+                else {
+                    result = ByteBuffer.wrap(buffer);
+                }
+                pointer = used;
+                return result;
+            }
+
+            return null;
+        }
+
+        public boolean write(byte b) {
+            if (used < size) {
+                buffer[used++] = b;
+                return true;
+            }
+
+            return false;
+        }
+
+        public void write(byte[] b, int off, int len) {
+            System.arraycopy(b, off, buffer, used, len);
+            used = used + len;
+        }
+
+        public void read(byte[] b, int off, int len) {
+            System.arraycopy(buffer, pointer, b, off, len);
+            pointer = pointer + len;
+        }
+
+        public void writeTo(OutputStream target) throws IOException {
+            if (pointer < used) {
+                target.write(buffer, pointer, used - pointer);
+                pointer = used;
+            }
+        }
+
+        public void reset() {
+            pointer = 0;
+        }
+
+        public int bytesUsed() {
+            return used;
+        }
+
+        public int bytesUnread() {
+            return used - pointer;
+        }
+
+        public int read() {
+            if (pointer < used) {
+                return buffer[pointer++] & 0xff;
+            }
+
+            return -1;
+        }
+
+        public int spaceLeft() {
+            return size - used;
+        }
+    }
+
+    class StreamByteBufferOutputStream extends OutputStream {
+        private boolean closed = false;
+
+        @Override
+        public void write(byte[] b, int off, int len) throws IOException {
+            if (b == null) {
+                throw new NullPointerException();
+            }
+
+            if ((off < 0) || (off > b.length) || (len < 0) ||
+                    ((off + len) > b.length) || ((off + len) < 0)) {
+                throw new IndexOutOfBoundsException();
+            }
+
+            if (len == 0) {
+                return;
+            }
+
+            int bytesLeft = len;
+            int currentOffset = off;
+            while (bytesLeft > 0) {
+                int spaceLeft = allocateSpace();
+                int writeBytes = Math.min(spaceLeft, bytesLeft);
+                currentWriteChunk.write(b, currentOffset, writeBytes);
+                bytesLeft -= writeBytes;
+                currentOffset += writeBytes;
+            }
+        }
+
+        @Override
+        public void close() throws IOException {
+            closed = true;
+        }
+
+        public boolean isClosed() {
+            return closed;
+        }
+
+        @Override
+        public void write(int b) throws IOException {
+            allocateSpace();
+            currentWriteChunk.write((byte) b);
+        }
+
+        public StreamByteBuffer getBuffer() {
+            return StreamByteBuffer.this;
+        }
+    }
+
+    class StreamByteBufferInputStream extends InputStream {
+        @Override
+        public int read() throws IOException {
+            prepareRead();
+            return currentReadChunk.read();
+        }
+
+        @Override
+        public int read(byte[] b, int off, int len) throws IOException {
+            return readImpl(b, off, len);
+        }
+
+        int readImpl(byte[] b, int off, int len) {
+            if (b == null) {
+                throw new NullPointerException();
+            }
+
+            if ((off < 0) || (off > b.length) || (len < 0) ||
+                    ((off + len) > b.length) || ((off + len) < 0)) {
+                throw new IndexOutOfBoundsException();
+            }
+
+            if (len == 0) {
+                return 0;
+            }
+
+            int bytesLeft = len;
+            int currentOffset = off;
+            int bytesUnread = prepareRead();
+            int totalBytesRead = 0;
+            while (bytesLeft > 0 && bytesUnread != -1) {
+                int readBytes = Math.min(bytesUnread, bytesLeft);
+                currentReadChunk.read(b, currentOffset, readBytes);
+                bytesLeft -= readBytes;
+                currentOffset += readBytes;
+                totalBytesRead += readBytes;
+                bytesUnread = prepareRead();
+            }
+            if (totalBytesRead > 0) {
+                return totalBytesRead;
+            }
+
+            return -1;
+        }
+
+        @Override
+        public synchronized void reset() throws IOException {
+            if (readMode == ReadMode.RETAIN_AFTER_READING) {
+                StreamByteBuffer.this.reset();
+            }
+            else {
+                // reset isn't supported in ReadMode.REMOVE_AFTER_READING
+                super.reset();
+            }
+        }
+
+        @Override
+        public int available() throws IOException {
+            return totalBytesUnread();
+        }
+
+        public StreamByteBuffer getBuffer() {
+            return StreamByteBuffer.this;
+        }
+    }
+
+    public void clear() {
+        chunks.clear();
+        currentReadChunk = null;
+        totalBytesUnreadInList = 0;
+        totalBytesUnreadInIterator = 0;
+        currentWriteChunk = new StreamByteBufferChunk(chunkSize);
+        readIterator = null;
+    }
+}
diff --git a/grails-encoder/src/main/groovy/org/grails/encoder/impl/URLCodecFactory.groovy b/grails-encoder/src/main/groovy/org/grails/encoder/impl/URLCodecFactory.groovy
index 395b4728f0..344dd4a3fe 100644
--- a/grails-encoder/src/main/groovy/org/grails/encoder/impl/URLCodecFactory.groovy
+++ b/grails-encoder/src/main/groovy/org/grails/encoder/impl/URLCodecFactory.groovy
@@ -1,81 +1,81 @@
-/*
- *  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.
- */
-package org.grails.encoder.impl
-
-import groovy.transform.CompileStatic
-
-import org.grails.encoder.CodecFactory
-import org.grails.encoder.CodecIdentifier
-import org.grails.encoder.Decoder
-import org.grails.encoder.DefaultCodecIdentifier
-import org.grails.encoder.Encoder
-
-/**
- * Implements the 'www-form-urlencoded' encoding scheme, also misleadingly known as URL encoding.
- *
- * @see <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">Chapter 17.13.4 Form content types</a>
- *           of the <a href="http://www.w3.org/TR/html4/">HTML 4.01 Specification</a>
- *
- * @since 2.4
- */
-@CompileStatic
-class URLCodecFactory implements CodecFactory {
-
-    static final CodecIdentifier URL_CODEC_IDENTIFIER = new DefaultCodecIdentifier('URL')
-
-    Encoder encoder = new Encoder() {
-        @Override
-        CodecIdentifier getCodecIdentifier() {
-            URL_CODEC_IDENTIFIER
-        }
-
-        Object encode(Object o) {
-            if (o == null) return o
-            URLEncoder.encode(String.valueOf(o), resolveEncoding())
-        }
-
-        boolean isApplyToSafelyEncoded() {
-            true
-        }
-
-        boolean isSafe() {
-            true
-        }
-
-        void markEncoded(CharSequence string) {
-
-        }
-    }
-
-    Decoder decoder = new Decoder() {
-        CodecIdentifier getCodecIdentifier() {
-            URL_CODEC_IDENTIFIER
-        }
-
-        @Override
-        Object decode(Object o) {
-            if (o == null) return o
-            URLDecoder.decode(String.valueOf(o), resolveEncoding())
-        }
-    }
-
-    protected String resolveEncoding() {
-        'UTF-8'
-    }
-}
+/*
+ *  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.
+ */
+package org.grails.encoder.impl
+
+import groovy.transform.CompileStatic
+
+import org.grails.encoder.CodecFactory
+import org.grails.encoder.CodecIdentifier
+import org.grails.encoder.Decoder
+import org.grails.encoder.DefaultCodecIdentifier
+import org.grails.encoder.Encoder
+
+/**
+ * Implements the 'www-form-urlencoded' encoding scheme, also misleadingly known as URL encoding.
+ *
+ * @see <a href="http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1">Chapter 17.13.4 Form content types</a>
+ *           of the <a href="http://www.w3.org/TR/html4/">HTML 4.01 Specification</a>
+ *
+ * @since 2.4
+ */
+@CompileStatic
+class URLCodecFactory implements CodecFactory {
+
+    static final CodecIdentifier URL_CODEC_IDENTIFIER = new DefaultCodecIdentifier('URL')
+
+    Encoder encoder = new Encoder() {
+        @Override
+        CodecIdentifier getCodecIdentifier() {
+            URL_CODEC_IDENTIFIER
+        }
+
+        Object encode(Object o) {
+            if (o == null) return o
+            URLEncoder.encode(String.valueOf(o), resolveEncoding())
+        }
+
+        boolean isApplyToSafelyEncoded() {
+            true
+        }
+
+        boolean isSafe() {
+            true
+        }
+
+        void markEncoded(CharSequence string) {
+
+        }
+    }
+
+    Decoder decoder = new Decoder() {
+        CodecIdentifier getCodecIdentifier() {
+            URL_CODEC_IDENTIFIER
+        }
+
+        @Override
+        Object decode(Object o) {
+            if (o == null) return o
+            URLDecoder.decode(String.valueOf(o), resolveEncoding())
+        }
+    }
+
+    protected String resolveEncoding() {
+        'UTF-8'
+    }
+}
diff --git a/grails-spring/src/main/groovy/org/grails/spring/BeanConfiguration.java b/grails-spring/src/main/groovy/org/grails/spring/BeanConfiguration.java
index f29c020b5b..f370f546e8 100644
--- a/grails-spring/src/main/groovy/org/grails/spring/BeanConfiguration.java
+++ b/grails-spring/src/main/groovy/org/grails/spring/BeanConfiguration.java
@@ -1,144 +1,144 @@
-/*
- *  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.
- */
-package org.grails.spring;
-
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-
-/**
- * Represents a runtime bean configuration.
- *
- * Credit must go to Solomon Duskis and the
- * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
- *
- * @author Graeme
- * @since 0.3
- */
-public interface BeanConfiguration {
-
-    String AUTOWIRE_BY_TYPE = "byType";
-    String AUTOWIRE_BY_NAME = "byName";
-
-    /**
-     * @return The name of the bean
-     */
-    String getName();
-
-    /**
-     * @return true if the bean is singleton
-     */
-    boolean isSingleton();
-
-    /**
-     * @return The Spring bean definition instance
-     */
-    AbstractBeanDefinition getBeanDefinition();
-
-    /**
-     * Adds a property value to this bean.
-     * @param propertyName The name of the property
-     * @param propertyValue The value of the property
-     *
-     * @return Returns this bean configuration
-     */
-    BeanConfiguration addProperty(String propertyName, Object propertyValue);
-
-    /**
-     * Sets the name of the method to call when destroying the bean.
-     *
-     * @param methodName The method name
-     * @return This bean configuration
-     */
-    BeanConfiguration setDestroyMethod(String methodName);
-
-    /**
-     * Sets the names of the beans this bean configuration depends on
-     *
-     * @param dependsOn Bean names it depends on
-     * @return This bean configuration
-     */
-    BeanConfiguration setDependsOn(String[] dependsOn);
-
-    /**
-     *
-     * @param beanName
-     * @return This BeanConfiguration
-     */
-    BeanConfiguration setFactoryBean(String beanName);
-
-    /**
-     *
-     * @param methodName
-     * @return This BeanConfiguration
-     */
-    BeanConfiguration setFactoryMethod(String methodName);
-
-    /**
-     * Sets the autowire type, either "byType" or "byName"
-     *
-     * @param type The type
-     * @return This BeanConfiguration
-     */
-    BeanConfiguration setAutowire(String type);
-
-    /**
-     * Sets the name of the bean in the app ctx.
-     * @param beanName The bean name
-     */
-    void setName(String beanName);
-
-    /**
-     * Returns true if the bean config has the name property set.
-     * @param name The name of the property
-     * @return true if it does have a property with the given name
-     */
-    boolean hasProperty(String name);
-
-    /**
-     * Returns the value of the given property or throws a MissingPropertyException.
-     *
-     * @param name The name of the property
-     * @return The value of the property
-     */
-    Object getPropertyValue(String name);
-
-    /**
-     * Sets a property value on the bean configuration
-     *
-     * @param property The name of the property
-     * @param newValue The value
-     */
-    void setPropertyValue(String property, Object newValue);
-
-    /**
-     * Sets the BeanConfiguration as an Abstract bean definition
-     * @param isAbstract Whether its abstract or not
-     * @return This BeanConfiguration object
-     */
-    BeanConfiguration setAbstract(boolean isAbstract);
-
-    /**
-     * Sets the name of the parent bean.
-     *
-     * @param name Either a string which is the name of the bean, a RuntimeBeanReference or a BeanConfiguration
-     */
-    void setParent(Object name);
-
-    void setBeanDefinition(BeanDefinition definition);
-}
+/*
+ *  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.
+ */
+package org.grails.spring;
+
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+
+/**
+ * Represents a runtime bean configuration.
+ *
+ * Credit must go to Solomon Duskis and the
+ * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
+ *
+ * @author Graeme
+ * @since 0.3
+ */
+public interface BeanConfiguration {
+
+    String AUTOWIRE_BY_TYPE = "byType";
+    String AUTOWIRE_BY_NAME = "byName";
+
+    /**
+     * @return The name of the bean
+     */
+    String getName();
+
+    /**
+     * @return true if the bean is singleton
+     */
+    boolean isSingleton();
+
+    /**
+     * @return The Spring bean definition instance
+     */
+    AbstractBeanDefinition getBeanDefinition();
+
+    /**
+     * Adds a property value to this bean.
+     * @param propertyName The name of the property
+     * @param propertyValue The value of the property
+     *
+     * @return Returns this bean configuration
+     */
+    BeanConfiguration addProperty(String propertyName, Object propertyValue);
+
+    /**
+     * Sets the name of the method to call when destroying the bean.
+     *
+     * @param methodName The method name
+     * @return This bean configuration
+     */
+    BeanConfiguration setDestroyMethod(String methodName);
+
+    /**
+     * Sets the names of the beans this bean configuration depends on
+     *
+     * @param dependsOn Bean names it depends on
+     * @return This bean configuration
+     */
+    BeanConfiguration setDependsOn(String[] dependsOn);
+
+    /**
+     *
+     * @param beanName
+     * @return This BeanConfiguration
+     */
+    BeanConfiguration setFactoryBean(String beanName);
+
+    /**
+     *
+     * @param methodName
+     * @return This BeanConfiguration
+     */
+    BeanConfiguration setFactoryMethod(String methodName);
+
+    /**
+     * Sets the autowire type, either "byType" or "byName"
+     *
+     * @param type The type
+     * @return This BeanConfiguration
+     */
+    BeanConfiguration setAutowire(String type);
+
+    /**
+     * Sets the name of the bean in the app ctx.
+     * @param beanName The bean name
+     */
+    void setName(String beanName);
+
+    /**
+     * Returns true if the bean config has the name property set.
+     * @param name The name of the property
+     * @return true if it does have a property with the given name
+     */
+    boolean hasProperty(String name);
+
+    /**
+     * Returns the value of the given property or throws a MissingPropertyException.
+     *
+     * @param name The name of the property
+     * @return The value of the property
+     */
+    Object getPropertyValue(String name);
+
+    /**
+     * Sets a property value on the bean configuration
+     *
+     * @param property The name of the property
+     * @param newValue The value
+     */
+    void setPropertyValue(String property, Object newValue);
+
+    /**
+     * Sets the BeanConfiguration as an Abstract bean definition
+     * @param isAbstract Whether its abstract or not
+     * @return This BeanConfiguration object
+     */
+    BeanConfiguration setAbstract(boolean isAbstract);
+
+    /**
+     * Sets the name of the parent bean.
+     *
+     * @param name Either a string which is the name of the bean, a RuntimeBeanReference or a BeanConfiguration
+     */
+    void setParent(Object name);
+
+    void setBeanDefinition(BeanDefinition definition);
+}
diff --git a/grails-spring/src/main/groovy/org/grails/spring/DefaultBeanConfiguration.java b/grails-spring/src/main/groovy/org/grails/spring/DefaultBeanConfiguration.java
index 5a933ff8fd..cfd976d8f0 100644
--- a/grails-spring/src/main/groovy/org/grails/spring/DefaultBeanConfiguration.java
+++ b/grails-spring/src/main/groovy/org/grails/spring/DefaultBeanConfiguration.java
@@ -1,320 +1,320 @@
-/*
- *  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.
- */
-package org.grails.spring;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import groovy.lang.GroovyObjectSupport;
-
-import org.springframework.beans.BeanWrapper;
-import org.springframework.beans.BeanWrapperImpl;
-import org.springframework.beans.PropertyValue;
-import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.ConstructorArgumentValues;
-import org.springframework.beans.factory.config.RuntimeBeanReference;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.GenericBeanDefinition;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.util.Assert;
-
-/**
- * Default implementation of the BeanConfiguration interface .
- *
- * Credit must go to Solomon Duskis and the
- * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
- *
- * @author Graeme
- * @since 0.3
- */
-public class DefaultBeanConfiguration extends GroovyObjectSupport implements BeanConfiguration {
-
-    private static final String AUTOWIRE = "autowire";
-    private static final String SINGLETON = "singleton";
-    private static final String CONSTRUCTOR_ARGS = "constructorArgs";
-    private static final String DESTROY_METHOD = "destroyMethod";
-    private static final String FACTORY_BEAN = "factoryBean";
-    private static final String FACTORY_METHOD = "factoryMethod";
-    private static final String INIT_METHOD = "initMethod";
-    private static final String BY_NAME = "byName";
-    private static final String PARENT = "parent";
-    private static final String BY_TYPE = "byType";
-    private static final String BY_CONSTRUCTOR = "constructor";
-    private static final List<String> DYNAMIC_PROPS = Arrays.asList(
-        AUTOWIRE,
-        CONSTRUCTOR_ARGS,
-        DESTROY_METHOD,
-        FACTORY_BEAN,
-        FACTORY_METHOD,
-        INIT_METHOD,
-        BY_NAME,
-        BY_TYPE,
-        BY_CONSTRUCTOR);
-
-    private String parentName;
-
-    @Override
-    public Object getProperty(String property) {
-        @SuppressWarnings("unused")
-        AbstractBeanDefinition bd = getBeanDefinition();
-        if (wrapper.isReadableProperty(property)) {
-            return wrapper.getPropertyValue(property);
-        }
-        if (DYNAMIC_PROPS.contains(property)) {
-            return null;
-        }
-        return super.getProperty(property);
-    }
-
-    @Override
-    public void setProperty(String property, Object newValue) {
-        if (PARENT.equals(property)) {
-            setParent(newValue);
-            return;
-        }
-
-        AbstractBeanDefinition bd = getBeanDefinition();
-        if (AUTOWIRE.equals(property)) {
-            if (BY_NAME.equals(newValue)) {
-                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_NAME);
-            }
-            else if (BY_TYPE.equals(newValue)) {
-                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE);
-            }
-            else if (Boolean.TRUE.equals(newValue)) {
-                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_NAME);
-            }
-            else if (BY_CONSTRUCTOR.equals(newValue)) {
-                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR);
-            }
-        }
-        // constructorArgs
-        else if (CONSTRUCTOR_ARGS.equals(property) && newValue instanceof List<?>) {
-            ConstructorArgumentValues cav = new ConstructorArgumentValues();
-            for (Object e : (List<?>) newValue) {
-                cav.addGenericArgumentValue(e);
-            }
-            bd.setConstructorArgumentValues(cav);
-        }
-        // destroyMethod
-        else if (DESTROY_METHOD.equals(property)) {
-            if (newValue != null) {
-                bd.setDestroyMethodName(newValue.toString());
-            }
-        }
-        // factoryBean
-        else if (FACTORY_BEAN.equals(property)) {
-            if (newValue != null) {
-                bd.setFactoryBeanName(newValue.toString());
-            }
-        }
-        // factoryMethod
-        else if (FACTORY_METHOD.equals(property)) {
-            if (newValue != null) {
-                bd.setFactoryMethodName(newValue.toString());
-            }
-        }
-        // initMethod
-        else if (INIT_METHOD.equals(property)) {
-            if (newValue != null) {
-                bd.setInitMethodName(newValue.toString());
-            }
-        }
-        // singleton property
-        else if (SINGLETON.equals(property)) {
-            bd.setScope(Boolean.TRUE.equals(newValue) ? BeanDefinition.SCOPE_SINGLETON : BeanDefinition.SCOPE_PROTOTYPE);
-        }
-        else if (wrapper.isWritableProperty(property)) {
-            wrapper.setPropertyValue(property, newValue);
-        }
-        // autowire
-        else {
-            super.setProperty(property, newValue);
-        }
-    }
-
-    private Class<?> clazz;
-    private String name;
-    private boolean singleton = true;
-    private AbstractBeanDefinition definition;
-    private Collection<?> constructorArgs = Collections.emptyList();
-    private BeanWrapper wrapper;
-
-    public DefaultBeanConfiguration(String name, Class<?> clazz) {
-        this.name = name;
-        this.clazz = clazz;
-    }
-
-    public DefaultBeanConfiguration(String name, Class<?> clazz, boolean prototype) {
-        this(name, clazz, Collections.emptyList());
-        singleton = !prototype;
-    }
-
-    public DefaultBeanConfiguration(String name) {
-        this(name, null, Collections.emptyList());
-    }
-
-    public DefaultBeanConfiguration(Class<?> clazz2) {
-        clazz = clazz2;
-    }
-
-    public DefaultBeanConfiguration(String name2, Class<?> clazz2, Collection<?> args) {
-        name = name2;
-        clazz = clazz2;
-        constructorArgs = args;
-    }
-
-    public DefaultBeanConfiguration(String name2, boolean prototype) {
-        this(name2, null, Collections.emptyList());
-        singleton = !prototype;
-    }
-
-    public DefaultBeanConfiguration(Class<?> clazz2, Collection<?> constructorArguments) {
-        clazz = clazz2;
-        constructorArgs = constructorArguments;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public boolean isSingleton() {
-        return singleton;
-    }
-
-    public AbstractBeanDefinition getBeanDefinition() {
-        if (definition == null) {
-            definition = createBeanDefinition();
-        }
-        return definition;
-    }
-
-    public void setBeanDefinition(BeanDefinition definition) {
-        this.definition = (AbstractBeanDefinition) definition;
-    }
-
-    protected AbstractBeanDefinition createBeanDefinition() {
-        AbstractBeanDefinition bd = new GenericBeanDefinition();
-        if (!constructorArgs.isEmpty()) {
-            ConstructorArgumentValues cav = new ConstructorArgumentValues();
-            for (Object constructorArg : constructorArgs) {
-                cav.addGenericArgumentValue(constructorArg);
-            }
-            bd.setConstructorArgumentValues(cav);
-        }
-        if (clazz != null) {
-            bd.setLazyInit(clazz.getAnnotation(Lazy.class) != null);
-            bd.setBeanClass(clazz);
-        }
-        bd.setScope(singleton ? AbstractBeanDefinition.SCOPE_SINGLETON : AbstractBeanDefinition.SCOPE_PROTOTYPE);
-        if (parentName != null) {
-            bd.setParentName(parentName);
-        }
-        wrapper = new BeanWrapperImpl(bd);
-        return bd;
-    }
-
-    public BeanConfiguration addProperty(String propertyName, Object propertyValue) {
-        if (propertyValue instanceof BeanConfiguration) {
-            propertyValue = ((BeanConfiguration) propertyValue).getBeanDefinition();
-        }
-        getBeanDefinition()
-            .getPropertyValues()
-            .addPropertyValue(propertyName, propertyValue);
-
-        return this;
-    }
-
-    public BeanConfiguration setDestroyMethod(String methodName) {
-        getBeanDefinition().setDestroyMethodName(methodName);
-        return this;
-    }
-
-    public BeanConfiguration setDependsOn(String[] dependsOn) {
-        getBeanDefinition().setDependsOn(dependsOn);
-        return this;
-    }
-
-    public BeanConfiguration setFactoryBean(String beanName) {
-        getBeanDefinition().setFactoryBeanName(beanName);
-        return this;
-    }
-
-    public BeanConfiguration setFactoryMethod(String methodName) {
-        getBeanDefinition().setFactoryMethodName(methodName);
-        return this;
-    }
-
-    public BeanConfiguration setAutowire(String type) {
-        if ("byName".equals(type)) {
-            getBeanDefinition().setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_NAME);
-        }
-        else if ("byType".equals(type)) {
-            getBeanDefinition().setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
-        }
-        return this;
-    }
-
-    public void setName(String beanName) {
-        name = beanName;
-    }
-
-    public Object getPropertyValue(String propName) {
-        PropertyValue propertyValue = getBeanDefinition()
-            .getPropertyValues()
-            .getPropertyValue(propName);
-        if (propertyValue == null) {
-            return null;
-        }
-
-        return propertyValue.getValue();
-    }
-
-    public boolean hasProperty(String propName) {
-        return getBeanDefinition().getPropertyValues().contains(propName);
-    }
-
-    public void setPropertyValue(String property, Object newValue) {
-        getBeanDefinition().getPropertyValues().addPropertyValue(property, newValue);
-    }
-
-    public BeanConfiguration setAbstract(boolean isAbstract) {
-        getBeanDefinition().setAbstract(isAbstract);
-        return this;
-    }
-
-    public void setParent(Object obj) {
-        Assert.notNull(obj, "Parent bean cannot be set to a null runtime bean reference!");
-
-        if (obj instanceof String) {
-            parentName = (String) obj;
-        }
-        else if (obj instanceof RuntimeBeanReference) {
-            parentName = ((RuntimeBeanReference) obj).getBeanName();
-        }
-        else if (obj instanceof BeanConfiguration) {
-            parentName = ((BeanConfiguration) obj).getName();
-        }
-        getBeanDefinition().setParentName(parentName);
-        setAbstract(false);
-    }
-}
+/*
+ *  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.
+ */
+package org.grails.spring;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+import groovy.lang.GroovyObjectSupport;
+
+import org.springframework.beans.BeanWrapper;
+import org.springframework.beans.BeanWrapperImpl;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.config.RuntimeBeanReference;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.GenericBeanDefinition;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.util.Assert;
+
+/**
+ * Default implementation of the BeanConfiguration interface .
+ *
+ * Credit must go to Solomon Duskis and the
+ * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
+ *
+ * @author Graeme
+ * @since 0.3
+ */
+public class DefaultBeanConfiguration extends GroovyObjectSupport implements BeanConfiguration {
+
+    private static final String AUTOWIRE = "autowire";
+    private static final String SINGLETON = "singleton";
+    private static final String CONSTRUCTOR_ARGS = "constructorArgs";
+    private static final String DESTROY_METHOD = "destroyMethod";
+    private static final String FACTORY_BEAN = "factoryBean";
+    private static final String FACTORY_METHOD = "factoryMethod";
+    private static final String INIT_METHOD = "initMethod";
+    private static final String BY_NAME = "byName";
+    private static final String PARENT = "parent";
+    private static final String BY_TYPE = "byType";
+    private static final String BY_CONSTRUCTOR = "constructor";
+    private static final List<String> DYNAMIC_PROPS = Arrays.asList(
+        AUTOWIRE,
+        CONSTRUCTOR_ARGS,
+        DESTROY_METHOD,
+        FACTORY_BEAN,
+        FACTORY_METHOD,
+        INIT_METHOD,
+        BY_NAME,
+        BY_TYPE,
+        BY_CONSTRUCTOR);
+
+    private String parentName;
+
+    @Override
+    public Object getProperty(String property) {
+        @SuppressWarnings("unused")
+        AbstractBeanDefinition bd = getBeanDefinition();
+        if (wrapper.isReadableProperty(property)) {
+            return wrapper.getPropertyValue(property);
+        }
+        if (DYNAMIC_PROPS.contains(property)) {
+            return null;
+        }
+        return super.getProperty(property);
+    }
+
+    @Override
+    public void setProperty(String property, Object newValue) {
+        if (PARENT.equals(property)) {
+            setParent(newValue);
+            return;
+        }
+
+        AbstractBeanDefinition bd = getBeanDefinition();
+        if (AUTOWIRE.equals(property)) {
+            if (BY_NAME.equals(newValue)) {
+                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_NAME);
+            }
+            else if (BY_TYPE.equals(newValue)) {
+                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE);
+            }
+            else if (Boolean.TRUE.equals(newValue)) {
+                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_NAME);
+            }
+            else if (BY_CONSTRUCTOR.equals(newValue)) {
+                bd.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR);
+            }
+        }
+        // constructorArgs
+        else if (CONSTRUCTOR_ARGS.equals(property) && newValue instanceof List<?>) {
+            ConstructorArgumentValues cav = new ConstructorArgumentValues();
+            for (Object e : (List<?>) newValue) {
+                cav.addGenericArgumentValue(e);
+            }
+            bd.setConstructorArgumentValues(cav);
+        }
+        // destroyMethod
+        else if (DESTROY_METHOD.equals(property)) {
+            if (newValue != null) {
+                bd.setDestroyMethodName(newValue.toString());
+            }
+        }
+        // factoryBean
+        else if (FACTORY_BEAN.equals(property)) {
+            if (newValue != null) {
+                bd.setFactoryBeanName(newValue.toString());
+            }
+        }
+        // factoryMethod
+        else if (FACTORY_METHOD.equals(property)) {
+            if (newValue != null) {
+                bd.setFactoryMethodName(newValue.toString());
+            }
+        }
+        // initMethod
+        else if (INIT_METHOD.equals(property)) {
+            if (newValue != null) {
+                bd.setInitMethodName(newValue.toString());
+            }
+        }
+        // singleton property
+        else if (SINGLETON.equals(property)) {
+            bd.setScope(Boolean.TRUE.equals(newValue) ? BeanDefinition.SCOPE_SINGLETON : BeanDefinition.SCOPE_PROTOTYPE);
+        }
+        else if (wrapper.isWritableProperty(property)) {
+            wrapper.setPropertyValue(property, newValue);
+        }
+        // autowire
+        else {
+            super.setProperty(property, newValue);
+        }
+    }
+
+    private Class<?> clazz;
+    private String name;
+    private boolean singleton = true;
+    private AbstractBeanDefinition definition;
+    private Collection<?> constructorArgs = Collections.emptyList();
+    private BeanWrapper wrapper;
+
+    public DefaultBeanConfiguration(String name, Class<?> clazz) {
+        this.name = name;
+        this.clazz = clazz;
+    }
+
+    public DefaultBeanConfiguration(String name, Class<?> clazz, boolean prototype) {
+        this(name, clazz, Collections.emptyList());
+        singleton = !prototype;
+    }
+
+    public DefaultBeanConfiguration(String name) {
+        this(name, null, Collections.emptyList());
+    }
+
+    public DefaultBeanConfiguration(Class<?> clazz2) {
+        clazz = clazz2;
+    }
+
+    public DefaultBeanConfiguration(String name2, Class<?> clazz2, Collection<?> args) {
+        name = name2;
+        clazz = clazz2;
+        constructorArgs = args;
+    }
+
+    public DefaultBeanConfiguration(String name2, boolean prototype) {
+        this(name2, null, Collections.emptyList());
+        singleton = !prototype;
+    }
+
+    public DefaultBeanConfiguration(Class<?> clazz2, Collection<?> constructorArguments) {
+        clazz = clazz2;
+        constructorArgs = constructorArguments;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public boolean isSingleton() {
+        return singleton;
+    }
+
+    public AbstractBeanDefinition getBeanDefinition() {
+        if (definition == null) {
+            definition = createBeanDefinition();
+        }
+        return definition;
+    }
+
+    public void setBeanDefinition(BeanDefinition definition) {
+        this.definition = (AbstractBeanDefinition) definition;
+    }
+
+    protected AbstractBeanDefinition createBeanDefinition() {
+        AbstractBeanDefinition bd = new GenericBeanDefinition();
+        if (!constructorArgs.isEmpty()) {
+            ConstructorArgumentValues cav = new ConstructorArgumentValues();
+            for (Object constructorArg : constructorArgs) {
+                cav.addGenericArgumentValue(constructorArg);
+            }
+            bd.setConstructorArgumentValues(cav);
+        }
+        if (clazz != null) {
+            bd.setLazyInit(clazz.getAnnotation(Lazy.class) != null);
+            bd.setBeanClass(clazz);
+        }
+        bd.setScope(singleton ? AbstractBeanDefinition.SCOPE_SINGLETON : AbstractBeanDefinition.SCOPE_PROTOTYPE);
+        if (parentName != null) {
+            bd.setParentName(parentName);
+        }
+        wrapper = new BeanWrapperImpl(bd);
+        return bd;
+    }
+
+    public BeanConfiguration addProperty(String propertyName, Object propertyValue) {
+        if (propertyValue instanceof BeanConfiguration) {
+            propertyValue = ((BeanConfiguration) propertyValue).getBeanDefinition();
+        }
+        getBeanDefinition()
+            .getPropertyValues()
+            .addPropertyValue(propertyName, propertyValue);
+
+        return this;
+    }
+
+    public BeanConfiguration setDestroyMethod(String methodName) {
+        getBeanDefinition().setDestroyMethodName(methodName);
+        return this;
+    }
+
+    public BeanConfiguration setDependsOn(String[] dependsOn) {
+        getBeanDefinition().setDependsOn(dependsOn);
+        return this;
+    }
+
+    public BeanConfiguration setFactoryBean(String beanName) {
+        getBeanDefinition().setFactoryBeanName(beanName);
+        return this;
+    }
+
+    public BeanConfiguration setFactoryMethod(String methodName) {
+        getBeanDefinition().setFactoryMethodName(methodName);
+        return this;
+    }
+
+    public BeanConfiguration setAutowire(String type) {
+        if ("byName".equals(type)) {
+            getBeanDefinition().setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_NAME);
+        }
+        else if ("byType".equals(type)) {
+            getBeanDefinition().setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);
+        }
+        return this;
+    }
+
+    public void setName(String beanName) {
+        name = beanName;
+    }
+
+    public Object getPropertyValue(String propName) {
+        PropertyValue propertyValue = getBeanDefinition()
+            .getPropertyValues()
+            .getPropertyValue(propName);
+        if (propertyValue == null) {
+            return null;
+        }
+
+        return propertyValue.getValue();
+    }
+
+    public boolean hasProperty(String propName) {
+        return getBeanDefinition().getPropertyValues().contains(propName);
+    }
+
+    public void setPropertyValue(String property, Object newValue) {
+        getBeanDefinition().getPropertyValues().addPropertyValue(property, newValue);
+    }
+
+    public BeanConfiguration setAbstract(boolean isAbstract) {
+        getBeanDefinition().setAbstract(isAbstract);
+        return this;
+    }
+
+    public void setParent(Object obj) {
+        Assert.notNull(obj, "Parent bean cannot be set to a null runtime bean reference!");
+
+        if (obj instanceof String) {
+            parentName = (String) obj;
+        }
+        else if (obj instanceof RuntimeBeanReference) {
+            parentName = ((RuntimeBeanReference) obj).getBeanName();
+        }
+        else if (obj instanceof BeanConfiguration) {
+            parentName = ((BeanConfiguration) obj).getName();
+        }
+        getBeanDefinition().setParentName(parentName);
+        setAbstract(false);
+    }
+}
diff --git a/grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java b/grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java
index bcd55f0165..fa43f50607 100644
--- a/grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java
+++ b/grails-spring/src/main/groovy/org/grails/spring/DefaultRuntimeSpringConfiguration.java
@@ -1,367 +1,367 @@
-/*
- *  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.
- */
-package org.grails.spring;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import groovy.lang.GroovySystem;
-import groovy.lang.MetaClass;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.springframework.beans.PropertyValue;
-import org.springframework.beans.factory.ListableBeanFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.beans.factory.support.DefaultListableBeanFactory;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.util.Assert;
-
-/**
- * A programmable runtime Spring configuration that allows a spring ApplicationContext
- * to be constructed at runtime.
- *
- * Credit must go to Solomon Duskis and the
- * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
- *
- * @author Graeme
- * @since 0.3
- */
-public class DefaultRuntimeSpringConfiguration implements RuntimeSpringConfiguration {
-
-    private static final Log LOG = LogFactory.getLog(DefaultRuntimeSpringConfiguration.class);
-    protected GenericApplicationContext context;
-    private Map<String, BeanConfiguration> beanConfigs = new HashMap<>();
-    private Map<String, BeanDefinition> beanDefinitions = new HashMap<>();
-    private Set<String> beanNames = new LinkedHashSet<>();
-    protected ApplicationContext parent;
-    protected ClassLoader classLoader;
-    protected Map<String, List<String>> aliases = new HashMap<>();
-    protected ListableBeanFactory beanFactory;
-
-    /**
-     * Creates the ApplicationContext instance. Subclasses can override to customise the used ApplicationContext
-     *
-     * @param parentCtx The parent ApplicationContext instance. Can be null.
-     *
-     * @return An instance of GenericApplicationContext
-     */
-    protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx) {
-        if (parentCtx != null && beanFactory != null) {
-            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
-                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");
-
-            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory, parentCtx);
-        }
-
-        if (beanFactory != null) {
-            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
-                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");
-
-            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory);
-        }
-
-        if (parentCtx != null) {
-            return new GrailsApplicationContext(parentCtx);
-        }
-
-        return new GrailsApplicationContext();
-    }
-
-    public DefaultRuntimeSpringConfiguration() {
-        super();
-    }
-
-    public DefaultRuntimeSpringConfiguration(ApplicationContext parent) {
-        this(parent, null);
-    }
-
-    public DefaultRuntimeSpringConfiguration(ApplicationContext parent, ClassLoader cl) {
-        this.parent = parent;
-        classLoader = cl;
-    }
-
-    private void trySettingClassLoaderOnContextIfFoundInParent(ApplicationContext parentCtx) {
-        if (parentCtx.containsBean("classLoader")) {
-            Object cl = parentCtx.getBean("classLoader");
-            if (cl instanceof ClassLoader) {
-                setClassLoaderOnContext((ClassLoader) cl);
-            }
-        }
-    }
-
-    private void setClassLoaderOnContext(ClassLoader cl) {
-        context.setClassLoader(cl);
-        context.getBeanFactory().setBeanClassLoader(cl);
-    }
-
-    /**
-     * Initialises the ApplicationContext instance.
-     */
-    protected void initialiseApplicationContext() {
-        if (context != null) {
-            return;
-        }
-
-        context = createApplicationContext(parent);
-
-        if (parent != null && classLoader == null) {
-            trySettingClassLoaderOnContextIfFoundInParent(parent);
-        }
-        else if (classLoader != null) {
-            setClassLoaderOnContext(classLoader);
-        }
-
-        Assert.notNull(context, "ApplicationContext cannot be null");
-    }
-
-    public BeanConfiguration addSingletonBean(String name, @SuppressWarnings("rawtypes") Class clazz) {
-        BeanConfiguration bc = new DefaultBeanConfiguration(name, clazz);
-        registerBeanConfiguration(name, bc);
-        return bc;
-    }
-
-    public BeanConfiguration addPrototypeBean(String name, @SuppressWarnings("rawtypes") Class clazz) {
-        BeanConfiguration bc = new DefaultBeanConfiguration(name, clazz, true);
-        registerBeanConfiguration(name, bc);
-        return bc;
-    }
-
-    public ApplicationContext getApplicationContext() {
-        long now = LOG.isDebugEnabled() ? System.currentTimeMillis() : 0;
-        initialiseApplicationContext();
-        registerBeansWithContext(context);
-        context.refresh();
-        if (LOG.isDebugEnabled()) {
-            LOG.debug("Created ApplicationContext in " + (System.currentTimeMillis() - now) + "ms");
-        }
-        return context;
-    }
-
-    public ApplicationContext getUnrefreshedApplicationContext() {
-        initialiseApplicationContext();
-        return context;
-    }
-
-    public BeanConfiguration addSingletonBean(String name) {
-        BeanConfiguration bc = new DefaultBeanConfiguration(name);
-        registerBeanConfiguration(name, bc);
-        return bc;
-    }
-
-    public BeanConfiguration createSingletonBean(@SuppressWarnings("rawtypes") Class clazz) {
-        return new DefaultBeanConfiguration(clazz);
-    }
-
-    @SuppressWarnings("rawtypes")
-    public BeanConfiguration addSingletonBean(String name, Class clazz, Collection args) {
-        BeanConfiguration bc = new DefaultBeanConfiguration(name, clazz, args);
-        registerBeanConfiguration(name, bc);
-        return bc;
-    }
-
-    public BeanConfiguration addPrototypeBean(String name) {
-        BeanConfiguration bc = new DefaultBeanConfiguration(name, true);
-        registerBeanConfiguration(name, bc);
-        return bc;
-    }
-
-    private void registerBeanConfiguration(String name, BeanConfiguration bc) {
-        beanConfigs.put(name, bc);
-        beanNames.add(name);
-    }
-
-    @SuppressWarnings("rawtypes")
-    public BeanConfiguration createSingletonBean(Class clazz, Collection constructorArguments) {
-        return new DefaultBeanConfiguration(clazz, constructorArguments);
-    }
-
-    public BeanConfiguration createPrototypeBean(String name) {
-        return new DefaultBeanConfiguration(name, true);
-    }
-
-    public BeanConfiguration createSingletonBean(String name) {
-        return new DefaultBeanConfiguration(name);
-    }
-
-    public void addBeanConfiguration(String beanName, BeanConfiguration beanConfiguration) {
-        beanConfiguration.setName(beanName);
-        registerBeanConfiguration(beanName, beanConfiguration);
-    }
-
-    public void addBeanDefinition(String name, BeanDefinition bd) {
-        beanDefinitions.put(name, bd);
-        beanConfigs.remove(name);
-        beanNames.add(name);
-    }
-
-    public boolean containsBean(String name) {
-        return beanNames.contains(name);
-    }
-
-    public BeanConfiguration getBeanConfig(String name) {
-        return beanConfigs.get(name);
-    }
-
-    public AbstractBeanDefinition createBeanDefinition(String name) {
-        if (containsBean(name)) {
-            if (beanDefinitions.containsKey(name)) {
-                return (AbstractBeanDefinition) beanDefinitions.get(name);
-            }
-            if (beanConfigs.containsKey(name)) {
-                return beanConfigs.get(name).getBeanDefinition();
-            }
-        }
-        return null;
-    }
-
-    public void registerPostProcessor(BeanFactoryPostProcessor processor) {
-        initialiseApplicationContext();
-        context.addBeanFactoryPostProcessor(processor);
-    }
-
-    public List<String> getBeanNames() {
-        return Collections.unmodifiableList(new ArrayList<>(beanNames));
-    }
-
-    public void registerBeansWithContext(GenericApplicationContext applicationContext) {
-        registerBeansWithRegistry(applicationContext);
-    }
-
-    public void registerBeansWithRegistry(BeanDefinitionRegistry registry) {
-        registerUnrefreshedBeansWithRegistry(registry);
-        registerBeanConfigsWithRegistry(registry);
-        registerBeanDefinitionsWithRegistry(registry);
-        registerBeanAliasesWithRegistry(registry);
-    }
-
-    private void registerUnrefreshedBeansWithRegistry(BeanDefinitionRegistry registry) {
-        if (context != null) {
-            for (String beanName : context.getBeanDefinitionNames()) {
-                registry.registerBeanDefinition(beanName, context.getBeanDefinition(beanName));
-            }
-        }
-    }
-
-    private void registerBeanConfigsWithRegistry(BeanDefinitionRegistry registry) {
-        for (BeanConfiguration bc : beanConfigs.values()) {
-            String beanName = bc.getName();
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("[RuntimeConfiguration] Registering bean [" + beanName + "]");
-                if (LOG.isTraceEnabled()) {
-                    PropertyValue[] pvs = bc.getBeanDefinition()
-                                            .getPropertyValues()
-                                            .getPropertyValues();
-                    for (PropertyValue pv : pvs) {
-                        LOG.trace("[RuntimeConfiguration] With property [" + pv.getName() + "] set to [" + pv.getValue() + "]");
-                    }
-                }
-            }
-
-            registry.registerBeanDefinition(beanName, bc.getBeanDefinition());
-        }
-    }
-
-    private void registerBeanDefinitionsWithRegistry(BeanDefinitionRegistry registry) {
-        for (Object key : beanDefinitions.keySet()) {
-            BeanDefinition bd = beanDefinitions.get(key);
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("[RuntimeConfiguration] Registering bean [" + key + "]");
-                if (LOG.isTraceEnabled()) {
-                    PropertyValue[] pvs = bd.getPropertyValues().getPropertyValues();
-                    for (PropertyValue pv : pvs) {
-                        LOG.trace("[RuntimeConfiguration] With property [" + pv.getName() + "] set to [" + pv.getValue() + "]");
-                    }
-                }
-            }
-            final String beanName = key.toString();
-            registry.registerBeanDefinition(beanName, bd);
-        }
-    }
-
-    public void registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig) {
-        if (targetSpringConfig == null) {
-            return;
-        }
-
-        ApplicationContext ctx = targetSpringConfig.getUnrefreshedApplicationContext();
-        if (ctx instanceof BeanDefinitionRegistry) {
-            final BeanDefinitionRegistry registry = (BeanDefinitionRegistry) ctx;
-            registerUnrefreshedBeansWithRegistry(registry);
-            registerBeansWithRegistry(registry);
-        }
-        for (Map.Entry<String, BeanConfiguration> beanEntry : beanConfigs.entrySet()) {
-            targetSpringConfig.addBeanConfiguration(beanEntry.getKey(), beanEntry.getValue());
-        }
-    }
-
-    private void registerBeanAliasesWithRegistry(BeanDefinitionRegistry beanDefinitionRegistry) {
-        for (Map.Entry<String, List<String>> entry : aliases.entrySet()) {
-            String beanName = entry.getKey();
-            List<String> beanAliases = entry.getValue();
-            if (beanAliases != null && !beanAliases.isEmpty()) {
-                for (String alias : beanAliases) {
-                    beanDefinitionRegistry.registerAlias(beanName, alias);
-                }
-            }
-        }
-    }
-
-    private void removeBeanDefinition(BeanDefinitionRegistry registry, String beanName) {
-        MetaClass mc = GroovySystem.getMetaClassRegistry().getMetaClass(registry.getClass());
-        if (!mc.respondsTo(registry, "removeBeanDefinition").isEmpty()) {
-            mc.invokeMethod(registry, "removeBeanDefinition", new Object[] { beanName });
-        }
-    }
-
-    public BeanConfiguration addAbstractBean(String name) {
-        BeanConfiguration bc = new DefaultBeanConfiguration(name);
-        bc.setAbstract(true);
-        registerBeanConfiguration(name, bc);
-        return bc;
-    }
-
-    public void addAlias(String alias, String beanName) {
-        List<String> beanAliases = aliases.get(beanName);
-        if (beanAliases == null) {
-            beanAliases = new ArrayList<>();
-            aliases.put(beanName, beanAliases);
-        }
-        beanAliases.add(alias);
-    }
-
-    public BeanDefinition getBeanDefinition(String beanName) {
-        return beanDefinitions.get(beanName);
-    }
-
-    public void setBeanFactory(ListableBeanFactory beanFactory) {
-        this.beanFactory = beanFactory;
-    }
-}
+/*
+ *  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.
+ */
+package org.grails.spring;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import groovy.lang.GroovySystem;
+import groovy.lang.MetaClass;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.ListableBeanFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.util.Assert;
+
+/**
+ * A programmable runtime Spring configuration that allows a spring ApplicationContext
+ * to be constructed at runtime.
+ *
+ * Credit must go to Solomon Duskis and the
+ * article: http://jroller.com/page/Solomon?entry=programmatic_configuration_in_spring
+ *
+ * @author Graeme
+ * @since 0.3
+ */
+public class DefaultRuntimeSpringConfiguration implements RuntimeSpringConfiguration {
+
+    private static final Log LOG = LogFactory.getLog(DefaultRuntimeSpringConfiguration.class);
+    protected GenericApplicationContext context;
+    private Map<String, BeanConfiguration> beanConfigs = new HashMap<>();
+    private Map<String, BeanDefinition> beanDefinitions = new HashMap<>();
+    private Set<String> beanNames = new LinkedHashSet<>();
+    protected ApplicationContext parent;
+    protected ClassLoader classLoader;
+    protected Map<String, List<String>> aliases = new HashMap<>();
+    protected ListableBeanFactory beanFactory;
+
+    /**
+     * Creates the ApplicationContext instance. Subclasses can override to customise the used ApplicationContext
+     *
+     * @param parentCtx The parent ApplicationContext instance. Can be null.
+     *
+     * @return An instance of GenericApplicationContext
+     */
+    protected GenericApplicationContext createApplicationContext(ApplicationContext parentCtx) {
+        if (parentCtx != null && beanFactory != null) {
+            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
+                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");
+
+            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory, parentCtx);
+        }
+
+        if (beanFactory != null) {
+            Assert.isInstanceOf(DefaultListableBeanFactory.class, beanFactory,
+                    "ListableBeanFactory set must be a subclass of DefaultListableBeanFactory");
+
+            return new GrailsApplicationContext((DefaultListableBeanFactory) beanFactory);
+        }
+
+        if (parentCtx != null) {
+            return new GrailsApplicationContext(parentCtx);
+        }
+
+        return new GrailsApplicationContext();
+    }
+
+    public DefaultRuntimeSpringConfiguration() {
+        super();
+    }
+
+    public DefaultRuntimeSpringConfiguration(ApplicationContext parent) {
+        this(parent, null);
+    }
+
+    public DefaultRuntimeSpringConfiguration(ApplicationContext parent, ClassLoader cl) {
+        this.parent = parent;
+        classLoader = cl;
+    }
+
+    private void trySettingClassLoaderOnContextIfFoundInParent(ApplicationContext parentCtx) {
+        if (parentCtx.containsBean("classLoader")) {
+            Object cl = parentCtx.getBean("classLoader");
+            if (cl instanceof ClassLoader) {
+                setClassLoaderOnContext((ClassLoader) cl);
+            }
+        }
+    }
+
+    private void setClassLoaderOnContext(ClassLoader cl) {
+        context.setClassLoader(cl);
+        context.getBeanFactory().setBeanClassLoader(cl);
+    }
+
+    /**
+     * Initialises the ApplicationContext instance.
+     */
+    protected void initialiseApplicationContext() {
+        if (context != null) {
+            return;
+        }
+
+        context = createApplicationContext(parent);
+
+        if (parent != null && classLoader == null) {
+            trySettingClassLoaderOnContextIfFoundInParent(parent);
+        }
+        else if (classLoader != null) {
+            setClassLoaderOnContext(classLoader);
+        }
+
+        Assert.notNull(context, "ApplicationContext cannot be null");
+    }
+
+    public BeanConfiguration addSingletonBean(String name, @SuppressWarnings("rawtypes") Class clazz) {
+        BeanConfiguration bc = new DefaultBeanConfiguration(name, clazz);
+        registerBeanConfiguration(name, bc);
+        return bc;
+    }
+
+    public BeanConfiguration addPrototypeBean(String name, @SuppressWarnings("rawtypes") Class clazz) {
+        BeanConfiguration bc = new DefaultBeanConfiguration(name, clazz, true);
+        registerBeanConfiguration(name, bc);
+        return bc;
+    }
+
+    public ApplicationContext getApplicationContext() {
+        long now = LOG.isDebugEnabled() ? System.currentTimeMillis() : 0;
+        initialiseApplicationContext();
+        registerBeansWithContext(context);
+        context.refresh();
+        if (LOG.isDebugEnabled()) {
+            LOG.debug("Created ApplicationContext in " + (System.currentTimeMillis() - now) + "ms");
+        }
+        return context;
+    }
+
+    public ApplicationContext getUnrefreshedApplicationContext() {
+        initialiseApplicationContext();
+        return context;
+    }
+
+    public BeanConfiguration addSingletonBean(String name) {
+        BeanConfiguration bc = new DefaultBeanConfiguration(name);
+        registerBeanConfiguration(name, bc);
+        return bc;
+    }
+
+    public BeanConfiguration createSingletonBean(@SuppressWarnings("rawtypes") Class clazz) {
+        return new DefaultBeanConfiguration(clazz);
+    }
+
+    @SuppressWarnings("rawtypes")
+    public BeanConfiguration addSingletonBean(String name, Class clazz, Collection args) {
+        BeanConfiguration bc = new DefaultBeanConfiguration(name, clazz, args);
+        registerBeanConfiguration(name, bc);
+        return bc;
+    }
+
+    public BeanConfiguration addPrototypeBean(String name) {
+        BeanConfiguration bc = new DefaultBeanConfiguration(name, true);
+        registerBeanConfiguration(name, bc);
+        return bc;
+    }
+
+    private void registerBeanConfiguration(String name, BeanConfiguration bc) {
+        beanConfigs.put(name, bc);
+        beanNames.add(name);
+    }
+
+    @SuppressWarnings("rawtypes")
+    public BeanConfiguration createSingletonBean(Class clazz, Collection constructorArguments) {
+        return new DefaultBeanConfiguration(clazz, constructorArguments);
+    }
+
+    public BeanConfiguration createPrototypeBean(String name) {
+        return new DefaultBeanConfiguration(name, true);
+    }
+
+    public BeanConfiguration createSingletonBean(String name) {
+        return new DefaultBeanConfiguration(name);
+    }
+
+    public void addBeanConfiguration(String beanName, BeanConfiguration beanConfiguration) {
+        beanConfiguration.setName(beanName);
+        registerBeanConfiguration(beanName, beanConfiguration);
+    }
+
+    public void addBeanDefinition(String name, BeanDefinition bd) {
+        beanDefinitions.put(name, bd);
+        beanConfigs.remove(name);
+        beanNames.add(name);
+    }
+
+    public boolean containsBean(String name) {
+        return beanNames.contains(name);
+    }
+
+    public BeanConfiguration getBeanConfig(String name) {
+        return beanConfigs.get(name);
+    }
+
+    public AbstractBeanDefinition createBeanDefinition(String name) {
+        if (containsBean(name)) {
+            if (beanDefinitions.containsKey(name)) {
+                return (AbstractBeanDefinition) beanDefinitions.get(name);
+            }
+            if (beanConfigs.containsKey(name)) {
+                return beanConfigs.get(name).getBeanDefinition();
+            }
+        }
+        return null;
+    }
+
+    public void registerPostProcessor(BeanFactoryPostProcessor processor) {
+        initialiseApplicationContext();
+        context.addBeanFactoryPostProcessor(processor);
+    }
+
+    public List<String> getBeanNames() {
+        return Collections.unmodifiableList(new ArrayList<>(beanNames));
+    }
+
+    public void registerBeansWithContext(GenericApplicationContext applicationContext) {
+        registerBeansWithRegistry(applicationContext);
+    }
+
+    public void registerBeansWithRegistry(BeanDefinitionRegistry registry) {
+        registerUnrefreshedBeansWithRegistry(registry);
+        registerBeanConfigsWithRegistry(registry);
+        registerBeanDefinitionsWithRegistry(registry);
+        registerBeanAliasesWithRegistry(registry);
+    }
+
+    private void registerUnrefreshedBeansWithRegistry(BeanDefinitionRegistry registry) {
+        if (context != null) {
+            for (String beanName : context.getBeanDefinitionNames()) {
+                registry.registerBeanDefinition(beanName, context.getBeanDefinition(beanName));
+            }
+        }
+    }
+
+    private void registerBeanConfigsWithRegistry(BeanDefinitionRegistry registry) {
+        for (BeanConfiguration bc : beanConfigs.values()) {
+            String beanName = bc.getName();
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("[RuntimeConfiguration] Registering bean [" + beanName + "]");
+                if (LOG.isTraceEnabled()) {
+                    PropertyValue[] pvs = bc.getBeanDefinition()
+                                            .getPropertyValues()
+                                            .getPropertyValues();
+                    for (PropertyValue pv : pvs) {
+                        LOG.trace("[RuntimeConfiguration] With property [" + pv.getName() + "] set to [" + pv.getValue() + "]");
+                    }
+                }
+            }
+
+            registry.registerBeanDefinition(beanName, bc.getBeanDefinition());
+        }
+    }
+
+    private void registerBeanDefinitionsWithRegistry(BeanDefinitionRegistry registry) {
+        for (Object key : beanDefinitions.keySet()) {
+            BeanDefinition bd = beanDefinitions.get(key);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("[RuntimeConfiguration] Registering bean [" + key + "]");
+                if (LOG.isTraceEnabled()) {
+                    PropertyValue[] pvs = bd.getPropertyValues().getPropertyValues();
+                    for (PropertyValue pv : pvs) {
+                        LOG.trace("[RuntimeConfiguration] With property [" + pv.getName() + "] set to [" + pv.getValue() + "]");
+                    }
+                }
+            }
+            final String beanName = key.toString();
+            registry.registerBeanDefinition(beanName, bd);
+        }
+    }
+
+    public void registerBeansWithConfig(RuntimeSpringConfiguration targetSpringConfig) {
+        if (targetSpringConfig == null) {
+            return;
+        }
+
+        ApplicationContext ctx = targetSpringConfig.getUnrefreshedApplicationContext();
+        if (ctx instanceof BeanDefinitionRegistry) {
+            final BeanDefinitionRegistry registry = (BeanDefinitionRegistry) ctx;
+            registerUnrefreshedBeansWithRegistry(registry);
+            registerBeansWithRegistry(registry);
+        }
+        for (Map.Entry<String, BeanConfiguration> beanEntry : beanConfigs.entrySet()) {
+            targetSpringConfig.addBeanConfiguration(beanEntry.getKey(), beanEntry.getValue());
+        }
+    }
+
+    private void registerBeanAliasesWithRegistry(BeanDefinitionRegistry beanDefinitionRegistry) {
+        for (Map.Entry<String, List<String>> entry : aliases.entrySet()) {
+            String beanName = entry.getKey();
+            List<String> beanAliases = entry.getValue();
+            if (beanAliases != null && !beanAliases.isEmpty()) {
+                for (String alias : beanAliases) {
+                    beanDefinitionRegistry.registerAlias(beanName, alias);
+                }
+            }
+        }
+    }
+
+    private void removeBeanDefinition(BeanDefinitionRegistry registry, String beanName) {
+        MetaClass mc = GroovySystem.getMetaClassRegistry().getMetaClass(registry.getClass());
+        if (!mc.respondsTo(registry, "removeBeanDefinition").isEmpty()) {
+            mc.invokeMethod(registry, "removeBeanDefinition", new Object[] { beanName });
+        }
+    }
+
+    public BeanConfiguration addAbstractBean(String name) {
+        BeanConfiguration bc = new DefaultBeanConfiguration(name);
+        bc.setAbstract(true);
+        registerBeanConfiguration(name, bc);
+        return bc;
+    }
+
+    public void addAlias(String alias, String beanName) {
+        List<String> beanAliases = aliases.get(beanName);
+        if (beanAliases == null) {
+            beanAliases = new ArrayList<>();
+            aliases.put(beanName, beanAliases);
+        }
+        beanAliases.add(alias);
+    }
+
+    public BeanDefinition getBeanDefinition(String beanName) {
+        return beanDefinitions.get(beanName);
+    }
+
+    public void setBeanFactory(ListableBeanFactory beanFactory) {
+        this.beanFactory = beanFactory;
+    }
+}
diff --git a/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyHandlerInterceptor.java b/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyHandlerInterceptor.java
index 07108e22fa..f22d070ca5 100755
--- a/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyHandlerInterceptor.java
+++ b/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyHandlerInterceptor.java
@@ -1,40 +1,40 @@
-/*
- *  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.
- */
-package org.grails.web.plugins.support;
-
-import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-
-import org.springframework.web.servlet.HandlerInterceptor;
-import org.springframework.web.servlet.ModelAndView;
-
-public class MyHandlerInterceptor implements HandlerInterceptor {
-
-    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
-        // do nothing
-    }
-
-    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
-        // do nothing
-    }
-
-    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
-        return false;
-    }
-}
+/*
+ *  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.
+ */
+package org.grails.web.plugins.support;
+
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.ModelAndView;
+
+public class MyHandlerInterceptor implements HandlerInterceptor {
+
+    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
+        // do nothing
+    }
+
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
+        // do nothing
+    }
+
+    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
+        return false;
+    }
+}
diff --git a/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyWebRequestInterceptor.java b/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyWebRequestInterceptor.java
index 63588b10b7..1006d44335 100755
--- a/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyWebRequestInterceptor.java
+++ b/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/MyWebRequestInterceptor.java
@@ -1,38 +1,38 @@
-/*
- *  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.
- */
-package org.grails.web.plugins.support;
-
-import org.springframework.ui.ModelMap;
-import org.springframework.web.context.request.WebRequest;
-import org.springframework.web.context.request.WebRequestInterceptor;
-
-public class MyWebRequestInterceptor implements WebRequestInterceptor {
-
-    public void afterCompletion(WebRequest request, Exception ex) {
-        // do nothing
-    }
-
-    public void postHandle(WebRequest request, ModelMap model) {
-        // do nothing
-    }
-
-    public void preHandle(WebRequest request) throws Exception {
-        // do nothing
-    }
-}
+/*
+ *  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.
+ */
+package org.grails.web.plugins.support;
+
+import org.springframework.ui.ModelMap;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.context.request.WebRequestInterceptor;
+
+public class MyWebRequestInterceptor implements WebRequestInterceptor {
+
+    public void afterCompletion(WebRequest request, Exception ex) {
+        // do nothing
+    }
+
+    public void postHandle(WebRequest request, ModelMap model) {
+        // do nothing
+    }
+
+    public void preHandle(WebRequest request) throws Exception {
+        // do nothing
+    }
+}
diff --git a/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/web-interceptor-wiring-tests.xml b/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/web-interceptor-wiring-tests.xml
index e73e1cb6a2..db49041326 100755
--- a/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/web-interceptor-wiring-tests.xml
+++ b/grails-test-suite-uber/src/test/groovy/org/grails/web/plugins/support/web-interceptor-wiring-tests.xml
@@ -1,57 +1,57 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~  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.
-  -->
-
-<!--
-
-     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
-
-       http://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.
-
--->
-<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "https://www.springframework.org/dtd/spring-beans.dtd">
-
-<beans>
-	<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
-
-	</bean>
-
-	<bean id="myHandlerInterceptor" class="org.codehaus.groovy.grails.web.plugins.support.MyHandlerInterceptor"/>
-
-	<bean id="myWebRequestInterceptor" class="org.codehaus.groovy.grails.web.plugins.support.MyWebRequestInterceptor"/>
-
-	<bean class="org.codehaus.groovy.grails.web.plugins.support.HandlerMappingInterceptorWiringBeanFactoryPostProcessor"/>
-
-	<bean id="machin" class="java.lang.Object"/>
-
-	<bean id="bidon" class="java.lang.Object"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~  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.
+  -->
+
+<!--
+
+     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
+
+       http://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.
+
+-->
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "https://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+	<bean id="handlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+
+	</bean>
+
+	<bean id="myHandlerInterceptor" class="org.codehaus.groovy.grails.web.plugins.support.MyHandlerInterceptor"/>
+
+	<bean id="myWebRequestInterceptor" class="org.codehaus.groovy.grails.web.plugins.support.MyWebRequestInterceptor"/>
+
+	<bean class="org.codehaus.groovy.grails.web.plugins.support.HandlerMappingInterceptorWiringBeanFactoryPostProcessor"/>
+
+	<bean id="machin" class="java.lang.Object"/>
+
+	<bean id="bidon" class="java.lang.Object"/>
 </beans>
\ No newline at end of file
diff --git a/grails-test-suite-web/src/test/groovy/org/grails/web/servlet/BindDataMethodTests.groovy b/grails-test-suite-web/src/test/groovy/org/grails/web/servlet/BindDataMethodTests.groovy
index ac36eab2bc..d1b9fbfee6 100644
--- a/grails-test-suite-web/src/test/groovy/org/grails/web/servlet/BindDataMethodTests.groovy
+++ b/grails-test-suite-web/src/test/groovy/org/grails/web/servlet/BindDataMethodTests.groovy
@@ -1,196 +1,196 @@
-/*
- *  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.
- */
-package org.grails.web.servlet
-
-import grails.artefact.Artefact
-import grails.testing.web.controllers.ControllerUnitTest
-import spock.lang.Specification
-
-/**
- * Tests for the bindData method
- *
- */
-class BindDataMethodTests extends Specification implements ControllerUnitTest<BindingController> {
-
-    void 'Test bindData with Map'() {
-        when:
-        def model = controller.bindWithMap()
-        def target = model.target
-
-        then:
-        target.name == 'Marc Palmer'
-    }
-
-    void 'Test bindData With Excludes'() {
-        when:
-        def model = controller.bindWithExcludes()
-        def target = model.target
-
-        then:
-        target.name == 'Marc Palmer'
-        target.email == null
-    }
-
-    void 'Test bindData With Includes'() {
-        when:
-        def model = controller.bindWithIncludes()
-        def target = model.target
-
-        then:
-        target.name == 'Marc Palmer'
-        target.email == null
-    }
-
-    void 'Test bindData With Empty Includes/Excludes Map'() {
-        when:
-        def model = controller.bindWithEmptyIncludesExcludesMap()
-        def target = model.target
-
-        then:
-        target.name == 'Marc Palmer'
-        target.email == 'dowantthis'
-    }
-
-    void 'Test bindData Overriding Included With Excluded'() {
-        when:
-        def model = controller.bindWithIncludeOverriddenByExclude()
-        def target = model.target
-
-        then:
-        target.name == 'Marc Palmer'
-        target.email == null
-    }
-
-    void 'Test bindData With Prefix Filter'() {
-        when:
-        def model = controller.bindWithPrefixFilter()
-        def target = model.target
-
-        then:
-        target.name == 'Lee Butts'
-        target.email == 'lee@mail.com'
-    }
-
-    void 'Test bindData With Disallowed And GrailsParameterMap'() {
-        when:
-        params.name = 'Marc Palmer'
-        params.email = 'dontwantthis'
-        params.'address.country' = 'gbr'
-        def model = controller.bindWithParamsAndDisallowed()
-        def target = model.target
-
-        then:
-        target.name == 'Marc Palmer'
-        target.address.country == 'gbr'
-        target.email == null
-    }
-
-    void 'Test bindData With Prefix Filter And Disallowed'() {
-        when:
-        def model = controller.bindWithPrefixFilterAndDisallowed()
-        def target = model.target
-
-        then:
-        target.name == 'Lee Butts'
-        target.email == null
-    }
-
-    void 'Test bindData Converts Single String In Map To List'() {
-        when:
-        def model = controller.bindWithStringConvertedToList()
-        def target = model.target
-
-        then:
-        target.name == 'Lee Butts'
-        target.email == null
-    }
-}
-
-@Artefact('Controller')
-class BindingController {
-
-    def bindWithMap() {
-        def target = new CommandObject()
-        bindData target, [ name : 'Marc Palmer' ]
-        [target: target]
-    }
-
-    def bindWithExcludes() {
-        def target = new CommandObject()
-        bindData target, [name: 'Marc Palmer', email: 'dontwantthis'], [exclude: ['email']]
-        [target: target]
-    }
-
-    def bindWithIncludes() {
-        def target = new CommandObject()
-        bindData target, [ name : 'Marc Palmer', email : 'dontwantthis' ], [include:['name']]
-        [target: target]
-    }
-
-    def bindWithEmptyIncludesExcludesMap() {
-        def target = new CommandObject()
-        bindData target, [ name : 'Marc Palmer', email : 'dowantthis' ], [:]
-        [target: target]
-    }
-
-    def bindWithIncludeOverriddenByExclude() {
-        def target = new CommandObject()
-        bindData target, [ name : 'Marc Palmer', email : 'dontwantthis' ], [include: ['name', 'email'], exclude: ['email']]
-        [target: target]
-    }
-
-    def bindWithPrefixFilter() {
-        def target = new CommandObject()
-        def filter = "lee"
-        bindData target, [ 'mark.name' : 'Marc Palmer', 'mark.email' : 'dontwantthis', 'lee.name': 'Lee Butts', 'lee.email': 'lee@mail.com'], filter
-        [target: target]
-    }
-
-    def bindWithParamsAndDisallowed() {
-        def target = new CommandObject()
-        bindData target, params, [exclude:['email']]
-        [target: target]
-    }
-
-    def bindWithPrefixFilterAndDisallowed() {
-        def target = new CommandObject()
-        def filter = "lee"
-        def disallowed = [exclude:["email"]]
-        bindData target, [ 'mark.name' : 'Marc Palmer', 'mark.email' : 'dontwantthis', 'lee.name': 'Lee Butts', 'lee.email': 'lee@mail.com'], disallowed, filter
-        [target: target]
-    }
-
-    def bindWithStringConvertedToList() {
-        def target = new CommandObject()
-        def filter = "lee"
-        def disallowed = [exclude:"email"]
-        bindData target, [ 'mark.name' : 'Marc Palmer', 'mark.email' : 'dontwantthis', 'lee.name': 'Lee Butts', 'lee.email': 'lee@mail.com'], disallowed, filter
-        [target: target]
-    }
-}
-
-class CommandObject {
-    String name
-    String email
-    Address address = new Address()
-}
-
-class Address {
-    String country
-}
+/*
+ *  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.
+ */
+package org.grails.web.servlet
+
+import grails.artefact.Artefact
+import grails.testing.web.controllers.ControllerUnitTest
+import spock.lang.Specification
+
+/**
+ * Tests for the bindData method
+ *
+ */
+class BindDataMethodTests extends Specification implements ControllerUnitTest<BindingController> {
+
+    void 'Test bindData with Map'() {
+        when:
+        def model = controller.bindWithMap()
+        def target = model.target
+
+        then:
+        target.name == 'Marc Palmer'
+    }
+
+    void 'Test bindData With Excludes'() {
+        when:
+        def model = controller.bindWithExcludes()
+        def target = model.target
+
+        then:
+        target.name == 'Marc Palmer'
+        target.email == null
+    }
+
+    void 'Test bindData With Includes'() {
+        when:
+        def model = controller.bindWithIncludes()
+        def target = model.target
+
+        then:
+        target.name == 'Marc Palmer'
+        target.email == null
+    }
+
+    void 'Test bindData With Empty Includes/Excludes Map'() {
+        when:
+        def model = controller.bindWithEmptyIncludesExcludesMap()
+        def target = model.target
+
+        then:
+        target.name == 'Marc Palmer'
+        target.email == 'dowantthis'
+    }
+
+    void 'Test bindData Overriding Included With Excluded'() {
+        when:
+        def model = controller.bindWithIncludeOverriddenByExclude()
+        def target = model.target
+
+        then:
+        target.name == 'Marc Palmer'
+        target.email == null
+    }
+
+    void 'Test bindData With Prefix Filter'() {
+        when:
+        def model = controller.bindWithPrefixFilter()
+        def target = model.target
+
+        then:
+        target.name == 'Lee Butts'
+        target.email == 'lee@mail.com'
+    }
+
+    void 'Test bindData With Disallowed And GrailsParameterMap'() {
+        when:
+        params.name = 'Marc Palmer'
+        params.email = 'dontwantthis'
+        params.'address.country' = 'gbr'
+        def model = controller.bindWithParamsAndDisallowed()
+        def target = model.target
+
+        then:
+        target.name == 'Marc Palmer'
+        target.address.country == 'gbr'
+        target.email == null
+    }
+
+    void 'Test bindData With Prefix Filter And Disallowed'() {
+        when:
+        def model = controller.bindWithPrefixFilterAndDisallowed()
+        def target = model.target
+
+        then:
+        target.name == 'Lee Butts'
+        target.email == null
+    }
+
+    void 'Test bindData Converts Single String In Map To List'() {
+        when:
+        def model = controller.bindWithStringConvertedToList()
+        def target = model.target
+
+        then:
+        target.name == 'Lee Butts'
+        target.email == null
+    }
+}
+
+@Artefact('Controller')
+class BindingController {
+
+    def bindWithMap() {
+        def target = new CommandObject()
+        bindData target, [ name : 'Marc Palmer' ]
+        [target: target]
+    }
+
+    def bindWithExcludes() {
+        def target = new CommandObject()
+        bindData target, [name: 'Marc Palmer', email: 'dontwantthis'], [exclude: ['email']]
+        [target: target]
+    }
+
+    def bindWithIncludes() {
+        def target = new CommandObject()
+        bindData target, [ name : 'Marc Palmer', email : 'dontwantthis' ], [include:['name']]
+        [target: target]
+    }
+
+    def bindWithEmptyIncludesExcludesMap() {
+        def target = new CommandObject()
+        bindData target, [ name : 'Marc Palmer', email : 'dowantthis' ], [:]
+        [target: target]
+    }
+
+    def bindWithIncludeOverriddenByExclude() {
+        def target = new CommandObject()
+        bindData target, [ name : 'Marc Palmer', email : 'dontwantthis' ], [include: ['name', 'email'], exclude: ['email']]
+        [target: target]
+    }
+
+    def bindWithPrefixFilter() {
+        def target = new CommandObject()
+        def filter = "lee"
+        bindData target, [ 'mark.name' : 'Marc Palmer', 'mark.email' : 'dontwantthis', 'lee.name': 'Lee Butts', 'lee.email': 'lee@mail.com'], filter
+        [target: target]
+    }
+
+    def bindWithParamsAndDisallowed() {
+        def target = new CommandObject()
+        bindData target, params, [exclude:['email']]
+        [target: target]
+    }
+
+    def bindWithPrefixFilterAndDisallowed() {
+        def target = new CommandObject()
+        def filter = "lee"
+        def disallowed = [exclude:["email"]]
+        bindData target, [ 'mark.name' : 'Marc Palmer', 'mark.email' : 'dontwantthis', 'lee.name': 'Lee Butts', 'lee.email': 'lee@mail.com'], disallowed, filter
+        [target: target]
+    }
+
+    def bindWithStringConvertedToList() {
+        def target = new CommandObject()
+        def filter = "lee"
+        def disallowed = [exclude:"email"]
+        bindData target, [ 'mark.name' : 'Marc Palmer', 'mark.email' : 'dontwantthis', 'lee.name': 'Lee Butts', 'lee.email': 'lee@mail.com'], disallowed, filter
+        [target: target]
+    }
+}
+
+class CommandObject {
+    String name
+    String email
+    Address address = new Address()
+}
+
+class Address {
+    String country
+}