Skip to content

Commit

Permalink
Improve getIcon method
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored May 12, 2020
1 parent e24c141 commit 478ee05
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/org/jabref/gui/util/BackgroundTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,8 @@ public BackgroundTask<V> withInitialMessage(String message) {
return this;
}

public static Node getIcon(Object task) {
if (task instanceof Task) {
return BackgroundTask.iconMap.getOrDefault(((Task<?>) task).getTitle(), null);
}
return null;
public static <T> Node getIcon(Task<T> task) {
return BackgroundTask.iconMap.getOrDefault(task).getTitle(), null);
}

static class BackgroundProgress {
Expand Down

0 comments on commit 478ee05

Please sign in to comment.