julianhyde commented on a change in pull request #2124:
URL: https://github.com/apache/calcite/pull/2124#discussion_r479603916



##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -653,15 +657,19 @@ private RexNode simplifyUnaryPlus(RexCall call, 
RexUnknownAs unknownAs) {
     return simplify(call.getOperands().get(0), unknownAs);
   }
 
-  private RexNode simplifyIs(RexCall call, RexUnknownAs unknownAs) {
+  private @Nonnull RexNode simplifyIs(RexCall call, RexUnknownAs unknownAs) {

Review comment:
       I added `@Nonnull` because most `simplifyXxx` methods return null if 
they are not able to simplify, whereas this an exception.
   
   If we were starting from scratch, I agree with you, we would make `@Nonnull` 
the default (or better, use Kotlin where all types are non-null unless followed 
by `?`) but I don't think it's worth it to change the code to systematically 
declare whether each parameter or return is nullable.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to