{"record":{"id":"92f6ab00307c2a05","repo":"alibaba/nacos","slug":"both-parameters-must-be-non-negative","errorCode":null,"errorMessage":"Both parameters must be non-negative","messagePattern":"Both parameters must be non-negative","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/com/alibaba/nacos/common/utils/RandomUtils.java","lineNumber":82,"sourceCode":"        if (diff == 0) {\n            return startInclusive;\n        }\n        return startInclusive + RANDOM.nextInt(diff);\n    }\n    \n    /**\n     * Check input parameters.\n     *\n     * @param startInclusive lower limit, must be non-negative\n     * @param endExclusive   the upper bound (not included)\n     */\n    private static void checkParameters(final long startInclusive, final long endExclusive) {\n        if (endExclusive < startInclusive) {\n            throw new IllegalArgumentException(\n                \"startInclusive must be less than or equal to the endExclusive.\");\n        }\n        if (startInclusive < 0) {\n            throw new IllegalArgumentException(\"Both parameters must be non-negative\");\n        }\n    }\n}\n","sourceCodeStart":64,"sourceCodeEnd":86,"githubUrl":"https://github.com/alibaba/nacos/blob/9b989acdf181d00898f2e8839257bb2b2a3cefe3/common/src/main/java/com/alibaba/nacos/common/utils/RandomUtils.java#L64-L86","documentation":"Error \"Both parameters must be non-negative\" thrown in alibaba/nacos.","triggerScenarios":"Thrown at common/src/main/java/com/alibaba/nacos/common/utils/RandomUtils.java:82 when the library encounters an invalid state.","commonSituations":"Requesting a random value with a negative bound parameter.","solutions":["Correct the invalid value for RandomUtils negative parameter to match the expected format or allowed set, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b989acdf181d00898f2e8839257bb2b2a3cefe3","analyzedAt":"2026-08-14T07:17:31.569Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}