{"record":{"id":"0064b7581e2f7923","repo":"quarkusio/quarkus","slug":"height-must-be-positive","errorCode":null,"errorMessage":"`height` must be positive","messagePattern":"`height` must be positive","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchArgs.java","lineNumber":97,"sourceCode":"        this.radius = radius;\n        this.unit = unit;\n        return this;\n    }\n\n    /**\n     * Search inside circular area according to given {@code radius}.\n     *\n     * @param width the width of the box\n     * @param height the height of the box\n     * @param unit the unit\n     * @return the current {@code GeoSearchArgs}\n     **/\n    public GeoSearchArgs<V> byBox(double width, double height, GeoUnit unit) {\n        if (width < 0) {\n            throw new IllegalArgumentException(\"`width` must be positive\");\n        }\n        if (height < 0) {\n            throw new IllegalArgumentException(\"`height` must be positive\");\n        }\n        if (unit == null) {\n            throw new IllegalArgumentException(\"`unit` cannot be `null`\");\n        }\n        this.width = width;\n        this.height = height;\n        this.unit = unit;\n        return this;\n    }\n\n    /**\n     * Use {@code ASC} order (from small to large).\n     *\n     * @return the current {@code GeoRadiusArgs}\n     **/\n    public GeoSearchArgs<V> ascending() {\n        this.direction = \"ASC\";\n        return this;","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoSearchArgs.java#L79-L115","documentation":"In byBox, after width is validated, the height is checked: a negative height throws IllegalArgumentException with this message. Both box dimensions must be non-negative to form a valid BYBOX area for GEOSEARCH.","triggerScenarios":"Calling byBox(10, -3, GeoUnit.KM) or passing a height computed from data that can be negative, e.g. y2 - y1 with points in descending order.","commonSituations":"Bounding boxes computed from unordered corner points; sentinel negative values from config; swapped width/height arguments so the negative value lands in height.","solutions":["Ensure height is non-negative, e.g. Math.abs(y2 - y1)","Reorder min/max computation so extents are always positive","Check argument order if width and height may be swapped"],"exampleFix":"// before\ndouble height = y1 - y2; // negative when y2 > y1\nargs.byBox(width, height, GeoUnit.KM);\n// after\ndouble height = Math.abs(y1 - y2);\nargs.byBox(width, height, GeoUnit.KM);","handlingStrategy":"validation","validationCode":"if (height < 0) { throw new IllegalStateException(\"height must be >= 0\"); }","typeGuard":null,"tryCatchPattern":"try { args.byBox(width, height, unit); } catch (IllegalArgumentException e) { log.warn(\"Bad box height: \" + e.getMessage()); }","preventionTips":["Normalize corner points (min/max) before computing height","Validate dimensions when loading from config","Check argument order for width/height"],"tags":["redis","geo","illegal-argument","argument-validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}