{"record":{"id":"6015c94434ae0b95","repo":"alibaba/spring-cloud-alibaba","slug":"unexpected-character-c-after","errorCode":null,"errorMessage":"Unexpected character '{c}' after '/'","messagePattern":"Unexpected character '(.+?)' after '/'","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":640,"sourceCode":"\t\tif (c == '/') {\n\t\t\ti++;\n\t\t\tc = s.charAt(i);\n\t\t\tfinal int v2 = Integer.parseInt(String.valueOf(c));\n\t\t\ti++;\n\t\t\tif (i >= s.length()) {\n\t\t\t\taddToSet(val, end, v2, type);\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\tc = s.charAt(i);\n\t\t\tif (c >= '0' && c <= '9') {\n\t\t\t\tfinal ValueSet vs = getValue(v2, s, i);\n\t\t\t\tfinal int v3 = vs.value;\n\t\t\t\taddToSet(val, end, v3, type);\n\t\t\t\ti = vs.pos;\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new ParseException(\"Unexpected character '\" + c + \"' after '/'\", i);\n\t\t\t}\n\t\t}\n\n\t\taddToSet(val, end, 0, type);\n\t\ti++;\n\t\treturn i;\n\t}\n\n\tpublic String getCronExpression() {\n\t\treturn cronExpression;\n\t}\n\n\tpublic String getExpressionSummary() {\n\t\tfinal StringBuilder buf = new StringBuilder();\n\n\t\tbuf.append(\"seconds: \");\n\t\tbuf.append(getExpressionSetSummary(seconds));\n\t\tbuf.append(\"\\n\");","sourceCodeStart":622,"sourceCodeEnd":658,"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#L622-L658","documentation":"Thrown in checkNext after a step '/' when the character following '/' is not a digit (guard at CronExpression.java:639-640). This branch handles steps that appear after a value or a range (e.g. '1-5/x' or '0/x'); a non-digit step is invalid.","triggerScenarios":"`new CronExpression(\"0 0 0 1-5/x * ?\")` ('x' after '/'), or `0 0 0 0/L * ?`, or any '<value>/<non-digit>'.","commonSituations":"Typo in the step value, a placeholder left as a letter, or a copy-paste that introduced an operator after '/' instead of a number.","solutions":["Place a digit immediately after '/', e.g. '1-5/x' -> '1-5/2'.","Remove the '/' if no step is intended (e.g. '0' alone).","Range-check any templated step value."],"exampleFix":"// before\nnew CronExpression(\"0 0 0 1-5/x * ?\");\n// after\nnew CronExpression(\"0 0 0 1-5/2 * ?\"); // days 1-5 every 2 days","handlingStrategy":"validation","validationCode":"// A '/' must be followed by a digit anywhere in a field.\nstatic boolean allStepsAreNumeric(String cron) {\n    if (cron == null) return true;\n    for (String f : cron.trim().split(\"\\\\s+\")) {\n        for (int i = 0; i < f.length(); i++) {\n            if (f.charAt(i) == '/' && (i + 1 >= f.length() || !Character.isDigit(f.charAt(i + 1))))\n                return false;\n        }\n    }\n    return true;\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":["Every '/' must be immediately followed by a digit.","Omit '/' if no step is needed.","Validate templated step values before formatting."],"tags":["cron","schedulerx","spring-cloud-alibaba","configuration","parsing","validation"],"backgroundTag":null,"analyzedSha":"115d5901102009492e05d5ec18c3f79cad4077d0","analyzedAt":"2026-08-14T04:47:13.900Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}