Skip to content

Commit 7455ceb

Browse files
authored
Stop filling in stack trace elements when loading jobs (#10934)
1 parent 0833b62 commit 7455ceb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/src/main/java/hudson/model/Job.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import java.io.File;
7878
import java.io.IOException;
7979
import java.nio.file.Files;
80+
import java.nio.file.Path;
8081
import java.util.ArrayList;
8182
import java.util.Calendar;
8283
import 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();

0 commit comments

Comments
 (0)