Suppress some warnings about variables hiding other variables.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 69332a6..0eaf296 100644 (file)
@@ -696,6 +696,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         */
        public List<Reply> getReplies(Post post) {
                Set<Sone> sones = getSones();
+               @SuppressWarnings("hiding")
                List<Reply> replies = new ArrayList<Reply>();
                for (Sone sone : sones) {
                        for (Reply reply : sone.getReplies()) {
@@ -788,6 +789,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         * @return All bookmarked posts
         */
        public Set<Post> getBookmarkedPosts() {
+               @SuppressWarnings("hiding")
                Set<Post> posts = new HashSet<Post>();
                synchronized (bookmarkedPosts) {
                        for (String bookmarkedPostId : bookmarkedPosts) {
@@ -1222,6 +1224,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
 
                /* initialize options. */
                sone.getOptions().addBooleanOption("AutoFollow", new DefaultOption<Boolean>(false));
+               sone.getOptions().addBooleanOption("EnableSoneInsertNotifications", new DefaultOption<Boolean>(false));
 
                /* load Sone. */
                String sonePrefix = "Sone/" + sone.getId();
@@ -1253,6 +1256,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                }
 
                /* load posts. */
+               @SuppressWarnings("hiding")
                Set<Post> posts = new HashSet<Post>();
                while (true) {
                        String postPrefix = sonePrefix + "/Posts/" + posts.size();
@@ -1275,6 +1279,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                }
 
                /* load replies. */
+               @SuppressWarnings("hiding")
                Set<Reply> replies = new HashSet<Reply>();
                while (true) {
                        String replyPrefix = sonePrefix + "/Replies/" + replies.size();
@@ -1324,6 +1329,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
 
                /* load options. */
                sone.getOptions().getBooleanOption("AutoFollow").set(configuration.getBooleanValue(sonePrefix + "/Options/AutoFollow").getValue(null));
+               sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").set(configuration.getBooleanValue(sonePrefix + "/Options/EnableSoneInsertNotifications").getValue(null));
 
                /* if we’re still here, Sone was loaded successfully. */
                synchronized (sone) {
@@ -1773,6 +1779,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
 
                        /* save options. */
                        configuration.getBooleanValue(sonePrefix + "/Options/AutoFollow").setValue(sone.getOptions().getBooleanOption("AutoFollow").getReal());
+                       configuration.getBooleanValue(sonePrefix + "/Options/EnableSoneInsertNotifications").setValue(sone.getOptions().getBooleanOption("EnableSoneInsertNotifications").getReal());
 
                        configuration.save();
                        logger.log(Level.INFO, "Sone %s saved.", sone);