{"record":{"id":"322df2b4bf9fffc0","repo":"redis/jedis","slug":"ordering-obo-or-bulk-must-not-be-null","errorCode":null,"errorMessage":"Ordering (OBO or BULK) must not be null.","messagePattern":"Ordering \\(OBO or BULK\\) must not be null\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/main/java/redis/clients/jedis/params/LMoveMParams.java","lineNumber":36,"sourceCode":" */\npublic class LMoveMParams implements IParams {\n\n  private Keyword selector;\n  private Integer count;\n  private ListMoveOrder order;\n\n  public static LMoveMParams lMoveMParams() {\n    return new LMoveMParams();\n  }\n\n  /**\n   * Move up to {@code count} elements (same semantics as the {@code count} argument of\n   * {@code LPOP}), ordered by {@code order}. Mutually exclusive with\n   * {@link #exactly(int, ListMoveOrder)} (last call wins).\n   */\n  public LMoveMParams count(int count, ListMoveOrder order) {\n    if (order == null) {\n      throw new IllegalArgumentException(\"Ordering (OBO or BULK) must not be null.\");\n    }\n    this.selector = Keyword.COUNT;\n    this.count = count;\n    this.order = order;\n    return this;\n  }\n\n  /**\n   * Move exactly {@code count} elements, or nothing (a {@code null} reply) if the source list does\n   * not hold that many, ordered by {@code order}. Mutually exclusive with\n   * {@link #count(int, ListMoveOrder)} (last call wins).\n   */\n  public LMoveMParams exactly(int count, ListMoveOrder order) {\n    if (order == null) {\n      throw new IllegalArgumentException(\"Ordering (OBO or BULK) must not be null.\");\n    }\n    this.selector = Keyword.EXACTLY;\n    this.count = count;","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/redis/jedis/blob/6dac31d4c224fb3257c216f3985340c6f500cdcb/src/main/java/redis/clients/jedis/params/LMoveMParams.java#L18-L54","documentation":"LMoveMParams.count(int, ListMoveOrder) supports LMPOP-style multi-list moves with an ordering that maps to Redis semantics (one-by-one vs bulk). Passing a null ListMoveOrder is rejected immediately with this IllegalArgumentException because the order must be encoded into the command arguments.","triggerScenarios":"Calling lmove-m/LMoveMParams.count(n, order) with a null order, typically when the order comes from a variable, config, or an enum lookup (ListMoveOrder.valueOf) that returned null or was defaulted to null.","commonSituations":"Mapping user/CLI input to ListMoveOrder with an unmatched branch leaving null; deserializing config where the order key is absent; passing a method parameter straight through without a default.","solutions":["Pass an explicit ListMoveOrder value (e.g. ListMoveOrder.OBO or ListMoveOrder.BULK) to count()","Default the order variable before the call, e.g. order == null ? ListMoveOrder.OBO : order","If order is parsed from input, fail earlier with a clear message on unknown values"],"exampleFix":"// before\nListMoveOrder order = parseOrder(input); // may return null\nparams.count(3, order);\n// after\nListMoveOrder order = parseOrder(input);\nparams.count(3, order != null ? order : ListMoveOrder.OBO);","handlingStrategy":"validation","validationCode":"if (order == null) order = ListMoveOrder.OBO;\nparams.count(n, order);","typeGuard":"ListMoveOrder nonNullOrDefault(ListMoveOrder o) { return o != null ? o : ListMoveOrder.OBO; }","tryCatchPattern":"try {\n  params.count(n, order);\n} catch (IllegalArgumentException e) {\n  params.count(n, ListMoveOrder.OBO);\n}","preventionTips":["Never pass possibly-null enum variables straight into param builders","Fail early when mapping input strings to ListMoveOrder","Pick a documented default order at the call site"],"tags":["jedis","lmove","null-argument","illegal-argument"],"backgroundTag":"null-argument","analyzedSha":"6dac31d4c224fb3257c216f3985340c6f500cdcb","analyzedAt":"2026-09-08T04:55:01.204Z","contentChangedAt":"2026-09-08T04:55:01.204Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}