From b7f4703f4d8992b81eea6514a5bf72f85bf2fdd4 Mon Sep 17 00:00:00 2001 From: Sergii Dotsenko <33420754+sdotsenko@users.noreply.github.com> Date: Wed, 9 Aug 2023 07:36:46 +0100 Subject: [PATCH] Fixed some typos and formatting issues across the project (#3486) Signed-off-by: Sergii Dotsenko --- README.md | 10 +++++----- src/main/java/redis/clients/jedis/StreamEntryID.java | 4 ++-- .../redis/clients/jedis/commands/ServerCommands.java | 2 +- .../redis/clients/jedis/params/MigrateParams.java | 12 ++++++------ .../java/redis/clients/jedis/params/ZAddParams.java | 12 ++++++------ .../clients/jedis/resps/AccessControlLogEntry.java | 2 +- .../clients/jedis/resps/StreamConsumerFullInfo.java | 2 +- .../clients/jedis/resps/StreamConsumerInfo.java | 2 +- .../clients/jedis/resps/StreamConsumersInfo.java | 2 +- .../redis/clients/jedis/resps/StreamFullInfo.java | 2 +- .../clients/jedis/resps/StreamGroupFullInfo.java | 2 +- .../redis/clients/jedis/resps/StreamGroupInfo.java | 2 +- .../java/redis/clients/jedis/resps/StreamInfo.java | 2 +- .../redis/clients/jedis/util/RedisInputStream.java | 4 ++-- .../java/redis/clients/jedis/ConnectionTest.java | 2 +- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index a1f3132641..b379424023 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,10 @@ The most recent version of this library supports redis version [5.0](https://git The table below highlights version compatibility of the most-recent library versions and Redis versions. Compatibility means communication features, and Redis command capabilities. -| Library version | Supported redis versions | -|-----------------|-------------------| -| 3.9+ | 5.0 and 6.2 Family of releases | -| >= 4.0 | Version 5.0 to current | +| Library version | Supported redis versions | +|-----------------|--------------------------------| +| 3.9+ | 5.0 and 6.2 Family of releases | +| >= 4.0 | Version 5.0 to current | ## Getting started @@ -78,7 +78,7 @@ for the complete list of supported commands. ### Easier way of using connection pool -Using a *try-with-resources* block for each command may be cumbursome, so you may consider using JedisPooled. +Using a *try-with-resources* block for each command may be cumbersome, so you may consider using JedisPooled. ```java JedisPooled jedis = new JedisPooled("localhost", 6379); diff --git a/src/main/java/redis/clients/jedis/StreamEntryID.java b/src/main/java/redis/clients/jedis/StreamEntryID.java index 66683d9038..9644010d7c 100644 --- a/src/main/java/redis/clients/jedis/StreamEntryID.java +++ b/src/main/java/redis/clients/jedis/StreamEntryID.java @@ -55,8 +55,8 @@ public int hashCode() { @Override public int compareTo(StreamEntryID other) { - int timeComapre = Long.compare(this.time, other.time); - return timeComapre != 0 ? timeComapre : Long.compare(this.sequence, other.sequence); + int timeCompare = Long.compare(this.time, other.time); + return timeCompare != 0 ? timeCompare : Long.compare(this.sequence, other.sequence); } public long getTime() { diff --git a/src/main/java/redis/clients/jedis/commands/ServerCommands.java b/src/main/java/redis/clients/jedis/commands/ServerCommands.java index d96074379b..46f1220407 100644 --- a/src/main/java/redis/clients/jedis/commands/ServerCommands.java +++ b/src/main/java/redis/clients/jedis/commands/ServerCommands.java @@ -70,7 +70,7 @@ public interface ServerCommands { * The SAVE commands performs a synchronous save of the dataset producing a point in time snapshot * of all the data inside the Redis instance, in the form of an RDB file. You almost never want to * call SAVE in production environments where it will block all the other clients. Instead usually - * BGSAVE is used. However in case of issues preventing Redis to create the background saving + * BGSAVE is used. However, in case of issues preventing Redis to create the background saving * child (for instance errors in the fork(2) system call), the SAVE command can be a good last * resort to perform the dump of the latest dataset. * @return result of the save diff --git a/src/main/java/redis/clients/jedis/params/MigrateParams.java b/src/main/java/redis/clients/jedis/params/MigrateParams.java index 3b9815e7c3..a75251e0e4 100644 --- a/src/main/java/redis/clients/jedis/params/MigrateParams.java +++ b/src/main/java/redis/clients/jedis/params/MigrateParams.java @@ -8,7 +8,7 @@ public class MigrateParams implements IParams { private boolean copy = false; private boolean replace = false; private String username = null; - private String passowrd = null; + private String password = null; public MigrateParams() { } @@ -28,13 +28,13 @@ public MigrateParams replace() { } public MigrateParams auth(String password) { - this.passowrd = password; + this.password = password; return this; } public MigrateParams auth2(String username, String password) { this.username = username; - this.passowrd = password; + this.password = password; return this; } @@ -47,9 +47,9 @@ public void addParams(CommandArguments args) { args.add(Keyword.REPLACE); } if (username != null) { - args.add(Keyword.AUTH2).add(username).add(passowrd); - } else if (passowrd != null) { - args.add(Keyword.AUTH).add(passowrd); + args.add(Keyword.AUTH2).add(username).add(password); + } else if (password != null) { + args.add(Keyword.AUTH).add(password); } } } diff --git a/src/main/java/redis/clients/jedis/params/ZAddParams.java b/src/main/java/redis/clients/jedis/params/ZAddParams.java index d00b05c23d..8194c041a6 100644 --- a/src/main/java/redis/clients/jedis/params/ZAddParams.java +++ b/src/main/java/redis/clients/jedis/params/ZAddParams.java @@ -5,7 +5,7 @@ public class ZAddParams implements IParams { - private Keyword existance; + private Keyword existence; private Keyword comparison; private boolean change; @@ -21,16 +21,16 @@ public static ZAddParams zAddParams() { * @return ZAddParams */ public ZAddParams nx() { - this.existance = Keyword.NX; + this.existence = Keyword.NX; return this; } /** - * Only set the key if it already exist. + * Only set the key if it already exists. * @return ZAddParams */ public ZAddParams xx() { - this.existance = Keyword.XX; + this.existence = Keyword.XX; return this; } @@ -64,8 +64,8 @@ public ZAddParams ch() { @Override public void addParams(CommandArguments args) { - if (existance != null) { - args.add(existance); + if (existence != null) { + args.add(existence); } if (comparison != null) { args.add(comparison); diff --git a/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java b/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java index 09ef3a43bb..930c9b064d 100644 --- a/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java +++ b/src/main/java/redis/clients/jedis/resps/AccessControlLogEntry.java @@ -6,7 +6,7 @@ /** * This class holds information about an Access Control Log entry (returned by ACL LOG command) They - * can be access via getters. For future purpose there is also {@link #getlogEntry} method that + * can be accessed via getters. For future purpose there is also {@link #getlogEntry} method that * returns a generic {@code Map} - in case where more info is returned from a server */ // TODO: remove diff --git a/src/main/java/redis/clients/jedis/resps/StreamConsumerFullInfo.java b/src/main/java/redis/clients/jedis/resps/StreamConsumerFullInfo.java index 6279640888..2f57329415 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamConsumerFullInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamConsumerFullInfo.java @@ -7,7 +7,7 @@ /** * This class holds information about a stream consumer with command - * {@code xinfo stream mystream full}. They can be access via getters. There is also + * {@code xinfo stream mystream full}. They can be accessed via getters. There is also * {@link StreamConsumerFullInfo#getConsumerInfo()} method that returns a generic {@link Map} in * case more info are returned from the server. */ diff --git a/src/main/java/redis/clients/jedis/resps/StreamConsumerInfo.java b/src/main/java/redis/clients/jedis/resps/StreamConsumerInfo.java index 63b417780e..0bf5a46250 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamConsumerInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamConsumerInfo.java @@ -3,7 +3,7 @@ import java.util.Map; /** - * This class holds information about a consumer. They can be access via getters. There is also + * This class holds information about a consumer. They can be accessed via getters. There is also * {@link StreamConsumersInfo#getConsumerInfo()}} method that returns a generic {@code Map} in case * more info are returned from the server. */ diff --git a/src/main/java/redis/clients/jedis/resps/StreamConsumersInfo.java b/src/main/java/redis/clients/jedis/resps/StreamConsumersInfo.java index ad12f0353b..4b12a95006 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamConsumersInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamConsumersInfo.java @@ -3,7 +3,7 @@ import java.util.Map; /** - * This class holds information about a consumer. They can be access via getters. There is also + * This class holds information about a consumer. They can be accessed via getters. There is also * {@link StreamConsumersInfo#getConsumerInfo()}} method that returns a generic {@code Map} in case * more info are returned from the server. * @deprecated Use {@link StreamConsumerInfo}. diff --git a/src/main/java/redis/clients/jedis/resps/StreamFullInfo.java b/src/main/java/redis/clients/jedis/resps/StreamFullInfo.java index 336bf9c9c2..e768b536b8 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamFullInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamFullInfo.java @@ -8,7 +8,7 @@ /** * This class holds information about a stream info with command {@code xinfo stream mystream full}. - * They can be access via getters. There is also {@link StreamFullInfo#getStreamFullInfo()} method + * They can be accessed via getters. There is also {@link StreamFullInfo#getStreamFullInfo()} method * that returns a generic {@link Map} in case where more info are returned from the server. */ public class StreamFullInfo implements Serializable { diff --git a/src/main/java/redis/clients/jedis/resps/StreamGroupFullInfo.java b/src/main/java/redis/clients/jedis/resps/StreamGroupFullInfo.java index 8472c6b7b6..8354c86815 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamGroupFullInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamGroupFullInfo.java @@ -8,7 +8,7 @@ /** * This class holds information about a stream group with command {@code xinfo stream mystream full}. - * They can be access via getters. There is also {@link StreamGroupFullInfo#getGroupFullInfo()} + * They can be accessed via getters. There is also {@link StreamGroupFullInfo#getGroupFullInfo()} * method that returns a generic {@link Map} in case more info are returned from the server. */ public class StreamGroupFullInfo implements Serializable { diff --git a/src/main/java/redis/clients/jedis/resps/StreamGroupInfo.java b/src/main/java/redis/clients/jedis/resps/StreamGroupInfo.java index d017701142..0531bb8fb5 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamGroupInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamGroupInfo.java @@ -5,7 +5,7 @@ import redis.clients.jedis.StreamEntryID; /** - * This class holds information about a stream group. They can be access via getters. There is also + * This class holds information about a stream group. They can be accessed via getters. There is also * {@link StreamGroupInfo#getGroupInfo()} method that returns a generic {@code Map} in case more * info are returned from the server. */ diff --git a/src/main/java/redis/clients/jedis/resps/StreamInfo.java b/src/main/java/redis/clients/jedis/resps/StreamInfo.java index 39e65b1202..a866f41e4c 100644 --- a/src/main/java/redis/clients/jedis/resps/StreamInfo.java +++ b/src/main/java/redis/clients/jedis/resps/StreamInfo.java @@ -5,7 +5,7 @@ import redis.clients.jedis.StreamEntryID; /** - * This class holds information about stream. They can be access via getters. There is also + * This class holds information about stream. They can be accessed via getters. There is also * {@link StreamInfo#getStreamInfo} method that returns a generic {@code Map} in case more info are * returned from the server. */ diff --git a/src/main/java/redis/clients/jedis/util/RedisInputStream.java b/src/main/java/redis/clients/jedis/util/RedisInputStream.java index 57734cffdb..a0dad9d437 100644 --- a/src/main/java/redis/clients/jedis/util/RedisInputStream.java +++ b/src/main/java/redis/clients/jedis/util/RedisInputStream.java @@ -128,7 +128,7 @@ public byte[] readLineBytes() { /** * Slow path in case a line of bytes cannot be read in one #fill() operation. This is still faster - * than creating the StrinbBuilder, String, then encoding as byte[] in Protocol, then decoding + * than creating the StringBuilder, String, then encoding as byte[] in Protocol, then decoding * back into a String. */ private byte[] readLineBytesSlowly() { @@ -236,7 +236,7 @@ public int read(byte[] b, int off, int len) throws JedisConnectionException { } /** - * This methods assumes there are required bytes to be read. If we cannot read anymore bytes an + * This method assumes there are required bytes to be read. If we cannot read anymore bytes an * exception is thrown to quickly ascertain that the stream was smaller than expected. */ private void ensureFill() throws JedisConnectionException { diff --git a/src/test/java/redis/clients/jedis/ConnectionTest.java b/src/test/java/redis/clients/jedis/ConnectionTest.java index ee9a0a9742..28eba8100c 100644 --- a/src/test/java/redis/clients/jedis/ConnectionTest.java +++ b/src/test/java/redis/clients/jedis/ConnectionTest.java @@ -17,7 +17,7 @@ public void tearDown() throws Exception { } @Test(expected = JedisConnectionException.class) - public void checkUnkownHost() { + public void checkUnknownHost() { client = new Connection("someunknownhost", Protocol.DEFAULT_PORT); client.connect(); }