Title:
Bug 85850:serious bug when creating entries in a structure with dot notation
| View in TrackerStatus/Resolution/Reason: Closed/Won't Fix/
Reporter/Name(from Bugbase): Luis Majano / Luis Majano (Luis Majano)
Created: 01/15/2011
Components: Language, Datastructure
Versions: 9.0.1
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
Problem:
serious bug when creating entries in a structure with dot notation.
Method:
Use the following template:test = structnew();test["org.model.test"] = {name="test",level=1};test["org.model"] = {name="test",level=1};writeDump(test);test = structnew();structInsert(test,"org.model.test",{name="test",level=1});structInsert(test,"org.model",{name="test",level=1});writeDump(test);test = structnew();test.put("org.model.test",{name="test",level=1});test.put("org.model",{name="test",level=1});writeDump(test);test = createObject("java","java.util.HashMap").init();test.put("org.model.test",{name="test",level=1});test.put("org.model",{name="test",level=1});writeDump(test);You will see that the last entries which are a subset of the name, are placed in the structure as undefined.
[mchandna]-pasting more appropriate and clean reproducible case:
<cfscript>
test = structnew();
test["org.model"] = {name="test1",level=1};
test["org.model.test"] = {name="test2",level=2};
</cfscript>
Original Error: <cfdump var=#test#>
</br>
</br>
Correct Implementation :
<cfdump var=#test["org.model"]#>
<cfdump var=#test["org.model.test"]#>
</br>
</br>
Wrong Implementation : <cfdump var=#test.org.model.test#>
Result:
undefined structure entries
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3043094
External Customer Info:
External Company:
External Customer Name: Luis Majano
External Customer Email: 7A3D2E124563615A99201549
External Test Config: 01/15/2011
Attachments:
Comments: