Skip to content

Update to Java 17 #1264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Network communication is handled using [Bolt Protocol](https://7687.org/).

| Driver Series | Supported Java Runtime versions | Status | Changelog |
| --- | --- | --- | --- |
| 5.0 | 8, 11 | Primary development branch. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/5.0-changelog) |
| 5.0 | 17 | Primary development branch. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/5.0-changelog) |
| 4.4 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.4-changelog) |
| 4.3 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.3-changelog) |
| 4.2 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.2-changelog) |
Expand Down
2 changes: 1 addition & 1 deletion build/javadoc/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p>These pages document the official <a href="https://neo4j.com" target="_top">Neo4j</a> driver for Java.</p>

<h3>Example</h3>
<h1>Example</h1>

<pre><code>import org.neo4j.driver.*;

Expand Down
1 change: 0 additions & 1 deletion driver/src/main/java/org/neo4j/driver/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ private ConfigBuilder withMetricsEnabled(boolean enabled) {
* <p>
* {@link MetricsAdapter#MICROMETER} enables implementation based on <a href="https://micrometer.io">Micrometer</a>. The metrics can be obtained
* afterwards via Micrometer means and {@link Driver#metrics()}. Micrometer must be on classpath when using this option.
* <p>
*
* @param metricsAdapter the metrics adapter to use. Use {@link MetricsAdapter#DEV_NULL} to disable metrics.
* @return this builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public interface ConnectionPoolMetrics {
* This number increases every time when a connection is acquired.
* See {@link ConnectionPoolMetrics#acquired()} for the total amount of connection acquired since the driver is created.
* The average acquisition time can be calculated using the code below:
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* ConnectionPoolMetrics previous, current;
Expand All @@ -129,7 +129,7 @@ public interface ConnectionPoolMetrics {
* This number increases every time when a connection is established.
* See {@link ConnectionPoolMetrics#created()} for the total amount of connections established since the pool is created.
* The average connection time can be calculated using the code below:
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* ConnectionPoolMetrics previous, current;
Expand All @@ -154,7 +154,7 @@ public interface ConnectionPoolMetrics {
* This number increases every time when a connection is returned back to the pool.
* See {@link ConnectionPoolMetrics#totalInUseCount()} for the total amount of connections that are borrowed out of the pool.
* The average in-use time can be calculated using the code below:
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* ConnectionPoolMetrics previous, current;
Expand Down
4 changes: 2 additions & 2 deletions driver/src/main/java/org/neo4j/driver/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ default void executeWriteWithoutResult(Consumer<TransactionContext> contextConsu
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
* a list of allowed types.
*
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down Expand Up @@ -289,7 +289,7 @@ default void executeWriteWithoutResult(Consumer<TransactionContext> contextConsu
/**
* Run a query in a managed auto-commit transaction with the specified
* {@link TransactionConfig configuration}, and return a result stream.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down
6 changes: 3 additions & 3 deletions driver/src/main/java/org/neo4j/driver/SimpleQueryRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public interface SimpleQueryRunner {
* <p>
* If you are creating parameters programmatically, {@link #run(String, Map)} might be more helpful, it converts your map to a {@link Value} for you.
*
* <h2>Example</h2>
* <h4>Example</h4>
* <pre class="doctest:QueryRunnerDocIT#parameterTest">
* {@code
*
Expand All @@ -89,7 +89,7 @@ public interface SimpleQueryRunner {
* This version of run takes a {@link Map} of parameters. The values in the map must be values that can be converted to Neo4j types. See {@link
* Values#parameters(Object...)} for a list of allowed types.
*
* <h2>Example</h2>
* <h4>Example</h4>
* <pre class="doctest:QueryRunnerDocIT#parameterTest">
* {@code
*
Expand Down Expand Up @@ -131,7 +131,7 @@ public interface SimpleQueryRunner {

/**
* Run a query and return a result stream.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre class="doctest:QueryRunnerDocIT#queryObjectTest">
* {@code
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public interface AsyncQueryRunner {
* <p>
* If you are creating parameters programmatically, {@link #runAsync(String, Map)}
* might be more helpful, it converts your map to a {@link Value} for you.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
*
Expand Down Expand Up @@ -126,7 +126,7 @@ public interface AsyncQueryRunner {
* This version of runAsync takes a {@link Map} of parameters. The values in the map
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
* a list of allowed types.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
*
Expand Down Expand Up @@ -186,7 +186,7 @@ public interface AsyncQueryRunner {
/**
* Run a query asynchronously and return a {@link CompletionStage} with a
* result cursor.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Query query = new Query( "MATCH (n) WHERE n.name = $myNameParam RETURN n.age" );
Expand Down
4 changes: 2 additions & 2 deletions driver/src/main/java/org/neo4j/driver/async/AsyncSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ <T> CompletionStage<T> executeWriteAsync(
* This version of runAsync takes a {@link Map} of parameters. The values in the map
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
* a list of allowed types.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down Expand Up @@ -357,7 +357,7 @@ <T> CompletionStage<T> executeWriteAsync(
/**
* Run a query asynchronously in an auto-commit transaction with the specified {@link TransactionConfig configuration} and return a
* {@link CompletionStage} with a result cursor.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ default Publisher<ReactiveResult> run(String query, TransactionConfig config) {
* This version of run takes a {@link Map} of parameters. The values in the map must be values that can be converted to Neo4j types. See {@link
* Values#parameters(Object...)} for a list of allowed types.
*
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down Expand Up @@ -201,7 +201,7 @@ default Publisher<ReactiveResult> run(String query, Map<String, Object> paramete
* Invoking this method will result in a Bolt RUN message exchange with server and the returned publisher will either emit an instance of {@link
* ReactiveResult} on success or an error otherwise.
*
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down
4 changes: 2 additions & 2 deletions driver/src/main/java/org/neo4j/driver/reactive/RxSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ default Publisher<RxTransaction> beginTransaction() {
* The values in the map must be values that can be converted to Neo4j types.
* See {@link Values#parameters(Object...)} for a list of allowed types.
*
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down Expand Up @@ -199,7 +199,7 @@ default Publisher<RxTransaction> beginTransaction() {
* Run a query in an auto-commit transaction with specified {@link TransactionConfig configuration} and return a reactive result stream.
* The query is not executed when the reactive result is returned.
* Instead, the publishers in the result will actually start the execution of the query.
* <h2>Example</h2>
* <h4>Example</h4>
* <pre>
* {@code
* Map<String, Object> metadata = new HashMap<>();
Expand Down
20 changes: 4 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.build.timestamp.format>'v'yyyyMMdd-HHmm</maven.build.timestamp.format>

<bundle.name>${project.groupId}.${project.artifactId}</bundle.name>
Expand Down Expand Up @@ -247,18 +247,6 @@
</build>
</profile>

<profile>
<id>java9</id>
<activation>
<activeByDefault>false</activeByDefault>
<jdk>9</jdk>
</activation>
<properties>
<maven.compiler.source>9</maven.compiler.source>
<maven.compiler.target>9</maven.compiler.target>
</properties>
</profile>

<!-- Disable parallel execution of integration tests with "-DsequentialITs" -->
<profile>
<id>sequentialIntegrationTests</id>
Expand Down Expand Up @@ -367,12 +355,12 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>2.21.0</version>
<version>2.23.0</version>
<executions>
<execution>
<goals>
Expand Down
1 change: 0 additions & 1 deletion testkit-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
7 changes: 3 additions & 4 deletions testkit/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Install Maven 3.6, Java 11, Java 8 and Python3
FROM maven:3.6.3-openjdk-8
FROM maven:3.8.6-openjdk-18-slim

RUN apt-get --quiet --quiet update \
&& apt-get --quiet --quiet install -y bash python3 \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHON=python3
ENV JAVA_HOME=/usr/local/openjdk-8
ENV PATH=$JAVA_HOME/bin:$PATH

# Install our own CAs on the image.
# Assumes Linux Debian based image.
# JAVA_HOME needed by update-ca-certificates hook to update Java with changed system CAs.
COPY CAs/* /usr/local/share/ca-certificates/
COPY CustomCAs/* /usr/local/share/custom-ca-certificates/
RUN update-ca-certificates
RUN echo 'jdk.tls.disabledAlgorithms=jdk.tls.disabledAlgorithms=SSLv3, TLSv1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL' > /testkit.java.security \
&& update-ca-certificates
2 changes: 1 addition & 1 deletion testkit/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

if __name__ == "__main__":
subprocess.check_call(
["java", "-Djdk.tls.client.protocols=TLSv1.3,TLSv1.2,TLSv1.1", "-jar", "testkit-backend/target/testkit-backend.jar",
["java", "-Djava.security.properties=/testkit.java.security", "-jar", "testkit-backend/target/testkit-backend.jar",
os.getenv('TEST_BACKEND_SERVER', '')],
stdout=sys.stdout, stderr=sys.stderr
)
Expand Down