(refac) Clean up code issues

This commit is contained in:
Viktor Lofgren 2024-02-23 11:39:19 +01:00
parent 5cdb07023b
commit 2201b1a506
7 changed files with 10 additions and 10 deletions

View File

@ -127,7 +127,7 @@ public class EdgeDomain implements Serializable {
ret.append(topDomain, 0, cutPoint);
}
if (!"".equals(subDomain) && !"www".equals(subDomain)) {
if (!subDomain.isEmpty() && !"www".equals(subDomain)) {
ret.append(":");
ret.append(subDomain);
}

View File

@ -209,7 +209,7 @@ public class LinkParser {
}
private boolean isUrlRelevant(String href) {
if (null == href || "".equals(href)) {
if (null == href || href.isEmpty()) {
return false;
}
if (href.length() > 128) {

View File

@ -56,7 +56,7 @@ public class IndexMetadataService {
continue;
}
long id = searchTermsUtil.getWordId(term);
long id = SearchTermsUtil.getWordId(term);
termIdsList.add(id);
termToId.put(term, id);
}

View File

@ -93,7 +93,7 @@ public class SearchSetsService {
return anySet;
}
if ("NONE".equals(searchSetIdentifier) || "".equals(searchSetIdentifier)) {
if ("NONE".equals(searchSetIdentifier) || searchSetIdentifier.isEmpty()) {
return anySet;
}

View File

@ -20,9 +20,7 @@ public record ProcessHeartbeat(
}
public String progressStyle() {
if ("RUNNING".equals(status) && progress != null) {
return """
background: linear-gradient(90deg, #ccc 0%%, #ccc %d%%, #fff %d%%)
""".formatted(progress, progress, progress);
return STR."background: linear-gradient(90deg, #ccc 0%, #ccc \{progress}%, #fff \{progress}%)";
}
return "";
}

View File

@ -21,9 +21,7 @@ public record TaskHeartbeat(
public String progressStyle() {
if ("RUNNING".equals(status) && progress != null) {
return """
background: linear-gradient(90deg, #ccc 0%%, #ccc %d%%, #fff %d%%)
""".formatted(progress, progress, progress);
return STR."background: linear-gradient(90deg, #ccc 0%, #ccc \{progress}%, #fff \{progress}%)";
}
return "";
}

View File

@ -39,6 +39,10 @@ public class ActorProcessWatcher {
public MqMessage waitResponse(MqOutbox outbox, ProcessService.ProcessId processId, long msgId)
throws ActorControlFlowException, InterruptedException, SQLException
{
// enums values only have a single instance,
// so it's safe to synchronize on them
// even though it looks a bit weird to
// synchronize on a parameter like this:
synchronized (processId) {
// Wake up the process spawning actor
processId.notifyAll();