提交 12689f0c 编写于 作者: M mindless

[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
上级 ca0b6e83
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册