提交 50295317 编写于 作者: K kohsuke

Renaming "foo" to "Foo" shouldn't cause an error.

See http://www.nabble.com/error-on-renaming-project-tt18061629.html

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10363 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3d0c9a7d
......@@ -373,7 +373,11 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
// sanity check
if (newName == null)
throw new IllegalArgumentException("New name is not given");
if (parent.getItem(newName) != null)
TopLevelItem existing = parent.getItem(newName);
if (existing != null && existing!=this)
// the look up is case insensitive, so we need "existing!=this"
// to allow people to rename "Foo" to "foo", for example.
// see http://www.nabble.com/error-on-renaming-project-tt18061629.html
throw new IllegalArgumentException("Job " + newName
+ " already exists");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册