{"record":{"id":"4b71aba5a3697736","repo":"projectlombok/lombok","slug":"minor-version-must-be-between-0-and-999","errorCode":null,"errorMessage":"Minor version must be between 0 and 999","messagePattern":"Minor version must be between 0 and 999","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/core/lombok/core/configuration/CheckerFrameworkVersion.java","lineNumber":74,"sourceCode":"\t}\n\t\n\tpublic boolean generateReturnsReceiver() {\n\t\treturn version >= 3100;\n\t}\n\t\n\tpublic boolean generateCalledMethods() {\n\t\treturn version >= 3100;\n\t}\n\t\n\tpublic static CheckerFrameworkVersion valueOf(String versionString) {\n\t\tif (versionString != null) versionString = versionString.trim();\n\t\tif (versionString == null || versionString.equalsIgnoreCase(\"false\") || versionString.equals(\"0\")) return new CheckerFrameworkVersion(0);\n\t\tif (versionString.equalsIgnoreCase(\"true\")) return new CheckerFrameworkVersion(DEFAULT);\n\t\tMatcher m = VERSION.matcher(versionString);\n\t\tif (!m.matches()) throw new IllegalArgumentException(\"Expected 'true' or 'false' or a major/minor version, such as '2.9'\");\n\t\tint major = Integer.parseInt(m.group(1));\n\t\tint minor = (m.group(2) != null && !m.group(2).isEmpty()) ? Integer.parseInt(m.group(2)) : 0;\n\t\tif (minor > 999) throw new IllegalArgumentException(\"Minor version must be between 0 and 999\");\n\t\tint v = major * 1000 + minor;\n\t\tif (v > MAX_SUPPORTED) {\n\t\t\tString s = (v / 1000) + \".\" + (v % 1000);\n\t\t\tthrow new IllegalArgumentException(\"Lombok supports at most v\" + s + \"; reduce the value of key 'checkerframework' to \" + s);\n\t\t}\n\t\treturn new CheckerFrameworkVersion(v);\n\t}\n\t\n\tpublic static String description() {\n\t\treturn \"checkerframework-version\";\n\t}\n\t\n\tpublic static String exampleValue() {\n\t\tString s = (MAX_SUPPORTED / 1000) + \".\" + (MAX_SUPPORTED % 1000);\n\t\treturn \"major.minor (example: 3.2 - and no higher than \" + s + \") or true or false\";\n\t}\n\t\n\t@Override public boolean equals(Object obj) {","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/projectlombok/lombok/blob/6d6a3e9fec0a9555702561fbeb8eac836575116e/src/core/lombok/core/configuration/CheckerFrameworkVersion.java#L56-L92","documentation":"CheckerFrameworkVersion.valueOf() encodes the version as major*1000+minor and enforces minor <= 999 and total <= MAX_SUPPORTED. A parsed minor version above 999 throws IllegalArgumentException 'Minor version must be between 0 and 999', rejecting implausible version strings rather than silently mis-encoding them.","triggerScenarios":"A 'checkerframework' lombok.config value matching VERSION but with a minor group larger than 999 (e.g. '2.1234') — after regex match, Integer.parseInt(m.group(2)) > 999.","commonSituations":"Paste errors that concatenate digits (e.g. '2.90' typo'd as '2.9001'); writing a date or build number instead of a version; misunderstanding the field as allowing arbitrary numeric identifiers.","solutions":["Correct the minor part to 0–999, e.g. '2.12' instead of '2.1234'.","If the intent was a real Checker Framework version, use its actual major.minor (patch is dropped).","Also verify the total v = major*1000+minor does not exceed MAX_SUPPORTED, or the follow-up 'reduce the value' error will fire.","Validate the value before writing it into lombok.config or before calling CheckerFrameworkVersion.valueOf programmatically."],"exampleFix":"// before (lombok.config)\ncheckerframework = 2.1234\n// after\ncheckerframework = 2.12","handlingStrategy":"validation","validationCode":"java.util.regex.Matcher m = java.util.regex.Pattern.compile(\"^(\\\\d+)(?:\\\\.(\\\\d+))?$\").matcher(s.trim());\nif (!m.matches()) throw new IllegalArgumentException(\"not a major[.minor] version\");\nint minor = m.group(2) == null ? 0 : Integer.parseInt(m.group(2));\nif (minor > 999) throw new IllegalArgumentException(\"minor must be 0-999\");","typeGuard":"function isValidCheckerVersion(s) { const m = /^\\d+(?:\\.(\\d{1,3}))?$/.exec(s.trim()); return m != null; }","tryCatchPattern":"try { CheckerFrameworkVersion cv = CheckerFrameworkVersion.valueOf(s); } catch (IllegalArgumentException e) { log.error(\"Invalid checkerframework version: \" + s); }","preventionTips":["Keep the minor segment to at most 3 digits.","Parse versions programmatically rather than hand-editing config numbers.","Double-check pasted version strings for duplicated digits.","Remember the major*1000+minor encoding caps the minor at 999."],"tags":["lombok","configuration","version-parsing","value-out-of-range"],"backgroundTag":"argument-out-of-range","analyzedSha":"6d6a3e9fec0a9555702561fbeb8eac836575116e","analyzedAt":"2026-09-07T23:18:01.841Z","contentChangedAt":"2026-09-07T23:18:01.841Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}