Skip to content

Commit ce5b82c

Browse files
author
Alexandre Dutra
committed
Fix various javac and javadoc warnings
1 parent a3a19df commit ce5b82c

20 files changed

Lines changed: 127 additions & 83 deletions

File tree

driver-core/src/main/java/com/datastax/driver/core/Connection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,7 @@ public ConnectionCloseFuture force() {
12111211

12121212
ChannelFuture future = channel.close();
12131213
future.addListener(new ChannelFutureListener() {
1214+
@Override
12141215
public void operationComplete(ChannelFuture future) {
12151216
factory.allChannels.remove(channel);
12161217
if (future.cause() != null) {
@@ -1421,7 +1422,7 @@ protected void initChannel(SocketChannel channel) throws Exception {
14211422
pipeline.addLast("ssl", sslOptions.newSSLHandler(channel));
14221423
}
14231424

1424-
// pipeline.addLast("debug", new LoggingHandler(LogLevel.INFO));
1425+
// pipeline.addLast("debug", new LoggingHandler(LogLevel.INFO));
14251426

14261427
pipeline.addLast("frameDecoder", new Frame.Decoder());
14271428
pipeline.addLast("frameEncoder", frameEncoder);

driver-core/src/main/java/com/datastax/driver/core/DataType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public String asFunctionParameterString() {
709709
* The driver provides a minimal support for such types through
710710
* instances of this class.
711711
* <p/>
712-
* A codec for custom types can be obtained via {@link TypeCodec#custom(CustomType)}.
712+
* A codec for custom types can be obtained via {@link TypeCodec#custom(DataType.CustomType)}.
713713
*/
714714
public static class CustomType extends DataType {
715715

driver-core/src/main/java/com/datastax/driver/core/TypeCodec.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@
9090
* the wrapper Java class instead, and implement the appropriate interface
9191
* (e.g. {@link com.datastax.driver.core.TypeCodec.PrimitiveBooleanCodec} for primitive {@code boolean} types;
9292
* there is one such interface for each Java primitive type).</li>
93-
* <li>TypeCodec implementations should not consume {@link ByteBuffer} instances by performing read operations
94-
* that modify their current position; if necessary, codecs should {@link ByteBuffer#duplicate()} duplicate} them.</li>
93+
* <li>When deserializing, TypeCodec implementations should not consume {@link ByteBuffer} instances
94+
* by performing relative read operations that modify their current position;
95+
* codecs should instead prefer absolute read methods, or, if necessary, they should
96+
* {@link ByteBuffer#duplicate() duplicate} their byte buffers prior to reading them.</li>
9597
* </ol>
9698
*
9799
* @param <T> The codec's Java type

driver-core/src/main/java/com/datastax/driver/core/policies/FallthroughRetryPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/**
2525
* A retry policy that never retries (nor ignores).
2626
* <p/>
27-
* All of the methods of this retry policy unconditionally return {@link RetryDecision#rethrow()}.
27+
* All of the methods of this retry policy unconditionally return {@link RetryPolicy.RetryDecision#rethrow()}.
2828
* If this policy is used, retry logic will have to be implemented in business code.
2929
*/
3030
public class FallthroughRetryPolicy implements RetryPolicy {

driver-core/src/main/java/com/datastax/driver/core/utils/UUIDs.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ public final class UUIDs {
3535
private UUIDs() {
3636
}
3737

38-
;
39-
4038
// http://www.ietf.org/rfc/rfc4122.txt
4139
private static final long START_EPOCH = makeEpoch();
4240
private static final long CLOCK_SEQ_AND_NODE = makeClockSeqAndNode();

driver-core/src/test/java/com/datastax/driver/core/ClusterInitTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import static com.datastax.driver.core.TestUtils.ipOfNode;
4545
import static com.datastax.driver.core.TestUtils.nonQuietClusterCloseOptions;
4646
import static org.mockito.Mockito.*;
47+
import static org.scassandra.http.client.PrimingRequest.then;
4748

4849
public class ClusterInitTest {
4950
private static final Logger logger = LoggerFactory.getLogger(ClusterInitTest.class);
@@ -278,8 +279,7 @@ private void primePeerRows(Scassandra scassandra, List<FakeHost> otherHosts) thr
278279
primingClient.prime(
279280
PrimingRequest.queryBuilder()
280281
.withQuery("SELECT * FROM system.peers")
281-
.withColumnTypes(ScassandraCluster.SELECT_PEERS)
282-
.withRows(rows)
282+
.withThen(then().withRows(rows).withColumnTypes(ScassandraCluster.SELECT_PEERS))
283283
.build());
284284
}
285285
}

driver-core/src/test/java/com/datastax/driver/core/ConnectionReleaseTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.concurrent.TimeoutException;
2929

3030
import static org.assertj.core.api.Assertions.assertThat;
31+
import static org.scassandra.http.client.PrimingRequest.then;
3132
import static org.testng.Assert.fail;
3233

3334
public class ConnectionReleaseTest extends ScassandraTestBase {
@@ -66,20 +67,20 @@ public void should_release_connection_before_completing_future() throws Exceptio
6667
primingClient.prime(
6768
PrimingRequest.queryBuilder()
6869
.withQuery("mock query")
69-
.withRows(ImmutableMap.of("key", 1))
70-
.withFixedDelay(10000)
70+
.withThen(then().withRows(ImmutableMap.of("key", 1))
71+
.withFixedDelay(10000L))
7172
.build()
7273
);
7374
primingClient.prime(
7475
PrimingRequest.queryBuilder()
7576
.withQuery("select c from test1 where k=1")
76-
.withRows(ImmutableMap.of("c", "hello"))
77+
.withThen(then().withRows(ImmutableMap.of("c", "hello")))
7778
.build()
7879
);
7980
primingClient.prime(
8081
PrimingRequest.queryBuilder()
8182
.withQuery("select n from test2 where c='hello'")
82-
.withRows(ImmutableMap.of("n", "world"))
83+
.withThen(then().withRows(ImmutableMap.of("n", "world")))
8384
.build()
8485
);
8586

driver-core/src/test/java/com/datastax/driver/core/HostAssert.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public void onAdd(Host host) {
123123
public HostAssert goesDownWithin(long duration, TimeUnit unit) {
124124
final CountDownLatch downSignal = new CountDownLatch(1);
125125
StateListener upListener = new StateListenerBase() {
126+
@Override
126127
public void onDown(Host host) {
127128
downSignal.countDown();
128129
}
@@ -141,31 +142,37 @@ public void onDown(Host host) {
141142
return this;
142143
}
143144

145+
@SuppressWarnings("deprecation")
144146
public HostAssert hasWorkload(String workload) {
145147
assertThat(actual.getDseWorkload()).isNotNull().isEqualTo(workload);
146148
return this;
147149
}
148150

151+
@SuppressWarnings("deprecation")
149152
public HostAssert hasNoWorkload() {
150153
assertThat(actual.getDseWorkload()).isNull();
151154
return this;
152155
}
153156

157+
@SuppressWarnings("deprecation")
154158
public HostAssert hasDseVersion(VersionNumber versionNumber) {
155159
assertThat(actual.getDseVersion()).isNotNull().isEqualTo(versionNumber);
156160
return this;
157161
}
158162

163+
@SuppressWarnings("deprecation")
159164
public HostAssert hasNoDseVersion() {
160165
assertThat(actual.getDseVersion()).isNull();
161166
return this;
162167
}
163168

169+
@SuppressWarnings("deprecation")
164170
public HostAssert hasDseGraph() {
165171
assertThat(actual.isDseGraphEnabled()).isTrue();
166172
return this;
167173
}
168174

175+
@SuppressWarnings("deprecation")
169176
public HostAssert hasNoDseGraph() {
170177
assertThat(actual.isDseGraphEnabled()).isFalse();
171178
return this;

driver-core/src/test/java/com/datastax/driver/core/RequestHandlerTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@
2020
import org.scassandra.http.client.PrimingRequest;
2121
import org.testng.annotations.Test;
2222

23+
import java.util.Collections;
24+
import java.util.List;
25+
import java.util.Map;
2326
import java.util.concurrent.TimeUnit;
2427
import java.util.concurrent.TimeoutException;
2528

2629
import static org.assertj.core.api.Assertions.assertThat;
30+
import static org.scassandra.http.client.PrimingRequest.then;
2731

2832
public class RequestHandlerTest {
2933

@@ -35,11 +39,11 @@ public void should_handle_race_between_response_and_cancellation() {
3539
try {
3640
// Use a mock server that takes a constant time to reply
3741
scassandra.start();
42+
List<Map<String, ?>> rows = Collections.<Map<String, ?>>singletonList(ImmutableMap.of("key", 1));
3843
scassandra.primingClient().prime(
3944
PrimingRequest.queryBuilder()
4045
.withQuery("mock query")
41-
.withRows(ImmutableMap.of("key", 1))
42-
.withFixedDelay(10)
46+
.withThen(then().withRows(rows).withFixedDelay(10L))
4347
.build()
4448
);
4549

driver-core/src/test/java/com/datastax/driver/core/ScassandraCluster.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import java.net.InetAddress;
2929
import java.net.InetSocketAddress;
30+
import java.util.Collections;
3031
import java.util.List;
3132
import java.util.Map;
3233
import java.util.TreeSet;
@@ -364,7 +365,7 @@ private void primeMetadata(Scassandra node) {
364365
.withQuery(query)
365366
.withThen(then()
366367
.withColumnTypes(metadata)
367-
.withRows(row)
368+
.withRows(Collections.<Map<String, ?>>singletonList(row))
368369
.build())
369370
.build());
370371
}
@@ -386,7 +387,7 @@ private void primeMetadata(Scassandra node) {
386387
.withQuery("select cluster_name from system.local")
387388
.withThen(then()
388389
.withColumnTypes(SELECT_CLUSTER_NAME)
389-
.withRows(clusterNameRow)
390+
.withRows(Collections.<Map<String, ?>>singletonList(clusterNameRow))
390391
.build())
391392
.build());
392393

0 commit comments

Comments
 (0)