Skip to content

Conversation

@ajs6f
Copy link
Member

@ajs6f ajs6f commented Jan 25, 2018

Two commits here: the first will be uncontroversial, I think-- it just adds in some type params to avoid compiler warnings. Maybe there's a reason not to, and if so, let's just skip it.

The other widens the return type of ResourceService::get (in both forms) in order to deal with Java's craptacular generics and their lack of proper co/contravariance control. Because ResourceService::get returns Optional<Resource>, I can't impl it with Optional<MyTypeThatImplsResource> because Java doesn't understand that Optional<MyTypeThatImplsResource> "extends" Optional<Resource>. So now I can, at the cost of making some test mocking code look pretty gross... this lets impls of ResourceService use get in their own code and get the actual type of Resource at stake. This is useful because MyTypeThatImplsResource can have extra fresh members (in my case for Cassandra, a member that gives the Basic Containment container for that resource).

Does that make sense?

@acoburn
Copy link
Member

acoburn commented Jan 25, 2018

This all looks good to me.

@acoburn acoburn merged commit e08c2d2 into trellis-ldp:master Jan 25, 2018
@ajs6f ajs6f deleted the TypeStuff branch January 25, 2018 21:18
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.

2 participants