File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
core/src/main/java/hudson/model Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 7777import java .io .File ;
7878import java .io .IOException ;
7979import java .nio .file .Files ;
80+ import java .nio .file .Path ;
8081import java .util .ArrayList ;
8182import java .util .Calendar ;
8283import java .util .Collection ;
@@ -210,9 +211,11 @@ public void onLoad(ItemGroup<? extends Item> parent, String name)
210211 // This code can be deleted after several Jenkins releases,
211212 // when it is likely that everyone is running a version equal or higher to this version.
212213 var buildDirPath = getBuildDir ().toPath ();
213- if (Files .deleteIfExists (buildDirPath .resolve ("legacyIds" ))) {
214+ Path legacyIds = buildDirPath .resolve ("legacyIds" );
215+ if (Files .exists (legacyIds )) {
214216 LOGGER .info ("Deleting legacyIds file in " + buildDirPath + ". See https://issues.jenkins"
215217 + ".io/browse/JENKINS-75465 for more information." );
218+ Files .delete (legacyIds );
216219 }
217220
218221 TextFile f = getNextBuildNumberFile ();
You can’t perform that action at this time.
0 commit comments