You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by la...@apache.org on 2018/05/31 15:07:01 UTC

calcite git commit: [CALCITE-2342] Fix improper use of assert

Repository: calcite
Updated Branches:
  refs/heads/master 39fee5d63 -> a99f386d5


[CALCITE-2342] Fix improper use of assert

Fix an improper use of assert in Schemas#path(CalciteSchema,
Iterable<String>) causing iterator not to move to the next
element if assertions are not turned on.

Close apache/calcite#712


Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/a99f386d
Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/a99f386d
Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/a99f386d

Branch: refs/heads/master
Commit: a99f386d5c36d560c832f9e70542f9d058ea22f5
Parents: 39fee5d
Author: Laurent Goujon <la...@apache.org>
Authored: Wed May 30 20:07:52 2018 -0700
Committer: Laurent Goujon <la...@dremio.com>
Committed: Thu May 31 08:06:03 2018 -0700

----------------------------------------------------------------------
 core/src/main/java/org/apache/calcite/schema/Schemas.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/a99f386d/core/src/main/java/org/apache/calcite/schema/Schemas.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/schema/Schemas.java b/core/src/main/java/org/apache/calcite/schema/Schemas.java
index a13df14..b238b3b 100644
--- a/core/src/main/java/org/apache/calcite/schema/Schemas.java
+++ b/core/src/main/java/org/apache/calcite/schema/Schemas.java
@@ -538,7 +538,7 @@ public final class Schemas {
       return PathImpl.EMPTY;
     }
     if (!rootSchema.name.isEmpty()) {
-      assert rootSchema.name.equals(iterator.next());
+      Preconditions.checkState(rootSchema.name.equals(iterator.next()));
     }
     for (;;) {
       final String name = iterator.next();