Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.25.0
    • None
    • core
    • None

    Description

      There are several methods which might return null, however, they are used a lot as "never null" ones:

        <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);
      

      It would be nice if the methods returned non-nullable values.

      The suggested API is

        <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);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            vladimirsitnikov Vladimir Sitnikov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: