The filename from the Download object is only set later in the download
process.
I think I should revisit some of the logic of the whole download process, and
maybe even some of the data structures. I’m not sure they are still as
appropriate as I deemed them to be back then.
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+import java.util.Objects;
import java.util.Set;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
eventBus.post(new GenericMessage("c"));
/* check if it’s already downloading. */
- if (downloads.values().stream().anyMatch(download -> download.filename().equals(dccSendReceived.filename()) && download.dccReceiver() != null)) {
+ if (downloads.values().stream().anyMatch(download -> Objects.equals(download.filename(), dccSendReceived.filename()) && download.dccReceiver() != null)) {
eventBus.post(new GenericMessage(format("Ignoring offer for %s, it’s already being downloaded.", dccSendReceived.filename())));
return;
}