diff --git a/core/src/main/java/hudson/model/AbstractItem.java b/core/src/main/java/hudson/model/AbstractItem.java index 5f298eb3d572ff023aeb4b043c354f561313ca68..980da8ed44d4bc6c52cde64b7d71a44851bdb7a5 100644 --- a/core/src/main/java/hudson/model/AbstractItem.java +++ b/core/src/main/java/hudson/model/AbstractItem.java @@ -216,6 +216,8 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet protected void renameTo(final String newName) throws IOException { // always synchronize from bigger objects first final ItemGroup parent = getParent(); + String oldName = this.name; + String oldFullName = getFullName(); synchronized (parent) { synchronized (this) { // sanity check @@ -248,9 +250,6 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet } }); - - String oldName = this.name; - String oldFullName = getFullName(); File oldRoot = this.getRootDir(); doSetName(newName); @@ -324,10 +323,9 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet } catch (AbstractMethodError _) { // ignore } - - ItemListener.fireLocationChange(this, oldFullName); } } + ItemListener.fireLocationChange(this, oldFullName); }