Skip to content

Commit

Permalink
[JENKINS-18678] Tweaking API, adding @SInCE & changelog for #1075, fi…
Browse files Browse the repository at this point in the history
…xing purgeCache so that test can pass.
  • Loading branch information
jglick committed Dec 23, 2013
1 parent fa03995 commit 833c423
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion changelog.html
Expand Up @@ -55,7 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=>
<li class="major bug">
Builds disappear after renaming a job.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-18678">issue 18678</a>)
</ul>
</div><!--=TRUNK-END=-->

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -1680,7 +1680,7 @@ void addToList( T item, List<T> collection ) throws IOException {
public void renameTo(String newName) throws IOException {
super.renameTo(newName);
// Update locations inside builds cache
builds.updateBaseDir(getBuildDir(), false);
builds.updateBaseDir(getBuildDir());
}

protected final synchronized <T extends Describable<T>>
Expand Down
Expand Up @@ -214,11 +214,10 @@ public final boolean baseDirInitialized() {
* Updates base directory location after directory changes.
* This method should be used on jobs renaming, etc.
* @param dir Directory location
* @param reloadBuilds Purges cache after the directory update
* @since 1.546
*/
public final void updateBaseDir(File dir, boolean reloadBuilds) {
public final void updateBaseDir(File dir) {
this.dir = dir;
purgeCache();
}

/**
Expand All @@ -230,6 +229,7 @@ public final void updateBaseDir(File dir, boolean reloadBuilds) {
*/
public void purgeCache() {
index = new Index();
fullyLoaded = false;
loadIdOnDisk();
}

Expand Down

0 comments on commit 833c423

Please sign in to comment.