Just in case, there's a new promising code analyzer:
https://github.com/amaembo/huntbugs

The procedure is rather simple:
1) checkout huntbugs, mvn install -DskipTests
2) cd to calcite
3) mvn one.util:huntbugs-maven-plugin:0.0.11-SNAPSHOT:huntbugs

What it does, it decompiles bytecode (via procyon), and performs the
analysis.

Here are sample issues identified on the calcite-core codebase:
https://github.com/apache/calcite/blob/857c06b6744840daac52f7a3ab7f6e0d32c90e41/core/src/main/java/org/apache/calcite/sql/fun/SqlMinMaxAggFunction.java#L112

The error is: The case 0: switch branch will never be executed, because
it's statically known that switch expression range is 1..1. Probably
there's some logic error or typo.
Basically, it figured out that minMaxKind is always equal
to MINMAX_COMPARABLE, so the switch is strange.

https://github.com/apache/calcite/blob/3ed625cf39c2671f57dbd0c73f27060169560269/core/src/main/java/org/apache/calcite/sql/fun/SqlStdOperatorTable.java#L472

The error is "Possible null dereference in
SqlStdOperatorTable.1.inferReturnType().
The expression addUnit.ordinal() may fail with NullPointerException as
addUnit can be null at this location."

Vladimir

Reply via email to