You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2016/01/21 20:38:58 UTC

logging-log4j2 git commit: Convert control statement bodies to block.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 18dc80e6a -> 82872f7e6


Convert control statement bodies to block.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/82872f7e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/82872f7e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/82872f7e

Branch: refs/heads/master
Commit: 82872f7e6ce6217e512f26a52a3be2b9bed112fb
Parents: 18dc80e
Author: ggregory <gg...@apache.org>
Authored: Thu Jan 21 11:38:55 2016 -0800
Committer: ggregory <gg...@apache.org>
Committed: Thu Jan 21 11:38:55 2016 -0800

----------------------------------------------------------------------
 .../apache/logging/log4j/core/util/CronExpression.java  | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/82872f7e/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CronExpression.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CronExpression.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CronExpression.java
index d1ae64c..dbb5a9d 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CronExpression.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/CronExpression.java
@@ -332,8 +332,9 @@ public final class CronExpression {
         // the second immediately following it.
         while (difference == 1000) {
             newDate = getTimeAfter(lastDate);
-            if (newDate == null)
+            if (newDate == null) {
                 break;
+            }
 
             difference = newDate.getTime() - lastDate.getTime();
 
@@ -647,8 +648,9 @@ public final class CronExpression {
                 if (c == '-') {
                     ValueSet vs = getValue(0, s, i + 1);
                     lastdayOffset = vs.value;
-                    if (lastdayOffset > 30)
+                    if (lastdayOffset > 30) {
                         throw new ParseException("Offset from last day must be <= 30", i + 1);
+                    }
                     i = vs.pos;
                 }
                 if (s.length() > i) {
@@ -697,8 +699,9 @@ public final class CronExpression {
 
         if (c == 'L') {
             if (type == DAY_OF_WEEK) {
-                if (val < 1 || val > 7)
+                if (val < 1 || val > 7) {
                     throw new ParseException("Day-of-Week values must be between 1 and 7", -1);
+                }
                 lastdayOfWeek = true;
             } else {
                 throw new ParseException("'L' option is not valid here. (pos=" + i + ")", i);
@@ -715,8 +718,9 @@ public final class CronExpression {
             } else {
                 throw new ParseException("'W' option is not valid here. (pos=" + i + ")", i);
             }
-            if (val > 31)
+            if (val > 31) {
                 throw new ParseException("The 'W' option does not make sense with values larger than 31 (max number of days in a month)", i);
+            }
             TreeSet<Integer> set = getSet(type);
             set.add(val);
             i++;