{"record":{"id":"afd72ebcafccfc96","repo":"JetBrains/intellij-community","slug":"error-short-name-module-cannot-be-empty","errorCode":"error.short.name.module.cannot.be.empty","errorMessage":"Module short name cannot be empty","messagePattern":"Module short name cannot be empty","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleConfigurable.java","lineNumber":68,"sourceCode":"    if (StringUtil.isEmpty(name)) return; //empty string comes on double click on module node\n    if (Comparing.strEqual(name, myModuleName)) return; //nothing changed\n    try {\n      modifiableModuleModel.renameModule(myModule, name);\n    }\n    catch (ModuleWithNameAlreadyExists moduleWithNameAlreadyExists) {\n      //do nothing\n    }\n    myConfigurator.moduleRenamed(myModule, myModuleName, name);\n    myModuleName = name;\n    myConfigurator.setModified(!Comparing.strEqual(myModuleName, myModule.getName()));\n    myContext.getDaemonAnalyzer().queueUpdateForAllElementsWithErrors();\n  }\n\n  @Override\n  protected void checkName(@NotNull String name) throws ConfigurationException {\n    super.checkName(name);\n    if (myModuleGrouper.getShortenedNameByFullModuleName(name).isEmpty()) {\n      throw new ConfigurationException(LangBundle.message(\"error.short.name.module.cannot.be.empty\"));\n    }\n    List<String> list = myModuleGrouper.getGroupPathByModuleName(name);\n    if (list.stream().anyMatch(String::isEmpty)) {\n      throw new ConfigurationException(LangBundle.message(\"error.names.of.parent.groups.cannot.be.empty\"));\n    }\n  }\n\n  public ModuleGrouper getModuleGrouper() {\n    return myModuleGrouper;\n  }\n\n  @Override\n  public ProjectStructureElement getProjectStructureElement() {\n    return myProjectStructureElement;\n  }\n\n  @Override\n  public @NotNull Module getEditableObject() {","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleConfigurable.java#L50-L86","documentation":"Thrown from ModuleConfigurable.checkName() when renaming a module to a full name whose shortened (group-stripped) form is empty. Module names may use dotted group paths like 'group.sub.name'; ModuleGrouper.getShortenedNameByFullModuleName removes group prefixes, and a name consisting only of group separators (e.g. a trailing dot) leaves an empty short name, which is invalid.","triggerScenarios":"Renaming a module in Project Structure to a value whose short name after group stripping is empty, such as '.' or 'a.'. ModuleGrouper.getShortenedNameByFullModuleName(name) returns an empty string.","commonSituations":"Typo in module rename (trailing dot, only dots); pasting a name with an invisible trailing separator; scripted renames generating malformed dotted names.","solutions":["Change the module name so the last dot-separated segment is non-empty (e.g. 'mygroup.mymodule' instead of 'mygroup.')","Avoid leading/trailing dots in module names"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String shortName = ModuleGrouper.getShortenedNameByFullModuleName(newName);\nif (shortName.isEmpty()) reject(\"module short name cannot be empty\");","typeGuard":null,"tryCatchPattern":"try { moduleConfigurable.checkName(name); } catch (ConfigurationException e) { /* show message, keep editor open */ }","preventionTips":["Never end a module name with '.'","When generating grouped names, assert the last dotted segment is non-empty"],"tags":["intellij","modules","rename","validation","module-groups"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}