{"record":{"id":"46180662dc1294df","repo":"apache/hadoop","slug":"suite-suiteclassname-suitename-conflicts-w","errorCode":null,"errorMessage":"suite \" + suiteClassName + \" suiteName conflicts with default suite \" + defaultSuite.getSuiteName()","messagePattern":"suite \" \\+ suiteClassName \\+ \" suiteName conflicts with default suite \" \\+ defaultSuite\\.getSuiteName\\(\\)","errorType":"validation","errorClass":"HdfsCompatIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-tools/hadoop-compat-bench/src/main/java/org/apache/hadoop/fs/compat/common/HdfsCompatCommand.java","lineNumber":98,"sourceCode":"              \", configuration \" + key + \" is not properly set.\");\n    }\n    Constructor<?> ctor = suiteClassName.getClass().getConstructor();\n    ctor.setAccessible(true);\n    Object suiteObj = ctor.newInstance();\n    if (suiteObj instanceof HdfsCompatSuite) {\n      this.suite = (HdfsCompatSuite) suiteObj;\n    } else {\n      throw new HdfsCompatIllegalArgumentException(\n          \"class name \" + suiteClassName + \" must be an\" +\n              \" implementation of \" + HdfsCompatSuite.class.getName());\n    }\n    if (suite.getSuiteName() == null || suite.getSuiteName().isEmpty()) {\n      throw new HdfsCompatIllegalArgumentException(\n          \"suite \" + suiteClassName + \" suiteName is empty\");\n    }\n    for (HdfsCompatSuite defaultSuite : defaultSuites.values()) {\n      if (suite.getSuiteName().equalsIgnoreCase(defaultSuite.getSuiteName())) {\n        throw new HdfsCompatIllegalArgumentException(\n            \"suite \" + suiteClassName + \" suiteName\" +\n                \" conflicts with default suite \" + defaultSuite.getSuiteName());\n      }\n    }\n    if (!hasApiCase() && !hasShellCase()) {\n      throw new HdfsCompatIllegalArgumentException(\n          \"suite \" + suiteClassName + \" is empty for both API and SHELL\");\n    }\n  }\n\n  private boolean hasApiCase() {\n    return (suite.getApiCases() != null) &&\n        (suite.getApiCases().length > 0);\n  }\n\n  private boolean hasShellCase() {\n    return (suite.getShellCases() != null) &&\n        (suite.getShellCases().length > 0);","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-compat-bench/src/main/java/org/apache/hadoop/fs/compat/common/HdfsCompatCommand.java#L80-L116","documentation":"Custom suite names are compared case-insensitively against every built-in default suite's name; a match throws HdfsCompatIllegalArgumentException. This prevents custom suites from shadowing or being confused with the suites hadoop-compat-bench ships by default.","triggerScenarios":"A custom suite whose getSuiteName() equals (ignoring case) the name of any default suite — e.g. naming your suite 'HDFS', 'ALL', or reusing a built-in suite's identifier in different letter case.","commonSituations":"Cloning an existing suite as a starting point and forgetting to change getSuiteName(); deliberately trying to override a default suite via the classname configuration (not supported — the default map is checked first and wins); casing differences ('MyHdfs' vs 'myhdfs') that collide.","solutions":["Rename the custom suite to something unique, e.g. 'myvendor-hdfs'","If you want different default behavior, modify the default suite in source rather than shadowing its name","Rebuild the suite jar and re-run"],"exampleFix":"// before\n@Override\npublic String getSuiteName() { return \"hdfs\"; } // collides with default\n// -> suite ... suiteName conflicts with default suite hdfs\n\n// after\n@Override\npublic String getSuiteName() { return \"myvendor-hdfs\"; }","handlingStrategy":"validation","validationCode":"for (HdfsCompatSuite d : defaultSuites.values()) {\n  if (mySuiteName.equalsIgnoreCase(d.getSuiteName())) {\n    throw new IllegalArgumentException(\n        \"suite name '\" + mySuiteName + \"' conflicts with default suite \"\n        + d.getSuiteName() + \"; rename it\");\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefix custom suite names with a vendor or project namespace (myvendor-*)","Assert name uniqueness against the built-in list in a registration unit test"],"tags":["hadoop-compat-bench","suite-registration","name-conflict"],"backgroundTag":"identifier-name-conflict","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}