This is an automated email from the ASF dual-hosted git repository.

rubenql pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new 02a031e  [CALCITE-4156] ReflectiveRelMetadataProvider constructor 
should throw an exception (instead of assertion) when called with an empty map
02a031e is described below

commit 02a031e7d82b6d6c8e590979818e1b53039ec543
Author: rubenada <[email protected]>
AuthorDate: Fri Aug 7 08:49:10 2020 +0100

    [CALCITE-4156] ReflectiveRelMetadataProvider constructor should throw an 
exception (instead of assertion) when called with an empty map
---
 .../apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
 
b/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
index fd4543e..cfb6066 100644
--- 
a/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
+++ 
b/core/src/main/java/org/apache/calcite/rel/metadata/ReflectiveRelMetadataProvider.java
@@ -25,6 +25,7 @@ import org.apache.calcite.util.Pair;
 import org.apache.calcite.util.ReflectiveVisitor;
 import org.apache.calcite.util.Util;
 
+import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMultimap;
 import com.google.common.collect.Multimap;
@@ -78,9 +79,8 @@ public class ReflectiveRelMetadataProvider
       ConcurrentMap<Class<RelNode>, UnboundMetadata> map,
       Class<? extends Metadata> metadataClass0,
       Multimap<Method, MetadataHandler> handlerMap) {
-    if (map.isEmpty()) {
-      throw new IllegalArgumentException("ReflectiveRelMetadataProvider 
methods map is empty");
-    }
+    Preconditions.checkArgument(!map.isEmpty(),
+        "ReflectiveRelMetadataProvider methods map is empty");
     this.map = map;
     this.metadataClass0 = metadataClass0;
     this.handlerMap = ImmutableMultimap.copyOf(handlerMap);

Reply via email to