Menu

#44 loadType skips 1 multiline entry.

open
nobody
None
5
2009-01-14
2009-01-14
Anonymous
No

Hi.

When using Yaml.loadtype with a String array, and the entries are multi line, it skips the first entry.

The code in question looks like this:

String[] messages = Yaml.loadType(ymlFile, String[].class);
System.out.println("number of msgs: " + messages.length);
for (String message : messages) {
System.out.println(name + "==> msg: " + message);}

and ymlFile looks like this:
---
- |
"ATPWAS0001A
[14-01-09 08:50:45:891 CET]
Message nr. 1
Do nothing"
- |
"ATPWAS0001A
[14-01-09 08:50:46:141 CET]
Message nr. 1
Do nothing"
- |
"ATPWAS0001A
[14-01-09 08:50:47:875 CET]
Message nr. 1
Do nothing"

This examle produces this output:
number of msgs: 2
LogWriter==> msg: "ATPWAS0001A
[14-01-09 08:50:46:141 CET]
Message nr. 1
Do nothing"
LogWriter==> msg: "ATPWAS0001A
[14-01-09 08:50:47:875 CET]
Message nr. 1
Do nothing"

Kind regards.

Discussion


Log in to post a comment.