提交 f49c912a 编写于 作者: O OHTAKE Tomohiro

Eliminate duplication of crontab lower/upper bounds

They look different, but had been same. See 921359c1
上级 240c381b
......@@ -36,8 +36,9 @@ import antlr.TokenStreamException;
* @author Kohsuke Kawaguchi
*/
abstract class BaseParser extends LLkParser {
private static final int[] LOWER_BOUNDS = new int[] {0,0,1,1,0};
private static final int[] UPPER_BOUNDS = new int[] {59,23,31,12,7};
// lower/uppser bounds of fields (inclusive)
static final int[] LOWER_BOUNDS = new int[] {0,0,1,1,0};
static final int[] UPPER_BOUNDS = new int[] {59,23,31,12,7};
/**
* Used to pick a value from within the range
......
......@@ -413,7 +413,7 @@ public final class CronTab {
public String checkSanity() {
for( int i=0; i<5; i++ ) {
long bitMask = (i<4)?bits[i]:(long)dayOfWeek;
for( int j=LOWER_BOUNDS[i]; j<=UPPER_BOUNDS[i]; j++ ) {
for( int j=BaseParser.LOWER_BOUNDS[i]; j<=BaseParser.UPPER_BOUNDS[i]; j++ ) {
if(!checkBits(bitMask,j)) {
// this rank has a sparse entry.
// if we have a sparse rank, one of them better be the left-most.
......@@ -428,8 +428,4 @@ public final class CronTab {
return null;
}
// lower/uppser bounds of fields
private static final int[] LOWER_BOUNDS = new int[] {0,0,1,0,0};
private static final int[] UPPER_BOUNDS = new int[] {59,23,31,12,7};
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册