arquillian / continuous-enterprise-development

Testable Solutions for Modern Applications
http://continuousdev.org/
116 stars 150 forks source link

Typo in REST, Repository Resources Section #93

Closed johnament closed 11 years ago

johnament commented 11 years ago
public abstract class RepositoryResource<
  DOMAIN extends Identifiable&Timestampable,
  REP extends Representation<DOMAIN>>
    implements Resource {

I'm thinking that the & is wrong there, did you mean < ? Also, ideally the leading < should be in line with its types.

aslakknutsen commented 11 years ago

& is correct. The contract is that DOMAIN must be Identifiable AND Timestampable..

In cases where Identifiable does not extend Timestampable, nor does Timestampable extend Identifiable.

But the Repository require a DOMAIN to extend both.

johnament commented 11 years ago

I really think you should add something clarifying that. I can honestly say that I've never seen that syntax before. With the two types being so close together, it is hard to read so a reader may not realize that this is what you're inferring.

ALRubinger commented 11 years ago

I can add some explanation. It's a JDK7 language feature.

aslakknutsen commented 11 years ago

I think it's been around since day one. The Java Generics Book from 2006 has a chapter on it; https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=6&ved=0CFcQFjAF&url=http%3A%2F%2Fmy.safaribooksonline.com%2Fbook%2Fprogramming%2Fjava%2F0596527756%2Fcomparison-and-bounds%2Fmultiple_bounds&ei=ycEtUtj7Daio4gSCj4DoBw&usg=AFQjCNEjbaycdacqXx23y6I1m0T5SwZJUg&sig2=TO-Og8F7TNDKc0qDgvj8iw&bvm=bv.51773540,d.bGE&cad=rja

ALRubinger commented 11 years ago

Wow...I just started seeing it and using it.