X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FCore.java;h=b0df7a9135a9254e438905c5edc6c97909d63061;hp=8e20176d9ca4bb2f5b224fa1db548bbdbe0fbbed;hb=b9fc06f5bf20b1c0d5e7c5e9b49e87581a843ee7;hpb=cdee9199c8ab6a1646ef9fce6930ce41f1b1b25b diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 8e20176..b0df7a9 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1,5 +1,5 @@ /* - * Sone - Core.java - Copyright © 2010–2016 David Roden + * Sone - Core.java - Copyright © 2010–2019 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -156,18 +156,18 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, /** Locked local Sones. */ /* synchronize on itself. */ - private final Set lockedSones = new HashSet(); + private final Set lockedSones = new HashSet<>(); /** Sone inserters. */ /* synchronize access on this on sones. */ - private final Map soneInserters = new HashMap(); + private final Map soneInserters = new HashMap<>(); /** Sone rescuers. */ /* synchronize access on this on sones. */ - private final Map soneRescuers = new HashMap(); + private final Map soneRescuers = new HashMap<>(); /** All known Sones. */ - private final Set knownSones = new HashSet(); + private final Set knownSones = new HashSet<>(); /** The post database. */ private final Database database; @@ -176,7 +176,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, private final Multimap trustedIdentities = Multimaps.synchronizedSetMultimap(HashMultimap.create()); /** All temporary images. */ - private final Map temporaryImages = new HashMap(); + private final Map temporaryImages = new HashMap<>(); /** Ticker for threads that mark own elements as known. */ private final ScheduledExecutorService localElementTicker = Executors.newScheduledThreadPool(1); @@ -444,7 +444,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, * @return The Sones that like the given post */ public Set getLikes(Post post) { - Set sones = new HashSet(); + Set sones = new HashSet<>(); for (Sone sone : getSones()) { if (sone.getLikedPostIds().contains(post.getId())) { sones.add(sone); @@ -461,7 +461,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, * @return The Sones that like the given reply */ public Set getLikes(PostReply reply) { - Set sones = new HashSet(); + Set sones = new HashSet<>(); for (Sone sone : getSones()) { if (sone.getLikedReplyIds().contains(reply.getId())) { sones.add(sone); @@ -1328,7 +1328,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, identityManager.start(); webOfTrustUpdater.init(); webOfTrustUpdater.start(); - database.start(); + database.startAsync(); } /** @@ -1368,7 +1368,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, } } saveConfiguration(); - database.stop(); + database.stopAsync(); webOfTrustUpdater.stop(); updateChecker.stop(); soneDownloader.stop();