Stamatis Zampetakis created CALCITE-7617:
--------------------------------------------

             Summary: Improve type safety of RelJson API using generics
                 Key: CALCITE-7617
                 URL: https://issues.apache.org/jira/browse/CALCITE-7617
             Project: Calcite
          Issue Type: Task
          Components: core
            Reporter: Stamatis Zampetakis
            Assignee: Stamatis Zampetakis
             Fix For: 1.43.0


The {{RelJson#typeNameToClass}} and {{RelJson#getConstructor}} APIs use raw 
types (Class, Constructor) leading to unchecked casts that may lead to 
unpredictable runtime failures. 

The APIs were meant to work only with sub-classes of the {{RelNode}} interface 
so we can improve type safety by introducing generic types in the signatures of 
the methods. Doing this the code becomes more safer & and more readable; 
redundant casts can be removed  and various runtime crashes can now be caught 
during compilation.

{{RelJson}} is an internal API so the change should not affect end-users.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to