From 04b83cf0f3f6ab0bc001bae1f1a3ec7c27852dbd Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 2 Jul 2019 14:30:00 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=94=A5=20Remove=20deprecated=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/web/WebInterface.java | 8 ++++---- .../kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt | 7 +------ .../net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt | 7 +------ .../kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt | 7 +------ src/test/java/net/pterodactylus/sone/core/CoreTest.java | 4 ++-- 5 files changed, 9 insertions(+), 24 deletions(-) diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index e8aea1b..cf67c0b 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -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) { diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt index ba7f957..83cb618 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostFoundEvent.kt @@ -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) diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt index a70d1b9..95cc3ee 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/NewPostReplyFoundEvent.kt @@ -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) diff --git a/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt b/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt index 117d800..d4a3d4c 100644 --- a/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt +++ b/src/main/kotlin/net/pterodactylus/sone/core/event/PostRemovedEvent.kt @@ -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) diff --git a/src/test/java/net/pterodactylus/sone/core/CoreTest.java b/src/test/java/net/pterodactylus/sone/core/CoreTest.java index 903cba0..85f981c 100644 --- a/src/test/java/net/pterodactylus/sone/core/CoreTest.java +++ b/src/test/java/net/pterodactylus/sone/core/CoreTest.java @@ -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; -- 2.7.4