{"record":{"id":"6bc68d8a920a493d","repo":"jeecgboot/JeecgBoot","slug":"error-6bc68d","errorCode":null,"errorMessage":"参数不能为空","messagePattern":"参数不能为空","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java","lineNumber":1144,"sourceCode":"\t * @author chenrui\n\t * @date 2025/2/13 18:35\n\t */\n\tpublic static boolean isObjectNotEmpty(Object object) {\n\t\treturn !isObjectEmpty(object);\n\t}\n\n\t/**\n\t * 如果src大于des返回true\n\t * for [QQYUN-10990]AIRAG\n\t * @param src\n\t * @param des\n\t * @return\n\t * @author: chenrui\n\t * @date: 2018/9/19 15:30\n\t */\n\tpublic static boolean isGt(Number src, Number des) {\n\t\tif (null == src || null == des) {\n\t\t\tthrow new IllegalArgumentException(\"参数不能为空\");\n\t\t}\n\t\tif (src.doubleValue() > des.doubleValue()) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * 如果src大于等于des返回true\n\t * for [QQYUN-10990]AIRAG\n\t * @param src\n\t * @param des\n\t * @return\n\t * @author: chenrui\n\t * @date: 2018/9/19 15:30\n\t */\n\tpublic static boolean isGe(Number src, Number des) {\n\t\tif (null == src || null == des) {","sourceCodeStart":1126,"sourceCodeEnd":1162,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java#L1126-L1162","documentation":"Thrown by oConvertUtils.isGt(Number src, Number des) when either src or des is null. This utility compares two Numbers and returns true if src > des. It is called primarily from AssertUtils.assertGt() and AssertUtils.assertLe() for boundary/range validation (e.g., AIRAG feature). The IllegalArgumentException is unchecked, so callers that pass null get a runtime crash.","triggerScenarios":"Calling isGt(null, 5), isGt(3, null), or isGt(null, null). In practice this happens when AssertUtils.assertGt is called with a Number value that was parsed from user input or a config property and was null because parsing failed or the field was absent.","commonSituations":"Numeric form field left blank and parsed to null Integer/Long; database column returns null for a numeric field that is then passed to an assertion; JSON deserialization produces null for an unboxed numeric type that was promoted to its wrapper.","solutions":["Null-check both arguments before calling isGt and provide a sensible default or return early.","Use primitive types (long, double, int) instead of wrapper types if null is never a valid input.","Validate user input at the controller layer and reject requests with missing numeric fields.","Wrap the assertion call in a try-catch for IllegalArgumentException if the business logic allows optional comparisons."],"exampleFix":"// before\nboolean result = oConvertUtils.isGt(pageSize, threshold);\n\n// after\nif (pageSize == null || threshold == null) {\n    return false;\n}\nboolean result = oConvertUtils.isGt(pageSize, threshold);","handlingStrategy":"validation","validationCode":"if (src == null || des == null) {\n    return false; // or throw a domain-specific exception\n}\nboolean result = oConvertUtils.isGt(src, des);","typeGuard":"private static boolean isSafeNumber(Number n) {\n    return n != null;\n}","tryCatchPattern":"try {\n    boolean result = oConvertUtils.isGt(src, des);\n} catch (IllegalArgumentException e) {\n    log.warn(\"Null number comparison: src={}, des={}\", src, des);\n    return false;\n}","preventionTips":["Null-check Number arguments before calling isGt.","Prefer primitive types when null is never a valid input.","Validate numeric request fields at the API boundary."],"tags":["validation","null","number","assertion","utility"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}