Skip to content

Commit a25c392

Browse files
authored
Merge pull request #49 from rethinkdb/release-candidate/v2.4.3
Release version v2.4.3
2 parents 33c8484 + 7166075 commit a25c392

24 files changed

Lines changed: 2653 additions & 341 deletions

.gitignore

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
build/
2-
out/
3-
.gradle/
1+
# ## RethinkDB .gitignore
2+
3+
# General
44
.#*
5+
6+
# IDE-related
57
*.iml
68
.idea/
9+
.vscode/
10+
out/
11+
12+
# Java-related
13+
*.class
14+
15+
# Gradle-related
16+
build/
17+
.gradle/
718
confidential.properties
819

20+
# Kotlin scripts
21+
scripts/kotlinc/
22+
923
# Byte-compiled / optimized / DLL files
1024
__pycache__/
1125
*.py[cod]
@@ -27,7 +41,4 @@ virtualenv/
2741

2842
# RethinkDB
2943
scripts/*.proto
30-
31-
# Editors
32-
.vscode/
33-
.idea/
44+
test-dburl-override.txt

DEPLOYING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,7 @@ To upload a new release directly to Sonatype, run the Gradle task `uploadArchive
3232
After release, you may need to go to https://oss.sonatype.org/#stagingRepositories and search for "rethinkdb" in the search box, find the release that is in status `open`. Select it and then click the `Close` button. This will check it and make it ready for release. If that stage passes you can click the `Release` button.
3333

3434
For full instructions see: http://central.sonatype.org/pages/releasing-the-deployment.html
35+
36+
## After deploying: Documentations
37+
38+
After deploying, the following file must be updated to reflect the new version: https://github.com/rethinkdb/docs/blob/master/0-getting-started/drivers/java.md

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ plugins {
1313
id("com.jfrog.bintray") version "1.8.4"
1414
}
1515

16-
version = "2.4.2"
16+
version = "2.4.3"
1717
group = "com.rethinkdb"
1818

1919
java.sourceCompatibility = JavaVersion.VERSION_1_8

src/main/java/com/rethinkdb/RethinkDB.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
public class RethinkDB extends TopLevel {
1616
/**
17-
* The Singleton to use to begin interacting with RethinkDB Driver
17+
* The Singleton to use to begin interacting with RethinkDB Driver.
1818
*/
1919
public static final RethinkDB r = new RethinkDB();
2020
/**
@@ -25,7 +25,7 @@ public class RethinkDB extends TopLevel {
2525
/**
2626
* Gets (or creates, if null) the {@link ObjectMapper} for handling {@link com.rethinkdb.net.Result}'s values.
2727
*
28-
* @return the {@link com.rethinkdb.net.Result}'s {@link ObjectMapper}
28+
* @return the {@link com.rethinkdb.net.Result}'s {@link ObjectMapper}.
2929
*/
3030
public synchronized static @NotNull ObjectMapper getResultMapper() {
3131
ObjectMapper mapper = resultMapper;
@@ -40,7 +40,7 @@ public class RethinkDB extends TopLevel {
4040
/**
4141
* Sets the {@link ObjectMapper} for handling {@link com.rethinkdb.net.Result}'s values.
4242
*
43-
* @param mapper an {@link ObjectMapper}, or null
43+
* @param mapper an {@link ObjectMapper}, or null.
4444
*/
4545
public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
4646
resultMapper = mapper;
@@ -49,7 +49,7 @@ public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
4949
/**
5050
* Creates a new connection builder.
5151
*
52-
* @return a newly created {@link Connection.Builder}
52+
* @return a newly created {@link Connection.Builder}.
5353
*/
5454
public @NotNull Connection.Builder connection() {
5555
return new Connection.Builder();
@@ -59,7 +59,7 @@ public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
5959
* Creates a new connection builder and configures it with a db-url.
6060
*
6161
* @param dburl the db-url to configure the builder.
62-
* @return a newly created {@link Connection.Builder}
62+
* @return a newly created {@link Connection.Builder}.
6363
*/
6464
public @NotNull Connection.Builder connection(@NotNull String dburl) {
6565
return connection(URI.create(dburl));
@@ -69,9 +69,20 @@ public synchronized static void setResultMapper(@Nullable ObjectMapper mapper) {
6969
* Creates a new connection builder and configures it with a db-url.
7070
*
7171
* @param uri the db-url to configure the builder.
72-
* @return a newly created {@link Connection.Builder}
72+
* @return a newly created {@link Connection.Builder}.
7373
*/
7474
public @NotNull Connection.Builder connection(@NotNull URI uri) {
7575
return new Connection.Builder(uri);
7676
}
77+
78+
/**
79+
* Copies a connection builder.
80+
*
81+
* @param b the original builder.
82+
* @return a copy of the {@link Connection.Builder}.
83+
*/
84+
public @NotNull Connection.Builder connection(Connection.Builder b) {
85+
return new Connection.Builder(b);
86+
}
87+
7788
}

src/main/java/com/rethinkdb/ast/Query.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.rethinkdb.ast;
22

3-
import com.rethinkdb.RethinkDB;
43
import com.rethinkdb.gen.exc.ReqlRuntimeError;
54
import com.rethinkdb.gen.proto.QueryType;
65
import com.rethinkdb.model.OptArgs;
76
import com.rethinkdb.utils.Internals;
7+
import org.jetbrains.annotations.NotNull;
88
import org.jetbrains.annotations.Nullable;
99
import org.slf4j.Logger;
1010
import org.slf4j.LoggerFactory;
@@ -22,21 +22,20 @@
2222
public class Query {
2323
private static final Logger LOGGER = LoggerFactory.getLogger(Query.class);
2424

25-
public final QueryType type;
25+
public final @NotNull QueryType type;
2626
public final long token;
27-
public final OptArgs globalOptions;
28-
2927
public final @Nullable ReqlAst term;
28+
public final @Nullable OptArgs globalOptions;
3029

31-
public Query(QueryType type, long token, @Nullable ReqlAst term, OptArgs globalOptions) {
30+
public Query(@NotNull QueryType type, long token, @Nullable ReqlAst term, @Nullable OptArgs globalOptions) {
3231
this.type = type;
3332
this.token = token;
3433
this.term = term;
3534
this.globalOptions = globalOptions;
3635
}
3736

38-
public Query(QueryType type, long token) {
39-
this(type, token, null, new OptArgs());
37+
public Query(@NotNull QueryType type, long token) {
38+
this(type, token, null, null);
4039
}
4140

4241
public ByteBuffer serialize() {
@@ -47,8 +46,8 @@ public ByteBuffer serialize() {
4746
if (term != null) {
4847
list.add(term.build());
4948
}
50-
if (!globalOptions.isEmpty()) {
51-
list.add(ReqlAst.buildOptarg(globalOptions));
49+
if (globalOptions != null && !globalOptions.isEmpty()) {
50+
list.add(ReqlAst.buildToMap(globalOptions));
5251
}
5352
String json = Internals.getInternalMapper().writeValueAsString(list);
5453
byte[] bytes = json.getBytes(StandardCharsets.UTF_8);

0 commit comments

Comments
 (0)