Vladimir Sitnikov created CALCITE-4303: ------------------------------------------
Summary: Refactor org.apache.calcite.rel.RelInput to provide null-safe getters Key: CALCITE-4303 URL: https://issues.apache.org/jira/browse/CALCITE-4303 Project: Calcite Issue Type: Sub-task Components: core Affects Versions: 1.25.0 Reporter: Vladimir Sitnikov There are several methods which might return null, however, they are used a lot as "never null" ones: {code:java} <E extends Enum<E>> @Nullable E getEnum(String tag, Class<E> enumClass); @Nullable List<RexNode> getExpressionList(String tag); @Nullable List<String> getStringList(String tag); @Nullable List<Integer> getIntegerList(String tag); @Nullable List<List<Integer>> getIntegerListList(String tag); {code} It would be nice if the methods returned non-nullable values. The suggested API is {code:java} <E extends Enum<E>> E getEnum(String tag, Class<E> enumClass); List<RexNode> getExpressionList(String tag); List<String> getStringList(String tag); List<Integer> getIntegerList(String tag); List<List<Integer>> getIntegerListList(String tag); <E extends Enum<E>> @Nullable E getEnumOrNull(String tag, Class<E> enumClass); @Nullable List<RexNode> getExpressionListOrNull(String tag); @Nullable List<String> getStringListOrNull(String tag); @Nullable List<Integer> getIntegerListOrNull(String tag); @Nullable List<List<Integer>> getIntegerListListOrNull(String tag); {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)