Elffuss BraidHub

kikocis/java-driver public

Avoid using public modifier on members of package-private classes.
Changeset23b509af140fb587e19ee13d9f388f51f623f96cd8014c62dc52b43ea65ab52a
AuthorAlexandre Dutra <alexandre.dutra@datastax.com> · 2015-12-28 14:53 +01:00
Committerolim7t <omichallat+github@gmail.com> · 2016-01-04 18:04 +01:00
Parents697c5b0360ec

Browse the files at this changeset

7 files changed

modified driver-core/src/main/java/com/datastax/driver/core/Connection.java +43 −43
@@ -70,7 +70,7 @@
7070
7171 volatile long maxIdleTime;
7272
73- public final InetSocketAddress address;
73+ final InetSocketAddress address;
7474 private final String name;
7575
7676 @VisibleForTesting
@@ -81,7 +81,7 @@
8181 final Dispatcher dispatcher;
8282
8383 // Used by connection pooling to count how many requests are "in flight" on that connection.
84- public final AtomicInteger inFlight = new AtomicInteger(0);
84+ final AtomicInteger inFlight = new AtomicInteger(0);
8585
8686 private final AtomicInteger writer = new AtomicInteger(0);
8787 private volatile String keyspace;
@@ -118,7 +118,7 @@
118118 this(name, address, factory, null);
119119 }
120120
121- public ListenableFuture<Void> initAsync() {
121+ ListenableFuture<Void> initAsync() {
122122 if (factory.isShutdown)
123123 return Futures.immediateFailedFuture(new ConnectionException(address, "Connection factory is shut down"));
124124
@@ -386,11 +386,11 @@
386386 return new UnsupportedProtocolVersionException(address, triedVersion, serverProtocolVersion);
387387 }
388388
389- public boolean isDefunct() {
389+ boolean isDefunct() {
390390 return isDefunct.get();
391391 }
392392
393- public int maxAvailableStreams() {
393+ int maxAvailableStreams() {
394394 return dispatcher.streamIdHandler.maxAvailableStreams();
395395 }
396396
@@ -420,11 +420,11 @@
420420 owner.onConnectionDefunct(this);
421421 }
422422
423- public String keyspace() {
423+ String keyspace() {
424424 return keyspace;
425425 }
426426
427- public void setKeyspace(String keyspace) throws ConnectionException {
427+ void setKeyspace(String keyspace) throws ConnectionException {
428428 if (keyspace == null)
429429 return;
430430
@@ -482,17 +482,17 @@
482482 * @throws ConnectionException if the connection is closed
483483 * @throws TransportException if an I/O error while sending the request
484484 */
485- public Future write(Message.Request request) throws ConnectionException, BusyConnectionException {
485+ Future write(Message.Request request) throws ConnectionException, BusyConnectionException {
486486 Future future = new Future(request);
487487 write(future);
488488 return future;
489489 }
490490
491- public ResponseHandler write(ResponseCallback callback) throws ConnectionException, BusyConnectionException {
491+ ResponseHandler write(ResponseCallback callback) throws ConnectionException, BusyConnectionException {
492492 return write(callback, true);
493493 }
494494
495- public ResponseHandler write(ResponseCallback callback, boolean startTimeout) throws ConnectionException, BusyConnectionException {
495+ ResponseHandler write(ResponseCallback callback, boolean startTimeout) throws ConnectionException, BusyConnectionException {
496496
497497 Message.Request request = callback.request();
498498
@@ -591,7 +591,7 @@
591591 ((HostConnectionPool) owner).returnConnection(this);
592592 }
593593
594- public boolean isClosed() {
594+ boolean isClosed() {
595595 return closeFuture.get() != null;
596596 }
597597
@@ -605,7 +605,7 @@
605605 * @return a future that will complete once the connection has terminated.
606606 * @see #tryTerminate(boolean)
607607 */
608- public CloseFuture closeAsync() {
608+ CloseFuture closeAsync() {
609609
610610 ConnectionCloseFuture future = new ConnectionCloseFuture();
611611 if (!closeFuture.compareAndSet(null, future)) {
@@ -674,9 +674,9 @@
674674 return String.format("Connection[%s, inFlight=%d, closed=%b]", name, inFlight.get(), isClosed());
675675 }
676676
677- public static class Factory {
677+ static class Factory {
678678
679- public final Timer timer;
679+ final Timer timer;
680680
681681 private final EventLoopGroup eventLoopGroup;
682682 private final Class<? extends Channel> channelClass;
@@ -684,12 +684,12 @@
684684 private final ChannelGroup allChannels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
685685
686686 private final ConcurrentMap<Host, AtomicInteger> idGenerators = new ConcurrentHashMap<Host, AtomicInteger>();
687- public final DefaultResponseHandler defaultHandler;
687+ final DefaultResponseHandler defaultHandler;
688688 final Cluster.Manager manager;
689689 final Cluster.ConnectionReaper reaper;
690- public final Configuration configuration;
690+ final Configuration configuration;
691691
692- public final AuthProvider authProvider;
692+ final AuthProvider authProvider;
693693 private volatile boolean isShutdown;
694694
695695 volatile ProtocolVersion protocolVersion;
@@ -708,7 +708,7 @@
708708 this.timer = nettyOptions.timer(manager.threadFactory("timeouter"));
709709 }
710710
711- public int getPort() {
711+ int getPort() {
712712 return configuration.getProtocolOptions().getPort();
713713 }
714714
@@ -718,7 +718,7 @@
718718 * @return the newly created (and initialized) connection.
719719 * @throws ConnectionException if connection attempt fails.
720720 */
721- public Connection open(Host host) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException {
721+ Connection open(Host host) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException {
722722 InetSocketAddress address = host.getSocketAddress();
723723
724724 if (isShutdown)
@@ -738,7 +738,7 @@
738738 /**
739739 * Same as open, but associate the created connection to the provided connection pool.
740740 */
741- public Connection open(HostConnectionPool pool) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException {
741+ Connection open(HostConnectionPool pool) throws ConnectionException, InterruptedException, UnsupportedProtocolVersionException, ClusterNameMismatchException {
742742 pool.host.convictionPolicy.signalConnectionsOpening(1);
743743 Connection connection = new Connection(buildConnectionName(pool.host), pool.host.getSocketAddress(), this, pool);
744744 try {
@@ -752,7 +752,7 @@
752752 /**
753753 * Creates new connections and associate them to the provided connection pool, but does not start them.
754754 */
755- public List<Connection> newConnections(HostConnectionPool pool, int count) {
755+ List<Connection> newConnections(HostConnectionPool pool, int count) {
756756 pool.host.convictionPolicy.signalConnectionsOpening(count);
757757 List<Connection> connections = Lists.newArrayListWithCapacity(count);
758758 for (int i = 0; i < count; i++)
@@ -791,7 +791,7 @@
791791 return g;
792792 }
793793
794- public long getReadTimeoutMillis() {
794+ long getReadTimeoutMillis() {
795795 return configuration.getSocketOptions().getReadTimeoutMillis();
796796 }
797797
@@ -826,7 +826,7 @@
826826 return b;
827827 }
828828
829- public void shutdown() {
829+ void shutdown() {
830830 // Make sure we skip creating connection from now on.
831831 isShutdown = true;
832832
@@ -927,7 +927,7 @@
927927
928928 class Dispatcher extends SimpleChannelInboundHandler<Message.Response> {
929929
930- public final StreamIdGenerator streamIdHandler;
930+ final StreamIdGenerator streamIdHandler;
931931 private final ConcurrentMap<Integer, ResponseHandler> pending = new ConcurrentHashMap<Integer, ResponseHandler>();
932932
933933 Dispatcher() {
@@ -940,12 +940,12 @@
940940 streamIdHandler = StreamIdGenerator.newInstance(protocolVersion);
941941 }
942942
943- public void add(ResponseHandler handler) {
943+ void add(ResponseHandler handler) {
944944 ResponseHandler old = pending.put(handler.streamId, handler);
945945 assert old == null;
946946 }
947947
948- public void removeHandler(ResponseHandler handler, boolean releaseStreamId) {
948+ void removeHandler(ResponseHandler handler, boolean releaseStreamId) {
949949
950950 // If we don't release the ID, mark first so that we can rely later on the fact that if
951951 // we receive a response for an ID with no handler, it's that this ID has been marked.
@@ -1042,7 +1042,7 @@
10421042 defunct(new TransportException(address, String.format("Unexpected exception triggered (%s)", cause), cause));
10431043 }
10441044
1045- public void errorOutAllHandler(ConnectionException ce) {
1045+ void errorOutAllHandler(ConnectionException ce) {
10461046 Iterator<ResponseHandler> iter = pending.values().iterator();
10471047 while (iter.hasNext()) {
10481048 ResponseHandler handler = iter.next();
@@ -1143,7 +1143,7 @@
11431143 private final Message.Request request;
11441144 private volatile InetSocketAddress address;
11451145
1146- public Future(Message.Request request) {
1146+ Future(Message.Request request) {
11471147 this.request = request;
11481148 }
11491149
@@ -1190,36 +1190,36 @@
11901190 return super.setException(new OperationTimedOutException(connection.address));
11911191 }
11921192
1193- public InetSocketAddress getAddress() {
1193+ InetSocketAddress getAddress() {
11941194 return address;
11951195 }
11961196 }
11971197
11981198 interface ResponseCallback {
1199- public Message.Request request();
1199+ Message.Request request();
12001200
1201- public int retryCount();
1201+ int retryCount();
12021202
1203- public void onSet(Connection connection, Message.Response response, long latency, int retryCount);
1203+ void onSet(Connection connection, Message.Response response, long latency, int retryCount);
12041204
1205- public void onException(Connection connection, Exception exception, long latency, int retryCount);
1205+ void onException(Connection connection, Exception exception, long latency, int retryCount);
12061206
1207- public boolean onTimeout(Connection connection, long latency, int retryCount);
1207+ boolean onTimeout(Connection connection, long latency, int retryCount);
12081208 }
12091209
12101210 static class ResponseHandler {
12111211
1212- public final Connection connection;
1213- public final int streamId;
1214- public final ResponseCallback callback;
1215- public final int retryCount;
1212+ final Connection connection;
1213+ final int streamId;
1214+ final ResponseCallback callback;
1215+ final int retryCount;
12161216
12171217 private final long startTime;
12181218 private volatile Timeout timeout;
12191219
12201220 private final AtomicBoolean isCancelled = new AtomicBoolean();
12211221
1222- public ResponseHandler(Connection connection, ResponseCallback callback) throws BusyConnectionException {
1222+ ResponseHandler(Connection connection, ResponseCallback callback) throws BusyConnectionException {
12231223 this.connection = connection;
12241224 this.streamId = connection.dispatcher.streamIdHandler.next();
12251225 if (streamId == -1)
@@ -1240,7 +1240,7 @@
12401240 timeout.cancel();
12411241 }
12421242
1243- public boolean cancelHandler() {
1243+ boolean cancelHandler() {
12441244 if (!isCancelled.compareAndSet(false, true))
12451245 return false;
12461246
@@ -1263,8 +1263,8 @@
12631263 }
12641264 }
12651265
1266- public interface DefaultResponseHandler {
1267- public void handle(Message.Response response);
1266+ interface DefaultResponseHandler {
1267+ void handle(Message.Response response);
12681268 }
12691269
12701270 private static class Initializer extends ChannelInitializer<SocketChannel> {
@@ -1284,7 +1284,7 @@
12841284 private final ChannelHandler idleStateHandler;
12851285 private final CodecRegistry codecRegistry;
12861286
1287- public Initializer(Connection connection, ProtocolVersion protocolVersion, FrameCompressor compressor, SSLOptions sslOptions, int heartBeatIntervalSeconds, NettyOptions nettyOptions, CodecRegistry codecRegistry) {
1287+ Initializer(Connection connection, ProtocolVersion protocolVersion, FrameCompressor compressor, SSLOptions sslOptions, int heartBeatIntervalSeconds, NettyOptions nettyOptions, CodecRegistry codecRegistry) {
12881288 this.connection = connection;
12891289 this.protocolVersion = protocolVersion;
12901290 this.compressor = compressor;
modified driver-core/src/main/java/com/datastax/driver/core/Frame.java +19 −19
@@ -76,8 +76,8 @@
7676 */
7777 class Frame {
7878
79- public final Header header;
80- public final ByteBuf body;
79+ final Header header;
80+ final ByteBuf body;
8181
8282 private Frame(Header header, ByteBuf body) {
8383 this.header = header;
@@ -116,17 +116,17 @@
116116 }
117117 }
118118
119- public static Frame create(ProtocolVersion version, int opcode, int streamId, EnumSet<Header.Flag> flags, ByteBuf body) {
119+ static Frame create(ProtocolVersion version, int opcode, int streamId, EnumSet<Header.Flag> flags, ByteBuf body) {
120120 Header header = new Header(version, flags, streamId, opcode);
121121 return new Frame(header, body);
122122 }
123123
124- public static class Header {
124+ static class Header {
125125
126- public final ProtocolVersion version;
127- public final EnumSet<Flag> flags;
128- public final int streamId;
129- public final int opcode;
126+ final ProtocolVersion version;
127+ final EnumSet<Flag> flags;
128+ final int streamId;
129+ final int opcode;
130130
131131 private Header(ProtocolVersion version, int flags, int streamId, int opcode) {
132132 this(version, Flag.deserialize(flags), streamId, opcode);
@@ -145,7 +145,7 @@
145145 * @param version the protocol version in use
146146 * @return the expected frame header length in bytes
147147 */
148- public static int lengthFor(ProtocolVersion version) {
148+ static int lengthFor(ProtocolVersion version) {
149149 switch (version) {
150150 case V1:
151151 case V2:
@@ -158,14 +158,14 @@
158158 }
159159 }
160160
161- public static enum Flag {
161+ enum Flag {
162162 // The order of that enum matters!!
163163 COMPRESSED,
164164 TRACING,
165165 CUSTOM_PAYLOAD,
166166 WARNING;
167167
168- public static EnumSet<Flag> deserialize(int flags) {
168+ static EnumSet<Flag> deserialize(int flags) {
169169 EnumSet<Flag> set = EnumSet.noneOf(Flag.class);
170170 Flag[] values = Flag.values();
171171 for (int n = 0; n < 8; n++) {
@@ -175,7 +175,7 @@
175175 return set;
176176 }
177177
178- public static int serialize(EnumSet<Flag> flags) {
178+ static int serialize(EnumSet<Flag> flags) {
179179 int i = 0;
180180 for (Flag flag : flags)
181181 i |= 1 << flag.ordinal();
@@ -184,11 +184,11 @@
184184 }
185185 }
186186
187- public Frame with(ByteBuf newBody) {
187+ Frame with(ByteBuf newBody) {
188188 return new Frame(header, newBody);
189189 }
190190
191- public static final class Decoder extends ByteToMessageDecoder {
191+ static final class Decoder extends ByteToMessageDecoder {
192192 static final DecoderForStreamIdSize decoderV1 = new DecoderForStreamIdSize(1);
193193 static final DecoderForStreamIdSize decoderV3 = new DecoderForStreamIdSize(2);
194194
@@ -243,7 +243,7 @@
243243 }
244244
245245 @ChannelHandler.Sharable
246- public static class Encoder extends MessageToMessageEncoder<Frame> {
246+ static class Encoder extends MessageToMessageEncoder<Frame> {
247247
248248 @Override
249249 protected void encode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception {
@@ -276,11 +276,11 @@
276276 }
277277 }
278278
279- public static class Decompressor extends MessageToMessageDecoder<Frame> {
279+ static class Decompressor extends MessageToMessageDecoder<Frame> {
280280
281281 private final FrameCompressor compressor;
282282
283- public Decompressor(FrameCompressor compressor) {
283+ Decompressor(FrameCompressor compressor) {
284284 assert compressor != null;
285285 this.compressor = compressor;
286286 }
@@ -302,11 +302,11 @@
302302 }
303303 }
304304
305- public static class Compressor extends MessageToMessageEncoder<Frame> {
305+ static class Compressor extends MessageToMessageEncoder<Frame> {
306306
307307 private final FrameCompressor compressor;
308308
309- public Compressor(FrameCompressor compressor) {
309+ Compressor(FrameCompressor compressor) {
310310 assert compressor != null;
311311 this.compressor = compressor;
312312 }
modified driver-core/src/main/java/com/datastax/driver/core/Message.java +29 −30
@@ -38,14 +38,14 @@
3838
3939 static AttributeKey<CodecRegistry> CODEC_REGISTRY_ATTRIBUTE_KEY = AttributeKey.newInstance("com.datastax.driver.core.CodecRegistry");
4040
41- public interface Coder<R extends Request> {
42- public void encode(R request, ByteBuf dest, ProtocolVersion version);
41+ interface Coder<R extends Request> {
42+ void encode(R request, ByteBuf dest, ProtocolVersion version);
4343
44- public int encodedSize(R request, ProtocolVersion version);
44+ int encodedSize(R request, ProtocolVersion version);
4545 }
4646
47- public interface Decoder<R extends Response> {
48- public R decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry);
47+ interface Decoder<R extends Response> {
48+ R decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry);
4949 }
5050
5151 private volatile int streamId;
@@ -61,27 +61,27 @@
6161 protected Message() {
6262 }
6363
64- public Message setStreamId(int streamId) {
64+ Message setStreamId(int streamId) {
6565 this.streamId = streamId;
6666 return this;
6767 }
6868
69- public int getStreamId() {
69+ int getStreamId() {
7070 return streamId;
7171 }
7272
73- public Map<String, ByteBuffer> getCustomPayload() {
73+ Map<String, ByteBuffer> getCustomPayload() {
7474 return customPayload;
7575 }
7676
77- public Message setCustomPayload(Map<String, ByteBuffer> customPayload) {
77+ Message setCustomPayload(Map<String, ByteBuffer> customPayload) {
7878 this.customPayload = customPayload;
7979 return this;
8080 }
8181
82- public static abstract class Request extends Message {
82+ static abstract class Request extends Message {
8383
84- public enum Type {
84+ enum Type {
8585 STARTUP(1, Requests.Startup.coder),
8686 CREDENTIALS(4, Requests.Credentials.coder),
8787 OPTIONS(5, Requests.Options.coder),
@@ -92,16 +92,16 @@
9292 BATCH(13, Requests.Batch.coder),
9393 AUTH_RESPONSE(15, Requests.AuthResponse.coder);
9494
95- public final int opcode;
96- public final Coder<?> coder;
95+ final int opcode;
96+ final Coder<?> coder;
9797
98- private Type(int opcode, Coder<?> coder) {
98+ Type(int opcode, Coder<?> coder) {
9999 this.opcode = opcode;
100100 this.coder = coder;
101101 }
102102 }
103103
104- public final Type type;
104+ final Type type;
105105 private final boolean tracingRequested;
106106
107107 protected Request(Type type) {
@@ -113,7 +113,7 @@
113113 this.tracingRequested = tracingRequested;
114114 }
115115
116- public boolean isTracingRequested() {
116+ boolean isTracingRequested() {
117117 return tracingRequested;
118118 }
119119
@@ -176,9 +176,9 @@
176176 }
177177 }
178178
179- public static abstract class Response extends Message {
179+ static abstract class Response extends Message {
180180
181- public enum Type {
181+ enum Type {
182182 ERROR(0, Responses.Error.decoder),
183183 READY(2, Responses.Ready.decoder),
184184 AUTHENTICATE(3, Responses.Authenticate.decoder),
@@ -188,8 +188,8 @@
188188 AUTH_CHALLENGE(14, Responses.AuthChallenge.decoder),
189189 AUTH_SUCCESS(16, Responses.AuthSuccess.decoder);
190190
191- public final int opcode;
192- public final Decoder<?> decoder;
191+ final int opcode;
192+ final Decoder<?> decoder;
193193
194194 private static final Type[] opcodeIdx;
195195
@@ -205,12 +205,12 @@
205205 }
206206 }
207207
208- private Type(int opcode, Decoder<?> decoder) {
208+ Type(int opcode, Decoder<?> decoder) {
209209 this.opcode = opcode;
210210 this.decoder = decoder;
211211 }
212212
213- public static Type fromOpcode(int opcode) {
213+ static Type fromOpcode(int opcode) {
214214 if (opcode < 0 || opcode >= opcodeIdx.length)
215215 throw new DriverInternalError(String.format("Unknown response opcode %d", opcode));
216216 Type t = opcodeIdx[opcode];
@@ -220,7 +220,7 @@
220220 }
221221 }
222222
223- public final Type type;
223+ final Type type;
224224 protected volatile UUID tracingId;
225225 protected volatile List<String> warnings;
226226
@@ -228,23 +228,23 @@
228228 this.type = type;
229229 }
230230
231- public Response setTracingId(UUID tracingId) {
231+ Response setTracingId(UUID tracingId) {
232232 this.tracingId = tracingId;
233233 return this;
234234 }
235235
236- public UUID getTracingId() {
236+ UUID getTracingId() {
237237 return tracingId;
238238 }
239239
240- public Response setWarnings(List<String> warnings) {
240+ Response setWarnings(List<String> warnings) {
241241 this.warnings = warnings;
242242 return this;
243243 }
244244 }
245245
246246 @ChannelHandler.Sharable
247- public static class ProtocolDecoder extends MessageToMessageDecoder<Frame> {
247+ static class ProtocolDecoder extends MessageToMessageDecoder<Frame> {
248248
249249 @Override
250250 protected void decode(ChannelHandlerContext ctx, Frame frame, List<Object> out) throws Exception {
@@ -278,11 +278,11 @@
278278 }
279279
280280 @ChannelHandler.Sharable
281- public static class ProtocolEncoder extends MessageToMessageEncoder<Request> {
281+ static class ProtocolEncoder extends MessageToMessageEncoder<Request> {
282282
283283 private final ProtocolVersion protocolVersion;
284284
285- public ProtocolEncoder(ProtocolVersion version) {
285+ ProtocolEncoder(ProtocolVersion version) {
286286 this.protocolVersion = version;
287287 }
288288
@@ -350,7 +350,6 @@
350350 // this method doesn't modify the given ByteBuffer
351351 static void bytesToHex(ByteBuffer bytes, StringBuilder sb) {
352352 int length = Math.min(bytes.remaining(), 50);
353- char[] hexChars = new char[length * 2];
354353 sb.append("0x");
355354 for (int i = 0; i < length; i++) {
356355 int v = bytes.get(i) & 0xFF;
modified driver-core/src/main/java/com/datastax/driver/core/ProtocolEvent.java +20 −20
@@ -25,15 +25,15 @@
2525
2626 class ProtocolEvent {
2727
28- public enum Type {TOPOLOGY_CHANGE, STATUS_CHANGE, SCHEMA_CHANGE}
28+ enum Type {TOPOLOGY_CHANGE, STATUS_CHANGE, SCHEMA_CHANGE}
2929
30- public final Type type;
30+ final Type type;
3131
3232 private ProtocolEvent(Type type) {
3333 this.type = type;
3434 }
3535
36- public static ProtocolEvent deserialize(ByteBuf bb, ProtocolVersion version) {
36+ static ProtocolEvent deserialize(ByteBuf bb, ProtocolVersion version) {
3737 switch (CBUtil.readEnumValue(Type.class, bb)) {
3838 case TOPOLOGY_CHANGE:
3939 return TopologyChange.deserializeEvent(bb);
@@ -45,11 +45,11 @@
4545 throw new AssertionError();
4646 }
4747
48- public static class TopologyChange extends ProtocolEvent {
49- public enum Change {NEW_NODE, REMOVED_NODE, MOVED_NODE}
48+ static class TopologyChange extends ProtocolEvent {
49+ enum Change {NEW_NODE, REMOVED_NODE, MOVED_NODE}
5050
51- public final Change change;
52- public final InetSocketAddress node;
51+ final Change change;
52+ final InetSocketAddress node;
5353
5454 private TopologyChange(Change change, InetSocketAddress node) {
5555 super(Type.TOPOLOGY_CHANGE);
@@ -70,12 +70,12 @@
7070 }
7171 }
7272
73- public static class StatusChange extends ProtocolEvent {
73+ static class StatusChange extends ProtocolEvent {
7474
75- public enum Status {UP, DOWN}
75+ enum Status {UP, DOWN}
7676
77- public final Status status;
78- public final InetSocketAddress node;
77+ final Status status;
78+ final InetSocketAddress node;
7979
8080 private StatusChange(Status status, InetSocketAddress node) {
8181 super(Type.STATUS_CHANGE);
@@ -96,17 +96,17 @@
9696 }
9797 }
9898
99- public static class SchemaChange extends ProtocolEvent {
99+ static class SchemaChange extends ProtocolEvent {
100100
101- public enum Change {CREATED, UPDATED, DROPPED}
101+ enum Change {CREATED, UPDATED, DROPPED}
102102
103- public final Change change;
104- public final SchemaElement targetType;
105- public final String targetKeyspace;
106- public final String targetName;
107- public final List<String> targetSignature;
103+ final Change change;
104+ final SchemaElement targetType;
105+ final String targetKeyspace;
106+ final String targetName;
107+ final List<String> targetSignature;
108108
109- public SchemaChange(Change change, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature) {
109+ SchemaChange(Change change, SchemaElement targetType, String targetKeyspace, String targetName, List<String> targetSignature) {
110110 super(Type.SCHEMA_CHANGE);
111111 this.change = change;
112112 this.targetType = targetType;
@@ -116,7 +116,7 @@
116116 }
117117
118118 // Assumes the type has already been deserialized
119- private static SchemaChange deserializeEvent(ByteBuf bb, ProtocolVersion version) {
119+ static SchemaChange deserializeEvent(ByteBuf bb, ProtocolVersion version) {
120120 Change change;
121121 SchemaElement targetType;
122122 String targetKeyspace, targetName;
modified driver-core/src/main/java/com/datastax/driver/core/Requests.java +68 −68
@@ -29,13 +29,13 @@
2929 private Requests() {
3030 }
3131
32- public static class Startup extends Message.Request {
32+ static class Startup extends Message.Request {
3333 private static final String CQL_VERSION_OPTION = "CQL_VERSION";
3434 private static final String CQL_VERSION = "3.0.0";
3535
36- public static final String COMPRESSION_OPTION = "COMPRESSION";
36+ static final String COMPRESSION_OPTION = "COMPRESSION";
3737
38- public static final Message.Coder<Startup> coder = new Message.Coder<Startup>() {
38+ static final Message.Coder<Startup> coder = new Message.Coder<Startup>() {
3939 public void encode(Startup msg, ByteBuf dest, ProtocolVersion version) {
4040 CBUtil.writeStringMap(msg.options, dest);
4141 }
@@ -47,7 +47,7 @@
4747
4848 private final Map<String, String> options;
4949
50- public Startup(ProtocolOptions.Compression compression) {
50+ Startup(ProtocolOptions.Compression compression) {
5151 super(Message.Request.Type.STARTUP);
5252
5353 ImmutableMap.Builder<String, String> map = new ImmutableMap.Builder<String, String>();
@@ -64,9 +64,9 @@
6464 }
6565
6666 // Only for protocol v1
67- public static class Credentials extends Message.Request {
67+ static class Credentials extends Message.Request {
6868
69- public static final Message.Coder<Credentials> coder = new Message.Coder<Credentials>() {
69+ static final Message.Coder<Credentials> coder = new Message.Coder<Credentials>() {
7070
7171 public void encode(Credentials msg, ByteBuf dest, ProtocolVersion version) {
7272 assert version == ProtocolVersion.V1;
@@ -81,15 +81,15 @@
8181
8282 private final Map<String, String> credentials;
8383
84- public Credentials(Map<String, String> credentials) {
84+ Credentials(Map<String, String> credentials) {
8585 super(Message.Request.Type.CREDENTIALS);
8686 this.credentials = credentials;
8787 }
8888 }
8989
90- public static class Options extends Message.Request {
90+ static class Options extends Message.Request {
9191
92- public static final Message.Coder<Options> coder = new Message.Coder<Options>() {
92+ static final Message.Coder<Options> coder = new Message.Coder<Options>() {
9393 public void encode(Options msg, ByteBuf dest, ProtocolVersion version) {
9494 }
9595
@@ -98,7 +98,7 @@
9898 }
9999 };
100100
101- public Options() {
101+ Options() {
102102 super(Message.Request.Type.OPTIONS);
103103 }
104104
@@ -108,9 +108,9 @@
108108 }
109109 }
110110
111- public static class Query extends Message.Request {
111+ static class Query extends Message.Request {
112112
113- public static final Message.Coder<Query> coder = new Message.Coder<Query>() {
113+ static final Message.Coder<Query> coder = new Message.Coder<Query>() {
114114 public void encode(Query msg, ByteBuf dest, ProtocolVersion version) {
115115 CBUtil.writeLongString(msg.query, dest);
116116 msg.options.encode(dest, version);
@@ -122,14 +122,14 @@
122122 }
123123 };
124124
125- public final String query;
126- public final QueryProtocolOptions options;
125+ final String query;
126+ final QueryProtocolOptions options;
127127
128- public Query(String query) {
128+ Query(String query) {
129129 this(query, QueryProtocolOptions.DEFAULT, false);
130130 }
131131
132- public Query(String query, QueryProtocolOptions options, boolean tracingRequested) {
132+ Query(String query, QueryProtocolOptions options, boolean tracingRequested) {
133133 super(Type.QUERY, tracingRequested);
134134 this.query = query;
135135 this.options = options;
@@ -151,9 +151,9 @@
151151 }
152152 }
153153
154- public static class Execute extends Message.Request {
154+ static class Execute extends Message.Request {
155155
156- public static final Message.Coder<Execute> coder = new Message.Coder<Execute>() {
156+ static final Message.Coder<Execute> coder = new Message.Coder<Execute>() {
157157 public void encode(Execute msg, ByteBuf dest, ProtocolVersion version) {
158158 CBUtil.writeBytes(msg.statementId.bytes, dest);
159159 msg.options.encode(dest, version);
@@ -165,10 +165,10 @@
165165 }
166166 };
167167
168- public final MD5Digest statementId;
169- public final QueryProtocolOptions options;
168+ final MD5Digest statementId;
169+ final QueryProtocolOptions options;
170170
171- public Execute(MD5Digest statementId, QueryProtocolOptions options, boolean tracingRequested) {
171+ Execute(MD5Digest statementId, QueryProtocolOptions options, boolean tracingRequested) {
172172 super(Message.Request.Type.EXECUTE, tracingRequested);
173173 this.statementId = statementId;
174174 this.options = options;
@@ -190,7 +190,7 @@
190190 }
191191 }
192192
193- static enum QueryFlag {
193+ enum QueryFlag {
194194 // The order of that enum matters!!
195195 VALUES,
196196 SKIP_METADATA,
@@ -200,7 +200,7 @@
200200 DEFAULT_TIMESTAMP,
201201 VALUE_NAMES;
202202
203- public static EnumSet<QueryFlag> deserialize(int flags) {
203+ static EnumSet<QueryFlag> deserialize(int flags) {
204204 EnumSet<QueryFlag> set = EnumSet.noneOf(QueryFlag.class);
205205 QueryFlag[] values = QueryFlag.values();
206206 for (int n = 0; n < values.length; n++) {
@@ -210,7 +210,7 @@
210210 return set;
211211 }
212212
213- public static int serialize(EnumSet<QueryFlag> flags) {
213+ static int serialize(EnumSet<QueryFlag> flags) {
214214 int i = 0;
215215 for (QueryFlag flag : flags)
216216 i |= 1 << flag.ordinal();
@@ -218,9 +218,9 @@
218218 }
219219 }
220220
221- public static class QueryProtocolOptions {
221+ static class QueryProtocolOptions {
222222
223- public static final QueryProtocolOptions DEFAULT = new QueryProtocolOptions(ConsistencyLevel.ONE,
223+ static final QueryProtocolOptions DEFAULT = new QueryProtocolOptions(ConsistencyLevel.ONE,
224224 Collections.<ByteBuffer>emptyList(),
225225 false,
226226 -1,
@@ -229,21 +229,21 @@
229229 Long.MIN_VALUE);
230230
231231 private final EnumSet<QueryFlag> flags = EnumSet.noneOf(QueryFlag.class);
232- public final ConsistencyLevel consistency;
233- public final List<ByteBuffer> values;
234- public final boolean skipMetadata;
235- public final int pageSize;
236- public final ByteBuffer pagingState;
237- public final ConsistencyLevel serialConsistency;
238- public final long defaultTimestamp;
239-
240- public QueryProtocolOptions(ConsistencyLevel consistency,
241- List<ByteBuffer> values,
242- boolean skipMetadata,
243- int pageSize,
244- ByteBuffer pagingState,
245- ConsistencyLevel serialConsistency,
246- long defaultTimestamp) {
232+ final ConsistencyLevel consistency;
233+ final List<ByteBuffer> values;
234+ final boolean skipMetadata;
235+ final int pageSize;
236+ final ByteBuffer pagingState;
237+ final ConsistencyLevel serialConsistency;
238+ final long defaultTimestamp;
239+
240+ QueryProtocolOptions(ConsistencyLevel consistency,
241+ List<ByteBuffer> values,
242+ boolean skipMetadata,
243+ int pageSize,
244+ ByteBuffer pagingState,
245+ ConsistencyLevel serialConsistency,
246+ long defaultTimestamp) {
247247
248248 this.consistency = consistency;
249249 this.values = values;
@@ -268,11 +268,11 @@
268268 flags.add(QueryFlag.DEFAULT_TIMESTAMP);
269269 }
270270
271- public QueryProtocolOptions copy(ConsistencyLevel newConsistencyLevel) {
271+ QueryProtocolOptions copy(ConsistencyLevel newConsistencyLevel) {
272272 return new QueryProtocolOptions(newConsistencyLevel, values, skipMetadata, pageSize, pagingState, serialConsistency, defaultTimestamp);
273273 }
274274
275- public void encode(ByteBuf dest, ProtocolVersion version) {
275+ void encode(ByteBuf dest, ProtocolVersion version) {
276276 switch (version) {
277277 case V1:
278278 if (flags.contains(QueryFlag.VALUES))
@@ -300,7 +300,7 @@
300300 }
301301 }
302302
303- public int encodedSize(ProtocolVersion version) {
303+ int encodedSize(ProtocolVersion version) {
304304 switch (version) {
305305 case V1:
306306 return CBUtil.sizeOfValueList(values)
@@ -333,9 +333,9 @@
333333 }
334334 }
335335
336- public static class Batch extends Message.Request {
336+ static class Batch extends Message.Request {
337337
338- public static final Message.Coder<Batch> coder = new Message.Coder<Batch>() {
338+ static final Message.Coder<Batch> coder = new Message.Coder<Batch>() {
339339 public void encode(Batch msg, ByteBuf dest, ProtocolVersion version) {
340340 int queries = msg.queryOrIdList.size();
341341 assert queries <= 0xFFFF;
@@ -385,12 +385,12 @@
385385 }
386386 };
387387
388- public final BatchStatement.Type type;
389- public final List<Object> queryOrIdList;
390- public final List<List<ByteBuffer>> values;
391- public final BatchProtocolOptions options;
388+ final BatchStatement.Type type;
389+ final List<Object> queryOrIdList;
390+ final List<List<ByteBuffer>> values;
391+ final BatchProtocolOptions options;
392392
393- public Batch(BatchStatement.Type type, List<Object> queryOrIdList, List<List<ByteBuffer>> values, BatchProtocolOptions options, boolean tracingRequested) {
393+ Batch(BatchStatement.Type type, List<Object> queryOrIdList, List<List<ByteBuffer>> values, BatchProtocolOptions options, boolean tracingRequested) {
394394 super(Message.Request.Type.BATCH, tracingRequested);
395395 this.type = type;
396396 this.queryOrIdList = queryOrIdList;
@@ -421,13 +421,13 @@
421421 }
422422 }
423423
424- public static class BatchProtocolOptions {
424+ static class BatchProtocolOptions {
425425 private final EnumSet<QueryFlag> flags = EnumSet.noneOf(QueryFlag.class);
426- public final ConsistencyLevel consistency;
427- public final ConsistencyLevel serialConsistency;
428- public final long defaultTimestamp;
429-
430- public BatchProtocolOptions(ConsistencyLevel consistency, ConsistencyLevel serialConsistency, long defaultTimestamp) {
426+ final ConsistencyLevel consistency;
427+ final ConsistencyLevel serialConsistency;
428+ final long defaultTimestamp;
429+
430+ BatchProtocolOptions(ConsistencyLevel consistency, ConsistencyLevel serialConsistency, long defaultTimestamp) {
431431 this.consistency = consistency;
432432 this.serialConsistency = serialConsistency;
433433 this.defaultTimestamp = defaultTimestamp;
@@ -442,7 +442,7 @@
442442 return new BatchProtocolOptions(newConsistencyLevel, serialConsistency, defaultTimestamp);
443443 }
444444
445- public void encode(ByteBuf dest, ProtocolVersion version) {
445+ void encode(ByteBuf dest, ProtocolVersion version) {
446446 switch (version) {
447447 case V2:
448448 CBUtil.writeConsistencyLevel(consistency, dest);
@@ -461,7 +461,7 @@
461461 }
462462 }
463463
464- public int encodedSize(ProtocolVersion version) {
464+ int encodedSize(ProtocolVersion version) {
465465 switch (version) {
466466 case V2:
467467 return CBUtil.sizeOfConsistencyLevel(consistency);
@@ -487,9 +487,9 @@
487487 }
488488 }
489489
490- public static class Prepare extends Message.Request {
490+ static class Prepare extends Message.Request {
491491
492- public static final Message.Coder<Prepare> coder = new Message.Coder<Prepare>() {
492+ static final Message.Coder<Prepare> coder = new Message.Coder<Prepare>() {
493493
494494 public void encode(Prepare msg, ByteBuf dest, ProtocolVersion version) {
495495 CBUtil.writeLongString(msg.query, dest);
@@ -502,7 +502,7 @@
502502
503503 private final String query;
504504
505- public Prepare(String query) {
505+ Prepare(String query) {
506506 super(Message.Request.Type.PREPARE);
507507 this.query = query;
508508 }
@@ -513,9 +513,9 @@
513513 }
514514 }
515515
516- public static class Register extends Message.Request {
516+ static class Register extends Message.Request {
517517
518- public static final Message.Coder<Register> coder = new Message.Coder<Register>() {
518+ static final Message.Coder<Register> coder = new Message.Coder<Register>() {
519519 public void encode(Register msg, ByteBuf dest, ProtocolVersion version) {
520520 dest.writeShort(msg.eventTypes.size());
521521 for (ProtocolEvent.Type type : msg.eventTypes)
@@ -532,7 +532,7 @@
532532
533533 private final List<ProtocolEvent.Type> eventTypes;
534534
535- public Register(List<ProtocolEvent.Type> eventTypes) {
535+ Register(List<ProtocolEvent.Type> eventTypes) {
536536 super(Message.Request.Type.REGISTER);
537537 this.eventTypes = eventTypes;
538538 }
@@ -543,9 +543,9 @@
543543 }
544544 }
545545
546- public static class AuthResponse extends Message.Request {
546+ static class AuthResponse extends Message.Request {
547547
548- public static final Message.Coder<AuthResponse> coder = new Message.Coder<AuthResponse>() {
548+ static final Message.Coder<AuthResponse> coder = new Message.Coder<AuthResponse>() {
549549
550550 public void encode(AuthResponse response, ByteBuf dest, ProtocolVersion version) {
551551 CBUtil.writeValue(response.token, dest);
@@ -558,7 +558,7 @@
558558
559559 private final byte[] token;
560560
561- public AuthResponse(byte[] token) {
561+ AuthResponse(byte[] token) {
562562 super(Message.Request.Type.AUTH_RESPONSE);
563563 this.token = token;
564564 }
modified driver-core/src/main/java/com/datastax/driver/core/Responses.java +68 −68
@@ -32,9 +32,9 @@
3232 private Responses() {
3333 }
3434
35- public static class Error extends Message.Response {
35+ static class Error extends Message.Response {
3636
37- public static final Message.Decoder<Error> decoder = new Message.Decoder<Error>() {
37+ static final Message.Decoder<Error> decoder = new Message.Decoder<Error>() {
3838 @Override
3939 public Error decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
4040 ExceptionCode code = ExceptionCode.fromValue(body.readInt());
@@ -89,10 +89,10 @@
8989 }
9090 };
9191
92- public final ProtocolVersion serverProtocolVersion;
93- public final ExceptionCode code;
94- public final String message;
95- public final Object infos; // can be null
92+ final ProtocolVersion serverProtocolVersion;
93+ final ExceptionCode code;
94+ final String message;
95+ final Object infos; // can be null
9696
9797 private Error(ProtocolVersion serverProtocolVersion, ExceptionCode code, String message, Object infos) {
9898 super(Message.Response.Type.ERROR);
@@ -102,7 +102,7 @@
102102 this.infos = infos;
103103 }
104104
105- public DriverException asException(InetSocketAddress host) {
105+ DriverException asException(InetSocketAddress host) {
106106 switch (code) {
107107 case SERVER_ERROR:
108108 return new ServerError(host, message);
@@ -151,9 +151,9 @@
151151 }
152152 }
153153
154- public static class Ready extends Message.Response {
154+ static class Ready extends Message.Response {
155155
156- public static final Message.Decoder<Ready> decoder = new Message.Decoder<Ready>() {
156+ static final Message.Decoder<Ready> decoder = new Message.Decoder<Ready>() {
157157 public Ready decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
158158 // TODO: Would it be cool to return a singleton? Check we don't need to
159159 // set the streamId or something
@@ -161,7 +161,7 @@
161161 }
162162 };
163163
164- public Ready() {
164+ Ready() {
165165 super(Message.Response.Type.READY);
166166 }
167167
@@ -171,18 +171,18 @@
171171 }
172172 }
173173
174- public static class Authenticate extends Message.Response {
174+ static class Authenticate extends Message.Response {
175175
176- public static final Message.Decoder<Authenticate> decoder = new Message.Decoder<Authenticate>() {
176+ static final Message.Decoder<Authenticate> decoder = new Message.Decoder<Authenticate>() {
177177 public Authenticate decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
178178 String authenticator = CBUtil.readString(body);
179179 return new Authenticate(authenticator);
180180 }
181181 };
182182
183- public final String authenticator;
183+ final String authenticator;
184184
185- public Authenticate(String authenticator) {
185+ Authenticate(String authenticator) {
186186 super(Message.Response.Type.AUTHENTICATE);
187187 this.authenticator = authenticator;
188188 }
@@ -193,18 +193,18 @@
193193 }
194194 }
195195
196- public static class Supported extends Message.Response {
196+ static class Supported extends Message.Response {
197197
198- public static final Message.Decoder<Supported> decoder = new Message.Decoder<Supported>() {
198+ static final Message.Decoder<Supported> decoder = new Message.Decoder<Supported>() {
199199 public Supported decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
200200 return new Supported(CBUtil.readStringToStringListMap(body));
201201 }
202202 };
203203
204- public final Map<String, List<String>> supported;
205- public final Set<ProtocolOptions.Compression> supportedCompressions = EnumSet.noneOf(ProtocolOptions.Compression.class);
204+ final Map<String, List<String>> supported;
205+ final Set<ProtocolOptions.Compression> supportedCompressions = EnumSet.noneOf(ProtocolOptions.Compression.class);
206206
207- public Supported(Map<String, List<String>> supported) {
207+ Supported(Map<String, List<String>> supported) {
208208 super(Message.Response.Type.SUPPORTED);
209209 this.supported = supported;
210210
@@ -229,16 +229,16 @@
229229 }
230230 }
231231
232- public static abstract class Result extends Message.Response {
232+ static abstract class Result extends Message.Response {
233233
234- public static final Message.Decoder<Result> decoder = new Message.Decoder<Result>() {
234+ static final Message.Decoder<Result> decoder = new Message.Decoder<Result>() {
235235 public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
236236 Kind kind = Kind.fromId(body.readInt());
237237 return kind.subDecoder.decode(body, version, codecRegistry);
238238 }
239239 };
240240
241- public enum Kind {
241+ enum Kind {
242242 VOID(1, Void.subcodec),
243243 ROWS(2, Rows.subcodec),
244244 SET_KEYSPACE(3, SetKeyspace.subcodec),
@@ -262,12 +262,12 @@
262262 }
263263 }
264264
265- private Kind(int id, Message.Decoder<Result> subDecoder) {
265+ Kind(int id, Message.Decoder<Result> subDecoder) {
266266 this.id = id;
267267 this.subDecoder = subDecoder;
268268 }
269269
270- public static Kind fromId(int id) {
270+ static Kind fromId(int id) {
271271 Kind k = ids[id];
272272 if (k == null)
273273 throw new DriverInternalError(String.format("Unknown kind id %d in RESULT message", id));
@@ -275,21 +275,21 @@
275275 }
276276 }
277277
278- public final Kind kind;
278+ final Kind kind;
279279
280280 protected Result(Kind kind) {
281281 super(Message.Response.Type.RESULT);
282282 this.kind = kind;
283283 }
284284
285- public static class Void extends Result {
285+ static class Void extends Result {
286286 // Even though we have no specific information here, don't make a
287287 // singleton since as each message it has in fact a streamid and connection.
288- public Void() {
288+ Void() {
289289 super(Kind.VOID);
290290 }
291291
292- public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
292+ static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
293293 public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
294294 return new Void();
295295 }
@@ -301,15 +301,15 @@
301301 }
302302 }
303303
304- public static class SetKeyspace extends Result {
305- public final String keyspace;
304+ static class SetKeyspace extends Result {
305+ final String keyspace;
306306
307307 private SetKeyspace(String keyspace) {
308308 super(Kind.SET_KEYSPACE);
309309 this.keyspace = keyspace;
310310 }
311311
312- public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
312+ static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
313313 public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
314314 return new SetKeyspace(CBUtil.readString(body));
315315 }
@@ -321,17 +321,17 @@
321321 }
322322 }
323323
324- public static class Rows extends Result {
324+ static class Rows extends Result {
325325
326- public static class Metadata {
326+ static class Metadata {
327327
328- private static enum Flag {
328+ private enum Flag {
329329 // The order of that enum matters!!
330330 GLOBAL_TABLES_SPEC,
331331 HAS_MORE_PAGES,
332332 NO_METADATA;
333333
334- public static EnumSet<Flag> deserialize(int flags) {
334+ static EnumSet<Flag> deserialize(int flags) {
335335 EnumSet<Flag> set = EnumSet.noneOf(Flag.class);
336336 Flag[] values = Flag.values();
337337 for (int n = 0; n < values.length; n++) {
@@ -341,7 +341,7 @@
341341 return set;
342342 }
343343
344- public static int serialize(EnumSet<Flag> flags) {
344+ static int serialize(EnumSet<Flag> flags) {
345345 int i = 0;
346346 for (Flag flag : flags)
347347 i |= 1 << flag.ordinal();
@@ -351,10 +351,10 @@
351351
352352 static final Metadata EMPTY = new Metadata(0, null, null, null);
353353
354- public final int columnCount;
355- public final ColumnDefinitions columns; // Can be null if no metadata was asked by the query
356- public final ByteBuffer pagingState;
357- public final int[] pkIndices;
354+ final int columnCount;
355+ final ColumnDefinitions columns; // Can be null if no metadata was asked by the query
356+ final ByteBuffer pagingState;
357+ final int[] pkIndices;
358358
359359 private Metadata(int columnCount, ColumnDefinitions columns, ByteBuffer pagingState, int[] pkIndices) {
360360 this.columnCount = columnCount;
@@ -363,11 +363,11 @@
363363 this.pkIndices = pkIndices;
364364 }
365365
366- public static Metadata decode(ByteBuf body, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
366+ static Metadata decode(ByteBuf body, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
367367 return decode(body, false, protocolVersion, codecRegistry);
368368 }
369369
370- public static Metadata decode(ByteBuf body, boolean withPkIndices, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
370+ static Metadata decode(ByteBuf body, boolean withPkIndices, ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
371371
372372 // flags & column count
373373 EnumSet<Flag> flags = Flag.deserialize(body.readInt());
@@ -428,7 +428,7 @@
428428 }
429429 }
430430
431- public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
431+ static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
432432 public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
433433
434434 Metadata metadata = Metadata.decode(body, version, codecRegistry);
@@ -448,8 +448,8 @@
448448 }
449449 };
450450
451- public final Metadata metadata;
452- public final Queue<List<ByteBuffer>> data;
451+ final Metadata metadata;
452+ final Queue<List<ByteBuffer>> data;
453453 private final ProtocolVersion version;
454454
455455 private Rows(Metadata metadata, Queue<List<ByteBuffer>> data, ProtocolVersion version) {
@@ -492,9 +492,9 @@
492492 }
493493 }
494494
495- public static class Prepared extends Result {
495+ static class Prepared extends Result {
496496
497- public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
497+ static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
498498 public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
499499 MD5Digest id = MD5Digest.wrap(CBUtil.readBytes(body));
500500 boolean withPkIndices = version.compareTo(V4) >= 0;
@@ -517,9 +517,9 @@
517517 }
518518 };
519519
520- public final MD5Digest statementId;
521- public final Rows.Metadata metadata;
522- public final Rows.Metadata resultMetadata;
520+ final MD5Digest statementId;
521+ final Rows.Metadata metadata;
522+ final Rows.Metadata resultMetadata;
523523
524524 private Prepared(MD5Digest statementId, Rows.Metadata metadata, Rows.Metadata resultMetadata) {
525525 super(Kind.PREPARED);
@@ -534,17 +534,17 @@
534534 }
535535 }
536536
537- public static class SchemaChange extends Result {
537+ static class SchemaChange extends Result {
538538
539- public enum Change {CREATED, UPDATED, DROPPED}
539+ enum Change {CREATED, UPDATED, DROPPED}
540540
541- public final Change change;
542- public final SchemaElement targetType;
543- public final String targetKeyspace;
544- public final String targetName;
545- public final List<String> targetSignature;
541+ final Change change;
542+ final SchemaElement targetType;
543+ final String targetKeyspace;
544+ final String targetName;
545+ final List<String> targetSignature;
546546
547- public static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
547+ static final Message.Decoder<Result> subcodec = new Message.Decoder<Result>() {
548548 public Result decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
549549 // Note: the CREATE KEYSPACE/TABLE/TYPE SCHEMA_CHANGE response is different from the SCHEMA_CHANGE EVENT type
550550 Change change;
@@ -592,17 +592,17 @@
592592 }
593593 }
594594
595- public static class Event extends Message.Response {
595+ static class Event extends Message.Response {
596596
597- public static final Message.Decoder<Event> decoder = new Message.Decoder<Event>() {
597+ static final Message.Decoder<Event> decoder = new Message.Decoder<Event>() {
598598 public Event decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
599599 return new Event(ProtocolEvent.deserialize(body, version));
600600 }
601601 };
602602
603- public final ProtocolEvent event;
603+ final ProtocolEvent event;
604604
605- public Event(ProtocolEvent event) {
605+ Event(ProtocolEvent event) {
606606 super(Message.Response.Type.EVENT);
607607 this.event = event;
608608 }
@@ -613,9 +613,9 @@
613613 }
614614 }
615615
616- public static class AuthChallenge extends Message.Response {
616+ static class AuthChallenge extends Message.Response {
617617
618- public static final Message.Decoder<AuthChallenge> decoder = new Message.Decoder<AuthChallenge>() {
618+ static final Message.Decoder<AuthChallenge> decoder = new Message.Decoder<AuthChallenge>() {
619619 public AuthChallenge decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
620620 ByteBuffer b = CBUtil.readValue(body);
621621 if (b == null)
@@ -627,7 +627,7 @@
627627 }
628628 };
629629
630- public final byte[] token;
630+ final byte[] token;
631631
632632 private AuthChallenge(byte[] token) {
633633 super(Message.Response.Type.AUTH_CHALLENGE);
@@ -635,9 +635,9 @@
635635 }
636636 }
637637
638- public static class AuthSuccess extends Message.Response {
638+ static class AuthSuccess extends Message.Response {
639639
640- public static final Message.Decoder<AuthSuccess> decoder = new Message.Decoder<AuthSuccess>() {
640+ static final Message.Decoder<AuthSuccess> decoder = new Message.Decoder<AuthSuccess>() {
641641 public AuthSuccess decode(ByteBuf body, ProtocolVersion version, CodecRegistry codecRegistry) {
642642 ByteBuffer b = CBUtil.readValue(body);
643643 if (b == null)
@@ -649,7 +649,7 @@
649649 }
650650 };
651651
652- public final byte[] token;
652+ final byte[] token;
653653
654654 private AuthSuccess(byte[] token) {
655655 super(Message.Response.Type.AUTH_SUCCESS);
modified pom.xml +0 −9
@@ -233,15 +233,6 @@
233233 <configuration>
234234 <comparisonVersion>3.0.0</comparisonVersion>
235235 <ignoredDifferencesFile>../clirr-ignores.xml</ignoredDifferencesFile>
236- <excludes>
237- <!-- Package-private, internal classes -->
238- <exclude>com/datastax/driver/core/Frame$*</exclude>
239- <exclude>com/datastax/driver/core/ProtocolEvent$*</exclude>
240- <exclude>com/datastax/driver/core/Message$*</exclude>
241- <exclude>com/datastax/driver/core/Requests$*</exclude>
242- <exclude>com/datastax/driver/core/Responses$*</exclude>
243- <exclude>com/datastax/driver/core/Connection$*</exclude>
244- </excludes>
245236 </configuration>
246237 <!--
247238 Workaround to make clirr plugin work with Java 8.