From 872c96f42b1303fe3777367c8ed14072971323e7 Mon Sep 17 00:00:00 2001 From: mbax Date: Mon, 23 Dec 2024 16:45:35 -0500 Subject: [PATCH] Remove deprecated methods/constructors --- .../org/kitteh/irc/client/library/Client.java | 37 +++---------------- .../library/defaults/DefaultBuilder.java | 14 ------- .../event/channel/ChannelTopicEvent.java | 25 ------------- 3 files changed, 5 insertions(+), 71 deletions(-) diff --git a/src/main/java/org/kitteh/irc/client/library/Client.java b/src/main/java/org/kitteh/irc/client/library/Client.java index 59ae212b8..51c857381 100644 --- a/src/main/java/org/kitteh/irc/client/library/Client.java +++ b/src/main/java/org/kitteh/irc/client/library/Client.java @@ -96,7 +96,7 @@ public interface Client extends ClientLinked { * Builds {@link Client}s. Create a builder with {@link Client#builder()}. *

* The default built client connects securely via port 6697. See {@link - * Server#secure(boolean)} to disable, or the other secure-prefixed methods in + * Server##port(int, Server.SecurityType)} to disable, or the other secure-prefixed methods in * this builder to fully utilize the feature. Note that the default * TrustManagerFactory relies on your local trust store. The default Oracle * trust store does not accept self-signed certificates. @@ -174,18 +174,6 @@ enum SecurityType { */ @NonNull Server host(@NonNull String host); - /** - * Sets the server port to which the client will connect. - *

- * By default, the port is 6697. - * - * @param port IRC server port - * @return this builder - * @deprecated use {@link #port(int, SecurityType)} instead - */ - @Deprecated - @NonNull Server port(int port); - /** * Sets the server port to which the client will connect and * determines TLS setting. By default, the port is 6697 and the @@ -207,27 +195,12 @@ enum SecurityType { */ @NonNull Server password(@Nullable String password); - /** - * Sets whether the client connects via TLS. - *

- * Note that by default the TrustManager used does not accept the - * certificates of many popular networks. You must use {@link - * #secureTrustManagerFactory(TrustManagerFactory)} to set your own - * TrustManagerFactory. - * - * @param secure true for TLS - * @return this builder - * @deprecated use {@link #port(int, SecurityType)} instead - */ - @Deprecated - @NonNull Server secure(boolean secure); - /** * Sets the key for TLS connection. * * @param keyCertChainFile X.509 certificate chain file in PEM format * @return this builder - * @see #secure(boolean) + * @see #port(int, SecurityType) */ @NonNull Server secureKeyCertChain(@Nullable Path keyCertChainFile); @@ -236,7 +209,7 @@ enum SecurityType { * * @param keyFile PKCS#8 private key file in PEM format * @return this builder - * @see #secure(boolean) + * @see #port(int, SecurityType) */ @NonNull Server secureKey(@Nullable Path keyFile); @@ -245,7 +218,7 @@ enum SecurityType { * * @param password password for private key * @return this builder - * @see #secure(boolean) + * @see #port(int, SecurityType) */ @NonNull Server secureKeyPassword(@Nullable String password); @@ -255,7 +228,7 @@ enum SecurityType { * @param factory trust manager supplier * @return this builder * @throws IllegalArgumentException if providing an insecure factory while the STS storage manager is set - * @see #secure(boolean) + * @see #port(int, SecurityType) */ @NonNull Server secureTrustManagerFactory(@Nullable TrustManagerFactory factory); diff --git a/src/main/java/org/kitteh/irc/client/library/defaults/DefaultBuilder.java b/src/main/java/org/kitteh/irc/client/library/defaults/DefaultBuilder.java index a0b66dd5f..52180cf7b 100644 --- a/src/main/java/org/kitteh/irc/client/library/defaults/DefaultBuilder.java +++ b/src/main/java/org/kitteh/irc/client/library/defaults/DefaultBuilder.java @@ -100,13 +100,6 @@ private class ServerImpl implements Server { return this; } - @Deprecated - @Override - public @NonNull Server port(int port) { - DefaultBuilder.this.serverHostWithPort = DefaultBuilder.this.serverHostWithPort.withPort(DefaultBuilder.this.isValidPort(port)); - return this; - } - @Override public @NonNull Server port(int port, @NonNull SecurityType security) { DefaultBuilder.this.serverHostWithPort = DefaultBuilder.this.serverHostWithPort.withPort(DefaultBuilder.this.isValidPort(port)); @@ -120,13 +113,6 @@ private class ServerImpl implements Server { return this; } - @Deprecated - @Override - public @NonNull Server secure(boolean secure) { - DefaultBuilder.this.secure = secure; - return this; - } - @Override public @NonNull Server secureKeyCertChain(@Nullable Path keyCertChainFile) { DefaultBuilder.this.secureKeyCertChain = keyCertChainFile; diff --git a/src/main/java/org/kitteh/irc/client/library/event/channel/ChannelTopicEvent.java b/src/main/java/org/kitteh/irc/client/library/event/channel/ChannelTopicEvent.java index 32121af09..d12ecef43 100644 --- a/src/main/java/org/kitteh/irc/client/library/event/channel/ChannelTopicEvent.java +++ b/src/main/java/org/kitteh/irc/client/library/event/channel/ChannelTopicEvent.java @@ -57,31 +57,6 @@ public ChannelTopicEvent(@NonNull Client client, @NonNull ServerMessage sourceMe this.updated = updated; } - /** - * Creates the event. - * - * @param client client for which this is occurring - * @param sourceMessage source message - * @param channel channel the topic is about - * @param updated if this is a new change - * @deprecated Use new constructor - */ - @Deprecated - public ChannelTopicEvent(@NonNull Client client, @NonNull ServerMessage sourceMessage, @NonNull Channel channel, boolean updated) { - this(client, sourceMessage, channel, null, null, updated); - } - - /** - * Gets the channel's topic. - * - * @return the channel topic - * @deprecated Use {@link #getNewTopic()} and {@link #getOldTopic()} - */ - @Deprecated - public Channel.@NonNull Topic getTopic() { - return this.getChannel().getTopic(); - } - public Channel.@NonNull Topic getNewTopic() { return this.newTopic; }