mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 22:12:25 +00:00
[FIXED HUDSON-3674] Don't allow rename of view to same name as another view
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19389 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
ca0b6e830d
commit
12689f0c30
1 file changed
+3
-1
@@ -139,9 +139,11 @@ public abstract class View extends AbstractModelObject implements AccessControll
|
||||
/**
|
||||
* Renames this view.
|
||||
*/
|
||||
public void rename(String newName) throws ParseException {
|
||||
public void rename(String newName) throws ParseException, FormException {
|
||||
if(name.equals(newName)) return; // noop
|
||||
checkGoodName(newName);
|
||||
if(owner.getView(newName)!=null)
|
||||
throw new FormException(Messages.Hudson_ViewAlreadyExists(newName),"name");
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
owner.onViewRenamed(this,oldName,newName);
|
||||
|
||||
Reference in new issue
Block a user