{"record":{"id":"8ec6fbd107ec41e3","repo":"jeecgboot/JeecgBoot","slug":"increment-31-incr","errorCode":null,"errorMessage":"Increment >= 31 : {incr}","messagePattern":"Increment >= 31 : (.+?)","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java","lineNumber":732,"sourceCode":"                    i = vs.pos;\n                }\n                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","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java#L714-L750","documentation":"checkIncrementRange rejects a step value greater than 31 for DAY_OF_MONTH (months have at most 31 days). A '/32' or larger step is invalid. Note the code uses '> 31' (i.e. 31 is allowed even though few months reach it). Message echoes the increment.","triggerScenarios":"Day-of-month step out of range: '0 0 0 1/32 * ?', or a computed monthly interval > 31 placed in the dom field.","commonSituations":"Confusing dom step with month step (for 'every N months' use the MONTH field, not dom); dynamic interval generation without bounds; off-by-one around 31.","solutions":["Cap day-of-month steps at 31; common values are '/2', '/3', '/5'.","For 'every N months' put the step in the MONTH field: '0 0 0 1 1/3 ?' = every 3 months on the 1st.","Clamp computed dom steps to 1-31."],"exampleFix":"// before - day-of-month step > 31\nString cron = \"0 0 0 1/40 * ?\";  // Increment >= 31 : 40\n\n// after - every 3 months on the 1st\nString cron = \"0 0 0 1 1/3 ?\";","handlingStrategy":"validation","validationCode":"// DAY_OF_MONTH step must be <= 31.\npublic static String validateDomStep(String domField) {\n    return validateStepRange(domField, 31);\n}\n// (validateStepRange as defined in error 295)","typeGuard":"public static boolean domStepValid(String domField) {\n    return stepWithinMax(domField, 31);\n}","tryCatchPattern":"try {\n    new CronExpression(expr);\n} catch (ParseException e) {\n    if (e.getMessage().startsWith(\"Increment >= 31\")) {\n        return \"Day-of-month steps must be <= 31; for multi-month intervals use the month step. \" + e.getMessage();\n    }\n    throw e;\n}","preventionTips":["Clamp day-of-month steps to 31.","For 'every N months', put the step in the MONTH field, not dom.","Validate dom-step bounds in any cron generation code."],"tags":["cron","xxl-job","step-operator","day-of-month","validation","parse-error"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}