{"record":{"id":"fa0addb4e23258da","repo":"apache/hadoop","slug":"invalid-input-or-indices","errorCode":null,"errorMessage":"Invalid input or indices","messagePattern":"Invalid input or indices","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/utils/UriUtils.java","lineNumber":232,"sourceCode":"    }\n    return url;\n  }\n\n  /**\n   * Replaces the oldString with newString in the baseUrl.\n   * It will extract the account url path to make sure we do not replace any\n   * matching string in blob path or any other part of url\n   * @param baseUrl the url to be updated.\n   * @param oldString the string to be replaced.\n   * @param newString the string to be replaced with.\n   * @return updated URL\n   */\n  private static String replacedUrl(String baseUrl, String oldString, String newString) {\n    int startIndex = baseUrl.toString().indexOf(\"//\") + 2;\n    int endIndex = baseUrl.toString().indexOf(\"/\", startIndex);\n    if (oldString == null || newString == null|| startIndex < 0\n        || endIndex > baseUrl.length() || startIndex > endIndex) {\n      throw new IllegalArgumentException(\"Invalid input or indices\");\n    }\n    StringBuilder sb = new StringBuilder(baseUrl);\n    int targetIndex = sb.indexOf(oldString, startIndex);\n    if (targetIndex == -1 || targetIndex >= endIndex) {\n      return baseUrl; // target not found within the specified range\n    }\n    sb.replace(targetIndex, targetIndex + oldString.length(), newString);\n    return sb.toString();\n  }\n\n  /**\n   * Checks if the key is for a directory in the set of directories.\n   * @param key the key to check.\n   * @param dirSet the set of directories.\n   * @return true if the key is for a directory in the set of directories.\n   */\n  public static boolean isKeyForDirectorySet(String key, Set<String> dirSet) {\n    for (String dir : dirSet) {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azurebfs/utils/UriUtils.java#L214-L250","documentation":"Error \"Invalid input or indices\" thrown in apache/hadoop.","triggerScenarios":"UriUtils receives an invalid string or out-of-range indices during parsing.","commonSituations":"See trigger scenarios.","solutions":["Validate the input string and start/end indices passed to the URI utility.","Fix index arithmetic in the calling code."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}