Return List instead of Optional and more tests#25
Return List instead of Optional and more tests#25mez5001 wants to merge 6 commits intoPennState:developfrom mez5001:develop
Conversation
mez5001
commented
May 2, 2018
- JsonSerializationutil.deserializeList returns a list instead of an Optional
- Added unit tests for handling Abstract Classes
Merge pull request #23 from mez5001/develop
| public static <T> Optional<List<T>> deserializeList(String json, Class<T> clazz) throws IOException { | ||
| public static <T> List<T> deserializeList(String json, Class<T> clazz) throws IOException { | ||
| if (json == null || json.trim().isEmpty()) { | ||
| return Optional.empty(); |
There was a problem hiding this comment.
Are there projects using this method at the moment? We'll need to know what (if anything) this will break.
There was a problem hiding this comment.
I am only aware of Worklion using this class. I will clean it up during the next release.
| } | ||
|
|
||
| public static <T> Optional<List<T>> deserializeList(String json, Class<T> clazz) throws IOException { | ||
| public static <T> List<T> deserializeList(String json, Class<T> clazz) throws IOException { |
There was a problem hiding this comment.
It would be nice to mark this method with the @nonnull JSR-305 annotation to help static analysis tools. Lately I've been favoring ErrorProne and SpotBugs.
There was a problem hiding this comment.
I have added this annotation to the method
|
I just realized that this is going to break one of the conventions we had discussed when starting the SCIMple project - the behavior of the But So our goal when fields weren't populated was to minimize the size of the JSON data that would be sent/received. |