You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/11/11 16:52:45 UTC

[GitHub] [calcite] julianhyde commented on a change in pull request #2255: [CALCITE-4393] ExceptionInInitializerError due to NPE in SqlCallBinding caused by circular dependency

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



##########
File path: core/src/main/java/org/apache/calcite/sql/SqlCallBinding.java
##########
@@ -145,10 +144,11 @@ public SqlCall getCall() {
       }
       final SqlOperandCountRange range = checker.getOperandCountRange();
       final List<SqlNode> list = Lists.newArrayList(operandList);
+      final SqlCall defaultCall = createDefaultCall();
       while (list.size() < range.getMax()
           && checker.isOptional(list.size())
           && checker.isFixedParameters()) {
-        list.add(DEFAULT_CALL);
+        list.add(defaultCall);

Review comment:
       Suggest you don’t create the defaultCall outside the loop. Most calls do not need default arguments. 
   
   You could in-line the defaultCall method, because it’s very simple.




----------------------------------------------------------------
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:
users@infra.apache.org