{"record":{"id":"13d111792e87eb33","repo":"pentaho/pentaho-kettle","slug":"repositoryexplorerdialog-exception-namecannotbeempty","errorCode":null,"errorMessage":"RepositoryExplorerDialog.Exception.NameCanNotBeEmpty","messagePattern":"RepositoryExplorerDialog\\.Exception\\.NameCanNotBeEmpty","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"ui/src/main/java/org/pentaho/di/ui/repository/dialog/RepositoryExplorerDialog.java","lineNumber":1828,"sourceCode":"      editor.grabHorizontal = true;\n      editor.grabVertical = true;\n      editor.minimumWidth = 50;\n\n      text.selectAll();\n      text.setFocus();\n\n      editor.layout();\n      editor.setEditor( text );\n    }\n    return retval;\n  }\n\n  public boolean renameTransformation( String name, String newname, RepositoryDirectoryInterface repdir ) {\n    boolean retval = false;\n\n    try {\n      if ( Utils.isEmpty( newname ) ) {\n        throw new KettleException( BaseMessages.getString(\n          PKG, \"RepositoryExplorerDialog.Exception.NameCanNotBeEmpty\" ) );\n      }\n      if ( !name.equals( newname ) ) {\n        ObjectId id = rep.getTransformationID( name, repdir );\n        if ( id != null ) {\n          // System.out.println(\"Renaming transformation [\"+name+\"] with ID = \"+id);\n          String comment = BaseMessages.getString( REPOSITORY_PKG, \"Repository.Rename\", name, newname );\n          rep.renameTransformation( id, comment, repdir, newname );\n          retval = true;\n        }\n      } else {\n        MessageBox mb = new MessageBox( shell, SWT.ICON_ERROR | SWT.OK );\n        mb\n          .setMessage( BaseMessages.getString(\n            PKG, \"RepositoryExplorerDialog.Trans.Rename.ErrorFinding.Message1\" )\n            + name + \"]\" + Const.CR\n            + BaseMessages.getString( PKG, \"RepositoryExplorerDialog.Trans.Rename.ErrorFinding.Message2\" ) );\n        mb.setText( BaseMessages.getString( PKG, \"RepositoryExplorerDialog.Trans.Rename.ErrorFinding.Title\" ) );","sourceCodeStart":1810,"sourceCodeEnd":1846,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/ui/src/main/java/org/pentaho/di/ui/repository/dialog/RepositoryExplorerDialog.java#L1810-L1846","documentation":"renameTransformation() validates that the new transformation name is non-empty before renaming it in the repository. If Utils.isEmpty(newname), it throws KettleException 'RepositoryExplorerDialog.Exception.NameCanNotBeEmpty'. The repository rejects renames to an empty string because object names are required keys.","triggerScenarios":"Invoking renameTransformation(name, newname, repdir) with newname == null or \"\" — typically from the explorer's rename dialog after the user clears the name field and confirms.","commonSituations":"User pastes whitespace-only text or deletes the default name in the rename dialog; scripted repository maintenance calls passing an empty new name.","solutions":["Provide a non-empty new name in the rename dialog before confirming.","Trim and validate the new name in code before calling renameTransformation.","If the UI allows empty confirmation, guard the dialog's ok() handler to reject blank input."],"exampleFix":"// before\nexplorer.renameTransformation( name, newNameInput, repdir );\n// after\nString trimmed = newNameInput == null ? \"\" : newNameInput.trim();\nif ( !trimmed.isEmpty() ) {\n  explorer.renameTransformation( name, trimmed, repdir );\n}","handlingStrategy":"validation","validationCode":"public static boolean isValidNewName( String name ) {\n  return name != null && !name.trim().isEmpty();\n}\n// before calling:\nif ( !isValidNewName( newName ) ) { /* block rename */ }","typeGuard":null,"tryCatchPattern":"try {\n  explorer.renameTransformation( name, newName, repdir );\n} catch ( KettleException e ) {\n  if ( e.getMessage().contains( \"NameCanNotBeEmpty\" ) ) {\n    showWarning( \"Name cannot be empty\" );\n  } else {\n    throw e;\n  }\n}","preventionTips":["Trim user input in the rename dialog and reject blank submissions at OK.","Pre-fill the dialog with the current name so users edit rather than delete.","Apply the same non-empty check for all rename* helpers (transformation, job, user).","Strip whitespace and disallow control characters in repository object names."],"tags":["kettle","repository","rename","validation","empty-name"],"backgroundTag":"empty-required-field","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}