Skip to content

Commit

Permalink
Use Objects.toString
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Du <i@bobdu.cc>
  • Loading branch information
BobDu committed Mar 22, 2024
1 parent 12a0efc commit 744f3db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/model/Slave.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.jar.JarFile;
import java.util.jar.Manifest;
Expand Down Expand Up @@ -392,7 +393,7 @@ public FilePath getRootPath() {
// if computer is null then channel is null and thus we were going to return null anyway
return null;
} else {
return createPath(computer.getAbsoluteRemoteFs() == null ? remoteFS : computer.getAbsoluteRemoteFs());
return createPath(Objects.toString(computer.getAbsoluteRemoteFs(), remoteFS));
}
}

Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/tasks/BuildTrigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
import java.util.StringTokenizer;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
Expand Down Expand Up @@ -113,7 +114,7 @@ public BuildTrigger(String childProjects, boolean evenIfUnstable) {

@DataBoundConstructor
public BuildTrigger(String childProjects, String threshold) {
this(childProjects, Result.fromString(threshold == null ? Result.SUCCESS.toString() : threshold));
this(childProjects, Result.fromString(Objects.toString(threshold, Result.SUCCESS.toString())));
}

public BuildTrigger(String childProjects, Result threshold) {
Expand Down

0 comments on commit 744f3db

Please sign in to comment.