RusticiSoftware / TinCanJava

Tin Can Java Library
http://rusticisoftware.github.io/TinCanJava/
Apache License 2.0
44 stars 46 forks source link

Initializing Statement from JSON does not auto init its id #39

Closed Smedzlatko closed 8 years ago

Smedzlatko commented 9 years ago

Initializing Statement from JSON does not auto init its id even if the id is present in the JSON object.

Example:

StringOfJSON json = new StringOfJSON(payload); // contains id inside
Statement statement = new Statement(json);

UUID id = statement.getId(); // null

Correct me if I am wrong but I would expect to set the Id automatically whenever it is present in the JSON and fill in null only if it is missing.

brianjmiller commented 9 years ago

I've not looked to reproduce it directly, but you are correct the behavior should be that the id is populated. Not sure when I'll get to it, if you can find the fix and submit a PR with a unit test that'd certainly speed up the process.

okabe-is commented 8 years ago

I made a pull request #49 to solve this bug.

brianjmiller commented 8 years ago

@okabe-is thanks, merged. @Smedzlatko please test if you get a chance, I'll be cutting a release with this fix soon.