From 5938f42d2f3c7c8e73182f4ae5869577ed370827 Mon Sep 17 00:00:00 2001 From: Michael Simons Date: Mon, 18 May 2020 12:10:03 +0200 Subject: [PATCH] Fix JavaDoc on JDK 11. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - JDK 11 JavaDoc is less lenient with HTML tags inside a -block, so this needed a fix. - We don’t use java-modules, so all modules are undefined. Therefor the search is broken. There are 2 solutions to the later: 1. Disabling modules in java-doc with `--no-module-directories`, but that also applies to references to JDK classes, which would than be broken. 2. (The one applied here): Check if `useModuleDirectories` is set to something different than literal `undefined`: If so, leave it and let JavaDocs JavaScript magic handle things, otherwise set it to false, causing JavaDocs JavaScript todo nothing. For reference: https://stackoverflow.com/a/57284322/1547989 --- driver/pom.xml | 12 +++++++++++- driver/src/main/javadoc/overview.html | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/driver/pom.xml b/driver/pom.xml index 57c19e0c8d..e0c84042ca 100644 --- a/driver/pom.xml +++ b/driver/pom.xml @@ -120,7 +120,17 @@ org/neo4j/driver/**/*.java - org.neo4j.driver.internal + org.neo4j.driver.internal + + + if (typeof useModuleDirectories !== 'undefined') { + useModuleDirectories = false; + } + + ]]> + + --allow-script-in-comments diff --git a/driver/src/main/javadoc/overview.html b/driver/src/main/javadoc/overview.html index 63b7176589..61f907ffe3 100644 --- a/driver/src/main/javadoc/overview.html +++ b/driver/src/main/javadoc/overview.html @@ -32,7 +32,7 @@

Example

// and makes handling errors much easier. // Use `session.writeTransaction` for writes and `session.readTransaction` for reading data. // These methods are also able to handle connection problems and transient errors using an automatic retry mechanism. - session.writeTransaction(tx -> tx.run("MERGE (a:Person {name: $x})", parameters("x", name))); + session.writeTransaction(tx -> tx.run("MERGE (a:Person {name: $x})", parameters("x", name))); } } @@ -40,7 +40,7 @@

Example

{ try (Session session = driver.session()) { - // A Managed Transaction transactions are a quick and easy way to wrap a Cypher Query. + // A Managed transaction is a quick and easy way to wrap a Cypher Query. // The `session.run` method will run the specified Query. // This simpler method does not use any automatic retry mechanism. Result result = session.run(