{"record":{"id":"262bb4fd6867fdcc","repo":"theonedev/onedev","slug":"request-string-string-is-not-a-valid-integer","errorCode":null,"errorMessage":"Request string '{string}' is not a valid integer","messagePattern":"Request string '(.+?)' is not a valid integer","errorType":"exception","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java","lineNumber":1380,"sourceCode":"\t * Gets the request parameter for this component as an int, using the given default in case no\n\t * corresponding request parameter was found.\n\t * \n\t * @param defaultValue\n\t *            Default value to return if request does not have an integer for this component\n\t * @return The value in the request for this component\n\t */\n\tprotected final int inputAsInt(final int defaultValue)\n\t{\n\t\tfinal String string = getInput();\n\t\tif (string != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn Integer.parseInt(string);\n\t\t\t}\n\t\t\tcatch (NumberFormatException e)\n\t\t\t{\n\t\t\t\tthrow new IllegalArgumentException(exceptionMessage(\"Request string '\" + string +\n\t\t\t\t\t\"' is not a valid integer\"));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn defaultValue;\n\t\t}\n\t}\n\n\t/**\n\t * Gets the request parameters for this component as ints.\n\t * \n\t * @return The values in the request for this component\n\t */\n\tprotected final int[] inputAsIntArray()\n\t{\n\t\tfinal String[] strings = getInputAsArray();\n\t\tif (strings != null)","sourceCodeStart":1362,"sourceCodeEnd":1398,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java#L1362-L1398","documentation":"Wicket FormComponent.inputAsInt parses the request parameter with Integer.parseInt and wraps NumberFormatException into an IllegalArgumentException with a component-scoped message; the submitted string is not a valid integer.","triggerScenarios":"Thrown at server-core/src/main/java/org/apache/wicket/markup/html/form/FormComponent.java:1380 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send an integer value for the form component's request parameter.","Use inputAsInt(defaultValue) semantics: absent parameters are fine, but present ones must parse."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}