-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return List instead of Optional and more tests #25
base: develop
Are you sure you want to change the base?
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
if (json == null || json.trim().isEmpty()) { | ||
return Optional.empty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am only aware of Worklion using this class. I will clean it up during the next release.
@@ -37,16 +38,16 @@ | |||
return Optional.of(obj); | |||
} | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |