{"record":{"id":"332766b64617a900","repo":"alibaba/spring-cloud-alibaba","slug":"increment-12","errorCode":null,"errorMessage":"Increment > 12 : {}","messagePattern":"Increment > 12 : (.+?)","errorType":"exception","errorClass":"ParseException","httpStatus":null,"severity":"error","filePath":"spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/util/CronExpression.java","lineNumber":448,"sourceCode":"\n\t\t\t\ti++;\n\t\t\t\tif (incr > 10) {\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t\tif (incr > 59 && (type == SECOND || type == MINUTE)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 60 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 23 && (type == HOUR)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 24 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 31 && (type == DAY_OF_MONTH)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 31 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 7 && (type == DAY_OF_WEEK)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 7 : \" + incr, i);\n\t\t\t\t}\n\t\t\t\telse if (incr > 12 && (type == MONTH)) {\n\t\t\t\t\tthrow new ParseException(\"Increment > 12 : \" + incr, i);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tincr = 1;\n\t\t\t}\n\n\t\t\taddToSet(ALL_SPEC_INT, -1, incr, type);\n\t\t\treturn i;\n\t\t}\n\t\telse if (c == 'L') {\n\t\t\ti++;\n\t\t\tif (type == DAY_OF_MONTH) {\n\t\t\t\tlastdayOfMonth = true;\n\t\t\t}\n\t\t\tif (type == DAY_OF_WEEK) {\n\t\t\t\taddToSet(7, 7, 0, type);\n\t\t\t}\n\t\t\tif (type == DAY_OF_MONTH && s.length() > i) {","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/alibaba/spring-cloud-alibaba/blob/115d5901102009492e05d5ec18c3f79cad4077d0/spring-cloud-alibaba-starters/spring-cloud-starter-alibaba-schedulerx/src/main/java/com/alibaba/cloud/scheduling/schedulerx/util/CronExpression.java#L430-L466","documentation":"Thrown when a step value after '/' exceeds 12 in the MONTH field (guard at CronExpression.java:447-448). Month steps are capped at 12 because a year has twelve months.","triggerScenarios":"`new CronExpression(\"0 0 0 ? */13 *\")` (month step 13) or any step > 12 in the month position.","commonSituations":"Developer wants a quarterly or yearly cadence and overstates the step, or a field misalignment places a large value in the month field.","solutions":["Use a month step <= 12, e.g. '*/13' -> '*/3' for quarterly.","For a yearly schedule, fix the month (e.g. '0 0 0 1 1 ?') rather than using a step.","Confirm the six fields are correctly ordered."],"exampleFix":"// before\nnew CronExpression(\"0 0 0 ? */13 *\");\n// after\nnew CronExpression(\"0 0 0 ? */3 *\"); // every 3 months (quarterly)","handlingStrategy":"validation","validationCode":"static boolean stepWithin(String field, int max) {\n    int slash = field.indexOf('/');\n    if (slash < 0) return true;\n    try { return Integer.parseInt(field.substring(slash + 1)) <= max; }\n    catch (NumberFormatException e) { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n    CronExpression cron = new CronExpression(raw);\n} catch (ParseException e) {\n    throw new IllegalArgumentException(\"Invalid cron expression: \" + raw, e);\n}","preventionTips":["Month steps cap at 12; for yearly cadence fix the month (e.g. month 1).","Range-check injected month/step values.","Recount fields so the month stays in position 5."],"tags":["cron","schedulerx","spring-cloud-alibaba","configuration","parsing","validation","range-check"],"backgroundTag":null,"analyzedSha":"115d5901102009492e05d5ec18c3f79cad4077d0","analyzedAt":"2026-08-14T04:47:13.900Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}