{"record":{"id":"64565621373d7157","repo":"xuxueli/xxl-job","slug":"unexpected-character-after","errorCode":null,"errorMessage":"Unexpected character '{}' after '/'","messagePattern":"Unexpected character '(.+?)' after '/'","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":865,"sourceCode":"            i++;\n            c = s.charAt(i);\n            int v2 = Integer.parseInt(String.valueOf(c));\n            i++;\n            if (i >= s.length()) {\n                checkIncrementRange(v2, type, i);\n                addToSet(val, end, v2, type);\n                return i;\n            }\n            c = s.charAt(i);\n            if (c >= '0' && c <= '9') {\n                ValueSet vs = getValue(v2, s, i);\n                int v3 = vs.value;\n                checkIncrementRange(v3, type, i);\n                addToSet(val, end, v3, type);\n                i = vs.pos;\n                return i;\n            } else {\n                throw new ParseException(\"Unexpected character '\" + c + \"' after '/'\", i);\n            }\n        }\n\n        addToSet(val, end, 0, type);\n        i++;\n        return i;\n    }\n\n    public String getCronExpression() {\n        return cronExpression;\n    }\n\n    public String getExpressionSummary() {\n        StringBuilder buf = new StringBuilder();\n\n        buf.append(\"seconds: \");\n        buf.append(getExpressionSetSummary(seconds));\n        buf.append(\"\\n\");","sourceCodeStart":847,"sourceCodeEnd":883,"githubUrl":"https://github.com/xuxueli/xxl-job/blob/e74c784f68f81fa89cb350913ef15794865d7b12/xxl-job-admin/src/main/java/com/xxl/job/admin/business/scheduler/cron/CronExpression.java#L847-L883","documentation":"In checkNext, after a '/' step modifier within a range expression, the character immediately following '/' must be a digit (0-9). If it is any other character (letter, symbol, etc.), this error fires. This catches malformed step values that are not integers.","triggerScenarios":"A cron expression like '0 0 0 1-5/x * ?' where 'x' follows '/' instead of a digit. The check at line 864 tests c >= '0' && c <= '9'; the else branch throws.","commonSituations":"Typo or copy-paste introducing a non-numeric character after '/', or a cron builder that inserts a variable name instead of a number.","solutions":["Replace the non-numeric character after '/' with a valid integer (e.g., '1-5/2').","Remove the '/' and its trailing content if no step is needed.","Sanitize cron input to ensure only digits follow '/' characters."],"exampleFix":"// before\n\"0 0 0 1-5/x * ?\"\n// after\n\"0 0 0 1-5/2 * ?\"","handlingStrategy":"validation","validationCode":"// After '/' in a range-step, the next char must be a digit\nfor (String field : cron.trim().split(\"\\\\s+\")) {\n    for (int j = 0; j < field.length(); j++) {\n        if (field.charAt(j) == '/' && j + 1 < field.length() && !Character.isDigit(field.charAt(j + 1))) {\n            throw new IllegalArgumentException(\"Non-numeric character after '/' in: \" + field);\n        }\n    }\n}","typeGuard":"boolean stepFollowedByDigit(String field) {\n    for (int j = 0; j < field.length(); j++) {\n        if (field.charAt(j) == '/' && j + 1 < field.length() && !Character.isDigit(field.charAt(j + 1))) return false;\n    }\n    return true;","tryCatchPattern":"try {\n    new CronExpression(cron);\n} catch (ParseException e) {\n    if (e.getMessage().contains(\"Unexpected character\") && e.getMessage().contains(\"after '/'\")) {\n        // replace the non-numeric char with a valid step integer\n    }\n}","preventionTips":["Ensure only digits follow '/' in any cron field.","Sanitize cron input to strip non-numeric characters after '/'.","Use a cron builder API instead of raw string concatenation for complex expressions."],"tags":["cron","validation","syntax","range"],"backgroundTag":null,"analyzedSha":"e74c784f68f81fa89cb350913ef15794865d7b12","analyzedAt":"2026-08-14T04:22:43.715Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}