Code formatted according to checkstyle rules

pull/1923/head
Nikita Koksharov 6 years ago
parent 062f642299
commit b47e2303b0

@ -19,7 +19,7 @@
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
@ -49,6 +49,7 @@
-->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
@ -170,7 +171,7 @@
<module name="SimplifyBooleanReturn"/>
<module name="StringLiteralEquality"/>
<module name="NestedIfDepth">
<property name="max" value="2"/>
<property name="max" value="3"/>
</module>
<module name="NestedTryDepth"/>
<module name="SuperClone"/>
@ -187,7 +188,6 @@
<!--module name="DesignForExtension"/-->
<module name="FinalClass"/>
<!--module name="HideUtilityClassConstructor"/-->
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
</module>
@ -216,6 +216,7 @@
<!--module name="TodoComment"/-->
<module name="UpperEll"/>
<module name="BooleanExpressionComplexity"/>
</module>
</module>

@ -360,7 +360,7 @@
</execution>
</executions>
<configuration>
<includes>**/org/redisson/api/**/*.java,**/org/redisson/cache/**/*.java</includes>
<includes>**/org/redisson/api/**/*.java,**/org/redisson/cache/**/*.java,**/org/redisson/client/**/*.java</includes>
<consoleOutput>true</consoleOutput>
<enableRSS>false</enableRSS>
<configLocation>/checkstyle.xml</configLocation>

@ -60,7 +60,7 @@ public class ChannelName implements CharSequence {
return true;
}
if (obj instanceof ChannelName) {
return Arrays.equals(name, ((ChannelName)obj).name);
return Arrays.equals(name, ((ChannelName) obj).name);
}
if (obj instanceof CharSequence) {
return toString().equals(obj);

@ -58,7 +58,7 @@ import io.netty.util.concurrent.FutureListener;
* @author Nikita Koksharov
*
*/
public class RedisClient {
public final class RedisClient {
private final AtomicReference<RFuture<InetSocketAddress>> resolvedAddrFuture = new AtomicReference<RFuture<InetSocketAddress>>();
private final Bootstrap bootstrap;

@ -46,7 +46,7 @@ public class RedisConnection implements RedisCommands {
private static final AttributeKey<RedisConnection> CONNECTION = AttributeKey.valueOf("connection");
protected final RedisClient redisClient;
final RedisClient redisClient;
private volatile RPromise<Void> fastReconnect;
private volatile boolean closed;
@ -97,10 +97,10 @@ public class RedisConnection implements RedisCommands {
return (C) channel.attr(RedisConnection.CONNECTION).get();
}
public CommandData getCurrentCommand() {
public CommandData<?, ?> getCurrentCommand() {
QueueCommand command = channel.attr(CommandsQueue.CURRENT_COMMAND).get();
if (command instanceof CommandData) {
return (CommandData)command;
return (CommandData<?, ?>) command;
}
return null;
}
@ -143,7 +143,7 @@ public class RedisConnection implements RedisCommands {
try {
if (!l.await(redisClient.getCommandTimeout(), TimeUnit.MILLISECONDS)) {
RPromise<R> promise = (RPromise<R>)future;
RPromise<R> promise = (RPromise<R>) future;
RedisTimeoutException ex = new RedisTimeoutException("Command execution timeout for " + redisClient.getAddr());
promise.tryFailure(ex);
throw ex;

@ -99,14 +99,14 @@ public class RedisPubSubConnection extends RedisConnection {
async(new PubSubPatternMessageDecoder(codec.getValueDecoder()), RedisCommands.PSUBSCRIBE, channels);
}
public void unsubscribe(final ChannelName... channels) {
public void unsubscribe(ChannelName... channels) {
synchronized (this) {
for (ChannelName ch : channels) {
this.channels.remove(ch);
unsubscibedChannels.add(ch);
}
}
ChannelFuture future = async((MultiDecoder)null, RedisCommands.UNSUBSCRIBE, channels);
ChannelFuture future = async((MultiDecoder) null, RedisCommands.UNSUBSCRIBE, channels);
future.addListener(new FutureListener<Void>() {
@Override
public void operationComplete(Future<Void> future) throws Exception {
@ -145,14 +145,14 @@ public class RedisPubSubConnection extends RedisConnection {
}
}
public void punsubscribe(final ChannelName... channels) {
public void punsubscribe(ChannelName... channels) {
synchronized (this) {
for (ChannelName ch : channels) {
patternChannels.remove(ch);
punsubscibedChannels.add(ch);
}
}
ChannelFuture future = async((MultiDecoder)null, RedisCommands.PUNSUBSCRIBE, channels);
ChannelFuture future = async((MultiDecoder) null, RedisCommands.PUNSUBSCRIBE, channels);
future.addListener(new FutureListener<Void>() {
@Override
public void operationComplete(Future<Void> future) throws Exception {

@ -15,6 +15,9 @@
*/
package org.redisson.client.codec;
import java.util.Arrays;
import java.util.List;
import org.redisson.cache.LocalCachedMessageCodec;
import org.redisson.client.protocol.Decoder;
import org.redisson.client.protocol.Encoder;
@ -27,16 +30,20 @@ import org.redisson.jcache.JCacheEventCodec;
*/
public abstract class BaseCodec implements Codec {
private static final List<Class<?>> SKIPPED_CODECS = Arrays.asList(StringCodec.class,
ByteArrayCodec.class, LocalCachedMessageCodec.class, BitSetCodec.class, JCacheEventCodec.class);
public static Codec copy(ClassLoader classLoader, Codec codec) {
if (codec instanceof StringCodec
|| codec instanceof ByteArrayCodec
|| codec instanceof LocalCachedMessageCodec
|| codec instanceof BitSetCodec
|| codec instanceof JCacheEventCodec
|| codec == null) {
if (codec == null) {
return codec;
}
for (Class<?> clazz : SKIPPED_CODECS) {
if (clazz.isAssignableFrom(codec.getClass())) {
return codec;
}
}
try {
return codec.getClass().getConstructor(ClassLoader.class, codec.getClass()).newInstance(classLoader, codec);
} catch (Exception e) {

@ -36,7 +36,7 @@ public class ByteArrayCodec extends BaseCodec {
private final Encoder encoder = new Encoder() {
@Override
public ByteBuf encode(Object in) throws IOException {
return Unpooled.wrappedBuffer((byte[])in);
return Unpooled.wrappedBuffer((byte[]) in);
}
};

@ -31,7 +31,7 @@ public class DoubleCodec extends StringCodec {
public static final DoubleCodec INSTANCE = new DoubleCodec();
public final Decoder<Object> decoder = new Decoder<Object>() {
private final Decoder<Object> decoder = new Decoder<Object>() {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
String str = (String) DoubleCodec.super.getValueDecoder().decode(buf, state);

@ -31,7 +31,7 @@ public class IntegerCodec extends StringCodec {
public static final IntegerCodec INSTANCE = new IntegerCodec();
public final Decoder<Object> decoder = new Decoder<Object>() {
private final Decoder<Object> decoder = new Decoder<Object>() {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
String str = (String) IntegerCodec.super.getValueDecoder().decode(buf, state);

@ -52,7 +52,7 @@ public class JsonJacksonMapCodec extends JsonJacksonCodec {
ByteBuf out = ByteBufAllocator.DEFAULT.buffer();
try {
ByteBufOutputStream os = new ByteBufOutputStream(out);
mapObjectMapper.writeValue((OutputStream)os, in);
mapObjectMapper.writeValue((OutputStream) os, in);
return os.buffer();
} catch (IOException e) {
out.release();
@ -65,9 +65,9 @@ public class JsonJacksonMapCodec extends JsonJacksonCodec {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
if (valueClass != null) {
return mapObjectMapper.readValue((InputStream)new ByteBufInputStream(buf), valueClass);
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), valueClass);
}
return mapObjectMapper.readValue((InputStream)new ByteBufInputStream(buf), valueTypeReference);
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), valueTypeReference);
}
};
@ -75,9 +75,9 @@ public class JsonJacksonMapCodec extends JsonJacksonCodec {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
if (keyClass != null) {
return mapObjectMapper.readValue((InputStream)new ByteBufInputStream(buf), keyClass);
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), keyClass);
}
return mapObjectMapper.readValue((InputStream)new ByteBufInputStream(buf), keyTypeReference);
return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), keyTypeReference);
}
};

@ -31,7 +31,7 @@ public class LongCodec extends StringCodec {
public static final LongCodec INSTANCE = new LongCodec();
public final Decoder<Object> decoder = new Decoder<Object>() {
private final Decoder<Object> decoder = new Decoder<Object>() {
@Override
public Object decode(ByteBuf buf, State state) throws IOException {
String str = (String) LongCodec.super.getValueDecoder().decode(buf, state);

@ -102,7 +102,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
}
protected final Logger log = LoggerFactory.getLogger(getClass());
final Logger log = LoggerFactory.getLogger(getClass());
private static final char CR = '\r';
private static final char LF = '\n';
@ -181,7 +181,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
protected void decodeCommand(Channel channel, ByteBuf in, QueueCommand data) throws Exception {
if (data instanceof CommandData) {
CommandData<Object, Object> cmd = (CommandData<Object, Object>)data;
CommandData<Object, Object> cmd = (CommandData<Object, Object>) data;
try {
decode(in, cmd, null, channel, false, null);
sendNext(channel, data);
@ -193,7 +193,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
throw e;
}
} else if (data instanceof CommandsData) {
CommandsData commands = (CommandsData)data;
CommandsData commands = (CommandsData) data;
try {
decodeCommandBatch(channel, in, data, commands);
} catch (Exception e) {
@ -364,7 +364,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
handleResult(data, parts, result, false, channel);
} else if (code == '*') {
long size = readLong(in);
List<Object> respParts = new ArrayList<Object>(Math.max((int)size, 0));
List<Object> respParts = new ArrayList<Object>(Math.max((int) size, 0));
state.get().incLevel();

@ -119,13 +119,13 @@ public class CommandEncoder extends MessageToByteEncoder<CommandData<?, ?>> {
private ByteBuf encode(Object in) {
if (in instanceof byte[]) {
return Unpooled.wrappedBuffer((byte[])in);
return Unpooled.wrappedBuffer((byte[]) in);
}
if (in instanceof ByteBuf) {
return (ByteBuf) in;
}
if (in instanceof ChannelName) {
return Unpooled.wrappedBuffer(((ChannelName)in).getName());
return Unpooled.wrappedBuffer(((ChannelName) in).getName());
}
String payload = in.toString();

@ -82,7 +82,7 @@ public class CommandPubSubDecoder extends CommandDecoder {
throw e;
}
} else if (data instanceof CommandData) {
CommandData<Object, Object> cmd = (CommandData<Object, Object>)data;
CommandData<Object, Object> cmd = (CommandData<Object, Object>) data;
try {
while (in.writerIndex() > in.readerIndex()) {
decode(in, cmd, null, channel, false, null);
@ -99,7 +99,7 @@ public class CommandPubSubDecoder extends CommandDecoder {
@Override
protected void decodeResult(CommandData<Object, Object> data, List<Object> parts, Channel channel,
final Object result) throws IOException {
Object result) throws IOException {
if (executor.isShutdown()) {
return;
}
@ -107,7 +107,7 @@ public class CommandPubSubDecoder extends CommandDecoder {
if (result instanceof Message) {
checkpoint();
final RedisPubSubConnection pubSubConnection = RedisPubSubConnection.getFrom(channel);
RedisPubSubConnection pubSubConnection = RedisPubSubConnection.getFrom(channel);
ChannelName channelName = ((Message) result).getChannel();
if (result instanceof PubSubStatusMessage) {
String operation = ((PubSubStatusMessage) result).getType().name().toLowerCase();
@ -121,7 +121,7 @@ public class CommandPubSubDecoder extends CommandDecoder {
if (Arrays.asList(RedisCommands.PUNSUBSCRIBE.getName(), RedisCommands.UNSUBSCRIBE.getName()).contains(d.getCommand().getName())) {
commands.remove(key);
if (result instanceof PubSubPatternMessage) {
channelName = ((PubSubPatternMessage)result).getPattern();
channelName = ((PubSubPatternMessage) result).getPattern();
}
PubSubEntry entry = entries.remove(channelName);
if (keepOrder) {
@ -133,7 +133,7 @@ public class CommandPubSubDecoder extends CommandDecoder {
if (keepOrder) {
if (result instanceof PubSubPatternMessage) {
channelName = ((PubSubPatternMessage)result).getPattern();
channelName = ((PubSubPatternMessage) result).getPattern();
}
PubSubEntry entry = entries.get(channelName);
if (entry != null) {
@ -160,9 +160,9 @@ public class CommandPubSubDecoder extends CommandDecoder {
}
}
private void enqueueMessage(Object res, final RedisPubSubConnection pubSubConnection, final PubSubEntry entry) {
private void enqueueMessage(Object res, RedisPubSubConnection pubSubConnection, PubSubEntry entry) {
if (res != null) {
entry.getQueue().add((Message)res);
entry.getQueue().add((Message) res);
}
if (entry.getSent().compareAndSet(false, true)) {

@ -67,8 +67,8 @@ public class PingConnectionHandler extends ChannelInboundHandlerAdapter {
@Override
public void run(Timeout timeout) throws Exception {
CommandData<?, ?> commandData = connection.getCurrentCommand();
if ((commandData == null || !commandData.isBlockingCommand()) &&
(future.cancel(false) || !future.isSuccess())) {
if ((commandData == null || !commandData.isBlockingCommand())
&& (future.cancel(false) || !future.isSuccess())) {
ctx.channel().close();
log.debug("channel: {} closed due to PING response timeout set in {} ms", ctx.channel(), config.getPingConnectionInterval());
} else {

@ -91,7 +91,7 @@ public class CommandData<T, R> implements QueueCommand {
@Override
public List<CommandData<Object, Object>> getPubSubOperations() {
if (RedisCommands.PUBSUB_COMMANDS.contains(getCommand().getName())) {
return Collections.singletonList((CommandData<Object, Object>)this);
return Collections.singletonList((CommandData<Object, Object>) this);
}
return Collections.emptyList();
}

@ -85,8 +85,8 @@ public class CommandsData implements QueueCommand {
public List<CommandData<Object, Object>> getPubSubOperations() {
List<CommandData<Object, Object>> result = new ArrayList<CommandData<Object, Object>>();
for (CommandData<?, ?> commandData : commands) {
if (RedisCommands.PUBSUB_COMMANDS.equals(commandData.getCommand().getName())) {
result.add((CommandData<Object, Object>)commandData);
if (RedisCommands.PUBSUB_COMMANDS.contains(commandData.getCommand().getName())) {
result.add((CommandData<Object, Object>) commandData);
}
}
return result;

@ -63,16 +63,16 @@ public class RedisCommand<R> {
}
public RedisCommand(String name) {
this(name, (String)null);
this(name, (String) null);
}
public RedisCommand(String name, ValueType outParamType) {
this(name, (String)null);
this(name, (String) null);
this.outParamType = outParamType;
}
public RedisCommand(String name, ValueType outParamType, Convertor<R> convertor) {
this(name, (String)null);
this(name, (String) null);
this.outParamType = outParamType;
this.convertor = convertor;
}

@ -24,7 +24,7 @@ public class BooleanAmountReplayConvertor implements Convertor<Boolean> {
@Override
public Boolean convert(Object obj) {
return (Long)obj > 0;
return (Long) obj > 0;
}

@ -31,7 +31,7 @@ public class BooleanNumberReplayConvertor implements Convertor<Boolean> {
@Override
public Boolean convert(Object obj) {
return (Long)obj != number;
return (Long) obj != number;
}

@ -37,7 +37,7 @@ public class TimeObjectDecoder implements MultiDecoder<Time> {
@Override
public Time decode(List<Object> parts, State state) {
return new Time(((Long)parts.get(0)).intValue(), ((Long)parts.get(1)).intValue());
return new Time(((Long) parts.get(0)).intValue(), ((Long) parts.get(1)).intValue());
}
}

@ -46,7 +46,7 @@ public class ClusterNodesDecoder implements Decoder<List<ClusterNodeInfo>> {
public List<ClusterNodeInfo> decode(ByteBuf buf, State state) throws IOException {
String response = buf.toString(CharsetUtil.UTF_8);
List<ClusterNodeInfo> nodes = new ArrayList<ClusterNodeInfo>();
List<ClusterNodeInfo> nodes = new ArrayList<>();
for (String nodeInfo : response.split("\n")) {
ClusterNodeInfo node = new ClusterNodeInfo(nodeInfo);
String[] params = nodeInfo.split(" ");
@ -89,9 +89,9 @@ public class ClusterNodesDecoder implements Decoder<List<ClusterNodeInfo>> {
}
String[] parts = slots.split("-");
if(parts.length == 1) {
if (parts.length == 1) {
node.addSlotRange(new ClusterSlotRange(Integer.valueOf(parts[0]), Integer.valueOf(parts[0])));
} else if(parts.length == 2) {
} else if (parts.length == 2) {
node.addSlotRange(new ClusterSlotRange(Integer.valueOf(parts[0]), Integer.valueOf(parts[1])));
}
}

@ -38,7 +38,7 @@ public class GeoMapReplayDecoder implements MultiDecoder<Map<Object, Object>> {
public Map<Object, Object> decode(List<Object> parts, State state) {
Map<Object, Object> result = new LinkedHashMap<Object, Object>(parts.size());
for (Object object : parts) {
List<Object> vals = ((List<Object>) object);
List<Object> vals = (List<Object>) object;
result.put(vals.get(0), vals.get(1));
}
return result;

@ -40,8 +40,8 @@ public class GeoPositionDecoder implements MultiDecoder<GeoPosition> {
return null;
}
Double longitude = (Double)parts.get(0);
Double latitude = (Double)parts.get(1);
Double longitude = (Double) parts.get(0);
Double latitude = (Double) parts.get(1);
return new GeoPosition(longitude, latitude);
}

@ -15,7 +15,6 @@
*/
package org.redisson.client.protocol.decoder;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

@ -34,7 +34,7 @@ public class ListScanResultReplayDecoder implements MultiDecoder<ListScanResult<
@Override
public ListScanResult<Object> decode(List<Object> parts, State state) {
return new ListScanResult<Object>((Long)parts.get(0), (List<Object>)parts.get(1));
return new ListScanResult<Object>((Long) parts.get(0), (List<Object>) parts.get(1));
}
}

@ -30,8 +30,8 @@ public class MapCacheScanResultReplayDecoder implements MultiDecoder<MapCacheSca
@Override
public MapCacheScanResult<Object, Object> decode(List<Object> parts, State state) {
Long pos = (Long)parts.get(0);
Map<Object, Object> values = (Map<Object, Object>)parts.get(1);
Long pos = (Long) parts.get(0);
Map<Object, Object> values = (Map<Object, Object>) parts.get(1);
List<Object> idleKeys = (List<Object>) parts.get(2);
return new MapCacheScanResult<Object, Object>(pos, values, idleKeys);
}

@ -35,7 +35,7 @@ public class MapScanResultReplayDecoder implements MultiDecoder<MapScanResult<Ob
@Override
public MapScanResult<Object, Object> decode(List<Object> parts, State state) {
return new MapScanResult<Object, Object>((Long)parts.get(0), (Map<Object, Object>)parts.get(1));
return new MapScanResult<Object, Object>((Long) parts.get(0), (Map<Object, Object>) parts.get(1));
}
}

@ -45,7 +45,7 @@ public class PendingResultDecoder implements MultiDecoder<Object> {
for (List<String> mapping : customerParts) {
consumerNames.put(mapping.get(0), Long.valueOf(mapping.get(1)));
}
return new PendingResult((Long)parts.get(0), convertor.convert(parts.get(1)), convertor.convert(parts.get(2)), consumerNames);
return new PendingResult((Long) parts.get(0), convertor.convert(parts.get(1)), convertor.convert(parts.get(2)), consumerNames);
}
}

@ -41,9 +41,9 @@ public class ScoredSortedSetReplayDecoder<T> implements MultiDecoder<List<Scored
@Override
public List<ScoredEntry<T>> decode(List<Object> parts, State state) {
List<ScoredEntry<T>> result = new ArrayList<ScoredEntry<T>>();
List<ScoredEntry<T>> result = new ArrayList<>();
for (int i = 0; i < parts.size(); i += 2) {
result.add(new ScoredEntry<T>(((Number)parts.get(i+1)).doubleValue(), (T)parts.get(i)));
result.add(new ScoredEntry<T>(((Number) parts.get(i+1)).doubleValue(), (T) parts.get(i)));
}
return result;
}

@ -34,11 +34,11 @@ public class ScoredSortedSetScanReplayDecoder implements MultiDecoder<ListScanRe
@Override
public ListScanResult<Object> decode(List<Object> parts, State state) {
List<Object> values = (List<Object>)parts.get(1);
List<Object> values = (List<Object>) parts.get(1);
for (int i = 1; i < values.size(); i++) {
values.remove(i);
}
return new ListScanResult<Object>((Long)parts.get(0), values);
return new ListScanResult<Object>((Long) parts.get(0), values);
}
}

@ -42,15 +42,15 @@ public class SlotsDecoder implements MultiDecoder<Object> {
@Override
public Object decode(List<Object> parts, State state) {
if (parts.size() > 2 && parts.get(0) instanceof List) {
Map<ClusterSlotRange, Set<String>> result = new HashMap<ClusterSlotRange, Set<String>>();
List<List<Object>> rows = (List<List<Object>>)(Object)parts;
Map<ClusterSlotRange, Set<String>> result = new HashMap<>();
List<List<Object>> rows = (List<List<Object>>) (Object) parts;
for (List<Object> row : rows) {
Iterator<Object> iterator = row.iterator();
Long startSlot = (Long)iterator.next();
Long endSlot = (Long)iterator.next();
Long startSlot = (Long) iterator.next();
Long endSlot = (Long) iterator.next();
ClusterSlotRange range = new ClusterSlotRange(startSlot.intValue(), endSlot.intValue());
Set<String> addresses = new HashSet<String>();
while(iterator.hasNext()) {
Set<String> addresses = new HashSet<>();
while (iterator.hasNext()) {
List<Object> addressParts = (List<Object>) iterator.next();
addresses.add(addressParts.get(0) + ":" + addressParts.get(1));
}

@ -19,7 +19,6 @@ import java.util.List;
import org.redisson.client.handler.State;
import org.redisson.client.protocol.Decoder;
import org.redisson.client.protocol.decoder.MultiDecoder;
/**
*
@ -36,7 +35,7 @@ public class TimeLongObjectDecoder implements MultiDecoder<Long> {
@Override
public Long decode(List<Object> parts, State state) {
return ((Long)parts.get(0)) * 1000L + ((Long)parts.get(1)) / 1000L;
return ((Long) parts.get(0)) * 1000L + ((Long) parts.get(1)) / 1000L;
}
}

@ -43,7 +43,7 @@ public class PubSubMessageDecoder implements MultiDecoder<Object> {
@Override
public PubSubMessage decode(List<Object> parts, State state) {
ChannelName name = new ChannelName((byte[])parts.get(1));
ChannelName name = new ChannelName((byte[]) parts.get(1));
return new PubSubMessage(name, parts.get(2));
}

@ -43,8 +43,8 @@ public class PubSubPatternMessageDecoder implements MultiDecoder<Object> {
@Override
public PubSubPatternMessage decode(List<Object> parts, State state) {
ChannelName patternName = new ChannelName((byte[])parts.get(1));
ChannelName name = new ChannelName((byte[])parts.get(2));
ChannelName patternName = new ChannelName((byte[]) parts.get(1));
ChannelName name = new ChannelName((byte[]) parts.get(2));
return new PubSubPatternMessage(patternName, name, parts.get(3));
}

@ -37,7 +37,7 @@ public class PubSubStatusDecoder implements MultiDecoder<Object> {
@Override
public PubSubStatusMessage decode(List<Object> parts, State state) {
PubSubType type = PubSubType.valueOf(parts.get(0).toString().toUpperCase());
ChannelName name = new ChannelName((byte[])parts.get(1));
ChannelName name = new ChannelName((byte[]) parts.get(1));
return new PubSubStatusMessage(type, name);
}

Loading…
Cancel
Save