Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In CALCITE-4199 we enabled CheckerFramework (via annotations and CI jobs) in the 'core' and 'linq4j' modules; this change further enables CheckerFramework in the 'server' module, and fixes all violations.
There are also a large number of 'cosmetic' modifications to improve code quality without changing behavior, including:
- Replace 'this.x = x; assert x != null;' by 'this.x = requireNonNull(x);' in constructors
- Replace assert in other code locations where it implements an invariant. We don't use requireNonNull because it throws NullPointerException; we would prefer to throw AssertionError or IllegalStateException
- Replace x.equals("") and x.size() == 0 with x.isEmpty()
- Make fields final where possible
- Make private methods and inner classes static where possible
- In class Pair<K, V> make the type variables K and V no longer @Nullable by default (you can make each of them nullable if you need)
Attachments
Issue Links
- is related to
-
CALCITE-4199 Add nullability annotations to the methods and fields, ensure consistency with checkerframework
- Closed
-
CALCITE-6553 In server, several CREATE and DROP commands are incorrect if schema does not exist
- Open
- relates to
-
CALCITE-4524 Make some fields non-nullable (SqlSelect.selectList, DataContext.getTypeFactory)
- Closed
-
CALCITE-6408 Not-null ThreadLocal
- Closed
- links to