{"record":{"id":"e6a6b6b791ae6dde","repo":"xuxueli/xxl-job","slug":"increment-7","errorCode":null,"errorMessage":"Increment >= 7 : {}","messagePattern":"Increment >= 7 : (.+?)","errorType":"validation","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java","lineNumber":734,"sourceCode":"                i = checkNext(i, s, val, type);\n                return i;\n            }\n        } else {\n            throw new ParseException(\"Unexpected character: \" + c, i);\n        }\n\n        return i;\n    }\n\n    private void checkIncrementRange(int incr, int type, int idxPos) throws ParseException {\n        if (incr > 59 && (type == SECOND || type == MINUTE)) {\n            throw new ParseException(\"Increment >= 60 : \" + incr, idxPos);\n        } else if (incr > 23 && (type == HOUR)) {\n            throw new ParseException(\"Increment >= 24 : \" + incr, idxPos);\n        } else if (incr > 31 && (type == DAY_OF_MONTH)) {\n            throw new ParseException(\"Increment >= 31 : \" + incr, idxPos);\n        } else if (incr > 7 && (type == DAY_OF_WEEK)) {\n            throw new ParseException(\"Increment >= 7 : \" + incr, idxPos);\n        } else if (incr > 12 && (type == MONTH)) {\n            throw new ParseException(\"Increment >= 12 : \" + incr, idxPos);\n        }\n    }\n\n    protected int checkNext(int pos, String s, int val, int type)\n            throws ParseException {\n\n        int end = -1;\n        int i = pos;\n\n        if (i >= s.length()) {\n            addToSet(val, end, -1, type);\n            return i;\n        }\n\n        char c = s.charAt(pos);\n","sourceCodeStart":716,"sourceCodeEnd":752,"githubUrl":"https://github.com/xuxueli/xxl-job/blob/e74c784f68f81fa89cb350913ef15794865d7b12/xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java#L716-L752","documentation":"Thrown by checkIncrementRange when a step/increment value in the Day-of-Week field exceeds 7. The day-of-week field cycles through 1-7 (SUN=1 through SAT=7), so an increment of 8 or more is rejected.","triggerScenarios":"A cron expression like '0 0 0 ? * 1/8' where the increment after '/' in the day-of-week field is >= 8. The check at line 733 tests incr > 7 with type DAY_OF_WEEK.","commonSituations":"Generating a weekday increment without bounds checking, or treating the day-of-week field as 0-indexed (0-6) and accidentally producing a value of 8.","solutions":["Reduce the day-of-week increment to 7 or less.","Remember that Quartz day-of-week is 1-7, not 0-6.","Validate step values against 7 for the day-of-week field before constructing the expression."],"exampleFix":"// before\n\"0 0 0 ? * 1/10\"\n// after\n\"0 0 0 ? * 1/2\"","handlingStrategy":"validation","validationCode":"// Validate step increment for day-of-week (field index 5)\nString[] parts = cron.trim().split(\"\\\\s+\");\nif (parts.length > 5 && parts[5].contains(\"/\")) {\n    int step = Integer.parseInt(parts[5].substring(parts[5].indexOf(\"/\") + 1));\n    if (step > 7) throw new IllegalArgumentException(\"Day-of-week step must be <= 7: \" + step);\n}","typeGuard":"boolean isValidDayOfWeekStep(String dowField) {\n    if (!dowField.contains(\"/\")) return true;\n    int step = Integer.parseInt(dowField.substring(dowField.indexOf(\"/\") + 1));\n    return step >= 1 && step <= 7;","tryCatchPattern":"try {\n    new CronExpression(cron);\n} catch (ParseException e) {\n    if (e.getMessage().contains(\"Increment >= 7\")) {\n        // reduce the weekday step\n    }\n}","preventionTips":["Remember Quartz day-of-week is 1-7 (not 0-6), so steps max at 7.","Clamp day-of-week step values to 1-7 before building the expression.","Validate increment values against the field maximum."],"tags":["cron","validation","increment","range"],"backgroundTag":null,"analyzedSha":"e74c784f68f81fa89cb350913ef15794865d7b12","analyzedAt":"2026-08-14T04:22:43.715Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}