JetBrains/intellij-community · error · ConfigurationException

error.names.of.parent.groups.cannot.be.empty

error.names.of.parent.groups.cannot.be.empty

Error message

Parent group names of a module cannot be empty

What it means

Thrown from ModuleConfigurable.checkName() when any intermediate group segment of a dotted module name is empty. For 'a..b' the group path from ModuleGrouper.getGroupPathByModuleName is ['a', ''], and the empty middle group makes the name invalid. Module groups form a hierarchy, and empty group names cannot be represented in the UI tree or .idea/modules.xml.

Source

Thrown at java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/ModuleConfigurable.java:72

    }
    catch (ModuleWithNameAlreadyExists moduleWithNameAlreadyExists) {
      //do nothing
    }
    myConfigurator.moduleRenamed(myModule, myModuleName, name);
    myModuleName = name;
    myConfigurator.setModified(!Comparing.strEqual(myModuleName, myModule.getName()));
    myContext.getDaemonAnalyzer().queueUpdateForAllElementsWithErrors();
  }

  @Override
  protected void checkName(@NotNull String name) throws ConfigurationException {
    super.checkName(name);
    if (myModuleGrouper.getShortenedNameByFullModuleName(name).isEmpty()) {
      throw new ConfigurationException(LangBundle.message("error.short.name.module.cannot.be.empty"));
    }
    List<String> list = myModuleGrouper.getGroupPathByModuleName(name);
    if (list.stream().anyMatch(String::isEmpty)) {
      throw new ConfigurationException(LangBundle.message("error.names.of.parent.groups.cannot.be.empty"));
    }
  }

  public ModuleGrouper getModuleGrouper() {
    return myModuleGrouper;
  }

  @Override
  public ProjectStructureElement getProjectStructureElement() {
    return myProjectStructureElement;
  }

  @Override
  public @NotNull Module getEditableObject() {
    return myModule;
  }

  @Override

View on GitHub (pinned to be881553f2)

Solutions

  1. Fix the module name so every dot-separated segment before the last is non-empty
  2. If grouping is unintended, use a plain name without dots
Defensive patterns

Strategy: validation

Validate before calling

List<String> groups = ModuleGrouper.getGroupPathByModuleName(newName);
if (groups.stream().anyMatch(String::isEmpty)) reject("parent group names cannot be empty");

Try / catch

try { moduleConfigurable.checkName(name); } catch (ConfigurationException e) { /* show message next to name field */ }

Prevention

When it happens

Trigger: Renaming a module to a name containing consecutive dots, a leading dot, or any empty segment (e.g. 'a..b', '.x', 'x.'); the check runs anyMatch(String::isEmpty) over the group path.

Common situations: Typing mistakes in grouped module names; migrating flat modules to grouped dotted names with a bad script; paste introducing double dots.

Related errors


AI-assisted analysis of JetBrains/intellij-community@be881553f2 (2026-08-14). Data as JSON: /api/errors/02e9f79823465072. Report an issue: GitHub.