[jira] [Commented] (CALCITE-3976) Generify the DefaultEdge class
[ https://issues.apache.org/jira/browse/CALCITE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17104003#comment-17104003 ] Liya Fan commented on CALCITE-3976: --- The PR is here: https://github.com/apache/calcite/pull/1963 Thanks a lot for your kind reminder. > 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 >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > 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)
[jira] [Commented] (CALCITE-3976) Generify the DefaultEdge class
[ https://issues.apache.org/jira/browse/CALCITE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17103608#comment-17103608 ] Julian Hyde commented on CALCITE-3976: -- Can you attach the PR? > 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 >Priority: Major > Time Spent: 1h 10m > Remaining Estimate: 0h > > 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)
[jira] [Commented] (CALCITE-3976) Generify the DefaultEdge class
[ https://issues.apache.org/jira/browse/CALCITE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17103166#comment-17103166 ] Liya Fan commented on CALCITE-3976: --- [~julianhyde] Sounds good. Thanks for your feedback. I have revised the PR accordingly. > 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 >Priority: Major > Time Spent: 40m > Remaining Estimate: 0h > > 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)
[jira] [Commented] (CALCITE-3976) Generify the DefaultEdge class
[ https://issues.apache.org/jira/browse/CALCITE-3976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17102031#comment-17102031 ] Julian Hyde commented on CALCITE-3976: -- If you are instantiating a graph, you don't have to use {{DefaultEdge}}. How about making another class, {{TypedEdge}}? > 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 >Priority: Major > Time Spent: 0.5h > Remaining Estimate: 0h > > 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)