From: David ‘Bombe’ Roden Date: Tue, 2 Jul 2019 12:30:00 +0000 (+0200) Subject: 🔥 Remove deprecated methods X-Git-Tag: v81^2~200^2~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=04b83cf0f3f6ab0bc001bae1f1a3ec7c27852dbd;p=Sone.git 🔥 Remove deprecated methods --- 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;