This is an automated email from the ASF dual-hosted git repository. sunlan pushed a commit to branch GROOVY_3_0_X in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 73ce5954a4ecd7ac0f32492b930326d6604d09dd Author: Daniel Sun <[email protected]> AuthorDate: Sat Apr 11 22:41:21 2020 +0800 Trivial refactoring: extract common variable (cherry picked from commit 558d49f91bc46c4fb9b741a90734ee3b32eb7429) --- .../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" }
