You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/04/11 14:47:14 UTC

[groovy] branch master updated: Trivial refactoring: Rename the extracted variable to align with other variable name rule

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

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 86d5e80  Trivial refactoring: Rename the extracted variable to align with other variable name rule
86d5e80 is described below

commit 86d5e802d74c3d8260f556908e3a2457c8ccaff7
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Apr 11 22:46:59 2020 +0800

    Trivial refactoring: Rename the extracted variable to align with other variable name rule
---
 .../groovy-xml/src/main/groovy/groovy/xml/StreamingDOMBuilder.groovy  | 2 +-
 .../src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy          | 2 +-
 .../groovy-xml/src/main/groovy/groovy/xml/StreamingSAXBuilder.groovy  | 2 +-
 .../groovy/xml/streamingmarkupsupport/AbstractStreamingBuilder.groovy | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingDOMBuilder.groovy b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingDOMBuilder.groovy
index 8441f7a..d625d13 100644
--- a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingDOMBuilder.groovy
+++ b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingDOMBuilder.groovy
@@ -37,7 +37,7 @@ class StreamingDOMBuilder extends AbstractStreamingBuilder {
         attrs.each {target, instruction ->
             def pi = null
             if (instruction instanceof Map) {
-                pi = dom.document.createProcessingInstruction(target, toMapString(instruction))
+                pi = dom.document.createProcessingInstruction(target, toMapStringClosure(instruction))
             } else {
                 pi = dom.document.createProcessingInstruction(target, instruction)
             }
diff --git a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy
index ce1c35b..1d50b08 100644
--- a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy
+++ b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy
@@ -75,7 +75,7 @@ class StreamingMarkupBuilder extends AbstractStreamingBuilder {
             out.unescaped() << "<?"
             if (instruction instanceof Map) {
                 out.unescaped() << target
-                out.unescaped() << toMapString(instruction) { value ->
+                out.unescaped() << toMapStringClosure(instruction) { value ->
                     def valueStr = value.toString()
                     valueStr.contains('\'') || (useDoubleQuotes && !valueStr.contains('"'))
                 }
diff --git a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingSAXBuilder.groovy b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingSAXBuilder.groovy
index 917d1ba..7b03ed4 100644
--- a/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingSAXBuilder.groovy
+++ b/subprojects/groovy-xml/src/main/groovy/groovy/xml/StreamingSAXBuilder.groovy
@@ -35,7 +35,7 @@ class StreamingSAXBuilder extends AbstractStreamingBuilder {
     def piClosure = {doc, pendingNamespaces, namespaces, namespaceSpecificTags, prefix, attrs, body, contentHandler ->
         attrs.each {target, instruction ->
             if (instruction instanceof Map) {
-                contentHandler.processingInstruction(target, toMapString(instruction))
+                contentHandler.processingInstruction(target, toMapStringClosure(instruction))
             } else {
                 contentHandler.processingInstruction(target, instruction)
             }
diff --git a/subprojects/groovy-xml/src/main/groovy/groovy/xml/streamingmarkupsupport/AbstractStreamingBuilder.groovy b/subprojects/groovy-xml/src/main/groovy/groovy/xml/streamingmarkupsupport/AbstractStreamingBuilder.groovy
index a109e4a..f2a7b16 100644
--- a/subprojects/groovy-xml/src/main/groovy/groovy/xml/streamingmarkupsupport/AbstractStreamingBuilder.groovy
+++ b/subprojects/groovy-xml/src/main/groovy/groovy/xml/streamingmarkupsupport/AbstractStreamingBuilder.groovy
@@ -60,9 +60,9 @@ class AbstractStreamingBuilder {
             }
         }
     }
-    def getNamespaceClosure = {doc, pendingNamespaces, namespaces, Object[] rest -> [namespaces, pendingNamespaces]}
+    def getNamespaceClosure = { doc, pendingNamespaces, namespaces, Object[] rest -> [namespaces, pendingNamespaces] }
 
-    def toMapString = { Map instruction, checkDoubleQutationMarks={value -> !value.toString().contains('"')} ->
+    def toMapStringClosure = { Map instruction, checkDoubleQutationMarks={ value -> !value.toString().contains('"') } ->
         def buf = new StringBuilder()
         instruction.each { name, value ->
             if (checkDoubleQutationMarks(value)) {