{"record":{"id":"aaf3751be0a84d68","repo":"JetBrains/intellij-community","slug":"replace-constructor-builder-error-invalid-builder-aaf375","errorCode":null,"errorMessage":"replace.constructor.builder.error.invalid.builder.qualified.class.name","messagePattern":"replace\\.constructor\\.builder\\.error\\.invalid\\.builder\\.qualified\\.class\\.name","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"warning","filePath":"java/java-impl-refactorings/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderDialog.java","lineNumber":522,"sourceCode":"    }\n    if (myCreateBuilderClassRadioButton.isSelected()) {\n      final String className = myNewClassName.getText().trim();\n      if (className.isEmpty()) throw new ConfigurationException(null);\n      if (!nameHelper.isQualifiedName(className)) {\n        throw new ConfigurationException(\n          JavaRefactoringBundle.message(\"replace.constructor.builder.error.invalid.builder.class.name\", className));\n      }\n      final String packageName = myPackageTextField.getText().trim();\n      if (!packageName.isEmpty() && !nameHelper.isQualifiedName(packageName)) {\n        throw new ConfigurationException(\n          JavaRefactoringBundle.message(\"replace.constructor.builder.error.invalid.builder.package.name\", packageName));\n      }\n    }\n    else {\n      final String qualifiedName = myExistentClassTF.getText().trim();\n      if (qualifiedName.isEmpty()) throw new ConfigurationException(null);\n      if (!nameHelper.isQualifiedName(qualifiedName)) {\n        throw new ConfigurationException(\n          JavaRefactoringBundle.message(\"replace.constructor.builder.error.invalid.builder.qualified.class.name\", qualifiedName));\n      }\n    }\n  }\n\n  private JScrollPane createTablePanel() {\n    myTableModel = new MyTableModel();\n    myTable = new JBTable(myTableModel);\n    myTable.setSurrendersFocusOnKeystroke(true);\n    myTable.getTableHeader().setReorderingAllowed(false);\n\n    final TableColumnModel columnModel = myTable.getColumnModel();\n    columnModel.getColumn(SKIP_SETTER).setCellRenderer(new BooleanTableCellRenderer());\n\n    myTable.registerKeyboardAction(\n      new ActionListener() {\n        @Override\n        public void actionPerformed(ActionEvent e) {","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/JetBrains/intellij-community/blob/be881553f2a76ac8b4ea53950d93f0de78295c19/java/java-impl-refactorings/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderDialog.java#L504-L540","documentation":"Thrown by ReplaceConstructorWithBuilderDialog.canRun() (ReplaceConstructorWithBuilderDialog.java:522) in the 'Use existing class' branch when the existing-class field is non-empty but not a valid qualified name (PsiNameHelper.isQualifiedName). Grammar gate only; whether the class actually resolves is not re-checked here in this branch's shown source (unlike IntroduceParameterObjectDialog, there is no findClass follow-up in this snippet).","triggerScenarios":"Replace Constructor with Builder with the use-existing radio selected; the field holds 'Builder' (simple name only), 'com..Builder', or text with spaces.","commonSituations":"Forgetting the package prefix when pointing at an existing builder, pasting from a Javadoc link that includes generics/annotations, or partially deleting an FQN.","solutions":["Supply the fully qualified name of the existing builder class ('com.acme.FooBuilder') via the class browser if available.","Remove stray spaces, doubled dots, or generic markers from the field.","Pre-check: PsiNameHelper.getInstance(project).isQualifiedName(fqn.trim())."],"exampleFix":"// before\n// existing builder: FooBuilder -> invalid qualified name\n\n// after\n// existing builder: com.acme.FooBuilder","handlingStrategy":"validation","validationCode":"String fqn = myExistentClassTF.getText().trim();\nif (!fqn.isEmpty() && !PsiNameHelper.getInstance(project).isQualifiedName(fqn)) {\n  // block before OK; require full 'package.Class' form\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Populate existing-builder fields via class browsing, not typing.","Reject simple names immediately in field validators so users add the package."],"tags":["intellij","refactoring","builder","java","qualified-name","fqn"],"backgroundTag":null,"analyzedSha":"be881553f2a76ac8b4ea53950d93f0de78295c19","analyzedAt":"2026-08-14T14:13:06.425Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}