You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Liya Fan (Jira)" <ji...@apache.org> on 2020/05/07 10:44:00 UTC

[jira] [Created] (CALCITE-3976) Generify the DefaultEdge class

Liya Fan created CALCITE-3976:
---------------------------------

             Summary: Generify the DefaultEdge class
                 Key: CALCITE-3976
                 URL: https://issues.apache.org/jira/browse/CALCITE-3976
             Project: Calcite
          Issue Type: Improvement
          Components: core
            Reporter: Liya Fan
            Assignee: Liya Fan


Currently, the {{source}} and {{target}} fields of class {{DefaultEdge}} is {{Object}}. This makes it necessary for some casts in the code base. In addition, it does not enforce the assertion that in a graph, the vertices have the same type as sources and targes in the edges. 

To solve the problem, we generify the DefaultEdge class with the type of the source/target vertices.

The benefits of generfication includes type safety: the above assertion can be enforced by the generified class. It also gives the compiler an opportunity to detect type related problems at compilation time. Without generification, some problems can only be detected at runtime, when a ClassCastException is thrown. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)