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 558d49f Trivial refactoring: extract common variable
558d49f is described below
commit 558d49f91bc46c4fb9b741a90734ee3b32eb7429
Author: Daniel Sun <[email protected]>
AuthorDate: Sat Apr 11 22:41:21 2020 +0800
Trivial refactoring: extract common variable
---
.../src/main/groovy/groovy/xml/StreamingMarkupBuilder.groovy | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 ee0f124..ce1c35b 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,10 @@ class StreamingMarkupBuilder extends
AbstractStreamingBuilder {
out.unescaped() << "<?"
if (instruction instanceof Map) {
out.unescaped() << target
- out.unescaped() << toMapString(instruction, {value ->
value.toString().contains('\'') || (useDoubleQuotes &&
!value.toString().contains('"'))})
+ out.unescaped() << toMapString(instruction) { value ->
+ def valueStr = value.toString()
+ valueStr.contains('\'') || (useDoubleQuotes &&
!valueStr.contains('"'))
+ }
} else {
out.unescaped() << "$target $instruction"
}