liangzimei / yamlmatlab

Automatically exported from code.google.com/p/yamlmatlab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

index out of bounds exception when importing empty array

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. call ReadYaml on a .yaml file containing a line with an empty array (e.g. 
'foo: []'

What is the expected output? What do you see instead?
It should create an empty array but instead it gives the following error 
message:

??? Java exception occurred:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(Unknown Source)
        at java.util.ArrayList.get(Unknown Source)

Error in ==> Hash2Struct at 69
                    switch class(d.get(0))

Error in ==> ReadYaml>ReplaceImportByStruct at 63
        s = Hash2Struct(ymlobj);

Error in ==> ReadYaml at 38
Data = ReplaceImportByStruct(yaml_file);

What version of the product are you using? On what operating system?
0.3.2 SLES10

Please provide any additional information below.

Original issue reported on code.google.com by cross...@gmail.com on 23 Jun 2011 at 5:00

Fixed in version 0.4.0

Original comment by JirkaCig...@gmail.com on 9 Sep 2011 at 7:32

  • Changed state: Fixed