Skip to content

Commit

Permalink
Use Java 17 pattern matching instanceof
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Jan 25, 2025
1 parent 29f1b4d commit 0d532c2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ public long getRecurrencePeriod() {
protected void doRun() {
List<ProvisioningActivity.Id> trackedExisting = new ArrayList<>();
for (Computer computer : Jenkins.getInstance().getComputers()) {
if (computer instanceof TrackedItem) {
trackedExisting.add(((TrackedItem) computer).getId());
if (computer instanceof TrackedItem item) {
trackedExisting.add(item.getId());
}
}

Expand Down

0 comments on commit 0d532c2

Please sign in to comment.