You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2018/01/18 01:35:44 UTC

[2/4] calcite git commit: Following [CALCITE-2090], add "fall through" comments to appease checkstyle

Following [CALCITE-2090], add "fall through" comments to appease checkstyle


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

Branch: refs/heads/master
Commit: 3e958cff41e4495b2fd0e21c0715b12cfd45313b
Parents: 8de5d8d
Author: Nishant <ni...@gmail.com>
Authored: Wed Jan 17 19:47:56 2018 +0530
Committer: Julian Hyde <jh...@apache.org>
Committed: Wed Jan 17 17:34:54 2018 -0800

----------------------------------------------------------------------
 .../org/apache/calcite/rel/rules/DateRangeRules.java    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/calcite/blob/3e958cff/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java b/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java
index c8d17bf..051ff7b 100644
--- a/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java
+++ b/core/src/main/java/org/apache/calcite/rel/rules/DateRangeRules.java
@@ -641,24 +641,28 @@ public abstract class DateRangeRules {
     }
 
     /**
-     * Commputes floor of given calendar object to provided timeunit
-     * @return returns a copy of calendar, floored to the given timeunit
+     * Computes floor of a calendar to a given time unit.
+     *
+     * @return returns a copy of calendar, floored to the given time unit
      */
     private Calendar floor(Calendar c, TimeUnitRange timeUnit) {
       c = (Calendar) c.clone();
       switch (timeUnit) {
       case YEAR:
         c.set(TIME_UNIT_CODES.get(TimeUnitRange.MONTH), Calendar.JANUARY);
-        // Ignore checkstyle failure for Fall through from previous branch of the switch statement.
-        // CHECKSTYLE: IGNORE 10
+        // fall through; need to zero out lower time units
       case MONTH:
         c.set(TIME_UNIT_CODES.get(TimeUnitRange.DAY), 1);
+        // fall through; need to zero out lower time units
       case DAY:
         c.set(TIME_UNIT_CODES.get(TimeUnitRange.HOUR), 0);
+        // fall through; need to zero out lower time units
       case HOUR:
         c.set(TIME_UNIT_CODES.get(TimeUnitRange.MINUTE), 0);
+        // fall through; need to zero out lower time units
       case MINUTE:
         c.set(TIME_UNIT_CODES.get(TimeUnitRange.SECOND), 0);
+        // fall through; need to zero out lower time units
       case SECOND:
         c.set(TIME_UNIT_CODES.get(TimeUnitRange.MILLISECOND), 0);
       }