Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/RunMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ protected Class<R> getBuildClass() {
}

/**
* Backward compatibility method that notifies {@link RunMap} of whom the owner is.
* Backward compatibility method that notifies {@link RunMap} of who the owner is.
* Traditionally, this method blocked and loaded all the build records on the disk,
* but now all the actual loading happens lazily.
*
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@
* Suitable for {@link Job#getBuild}.
*/
public final RunT getBuild(String id) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why is this still using a String? The point is to get rid of all the gratuitous decimal parsing/formatting in the critical path, deprecating this stuff and leaving it as dead code.

Copy link
Contributor Author

@somiljain2006 somiljain2006 Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I have reverted the changes in LazyBuildMixIn and removed the redundant parsing logic, leaving it as a simple pass-through to the deprecated RunMap#getById(String).

I also searched the codebase for internal calls to getById(String), but I didn't find any other call sites in Core that need to be migrated. If there are specific call sites I missed, please let me know, and I will update them.

return builds.getById(id);
try {
return builds.getById(Integer.parseInt(id));
} catch (NumberFormatException e) {

Check warning on line 235 in core/src/main/java/jenkins/model/lazy/LazyBuildMixIn.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 234-235 are not covered by tests
return builds.getById(id);
}
}

/**
Expand Down
Loading