🔥 Remove deprecated methods
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 2 Jul 2019 12:30:00 +0000 (14:30 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 2 Jul 2019 12:30:00 +0000 (14:30 +0200)
src/main/java/net/pterodactylus/sone/web/WebInterface.java
src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt
src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt
src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt
src/test/java/net/pterodactylus/sone/core/CoreTest.java

index e8aea1b..cf67c0b 100644 (file)
@@ -782,7 +782,7 @@ public class WebInterface implements SessionProvider {
         */
        @Subscribe
        public void newPostFound(NewPostFoundEvent newPostFoundEvent) {
-               Post post = newPostFoundEvent.post();
+               Post post = newPostFoundEvent.getPost();
                boolean isLocal = post.getSone().isLocal();
                if (isLocal) {
                        localPostNotification.add(post);
@@ -808,7 +808,7 @@ public class WebInterface implements SessionProvider {
         */
        @Subscribe
        public void newReplyFound(NewPostReplyFoundEvent newPostReplyFoundEvent) {
-               PostReply reply = newPostReplyFoundEvent.postReply();
+               PostReply reply = newPostReplyFoundEvent.getPostReply();
                boolean isLocal = reply.getSone().isLocal();
                if (isLocal) {
                        localReplyNotification.add(reply);
@@ -854,7 +854,7 @@ public class WebInterface implements SessionProvider {
 
        @Subscribe
        public void postRemoved(PostRemovedEvent postRemovedEvent) {
-               removePost(postRemovedEvent.post());
+               removePost(postRemovedEvent.getPost());
        }
 
        private void removePost(Post post) {
@@ -867,7 +867,7 @@ public class WebInterface implements SessionProvider {
 
        @Subscribe
        public void replyRemoved(PostReplyRemovedEvent postReplyRemovedEvent) {
-               removeReply(postReplyRemovedEvent.postReply());
+               removeReply(postReplyRemovedEvent.getPostReply());
        }
 
        private void removeReply(PostReply reply) {
index ba7f957..83cb618 100644 (file)
@@ -22,9 +22,4 @@ import net.pterodactylus.sone.data.Post
 /**
  * Event that signals that a new post was found.
  */
-data class NewPostFoundEvent(val post: Post) {
-
-       @Deprecated(message = "will go away", replaceWith = ReplaceWith("post"))
-       fun post() = post
-
-}
+data class NewPostFoundEvent(val post: Post)
index a70d1b9..95cc3ee 100644 (file)
@@ -22,9 +22,4 @@ import net.pterodactylus.sone.data.PostReply
 /**
  * Event that signals that a new [PostReply] was found.
  */
-data class NewPostReplyFoundEvent(val postReply: PostReply) {
-
-       @Deprecated(message = "will go away", replaceWith = ReplaceWith("postReply"))
-       fun postReply() = postReply
-
-}
+data class NewPostReplyFoundEvent(val postReply: PostReply)
index 117d800..d4a3d4c 100644 (file)
@@ -22,9 +22,4 @@ import net.pterodactylus.sone.data.Post
 /**
  * Event that signals that a [Post] was removed.
  */
-data class PostRemovedEvent(val post: Post) {
-
-       @Deprecated(message = "will go away", replaceWith = ReplaceWith("post"))
-       fun post() = post
-
-}
+data class PostRemovedEvent(val post: Post)
index 903cba0..85f981c 100644 (file)
@@ -100,8 +100,8 @@ public class CoreTest {
                                        mismatchDescription.appendText("is not PostRemovedEvent");
                                        return false;
                                }
-                               if (((PostRemovedEvent) item).post() != post) {
-                                       mismatchDescription.appendText("post is ").appendValue(((PostRemovedEvent) item).post());
+                               if (((PostRemovedEvent) item).getPost() != post) {
+                                       mismatchDescription.appendText("post is ").appendValue(((PostRemovedEvent) item).getPost());
                                        return false;
                                }
                                return true;