Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.7.6, 1.8.2, 1.9-beta-3
-
None
-
None
Description
When ConfigSlurper processes a property nested inside a Closure AND that same property exists as a top-level property name, the value is added to the top level property instead of the nested one. Simple test case to demonstrate:
def config = """
report.table = "XXX"
study
"""
def config2 = """
study { report.name = "ABC" }
"""
def slurper = new ConfigSlurper().parse(config)
println slurper
assert slurper.study.report.name == [:] // BUG!
assert slurper.report.name == "ABC" // BUG!
def slurper2 = new ConfigSlurper().parse(config2)
println slurper2
assert slurper2.study.report.name == "ABC"
The first slurper incorrectly sets report.name instead of study.report.name, while the second slurper behaves as expected. The only difference is the extra property "report.table" defined in the first config.
This seems to be related to bugs: https://jira.codehaus.org/browse/GROOVY-2986, https://jira.codehaus.org/browse/GROOVY-3334, and https://jira.codehaus.org/browse/GROOVY-3521