| Summary: | Inconsistency between class and method definitions for Node | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Greg Watson <g.watson> |
| Component: | GEF Graph | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ed, nyssen |
| Version: | 0.2.0 | ||
| Target Milestone: | 4.0.0 / 3.11.0 (Neon) M3 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Greg Watson
Surely a return extends is nothing to do with class extension?. It allows a future implementation of the class to return its internal Set<BetterEdge> directly. How can you have "class BetterEdge extends Edge" if Edge is final? You can't. I assumed that it was just the return types and host classes that were final. The current API is definitely inconsistent. IMHO it does not make sense that Node and Edge are final. Nevertheless, the Set<? extends ...> still does not make sense to me as a return type. If we would change to use a 'BetterEdge' subclass internally, I still see no need to return a Set<? extends Edge>. A 'BetterEdge' would still be an Edge. It could make sense to have Set<? extends Edge> as a method parameter, if Node and Edge aren't final, because an own edge implementation could then be passed in. It could also make sense to have something like Set<E> as a return type where E is a generic class parameter that maybe defined as <E extends Edge>. That would allow to use the complete Graph structure with an own Edge implementation. For now, I have implemented the following changes: - Removed final modifier from Node and Edge. - Ensured Graph constructor can take Set<? extends ...> node and edge sets. - Ensured all method return types do not use uper bound wildcards. - Increased version of graph bundles/features to 0.3.0 and adjusted dependencies in other bundles/features. Is that sufficient for your use case? Resolving as fixed in 3.11.0 M3. If the solution is not sufficient yet, please reopen. |