Skip to content

Misc cleanup of javalang, type coercion, jsonya, and Maybe#221

Merged
asfgit merged 8 commits intoapache:masterfrom
ahgittin:misc-cleanup-javalang-and-type-coercion
Jul 7, 2016
Merged

Misc cleanup of javalang, type coercion, jsonya, and Maybe#221
asfgit merged 8 commits intoapache:masterfrom
ahgittin:misc-cleanup-javalang-and-type-coercion

Conversation

@ahgittin
Copy link
Contributor

big tidy is ec4da19 moving most of our static TypeCoercions to a non-static utils impl (but not changing how we use TypeCoercions ... apart from the exception it throws)

others are as described in the individual commits, nothing too exciting, and big improvements to tests and javadocs

encountered while looking at how we can improve yaml type inference

ahgittin added 6 commits June 24, 2016 22:51
You can do `orThrowingUnwrapped()` to suppress the add'l caller trace,
and you can change more easily change the type of the exception it will throw.
bringing it in line with json which has always allowed lists and now allows primitives, as root objects
a few more methods which were elsewhere or not present,
better methods using Maybe, and callers updated to use them
with the Brooklyn TypeCoercions referring to and extending that
mainly around findMethod
*/
public static <T> T coerce(Object value, Class<T> targetType) {
return coerce(value, TypeToken.of(targetType));
static TypeCoercerExtensible coercer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit wary of having our singleton instance as a non-final package scoped field here, is private static final better?

@grkvlt
Copy link
Member

grkvlt commented Jul 3, 2016

@ahgittin Nice, looks like a good refactor. Minor comment about singletons...?

ahgittin added 2 commits July 7, 2016 10:16
fix conflict: Class.forName change upstream now ClassLoaderUtils, replicated locally
@ahgittin
Copy link
Contributor Author

ahgittin commented Jul 7, 2016

good idea @grkvlt , done

ahgittin added a commit to ahgittin/brooklyn-server that referenced this pull request Jul 7, 2016
@asfgit asfgit merged commit 89b89c5 into apache:master Jul 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants