Skip to content

Commit f1e1ddb

Browse files
author
AdrianTodt
authored
Merge pull request #35 from rethinkdb/release-candidate/v2.4.2
Release minor version 2.4.2
2 parents 4a11667 + a8fc2c8 commit f1e1ddb

File tree

230 files changed

+1169
-5299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+1169
-5299
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build/
2+
out/
23
.gradle/
34
.#*
45
*.iml

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![Maven Central](https://img.shields.io/maven-central/v/com.rethinkdb/rethinkdb-driver)](https://search.maven.org/artifact/com.rethinkdb/rethinkdb-driver)
44
[![Bintray](https://img.shields.io/bintray/v/rethinkdb/maven/rethinkdb-driver)](https://bintray.com/rethinkdb/maven/rethinkdb-driver/_latestVersion)
5+
[![License](https://img.shields.io/github/license/rethinkdb/rethinkdb-java?color=lightgrey)](https://github.com/rethinkdb/rethinkdb-java/tree/master/LICENSE)
56
[![Travis-CI.org](https://img.shields.io/travis/rethinkdb/rethinkdb-java)](https://travis-ci.org/rethinkdb/rethinkdb-java)
67
[![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Frethinkdb%2Frethinkdb-java)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Frethinkdb%2Frethinkdb-java)
78

@@ -23,14 +24,18 @@ Run `./gradlew assemble` to build the jar or `./gradlew install` to install it i
2324

2425
## Contributing to the driver
2526

27+
If you want to contribute to the driver, make sure to base your branch off of our **develop** branch (or a feature-branch)
28+
and create your PR into that **same** branch. **We will be rejecting any PRs between branches or into release branches!**
29+
It is very possible that your change might already be in development or you missed something.
30+
2631
### Installation
2732

2833
Besides JDK 8, to be able to contribute to the driver, you must also install:
2934

3035
* Python **3.6** or **3.7**
3136
* PIP3 libraries:
32-
* mako
33-
* rethinkdb
37+
* `mako`
38+
* `rethinkdb`
3439

3540
### Using Gradle
3641

@@ -105,6 +110,4 @@ These are also checked into git, so you don't need to run the conversion script
105110

106111
This section was moved to separate documentation:
107112

108-
> [How to deploy this repository to Bintray](DEPLOYING-BINTRAY.md)
109-
110-
> [How to deploy this repository to Maven Central (Sonatype)](DEPLOYING-SONATYPE.md)
113+
> [How to deploy this repository to Bintray with integration with Maven Central (Sonatype)](DEPLOYING.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.1.1"
16+
version = "2.4.2"
1717
group = "com.rethinkdb"
1818

1919
java.sourceCompatibility = JavaVersion.VERSION_1_8

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

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,47 +17,11 @@ public class RethinkDB extends TopLevel {
1717
* The Singleton to use to begin interacting with RethinkDB Driver
1818
*/
1919
public static final RethinkDB r = new RethinkDB();
20-
21-
/**
22-
* Jackson's {@link ObjectMapper} for internal JSON handling from and to RethinkDB's internals.
23-
*/
24-
private static ObjectMapper internalMapper;
2520
/**
2621
* Jackson's {@link ObjectMapper} for handling {@link com.rethinkdb.net.Result}'s values.
2722
*/
2823
private static ObjectMapper resultMapper;
2924

30-
/**
31-
* Gets (or creates, if null) the {@link ObjectMapper} for internal JSON handling from and to RethinkDB's internals.
32-
* <br><br>
33-
* <b>WARNING:If you're trying to get or configure the {@link com.rethinkdb.net.Result}'s mapper,
34-
* use {@link RethinkDB#getResultMapper()} instead.</b>
35-
*
36-
* @return the internal {@link ObjectMapper}
37-
*/
38-
public synchronized static @NotNull ObjectMapper getInternalMapper() {
39-
ObjectMapper mapper = internalMapper;
40-
if (mapper == null) {
41-
mapper = new ObjectMapper()
42-
.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
43-
.enable(DeserializationFeature.USE_LONG_FOR_INTS);
44-
internalMapper = mapper;
45-
}
46-
return mapper;
47-
}
48-
49-
/**
50-
* Sets the {@link ObjectMapper} for internal JSON handling from and to RethinkDB's internals.
51-
* <br><br>
52-
* <b>WARNING:If you're trying to set the {@link com.rethinkdb.net.Result}'s mapper,
53-
* use {@link RethinkDB#setResultMapper(ObjectMapper)} instead.</b>
54-
*
55-
* @param mapper an {@link ObjectMapper}, or null
56-
*/
57-
public synchronized static void setInternalMapper(@Nullable ObjectMapper mapper) {
58-
internalMapper = mapper;
59-
}
60-
6125
/**
6226
* Gets (or creates, if null) the {@link ObjectMapper} for handling {@link com.rethinkdb.net.Result}'s values.
6327
*

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.rethinkdb.gen.exc.ReqlRuntimeError;
55
import com.rethinkdb.gen.proto.QueryType;
66
import com.rethinkdb.model.OptArgs;
7+
import com.rethinkdb.utils.Internals;
78
import org.jetbrains.annotations.Nullable;
89
import org.slf4j.Logger;
910
import org.slf4j.LoggerFactory;
@@ -49,7 +50,7 @@ public ByteBuffer serialize() {
4950
if (!globalOptions.isEmpty()) {
5051
list.add(ReqlAst.buildOptarg(globalOptions));
5152
}
52-
String json = RethinkDB.getInternalMapper().writeValueAsString(list);
53+
String json = Internals.getInternalMapper().writeValueAsString(list);
5354
byte[] bytes = json.getBytes(StandardCharsets.UTF_8);
5455
ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES + Integer.BYTES + bytes.length)
5556
.order(ByteOrder.LITTLE_ENDIAN)

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

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
import com.rethinkdb.model.OptArgs;
1010
import com.rethinkdb.net.Connection;
1111
import com.rethinkdb.net.Result;
12+
import com.rethinkdb.utils.Types;
1213

13-
import java.lang.reflect.Type;
1414
import java.util.*;
1515
import java.util.Map.Entry;
1616
import java.util.concurrent.CompletableFuture;
@@ -95,7 +95,7 @@ public Result<Object> run(Connection conn, Result.FetchMode fetchMode) {
9595
* @return The result of this query
9696
*/
9797
public <T> Result<T> run(Connection conn, Class<T> typeRef) {
98-
return conn.run(this, new OptArgs(), null, new ClassReference<>(typeRef));
98+
return conn.run(this, new OptArgs(), null, Types.of(typeRef));
9999
}
100100

101101
/**
@@ -135,7 +135,7 @@ public Result<Object> run(Connection conn, OptArgs runOpts, Result.FetchMode fet
135135
* @return The result of this query
136136
*/
137137
public <T> Result<T> run(Connection conn, OptArgs runOpts, Class<T> typeRef) {
138-
return conn.run(this, runOpts, null, new ClassReference<>(typeRef));
138+
return conn.run(this, runOpts, null, Types.of(typeRef));
139139
}
140140

141141
/**
@@ -163,7 +163,7 @@ public <T> Result<T> run(Connection conn, OptArgs runOpts, TypeReference<T> type
163163
* @return The result of this query
164164
*/
165165
public <T> Result<T> run(Connection conn, Result.FetchMode fetchMode, Class<T> typeRef) {
166-
return conn.run(this, new OptArgs(), fetchMode, new ClassReference<>(typeRef));
166+
return conn.run(this, new OptArgs(), fetchMode, Types.of(typeRef));
167167
}
168168

169169
/**
@@ -192,7 +192,7 @@ public <T> Result<T> run(Connection conn, Result.FetchMode fetchMode, TypeRefere
192192
* @return The result of this query
193193
*/
194194
public <T> Result<T> run(Connection conn, OptArgs runOpts, Result.FetchMode fetchMode, Class<T> typeRef) {
195-
return conn.run(this, runOpts, fetchMode, new ClassReference<>(typeRef));
195+
return conn.run(this, runOpts, fetchMode, Types.of(typeRef));
196196
}
197197

198198
/**
@@ -254,7 +254,7 @@ public CompletableFuture<Result<Object>> runAsync(Connection conn, Result.FetchM
254254
* @return The result of this query
255255
*/
256256
public <T> CompletableFuture<Result<T>> runAsync(Connection conn, Class<T> typeRef) {
257-
return conn.runAsync(this, new OptArgs(), null, new ClassReference<>(typeRef));
257+
return conn.runAsync(this, new OptArgs(), null, Types.of(typeRef));
258258
}
259259

260260
/**
@@ -294,7 +294,7 @@ public CompletableFuture<Result<Object>> runAsync(Connection conn, OptArgs runOp
294294
* @return The result of this query
295295
*/
296296
public <T> CompletableFuture<Result<T>> runAsync(Connection conn, OptArgs runOpts, Class<T> typeRef) {
297-
return conn.runAsync(this, runOpts, null, new ClassReference<>(typeRef));
297+
return conn.runAsync(this, runOpts, null, Types.of(typeRef));
298298
}
299299

300300
/**
@@ -322,7 +322,7 @@ public <T> CompletableFuture<Result<T>> runAsync(Connection conn, OptArgs runOpt
322322
* @return The result of this query
323323
*/
324324
public <T> CompletableFuture<Result<T>> runAsync(Connection conn, Result.FetchMode fetchMode, Class<T> typeRef) {
325-
return conn.runAsync(this, new OptArgs(), fetchMode, new ClassReference<>(typeRef));
325+
return conn.runAsync(this, new OptArgs(), fetchMode, Types.of(typeRef));
326326
}
327327

328328
/**
@@ -351,7 +351,7 @@ public <T> CompletableFuture<Result<T>> runAsync(Connection conn, Result.FetchMo
351351
* @return The result of this query
352352
*/
353353
public <T> CompletableFuture<Result<T>> runAsync(Connection conn, OptArgs runOpts, Result.FetchMode fetchMode, Class<T> typeRef) {
354-
return conn.runAsync(this, runOpts, fetchMode, new ClassReference<>(typeRef));
354+
return conn.runAsync(this, runOpts, fetchMode, Types.of(typeRef));
355355
}
356356

357357
/**
@@ -438,22 +438,4 @@ private void astToString(StringBuilder builder, String name, String indent, bool
438438
}
439439
}
440440
}
441-
442-
/**
443-
* A TypeReference that accepts an class instead of compiler type information.
444-
*
445-
* @param <T> the type referred to.
446-
*/
447-
private static class ClassReference<T> extends TypeReference<T> {
448-
private Class<T> c;
449-
450-
ClassReference(Class<T> c) {
451-
this.c = c;
452-
}
453-
454-
@Override
455-
public Type getType() {
456-
return c;
457-
}
458-
}
459441
}

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

Lines changed: 0 additions & 141 deletions
This file was deleted.

src/main/java/com/rethinkdb/gen/ast/Add.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class Add extends ReqlExpr {
1616
public Add(Object arg) {
1717
this(new Arguments(arg), null);
1818
}
19-
public Add(Arguments args){
19+
public Add(Arguments args) {
2020
this(args, null);
2121
}
2222
public Add(Arguments args, OptArgs optargs) {

src/main/java/com/rethinkdb/gen/ast/And.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class And extends ReqlExpr {
1616
public And(Object arg) {
1717
this(new Arguments(arg), null);
1818
}
19-
public And(Arguments args){
19+
public And(Arguments args) {
2020
this(args, null);
2121
}
2222
public And(Arguments args, OptArgs optargs) {

src/main/java/com/rethinkdb/gen/ast/Append.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class Append extends ReqlExpr {
1616
public Append(Object arg) {
1717
this(new Arguments(arg), null);
1818
}
19-
public Append(Arguments args){
19+
public Append(Arguments args) {
2020
this(args, null);
2121
}
2222
public Append(Arguments args, OptArgs optargs) {

0 commit comments

Comments
 (0)