Skip to content

Commit 1a7f23a

Browse files
authored
Refactoring (#1476)
1 parent eeadd97 commit 1a7f23a

File tree

146 files changed

+266
-520
lines changed

Some content is hidden

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

146 files changed

+266
-520
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ If you want to contribute a pull request, we have a little bit of process you'll
4747
- Take a moment to read and sign our [CLA](http://neo4j.com/developer/cla)
4848

4949
We can't guarantee that we'll accept pull requests and may ask you to make some changes before they go in.
50-
Occasionally, we might also have logistical, commercial, or legal reasons why we can't accept your work but we'll try to find an alternative way for you to contribute in that case.
50+
Occasionally, we might also have logistical, commercial, or legal reasons why we can't accept your work, but we'll try to find an alternative way for you to contribute in that case.
5151
Remember that many community members have become regular contributors and some are now even Neo employees!
5252

5353

ISSUE_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ To help us understand your issue, please specify important details, primarily:
1515

1616
- Neo4j version: Community/Enterprise X.Y.Z
1717
- Neo4j Mode: Single instance/HA cluster with X members/Casual cluster with X core Y read-replica
18-
- Driver version: X lanaguage driver X.Y.Z (If you use some other library that wraps around this driver, you might want to raise an issue there first)
18+
- Driver version: X language driver X.Y.Z (If you use some other library that wraps around this driver, you might want to raise an issue there first)
1919
- Operating system: (for example Windows 10/Ubuntu 16.10 on AWS)
2020
- **Steps to reproduce**
2121
- Expected behavior
2222
- Actual behavior
2323

2424
Additionally, include (as appropriate) log-files, stacktraces, and other debug output.
2525
Always check the server logs to see if there is any stacktrace related to the driver error too.
26-
Aslo add any solutions you've tried to solve the problem yourself.
26+
Also, add any solutions you've tried to solve the problem yourself.
2727

2828
## Example bug report
2929

@@ -35,7 +35,7 @@ I got connection reset by peer errors.
3535
**Operating System:** Ubuntu 16.10 on AWS
3636

3737
### Steps to reproduce
38-
1. Start Neo4j on a AWS instance
38+
1. Start Neo4j on an AWS instance
3939
2. Run a query with the driver
4040
3. Put the driver idle for 2h
4141
4. Run another query

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ There are 2 ways of running Testkit tests:
142142

143143
##### Using the testkit-tests module
144144

145-
The `testkit-tests` module will automatically checkout Testkit and run it during Maven build.
145+
The `testkit-tests` module will automatically check out Testkit and run it during Maven build.
146146

147147
Prerequisites:
148148
- Docker
@@ -189,7 +189,7 @@ TEST_DOCKER_RMI=true \
189189
python3 main.py --tests TESTKIT_TESTS UNIT_TESTS --configs 4.3-enterprise
190190
````
191191
192-
On Windows or in the abscence of a Bash-compatible environment, the required steps are probably different.
192+
On Windows or in the absence of a Bash-compatible environment, the required steps are probably different.
193193
A simple `mvn clean install` will require admin rights on Windows, because our integration tests require admin privileges to install and start a service.
194194
195195
If all of this fails and you only want to try out a local development version of the driver, you could skip all tests like this:

driver/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<!-- Test dependencies -->
7070
<dependency>
7171
<groupId>org.hamcrest</groupId>
72-
<artifactId>hamcrest-junit</artifactId>
72+
<artifactId>hamcrest</artifactId>
7373
</dependency>
7474
<dependency>
7575
<groupId>org.mockito</groupId>

driver/src/main/java/org/neo4j/driver/Config.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,7 @@ public ConfigBuilder withLogging(Logging logging) {
390390
*
391391
* @return this builder
392392
*/
393+
@SuppressWarnings("deprecation")
393394
public ConfigBuilder withLeakedSessionsLogging() {
394395
this.logLeakedSessions = true;
395396
return this;

driver/src/main/java/org/neo4j/driver/Driver.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
377377
*/
378378
@Experimental
379379
@Deprecated
380+
@SuppressWarnings("SameReturnValue")
380381
TypeSystem defaultTypeSystem();
381382

382383
/**

driver/src/main/java/org/neo4j/driver/Logging.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static Logging console(Level level) {
143143
*
144144
* @return new logging implementation.
145145
*/
146+
@SuppressWarnings("SameReturnValue")
146147
static Logging none() {
147148
return DEV_NULL_LOGGING;
148149
}

driver/src/main/java/org/neo4j/driver/exceptions/AuthTokenManagerExecutionException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* <ul>
3030
* <li>{@link AuthTokenManager#getToken()} returned {@code null}</li>
3131
* <li>{@link AuthTokenManager#getToken()} returned a {@link java.util.concurrent.CompletionStage} that completed with {@code null}</li>
32-
* <li>{@link AuthTokenManager#getToken()} returned a {@link java.util.concurrent.CompletionStage} that completed with a token that was not creeated using {@link org.neo4j.driver.AuthTokens}</li>
32+
* <li>{@link AuthTokenManager#getToken()} returned a {@link java.util.concurrent.CompletionStage} that completed with a token that was not created using {@link org.neo4j.driver.AuthTokens}</li>
3333
* <li>{@link AuthTokenManager#getToken()} has thrown an exception</li>
3434
* <li>{@link AuthTokenManager#getToken()} returned a {@link java.util.concurrent.CompletionStage} that completed exceptionally</li>
3535
* </ul>

driver/src/main/java/org/neo4j/driver/internal/InternalPath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public InternalPath(List<Entity> alternatingNodeAndRel) {
8989
// even index - this should be a node
9090
try {
9191
lastNode = (Node) entity;
92-
if (nodes.isEmpty() || isEndpoint(lastNode, lastRelationship)) {
92+
if (nodes.isEmpty() || (lastRelationship != null && isEndpoint(lastNode, lastRelationship))) {
9393
nodes.add(lastNode);
9494
} else {
9595
throw new IllegalArgumentException("Node argument " + index

driver/src/main/java/org/neo4j/driver/internal/async/connection/NettyDomainNameResolverGroup.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public NettyDomainNameResolverGroup(DomainNameResolver domainNameResolver) {
3232
}
3333

3434
@Override
35+
@SuppressWarnings("resource")
3536
protected AddressResolver<InetSocketAddress> newResolver(EventExecutor executor) {
3637
return new NettyDomainNameResolver(executor, domainNameResolver).asAddressResolver();
3738
}

0 commit comments

Comments
 (0)