mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
update 确保线程安全;
This commit is contained in:
parent
b270bc1420
commit
ac1246d7d9
@ -32,10 +32,6 @@ import java.util.List;
|
|||||||
public class PartParser {
|
public class PartParser {
|
||||||
|
|
||||||
private final Part part;
|
private final Part part;
|
||||||
/**
|
|
||||||
* 是否是查询最后一天
|
|
||||||
*/
|
|
||||||
private boolean isLastDay;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建解析器
|
* 创建解析器
|
||||||
@ -68,12 +64,15 @@ public class PartParser {
|
|||||||
* @return {@link PartMatcher}
|
* @return {@link PartMatcher}
|
||||||
*/
|
*/
|
||||||
public PartMatcher parse(String value) {
|
public PartMatcher parse(String value) {
|
||||||
|
// 是否是查询最后一天
|
||||||
|
boolean isLastDay = false;
|
||||||
if (isMatchAllStr(value)) {
|
if (isMatchAllStr(value)) {
|
||||||
//兼容Quartz的"?"表达式,不会出现互斥情况,与"*"作用相同
|
//兼容Quartz的"?"表达式,不会出现互斥情况,与"*"作用相同
|
||||||
return new AlwaysTrueMatcher();
|
return new AlwaysTrueMatcher();
|
||||||
|
} else if ("L".equalsIgnoreCase(value)) {
|
||||||
|
isLastDay = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
isLastDay = false;
|
|
||||||
final List<Integer> values = parseArray(value);
|
final List<Integer> values = parseArray(value);
|
||||||
if (values.isEmpty()) {
|
if (values.isEmpty()) {
|
||||||
throw new CronException("Invalid part value: [{}]", value);
|
throw new CronException("Invalid part value: [{}]", value);
|
||||||
@ -270,7 +269,6 @@ public class PartParser {
|
|||||||
*/
|
*/
|
||||||
private int parseAlias(String name) throws CronException {
|
private int parseAlias(String name) throws CronException {
|
||||||
if ("L".equalsIgnoreCase(name)) {
|
if ("L".equalsIgnoreCase(name)) {
|
||||||
isLastDay = true;
|
|
||||||
// L表示最大值
|
// L表示最大值
|
||||||
return part.getMax();
|
return part.getMax();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user