Skip to content

[CALCITE-6552] Enable CheckerFramework in 'server' module#3937

Closed
julianhyde wants to merge 8 commits intoapache:mainfrom
julianhyde:main
Closed

[CALCITE-6552] Enable CheckerFramework in 'server' module#3937
julianhyde wants to merge 8 commits intoapache:mainfrom
julianhyde:main

Conversation

@julianhyde
Copy link
Contributor

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

@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant