{"record":{"id":"170de2b1d925d640","repo":"JetBrains/intellij-community","slug":"enter-a-file-name-to-create-a-new-0-1","errorCode":null,"errorMessage":"Enter a file name to create a new {0} {1}","messagePattern":"Enter a file name to create a new (.+?) (.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java","lineNumber":152,"sourceCode":"      IdeBundle.message(\"label.project.files.location\"),\n      JavaUiBundle.message(\"title.select.project.file.directory\", IdeCoreBundle.message(\"project.new.wizard.project.identification\")),\n      JavaUiBundle.message(\"description.select.project.file.directory\", StringUtil.capitalize(IdeCoreBundle.message(\"project.new.wizard.project.identification\"))),\n      true, false\n    );\n    String baseDir = context.getProjectFileDirectory();\n    String projectName = context.getProjectName();\n    String initialProjectName = projectName != null ? projectName : ProjectWizardUtil.findNonExistingFileName(baseDir, \"untitled\", \"\");\n    component.setPath(projectName == null ? (baseDir + File.separator + initialProjectName) : baseDir);\n    component.setNameValue(initialProjectName);\n    component.getNameComponent().select(0, initialProjectName.length());\n    return component;\n  }\n\n  public boolean validateNameAndPath(WizardContext context, boolean defaultFormat) throws ConfigurationException {\n    String name = getNameValue();\n    if (StringUtil.isEmptyOrSpaces(name)) {\n      ApplicationNamesInfo info = ApplicationNamesInfo.getInstance();\n      throw new ConfigurationException(JavaUiBundle.message(\"prompt.new.project.file.name\", info.getFullProductName(), context.getPresentationName()));\n    }\n\n    String projectDirectoryPath = getPath();\n    if (StringUtil.isEmptyOrSpaces(projectDirectoryPath)) {\n      throw new ConfigurationException(JavaUiBundle.message(\"prompt.enter.project.file.location\", context.getPresentationName()));\n    }\n    if (myShouldBeAbsolute && !new File(projectDirectoryPath).isAbsolute()) {\n      throw new ConfigurationException(JavaUiBundle.message(\"file.location.should.be.absolute\", StringUtil.capitalize(context.getPresentationName())));\n    }\n\n    boolean shouldPromptCreation = isPathChangedByUser();\n    String message = JavaUiBundle.message(\"directory.project.file.directory\", context.getPresentationName());\n    if (!ProjectWizardUtil.createDirectoryIfNotExists(message, projectDirectoryPath, shouldPromptCreation)) {\n      return false;\n    }\n\n    File projectDirectory = new File(projectDirectoryPath);\n    if (projectDirectory.exists() && !projectDirectory.canWrite()) {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/idea-ui/src/com/intellij/ide/util/projectWizard/NamePathComponent.java#L134-L170","documentation":"Thrown by NamePathComponent.validateNameAndPath() when the project/file name field is empty or whitespace-only. The wizard needs a name to derive the project file (.ipr) or directory name, so validation fails with a prompt naming the product and wizard presentation.","triggerScenarios":"Calling validateNameAndPath(context, defaultFormat) while getNameValue() is empty — the name text component was never filled (StringUtil.isEmptyOrSpaces(name) is true).","commonSituations":"New Project wizard opened with cleared name; plugin embeds NamePathComponent and forgets setNameValue(); paste operation removed the default 'untitledN' name.","solutions":["Type a project/file name into the wizard's name field","In plugin code, seed defaults: component.setNameValue(ProjectWizardUtil.findNonExistingFileName(baseDir, \"untitled\", \"\"))","Disable Finish/guard the wizard until the name field is non-empty to give earlier feedback"],"exampleFix":"// before\ncomponent.setPath(\"/home/user/proj\");\ncomponent.validateNameAndPath(context, true); // ConfigurationException: enter a file name\n\n// after\ncomponent.setPath(\"/home/user/proj\");\ncomponent.setNameValue(\"my-app\");\ncomponent.validateNameAndPath(context, true);","handlingStrategy":"validation","validationCode":"if (component.getNameValue() == null || component.getNameValue().trim().isEmpty()) {\n  component.setNameValue(ProjectWizardUtil.findNonExistingFileName(baseDir, \"untitled\", \"\"));\n}\ncomponent.validateNameAndPath(context, true);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Seed the name field with a generated unique default when the step opens","Disable Next/Finish while the name field is blank"],"tags":["wizard","project","validation","intellij"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}