Skip to content

Commit 64d2af3

Browse files
committed
JCBC-1266: Allow to compile against Java 11
Motivation ---------- To make progress with newer java versions, we need to make sure the client builds and runs fine against those. A couple changes were required to do so. Modifications ------------- Like with core-io, the major trouble was javadoc. We had to get rid of the pegdown doclet plugin and then javadoc started to throw a tantrum on certain javadocs, even with doclint off. This changeset removes all those warnings and allows for a green build process. Result ------ the java client now compiles against java 11 Change-Id: I8b2b1e4a31d1fbb841cdbb123599d1cbd98b8fc5 Reviewed-on: http://review.couchbase.org/101587 Tested-by: Build Bot <[email protected]> Reviewed-by: Subhashni Balakrishnan <[email protected]> Reviewed-by: David Nault <[email protected]>
1 parent 67cd46d commit 64d2af3

19 files changed

+100
-101
lines changed

docs/teaser.html

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
<h2>Welcome to the Couchbase Java SDK API Reference!</h2>
1+
<body>
2+
<h2>Welcome to the Couchbase Java SDK API Reference!</h2>
23

3-
<p><b>Here is a simple hello world that you can run and verify your installation works:</b></p>
4+
<p><b>Here is a simple hello world that you can run and verify your installation works:</b></p>
45

5-
<pre>
6-
// Connect to a cluster on localhost
7-
Cluster cluster = CouchbaseCluster.create();
8-
cluster.authenticate("username", "password");
6+
<pre>
7+
// Connect to a cluster on localhost
8+
Cluster cluster = CouchbaseCluster.create();
9+
cluster.authenticate("username", "password");
910

10-
// Open the default bucket
11-
Bucket bucket = cluster.openBucket("myTestBucket");
11+
// Open the default bucket
12+
Bucket bucket = cluster.openBucket("myTestBucket");
1213

13-
// Create a user and insert it
14-
JsonObject user = JsonObject.empty()
15-
.put("firstname", "Walter")
16-
.put("lastname", "White")
17-
.put("job", "chemistry teacher")
18-
.put("age", 50);
19-
JsonDocument doc = JsonDocument.create("walter", user);
20-
JsonDocument response = bucket.upsert(doc);
14+
// Create a user and insert it
15+
JsonObject user = JsonObject.empty()
16+
.put("firstname", "Walter")
17+
.put("lastname", "White")
18+
.put("job", "chemistry teacher")
19+
.put("age", 50);
20+
JsonDocument doc = JsonDocument.create("walter", user);
21+
JsonDocument response = bucket.upsert(doc);
2122

22-
// Read it back out
23-
JsonDocument walter = bucket.get("walter");
24-
System.out.println("Found: " + walter);
23+
// Read it back out
24+
JsonDocument walter = bucket.get("walter");
25+
System.out.println("Found: " + walter);
2526

26-
// Disconnect from the cluster
27-
cluster.disconnect();
28-
</pre>
27+
// Disconnect from the cluster
28+
cluster.disconnect();
29+
</pre>
2930

30-
<p style="border: 5px solid orange; padding: 4px;font-size: 12pt;">
31-
If you don't know where to go next, <b>start <a href="com/couchbase/client/java/CouchbaseCluster.html">at the CouchbaseCluster class</a></b>!
32-
</p>
31+
<p style="border: 5px solid orange; padding: 4px;font-size: 12pt;">
32+
If you don't know where to go next, <b>start <a href="com/couchbase/client/java/CouchbaseCluster.html">at the CouchbaseCluster class</a></b>!
33+
</p>
34+
</body>

pom.xml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,16 @@
226226
<plugin>
227227
<groupId>org.apache.maven.plugins</groupId>
228228
<artifactId>maven-javadoc-plugin</artifactId>
229-
<version>2.10.3</version>
229+
<version>3.0.1</version>
230230
<executions>
231231
<execution>
232232
<id>attach-javadocs</id>
233233
<goals>
234234
<goal>jar</goal>
235235
</goals>
236+
<configuration>
237+
<doclint>none</doclint>
238+
</configuration>
236239
</execution>
237240
</executions>
238241
<configuration>
@@ -247,12 +250,6 @@
247250
<location>${core.apidocs}/</location>
248251
</offlineLink>
249252
</offlineLinks>
250-
<doclet>ch.raffael.doclets.pegdown.PegdownDoclet</doclet>
251-
<docletArtifact>
252-
<groupId>ch.raffael.pegdown-doclet</groupId>
253-
<artifactId>pegdown-doclet</artifactId>
254-
<version>1.1</version>
255-
</docletArtifact>
256253
<useStandardDocletOptions>true</useStandardDocletOptions>
257254
<windowtitle>Couchbase Java SDK</windowtitle>
258255
<doctitle>Couchbase Java SDK (${project.version})</doctitle>

src/main/java/com/couchbase/client/java/bucket/AsyncBucketManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ Observable<Boolean> createN1qlIndex(final String indexName, List<Object> fields,
356356
final boolean ignoreIfExist, boolean defer);
357357

358358
/**
359-
* Drop the default primary index ({@value Index#PRIMARY_NAME}) associated with the current bucket.
359+
* Drop the default primary index ({@link Index#PRIMARY_NAME}) associated with the current bucket.
360360
*
361361
* The index management API only deals with GSI type of indexes, which allows it to uniquely identify indexes
362362
* by name.
@@ -423,7 +423,7 @@ Observable<Boolean> createN1qlIndex(final String indexName, List<Object> fields,
423423
* "online" or the watchTimeout has expired.. This only considers GSI indexes, as the index management API only
424424
* deals with this type of indexes.
425425
*
426-
* Note: You can activate DEBUG level logs on the "{@value DefaultAsyncBucketManager#INDEX_WATCH_LOG_NAME}" logger
426+
* Note: You can activate DEBUG level logs on the "{@link DefaultAsyncBucketManager#INDEX_WATCH_LOG_NAME}" logger
427427
* to see various stages of the polling.
428428
*
429429
* You can also watch a primary index by using the {@link Index#PRIMARY_NAME} constant.

src/main/java/com/couchbase/client/java/bucket/BucketManager.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ boolean createN1qlIndex(String indexName, List<Object> fields, Expression whereC
693693
boolean defer, long timeout, TimeUnit timeUnit);
694694

695695
/**
696-
* Drop the default primary index ({@value Index#PRIMARY_NAME}) associated with the current bucket, within the default management timeout.
696+
* Drop the default primary index ({@link Index#PRIMARY_NAME}) associated with the current bucket, within the default management timeout.
697697
*
698698
* The index management API only deals with GSI type of indexes, which allows it to uniquely identify indexes
699699
* by name.
@@ -706,7 +706,7 @@ boolean createN1qlIndex(String indexName, List<Object> fields, Expression whereC
706706
boolean dropN1qlPrimaryIndex(boolean ignoreIfNotExist);
707707

708708
/**
709-
* Drop the default primary index ({@value Index#PRIMARY_NAME}) associated with the current bucket, within a custom timeout.
709+
* Drop the default primary index ({@link Index#PRIMARY_NAME}) associated with the current bucket, within a custom timeout.
710710
*
711711
* The index management API only deals with GSI type of indexes, which allows it to uniquely identify indexes
712712
* by name.
@@ -811,7 +811,7 @@ boolean createN1qlIndex(String indexName, List<Object> fields, Expression whereC
811811
* "online" or the watchTimeout has expired. This only considers GSI indexes, as the index management API only
812812
* deals with this type of indexes.
813813
*
814-
* Note: You can activate DEBUG level logs on the "{@value DefaultAsyncBucketManager#INDEX_WATCH_LOG_NAME}" logger
814+
* Note: You can activate DEBUG level logs on the "{@link DefaultAsyncBucketManager#INDEX_WATCH_LOG_NAME}" logger
815815
* to see various stages of the polling.
816816
*
817817
* You can also watch a primary index by using the {@link Index#PRIMARY_NAME} constant.

src/main/java/com/couchbase/client/java/cluster/api/AbstractClusterApiClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public T delete(String... paths) {
114114
/**
115115
* Create the concrete {@link RestBuilderMarker builders} returned by concrete implementations.
116116
* Builders will be either capable of synchronous or asynchronous execution, depending on
117-
* type {@link T}.
117+
* type T.
118118
*/
119119
protected abstract T createBuilder(HttpMethod method, String fullPath);
120120

@@ -125,7 +125,7 @@ public T delete(String... paths) {
125125
* - if an element is null, it is ignored.
126126
*
127127
* @param paths the elements of the path.
128-
* @returns the full path.
128+
* @return returns the full path.
129129
*/
130130
public static String buildPath(String... paths) {
131131
if (paths == null || paths.length == 0) {

src/main/java/com/couchbase/client/java/cluster/api/AsyncRestBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ public AsyncRestBuilder withParam(String key, String value) {
9797
* Adds an HTTP header to the request. Using a key twice will result
9898
* in the last value being used for a given header.
9999
*
100-
* @param key the header name (see {@link HttpHeaders.Names} for standard names).
101-
* @param value the header value (see {@link HttpHeaders.Values} for standard values).
100+
* @param key the header name (see "HttpHeaders.Names" for standard names).
101+
* @param value the header value (see "HttpHeaders.Values" for standard values).
102102
*/
103103
public AsyncRestBuilder withHeader(String key, Object value) {
104104
this.headers.put(key, value);

src/main/java/com/couchbase/client/java/cluster/api/RestBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ public RestBuilder contentType(String type) {
8383
/**
8484
* Adds an HTTP header to the request. Using a key twice will result
8585
* in the last value being used for a given header.
86-
* @param key the header name (see {@link HttpHeaders.Names} for standard names).
87-
* @param value the header value (see {@link HttpHeaders.Values} for standard values).
86+
*
87+
* @param key the header name (see HttpHeaders.Names for standard names).
88+
* @param value the header value (see HttpHeaders.Values for standard values).
8889
*/
8990
public RestBuilder withHeader(String key, Object value) {
9091
delegate.withHeader(key, value);

src/main/java/com/couchbase/client/java/document/Document.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public interface Document<T> {
6363
* the environment.
6464
*
6565
* Note that the mutation token is always null, unless they are explicitly enabled on the
66-
* environment, the server version is supported (>= 4.0.0) and the mutation operation succeeded.
66+
* environment, the server version is supported (&gt;= 4.0.0) and the mutation operation succeeded.
6767
*
6868
* If set, it can be used for enhanced durability requirements, as well as optimized consistency
6969
* for N1QL queries.

src/main/java/com/couchbase/client/java/query/N1qlParams.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ public void injectParams(JsonObject queryJson) {
160160

161161
/**
162162
* Helper method to convert a duration into the n1ql (golang) format.
163-
* @return
164163
*/
165164
public static String durationToN1qlFormat(long duration, TimeUnit unit) {
166165
switch (unit) {

src/main/java/com/couchbase/client/java/query/ParameterizedN1qlQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import com.couchbase.client.java.document.json.JsonValue;
2121

2222
/**
23-
* Represent a N1QL {@link} with an optionally parameterized statement (in which case the
23+
* Represent a N1QL query with an optionally parameterized statement (in which case the
2424
* values must be passed according to the type and number of placeholders).
2525
*
2626
* Positional placeholders (in the form of either "$1" "$2" or just simple "?") are filled

src/main/java/com/couchbase/client/java/query/core/N1qlQueryExecutor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public class N1qlQueryExecutor {
109109

110110
/**
111111
* Construct a new N1qlQueryExecutor that will send requests through the given {@link ClusterFacade}. For queries that
112-
* are not ad-hoc, it will cache up to {@value #QUERY_CACHE_SIZE} queries.
112+
* are not ad-hoc, it will cache up to {@link #QUERY_CACHE_SIZE} queries.
113113
*
114114
* @param core the core through which to send requests.
115115
* @param bucket the bucket to bootstrap from.
@@ -122,7 +122,7 @@ public N1qlQueryExecutor(ClusterFacade core, String bucket, String username, Str
122122

123123
/**
124124
* Construct a new N1qlQueryExecutor that will send requests through the given {@link ClusterFacade}. For queries that
125-
* are not ad-hoc, it will cache up to {@value #QUERY_CACHE_SIZE} queries.
125+
* are not ad-hoc, it will cache up to {@link #QUERY_CACHE_SIZE} queries.
126126
*
127127
* @param core the core through which to send requests.
128128
* @param bucket the bucket to bootstrap from.
@@ -134,7 +134,7 @@ public N1qlQueryExecutor(ClusterFacade core, String bucket, String password) {
134134

135135
/**
136136
* Construct a new N1qlQueryExecutor that will send requests through the given {@link ClusterFacade}. For queries that
137-
* are not ad-hoc, it will cache up to {@value #QUERY_CACHE_SIZE} queries.
137+
* are not ad-hoc, it will cache up to {@link #QUERY_CACHE_SIZE} queries.
138138
*
139139
* @param core the core through which to send requests.
140140
* @param bucket the bucket to bootstrap from.
@@ -147,7 +147,7 @@ public N1qlQueryExecutor(ClusterFacade core, String bucket, String password, boo
147147

148148
/**
149149
* Construct a new N1qlQueryExecutor that will send requests through the given {@link ClusterFacade}. For queries that
150-
* are not ad-hoc, it will cache up to {@value #QUERY_CACHE_SIZE} queries.
150+
* are not ad-hoc, it will cache up to {@link #QUERY_CACHE_SIZE} queries.
151151
*
152152
* @param core the core through which to send requests.
153153
* @param bucket the bucket to bootstrap from.

0 commit comments

Comments
 (0)