Skip to content

Commit

Permalink
fixes suggested by IDEA
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-kuba committed Sep 27, 2023
1 parent 3160eec commit 803908d
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions pbsmon/src/main/java/cz/cesnet/meta/pbs/Job.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ public Date getTimeCompleted() {
}

public static class Credential {
private String id;
private Date validity;
private final String id;
private final Date validity;

public Credential(String id, Date validity) {
this.id = id;
Expand Down Expand Up @@ -421,7 +421,7 @@ public boolean getMemoryExceeded() {

public Integer getExitStatus() {
String s = attrs.get(pbs.isTorque() ? ATTRIBUTE_EXIT_STATUS_TORQUE : ATTRIBUTE_EXIT_STATUS_PBSPRO);
if (s != null) return new Integer(s);
if (s != null) return Integer.valueOf(s);
return null;
}

Expand Down Expand Up @@ -746,7 +746,7 @@ public String getExecHostFirst() {
if (execHostFirst == null) {
String hosts = attrs.get(ATTRIBUTE_EXEC_HOST);
if (hosts != null) {
String sh[] = hosts.split("\\+");
String[] sh = hosts.split("\\+");
execHostFirst = sh[0];
} else execHostFirst = null;
}
Expand Down Expand Up @@ -774,7 +774,7 @@ public String[] getExecHostMore() {
if (execHostMore == null) {
String hosts = attrs.get(ATTRIBUTE_EXEC_HOST);
if (hosts != null) {
String sh[] = hosts.split("\\+");
String[] sh = hosts.split("\\+");
if (sh.length > 1) {
execHostMore = new String[sh.length - 1];
System.arraycopy(sh, 1, this.execHostMore, 0, (sh.length - 1));
Expand Down Expand Up @@ -940,15 +940,12 @@ public String getScratchDir() {
if (scratch != null) return scratch;
//construct the path itself
String scratchType = getScratchType();
switch (scratchType) {
case "local":
return "/scratch/" + getUser() + "/job_" + getId();
case "ssd":
return "/scratch.ssd/" + getUser() + "/job_" + getId();
case "shared":
return "/scratch.shared/" + getUser() + "/job_" + getId();
}
return null;
return switch (scratchType) {
case "local" -> "/scratch/" + getUser() + "/job_" + getId();
case "ssd" -> "/scratch.ssd/" + getUser() + "/job_" + getId();
case "shared" -> "/scratch.shared/" + getUser() + "/job_" + getId();
default -> null;
};
}

private Map<String, ReservedResources> nodeName2reservedResources;
Expand Down

0 comments on commit 803908d

Please sign in to comment.