-
Notifications
You must be signed in to change notification settings - Fork 60
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
incorrect generic typing in operations of EntityGraph #424
Comments
Additionally, I'm very confused by this method: /**
* Add a node to the graph that corresponds to a managed
* type with inheritance. This allows for multiple subclass
* subgraphs to be defined for this node of the entity
* graph. Subclass subgraphs will automatically include the
* specified attributes of superclass subgraphs.
*
* @param attribute attribute
* @param type entity subclass
* @return subgraph for the attribute
* @throws IllegalArgumentException if the attribute's target
* type is not a managed type
* @throws IllegalStateException if the EntityGraph has been
* statically defined
*/
public <X> Subgraph<? extends X> addSubgraph(Attribute<T, X> attribute, Class<? extends X> type); The Javadoc is extremely cryptic, and the signature is weird. Is it supposed to be doing the equivalent of a
because with the present signature it doesn't seem like you could do anything useful with it, assuming my interpretation is correct. |
I'm also confused by this one: public <X> Subgraph<? extends X> addSubclassSubgraph(Class<? extends X> type); which actually makes no sense even without knowing the semantics: Java has wildcard capture, so you don't need the wildcards there. Perhaps it should be: public <X extends T> Subgraph<X> addSubclassSubgraph(Class<X> type); |
Introduces AbstractGraph as a place to declare common operations of EntityGraph and SubGraph See jakartaee#424
Please see #425 for one set of ideas for how to "fix" all this. |
this supersedes #411 |
Needed because of "Unchecked generics array creation for varargs parameter" compiler warning for the varargs version. see jakartaee#424
- fix incorrect generic signatures - add way to navigate to collection elements see jakartaee#424, jakartaee#411
- fix incorrect generic signatures - add way to navigate to collection elements see jakartaee#424, jakartaee#411
Needed because of "Unchecked generics array creation for varargs parameter" compiler warning for the varargs version. see jakartaee#424
- fix incorrect generic signatures - add way to navigate to collection elements see jakartaee#424, jakartaee#411
These operations have simply incorrect generic types, and we now have replacements. jakartaee#424
Needed because of "Unchecked generics array creation for varargs parameter" compiler warning for the varargs version. see #424
These operations have simply incorrect generic types, and we now have replacements. #424
There are several problems in the
EntityGraph
interface:addAttributeNodes(Attribute<T, ?>... attribute)
produces the infamous "Unchecked generics array creation for varargs parameter" compiler warning.addAttributeNodes(Attribute<T, ?>... attribute)
should beaddAttributeNodes(Attribute<? super T, ?>... attribute)
<X> Subgraph<X> addSubgraph(Attribute<T, X> attribute)
should be<X> Subgraph<X> addSubgraph(Attribute<? super T, X> attribute)
<X> Subgraph<X> addKeySubgraph(Attribute<T, X> attribute)
is simply wrong. I think it should be<X> Subgraph<X> addKeySubgraph(MapAttribute<T, X, ?> attribute)
.We need to put some thought into these.
The text was updated successfully, but these errors were encountered: