vlsi commented on a change in pull request #2171:
URL: https://github.com/apache/calcite/pull/2171#discussion_r495730869
##########
File path: core/src/main/java/org/apache/calcite/sql/type/SqlTypeUtil.java
##########
@@ -123,21 +126,13 @@ public static boolean isCharTypeComparable(
SqlCallBinding binding,
List<SqlNode> operands,
boolean throwOnFailure) {
- final SqlValidator validator = binding.getValidator();
- final SqlValidatorScope scope = binding.getScope();
- assert operands != null;
- assert operands.size() >= 2;
+ requireNonNull(operands, "operands");
Review comment:
> Maybe we can set a descriptive/imperative message here, like operands
must not be null or operands is null, it will be more clear?
The error message would be like `NullPointerException: operands`.
I guess it is more-or-less clear.
There should be a separate PR that replaces `requireNonNull(var);` with
`requireNonNull(var, "var");` and `assert var != null;` with
`requireNonNull(var, "var");`
----------------------------------------------------------------
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:
[email protected]