#71 GraphMLConverter fails to parse boolean values properly

open
nobody
None
5
2010-02-18
2010-02-18
Anonymous
No

GraphMLConverter and the associated DataUtil static utility functions rely on Flash/Flex's global Boolean() function to parse values typed as 'boolean' in GraphML. The code properly recognizes the type as 'boolean', but the value of boolean data can be incorrectly parsed as being 'true' even when the value is false. The problem occurs for two reasons:

1) When GraphMLConverter's parseData function calls DataUtil.parseValue it passes in the value to be parsed explicitly as a string
2) DataUtil.parseValue uses the global Boolean() function for Boolean types. Unfortunately, Boolean() treats _all_ non-empty strings (including "0" and "false") as being TRUE. See documentation at http://livedocs.adobe.com/flex/3/langref/package.html#Boolean%28%29 Thus, unless Boolean() receives an empty string, it will always return true in DataUtil.parseValue

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks