{"record":{"id":"d3d399ae095263ec","repo":"apache/pulsar","slug":"paramname-cannot-be-less-than-or-equal-to-0-d3d399","errorCode":null,"errorMessage":"${paramName} cannot be less than or equal to 0!","messagePattern":"(.+?) cannot be less than or equal to 0!","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java","lineNumber":61,"sourceCode":"            } else if (ex instanceof InvalidFormatException) {\n\n                InvalidFormatException invalidFormatException = (InvalidFormatException) ex;\n                String exceptionMessage = String.format(\"Failed to parse config file %s. %s on line: %d column: %d\",\n                        file,\n                        invalidFormatException.getOriginalMessage(),\n                        invalidFormatException.getLocation().getLineNr(),\n                        invalidFormatException.getLocation().getColumnNr());\n\n                throw new IllegalArgumentException(exceptionMessage);\n            } else {\n                throw new IllegalArgumentException(ex.getMessage());\n            }\n        }\n    }\n\n    public static boolean positiveCheck(String paramName, long value) {\n        if (value <= 0) {\n            throw new IllegalArgumentException(paramName + \" cannot be less than or equal to 0!\");\n        }\n        return true;\n    }\n\n    public static boolean maxValueCheck(String paramName, long value, long maxValue) {\n        if (value > maxValue) {\n            throw new IllegalArgumentException(paramName + \" cannot be greater than \" + maxValue + \"!\");\n        }\n        return true;\n    }\n}\n","sourceCodeStart":43,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java#L43-L73","documentation":"Bounds check in CmdUtils.positiveCheck: a CLI parameter that must be strictly positive (e.g. a size, count, or timeout) was passed as zero or negative; paramName names the offending option and value is the faulty input.","triggerScenarios":"Thrown at pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/utils/CmdUtils.java:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Supply a value greater than 0 for the named parameter"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}