{"record":{"id":"701d9847dc50bc48","repo":"apache/druid","slug":"arguments-cannot-be-empty-of-null","errorCode":null,"errorMessage":"Arguments cannot be empty of null","messagePattern":"Arguments cannot be empty of null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceUtils.java","lineNumber":57,"sourceCode":"    String name = instance;\n    if (instance != null && !instance.isEmpty()) {\n      int lastSlash = instance.lastIndexOf('/');\n      if (lastSlash > -1) {\n        name = instance.substring(lastSlash + 1);\n      } else {\n        name = instance; // let's assume not the URI like thing\n      }\n    }\n    return name;\n  }\n\n  /**\n   * Converts a list of terms to a 'OR' list of terms to look for a specific 'key'\n   */\n  public static String buildFilter(List<String> list, String key)\n  {\n    if (list == null || list.isEmpty() || key == null || key.isEmpty()) {\n      throw new IllegalArgumentException(\"Arguments cannot be empty of null\");\n    }\n    Iterator<String> it = list.iterator();\n\n    StringBuilder sb = new StringBuilder();\n    sb.append(StringUtils.format(\"(%s = \\\"%s\\\")\", key, it.next()));\n    while (it.hasNext()) {\n      sb.append(\" OR \").append(StringUtils.format(\"(%s = \\\"%s\\\")\", key, it.next()));\n    }\n    return sb.toString();\n  }\n\n  // cannot build it!\n  private GceUtils()\n  {\n  }\n}\n","sourceCodeStart":39,"sourceCodeEnd":74,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceUtils.java#L39-L74","documentation":"Generic validation helper in GceUtils.buildFilter: the caller passed a null/empty term list or a null/empty key when constructing a GCE API filter string. Without terms or a key no meaningful filter can be built, so the utility rejects the arguments instead of issuing a malformed list request.","triggerScenarios":"Thrown at extensions-contrib/gce-extensions/src/main/java/org/apache/druid/indexing/overlord/autoscaling/gce/GceUtils.java:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the instance/term list passed to GceUtils methods is populated before building filters (check autoscaler config for valid host patterns).","Validate the filter key (e.g. 'name') is non-empty at the call site.","Add logging of the offending list/key to identify which caller passed empty arguments."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}