Fixed - incorrect parsing of PubSubType.UNSUBSCRIBE command with non-English locale. #6423

pull/6442/head
mrniko 1 week ago
parent af54726926
commit e073ebd438

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -55,7 +51,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
String flagsStr = params[2]; String flagsStr = params[2];
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.toUpperCase().replaceAll("\\?", ""); String flagValue = flag.toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -73,7 +69,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -56,7 +52,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.replace("slave", "replica") String flagValue = flag.replace("slave", "replica")
.toUpperCase().replaceAll("\\?", ""); .toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -74,7 +70,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -16,11 +16,7 @@
package org.redisson.spring.data.connection; package org.redisson.spring.data.connection;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.EnumSet;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.redisson.client.handler.State; import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder; import org.redisson.client.protocol.Decoder;
@ -56,7 +52,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.replace("slave", "replica") String flagValue = flag.replace("slave", "replica")
.toUpperCase().replaceAll("\\?", ""); .toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -74,7 +70,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -58,7 +58,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.replace("slave", "replica") String flagValue = flag.replace("slave", "replica")
.toUpperCase().replaceAll("\\?", ""); .toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -83,7 +83,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -58,7 +58,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.replace("slave", "replica") String flagValue = flag.replace("slave", "replica")
.toUpperCase().replaceAll("\\?", ""); .toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -83,7 +83,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -58,7 +58,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Flag> flags = EnumSet.noneOf(Flag.class); Set<Flag> flags = EnumSet.noneOf(Flag.class);
for (String flag : flagsStr.split(",")) { for (String flag : flagsStr.split(",")) {
String flagValue = flag.replace("slave", "replica") String flagValue = flag.replace("slave", "replica")
.toUpperCase().replaceAll("\\?", ""); .toUpperCase(Locale.ENGLISH).replaceAll("\\?", "");
flags.add(Flag.valueOf(flagValue)); flags.add(Flag.valueOf(flagValue));
} }
@ -83,7 +83,7 @@ public class RedisClusterNodeDecoder implements Decoder<List<RedisClusterNode>>
Set<Integer> slotsCollection = new HashSet<Integer>(); Set<Integer> slotsCollection = new HashSet<Integer>();
LinkState linkState = null; LinkState linkState = null;
if (params.length >= 8 && params[7] != null) { if (params.length >= 8 && params[7] != null) {
linkState = LinkState.valueOf(params[7].toUpperCase()); linkState = LinkState.valueOf(params[7].toUpperCase(Locale.ENGLISH));
} }
if (params.length > 8) { if (params.length > 8) {
for (int i = 0; i < params.length - 8; i++) { for (int i = 0; i < params.length - 8; i++) {

@ -429,7 +429,7 @@ public interface RedisCommands {
String functionName = (String) parts.get(1); String functionName = (String) parts.get(1);
String functionDescription = (String) parts.get(3); String functionDescription = (String) parts.get(3);
List<FunctionLibrary.Flag> functionFlags = ((List<String>) parts.get(5)).stream() List<FunctionLibrary.Flag> functionFlags = ((List<String>) parts.get(5)).stream()
.map(s -> FunctionLibrary.Flag.valueOf(s.toUpperCase().replace("-", "_"))) .map(s -> FunctionLibrary.Flag.valueOf(s.toUpperCase(Locale.ENGLISH).replace("-", "_")))
.collect(Collectors.toList()); .collect(Collectors.toList());
return new FunctionLibrary.Function(functionName, functionDescription, functionFlags); return new FunctionLibrary.Function(functionName, functionDescription, functionFlags);
} }

@ -17,6 +17,8 @@ package org.redisson.client.protocol.convertor;
import org.redisson.api.JsonType; import org.redisson.api.JsonType;
import java.util.Locale;
/** /**
* Json data type convertor * Json data type convertor
* *
@ -30,6 +32,6 @@ public class JsonTypeConvertor implements Convertor<JsonType> {
if (obj == null) { if (obj == null) {
return null; return null;
} }
return JsonType.valueOf(obj.toString().toUpperCase()); return JsonType.valueOf(obj.toString().toUpperCase(Locale.ENGLISH));
} }
} }

@ -20,6 +20,7 @@ import org.redisson.client.handler.State;
import org.redisson.client.protocol.decoder.MultiDecoder; import org.redisson.client.protocol.decoder.MultiDecoder;
import java.util.List; import java.util.List;
import java.util.Locale;
/** /**
* *
@ -30,7 +31,7 @@ public class PubSubStatusDecoder implements MultiDecoder<Object> {
@Override @Override
public PubSubStatusMessage decode(List<Object> parts, State state) { public PubSubStatusMessage decode(List<Object> parts, State state) {
PubSubType type = PubSubType.valueOf(parts.get(0).toString().toUpperCase()); PubSubType type = PubSubType.valueOf(parts.get(0).toString().toUpperCase(Locale.ENGLISH));
ChannelName name = new ChannelName((byte[]) parts.get(1)); ChannelName name = new ChannelName((byte[]) parts.get(1));
return new PubSubStatusMessage(type, name); return new PubSubStatusMessage(type, name);
} }

@ -74,7 +74,7 @@ public class PropertiesConvertor {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append(parts[0]); builder.append(parts[0]);
for (int i = 1; i < parts.length; i++) { for (int i = 1; i < parts.length; i++) {
builder.append(parts[i].substring(0, 1).toUpperCase()) builder.append(parts[i].substring(0, 1).toUpperCase(Locale.ENGLISH))
.append(parts[i].substring(1)); .append(parts[i].substring(1));
} }
return builder.toString(); return builder.toString();

@ -16,6 +16,7 @@
package org.redisson.liveobject.core; package org.redisson.liveobject.core;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Locale;
import org.redisson.api.RMap; import org.redisson.api.RMap;
import org.redisson.liveobject.misc.ClassUtils; import org.redisson.liveobject.misc.ClassUtils;
@ -40,7 +41,7 @@ public class FieldAccessorInterceptor {
@FieldValue("liveObjectLiveMap") RMap<?, ?> map @FieldValue("liveObjectLiveMap") RMap<?, ?> map
) throws Exception { ) throws Exception {
if (args.length >= 1 && String.class.isAssignableFrom(args[0].getClass())) { if (args.length >= 1 && String.class.isAssignableFrom(args[0].getClass())) {
String name = ((String) args[0]).substring(0, 1).toUpperCase() + ((String) args[0]).substring(1); String name = ((String) args[0]).substring(0, 1).toUpperCase(Locale.ENGLISH) + ((String) args[0]).substring(1);
if ("get".equals(method.getName()) && args.length == 1) { if ("get".equals(method.getName()) && args.length == 1) {
try { try {
return me.getClass().getMethod("get" + name).invoke(me); return me.getClass().getMethod("get" + name).invoke(me);

Loading…
Cancel
Save