{"record":{"id":"7c72f8432cf83a67","repo":"apache/hadoop","slug":"suite-suiteclassname-suitename-is-empty","errorCode":null,"errorMessage":"suite \" + suiteClassName + \" suiteName is empty","messagePattern":"suite \" \\+ suiteClassName \\+ \" suiteName is empty","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":93,"sourceCode":"    String key = \"hadoop.compatibility.suite.\" + this.suiteName + \".classname\";\n    final String suiteClassName = conf.get(key, null);\n    if ((suiteClassName == null) || suiteClassName.isEmpty()) {\n      throw new HdfsCompatIllegalArgumentException(\n          \"cannot get class name for suite \" + this.suiteName +\n              \", 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);","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-tools/hadoop-compat-bench/src/main/java/org/apache/hadoop/fs/compat/common/HdfsCompatCommand.java#L75-L111","documentation":"Once a custom suite loads, HdfsCompatCommand validates its metadata: getSuiteName() must return a non-null, non-empty name. This error means the class loaded and passed the instanceof check but identifies itself with an empty name, so the tool cannot register, report, or address it.","triggerScenarios":"A custom HdfsCompatSuite implementation whose getSuiteName() returns null, \"\", or a value derived from an uninitialized field or an unset configuration entry.","commonSituations":"Suite classes copied from a template where the name constant was never filled in; getSuiteName() reading a value that is only populated in certain constructors; name taken from a resource/property that is missing at runtime.","solutions":["Return a stable non-empty constant from getSuiteName(), matching the name used in -suite and the configuration key","Initialize the name as a compile-time constant rather than runtime state","Rebuild and redeploy the suite jar so the tool loads the fixed class"],"exampleFix":"// before\n@Override\npublic String getSuiteName() { return suiteNameField; } // null at runtime\n// -> suite ... suiteName is empty\n\n// after\nprivate static final String NAME = \"mysuite\";\n@Override\npublic String getSuiteName() { return NAME; }","handlingStrategy":"validation","validationCode":"HdfsCompatSuite s = (HdfsCompatSuite) Class.forName(cls).getConstructor().newInstance();\nString name = s.getSuiteName();\nif (name == null || name.isEmpty()) {\n  throw new IllegalArgumentException(cls + \": getSuiteName() must not be null/empty\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Return a compile-time constant from getSuiteName()","Add a registration smoke test asserting name and cases are non-empty for every shipped suite"],"tags":["hadoop-compat-bench","suite-registration","plugin-validation"],"backgroundTag":"plugin-validation-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}