update to OpenJDK 21, Gradle 8.7

This commit is contained in:
Jörg Prante 2025-01-01 13:43:06 +01:00
parent c50bb3f8b4
commit 0992e12c50
13 changed files with 45 additions and 151 deletions

View file

@ -1,10 +1,7 @@
plugins { plugins {
id "checkstyle"
id "pmd"
id 'maven-publish' id 'maven-publish'
id 'signing' id 'signing'
id "io.github.gradle-nexus.publish-plugin" version "1.3.0" id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id "com.github.spotbugs" version "5.0.14"
id "org.cyclonedx.bom" version "1.7.2" id "org.cyclonedx.bom" version "1.7.2"
id "org.xbib.gradle.plugin.asciidoctor" version "2.5.2.2" id "org.xbib.gradle.plugin.asciidoctor" version "2.5.2.2"
} }
@ -31,14 +28,8 @@ ext {
apply plugin: 'java-library' apply plugin: 'java-library'
apply from: rootProject.file('gradle/init/banner.gradle')
apply from: rootProject.file('gradle/ide/idea.gradle')
apply from: rootProject.file('gradle/repositories/maven.gradle') apply from: rootProject.file('gradle/repositories/maven.gradle')
apply from: rootProject.file('gradle/compile/java.gradle') apply from: rootProject.file('gradle/compile/java.gradle')
apply from: rootProject.file('gradle/test/junit5.gradle') apply from: rootProject.file('gradle/test/junit5.gradle')
apply from: rootProject.file('gradle/quality/cyclonedx.gradle')
apply from: rootProject.file('gradle/quality/spotbugs.gradle')
apply from: rootProject.file('gradle/quality/checkstyle.gradle')
apply from: rootProject.file('gradle/quality/pmd.gradle')
apply from: rootProject.file('gradle/publish/sonatype.gradle') apply from: rootProject.file('gradle/publish/sonatype.gradle')
apply from: rootProject.file('gradle/publish/forgejo.gradle') apply from: rootProject.file('gradle/publish/forgejo.gradle')

View file

@ -1,5 +1,3 @@
group = org.xbib group = org.xbib
name = guava name = guava
version = 30.1 version = 30.2
org.gradle.warning.mode = ALL

View file

@ -2,19 +2,12 @@
apply plugin: 'java-library' apply plugin: 'java-library'
java { java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
modularity.inferModulePath.set(true) modularity.inferModulePath.set(true)
withJavadocJar()
withSourcesJar() withSourcesJar()
} withJavadocJar()
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
compileTestJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
} }
jar { jar {
@ -24,7 +17,10 @@ jar {
} }
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.compilerArgs.add('-Xlint:all') options.fork = true
options.forkOptions.jvmArgs += ['-Duser.language=en','-Duser.country=US']
options.compilerArgs.add('-Xlint:-requires-transitive-automatic')
options.compilerArgs.add('-Xlint:deprecation')
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }

View file

@ -1,7 +1,7 @@
dependencies { dependencies {
testImplementation libs.junit.jupiter.api testImplementation testLibs.junit.jupiter.api
testImplementation libs.hamcrest testImplementation testLibs.hamcrest
testRuntimeOnly libs.junit.jupiter.engine testRuntimeOnly testLibs.junit.jupiter.engine
} }
test { test {

Binary file not shown.

View file

@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

22
gradlew vendored
View file

@ -83,7 +83,8 @@ done
# This is normally unused # This is normally unused
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@ -130,18 +131,21 @@ location of your Java installation."
fi fi
else else
JAVACMD=java JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@ -149,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045 # shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command:
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# shell script including quotes and variable substitutions, so put them in # and any embedded shellness will be escaped.
# double quotes to make sure that they get re-expanded; and # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# * put everything else in single quotes, so that it's not re-expanded. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \

20
gradlew.bat vendored
View file

@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail

View file

@ -1,8 +1,10 @@
dependencyResolutionManagement { dependencyResolutionManagement {
versionCatalogs { versionCatalogs {
libs { libs {
version('gradle', '8.1.1') version('gradle', '8.7')
version('junit', '5.9.3') }
testLibs {
version('junit', '5.10.2')
library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit') library('junit-jupiter-api', 'org.junit.jupiter', 'junit-jupiter-api').versionRef('junit')
library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit') library('junit-jupiter-engine', 'org.junit.jupiter', 'junit-jupiter-engine').versionRef('junit')
library('junit4', 'junit', 'junit').version('4.13.2') library('junit4', 'junit', 'junit').version('4.13.2')

View file

@ -44,7 +44,7 @@ import java.util.Set;
abstract class AbstractBaseGraph<N> implements BaseGraph<N> { abstract class AbstractBaseGraph<N> implements BaseGraph<N> {
/** /**
* Returns the number of edges in this graph; used to calculate the size of {@link #edges()}. This * Returns the number of edges in this graph; used to calculate the size of {@code #edges()}. This
* implementation requires O(|N|) time. Classes extending this one may manually keep track of the * implementation requires O(|N|) time. Classes extending this one may manually keep track of the
* number of edges as the graph is updated, and override this method for better performance. * number of edges as the graph is updated, and override this method for better performance.
*/ */
@ -59,7 +59,7 @@ abstract class AbstractBaseGraph<N> implements BaseGraph<N> {
} }
/** /**
* An implementation of {@link BaseGraph#edges()} defined in terms of {@link #nodes()} and {@link * An implementation of {@link BaseGraph#edges()} defined in terms of {@code #nodes()} and {@link
* #successors(Object)}. * #successors(Object)}.
*/ */
@Override @Override

View file

@ -370,8 +370,6 @@ public abstract class AbstractFuture<V> extends InternalFutureFailureAccess
* *
* <p>The default {@link AbstractFuture} implementation throws {@code InterruptedException} if the * <p>The default {@link AbstractFuture} implementation throws {@code InterruptedException} if the
* current thread is interrupted during the call, even if the value is already available. * current thread is interrupted during the call, even if the value is already available.
*
* @throws CancellationException {@inheritDoc}
*/ */
@Override @Override
public V get(long timeout, TimeUnit unit) public V get(long timeout, TimeUnit unit)
@ -480,8 +478,6 @@ public abstract class AbstractFuture<V> extends InternalFutureFailureAccess
* *
* <p>The default {@link AbstractFuture} implementation throws {@code InterruptedException} if the * <p>The default {@link AbstractFuture} implementation throws {@code InterruptedException} if the
* current thread is interrupted during the call, even if the value is already available. * current thread is interrupted during the call, even if the value is already available.
*
* @throws CancellationException {@inheritDoc}
*/ */
@Override @Override
public V get() throws InterruptedException, ExecutionException { public V get() throws InterruptedException, ExecutionException {

View file

@ -244,9 +244,6 @@ public final class ClosingFuture<V> {
/** /**
* Computes a result, or throws an exception if unable to do so. * Computes a result, or throws an exception if unable to do so.
* *
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/ */
V call(DeferredCloser closer) throws Exception; V call(DeferredCloser closer) throws Exception;
} }
@ -261,10 +258,6 @@ public final class ClosingFuture<V> {
public interface AsyncClosingCallable<V extends Object> { public interface AsyncClosingCallable<V extends Object> {
/** /**
* Computes a result, or throws an exception if unable to do so. * Computes a result, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/ */
ClosingFuture<V> call(DeferredCloser closer) throws Exception; ClosingFuture<V> call(DeferredCloser closer) throws Exception;
} }
@ -280,10 +273,6 @@ public final class ClosingFuture<V> {
/** /**
* Applies this function to an input, or throws an exception if unable to do so. * Applies this function to an input, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/ */
U apply(DeferredCloser closer, T input) throws Exception; U apply(DeferredCloser closer, T input) throws Exception;
} }
@ -298,10 +287,6 @@ public final class ClosingFuture<V> {
public interface AsyncClosingFunction<T extends Object, U extends Object> { public interface AsyncClosingFunction<T extends Object, U extends Object> {
/** /**
* Applies this function to an input, or throws an exception if unable to do so. * Applies this function to an input, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline is done (but
* not before this method completes), even if this method throws or the pipeline is cancelled.
*/ */
ClosingFuture<U> apply(DeferredCloser closer, T input) throws Exception; ClosingFuture<U> apply(DeferredCloser closer, T input) throws Exception;
} }
@ -340,8 +325,7 @@ public final class ClosingFuture<V> {
/** /**
* Starts closing all closeable objects captured during the {@link ClosingFuture}'s asynchronous * Starts closing all closeable objects captured during the {@link ClosingFuture}'s asynchronous
* operation on the {@link Executor}s specified by calls to {@link * operation on the {@link Executor}s.
* DeferredCloser#eventuallyClose(Closeable, Executor)}.
* *
* <p>If any such calls specified {@link MoreExecutors#directExecutor()}, those objects will be * <p>If any such calls specified {@link MoreExecutors#directExecutor()}, those objects will be
* closed synchronously. * closed synchronously.
@ -410,8 +394,7 @@ public final class ClosingFuture<V> {
* value in order to close it. * value in order to close it.
* *
* @param future the future to create the {@code ClosingFuture} from. For discussion of the * @param future the future to create the {@code ClosingFuture} from. For discussion of the
* future's result type {@code C}, see {@link DeferredCloser#eventuallyClose(Closeable, * future's result type {@code C}.
* Executor)}.
* @param closingExecutor the future's result will be closed on this executor * @param closingExecutor the future's result will be closed on this executor
* @deprecated Creating {@link Future}s of closeable types is dangerous in general because the * @deprecated Creating {@link Future}s of closeable types is dangerous in general because the
* underlying value may never be closed if the {@link Future} is canceled after its operation * underlying value may never be closed if the {@link Future} is canceled after its operation
@ -704,8 +687,6 @@ public final class ClosingFuture<V> {
* <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a * <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a
* {@code ClosingFuture}. If possible, prefer calling {@link #transform(ClosingFunction, * {@code ClosingFuture}. If possible, prefer calling {@link #transform(ClosingFunction,
* Executor)} instead, with a function that returns the next value directly. * Executor)} instead, with a function that returns the next value directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor) closer.eventuallyClose()}
* for every closeable object this step creates in order to capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* <li>In case this step doesn't create new closeables, you can adapt an API that returns a * <li>In case this step doesn't create new closeables, you can adapt an API that returns a
@ -784,8 +765,6 @@ public final class ClosingFuture<V> {
* meets these conditions: * meets these conditions:
* *
* <ul> * <ul>
* <li>It does not need to capture any {@link Closeable} objects by calling {@link
* DeferredCloser#eventuallyClose(Closeable, Executor)}.
* <li>It returns a {@link ListenableFuture}. * <li>It returns a {@link ListenableFuture}.
* </ul> * </ul>
* *
@ -902,8 +881,6 @@ public final class ClosingFuture<V> {
* {@code ClosingFuture}. If possible, prefer calling {@link #catching(Class, * {@code ClosingFuture}. If possible, prefer calling {@link #catching(Class,
* ClosingFunction, Executor)} instead, with a function that returns the next value * ClosingFunction, Executor)} instead, with a function that returns the next value
* directly. * directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor) closer.eventuallyClose()}
* for every closeable object this step creates in order to capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* <li>In case this step doesn't create new closeables, you can adapt an API that returns a * <li>In case this step doesn't create new closeables, you can adapt an API that returns a
@ -1213,11 +1190,6 @@ public final class ClosingFuture<V> {
/** /**
* Computes a result, or throws an exception if unable to do so. * Computes a result, or throws an exception if unable to do so.
* *
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*
* @param peeker used to get the value of any of the input futures * @param peeker used to get the value of any of the input futures
*/ */
V call(DeferredCloser closer, Peeker peeker) throws Exception; V call(DeferredCloser closer, Peeker peeker) throws Exception;
@ -1233,11 +1205,6 @@ public final class ClosingFuture<V> {
/** /**
* Computes a {@link ClosingFuture} result, or throws an exception if unable to do so. * Computes a {@link ClosingFuture} result, or throws an exception if unable to do so.
* *
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*
* @param peeker used to get the value of any of the input futures * @param peeker used to get the value of any of the input futures
*/ */
ClosingFuture<V> call(DeferredCloser closer, Peeker peeker) throws Exception; ClosingFuture<V> call(DeferredCloser closer, Peeker peeker) throws Exception;
@ -1314,9 +1281,6 @@ public final class ClosingFuture<V> {
* <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a * <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a
* {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable, * {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable,
* Executor)} instead, with a function that returns the next value directly. * Executor)} instead, with a function that returns the next value directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} for every closeable object this step creates in order to
* capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* </ul> * </ul>
@ -1388,11 +1352,6 @@ public final class ClosingFuture<V> {
/** /**
* Applies this function to two inputs, or throws an exception if unable to do so. * Applies this function to two inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
U apply(DeferredCloser closer, V1 value1, V2 value2) throws Exception; U apply(DeferredCloser closer, V1 value1, V2 value2) throws Exception;
} }
@ -1411,11 +1370,6 @@ public final class ClosingFuture<V> {
/** /**
* Applies this function to two inputs, or throws an exception if unable to do so. * Applies this function to two inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
ClosingFuture<U> apply(DeferredCloser closer, V1 value1, V2 value2) throws Exception; ClosingFuture<U> apply(DeferredCloser closer, V1 value1, V2 value2) throws Exception;
} }
@ -1485,9 +1439,6 @@ public final class ClosingFuture<V> {
* <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a * <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a
* {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable, * {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable,
* Executor)} instead, with a function that returns the next value directly. * Executor)} instead, with a function that returns the next value directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} for every closeable object this step creates in order to
* capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* </ul> * </ul>
@ -1542,11 +1493,6 @@ public final class ClosingFuture<V> {
U extends Object> { U extends Object> {
/** /**
* Applies this function to three inputs, or throws an exception if unable to do so. * Applies this function to three inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
U apply(DeferredCloser closer, V1 value1, V2 value2, V3 v3) throws Exception; U apply(DeferredCloser closer, V1 value1, V2 value2, V3 v3) throws Exception;
} }
@ -1569,10 +1515,6 @@ public final class ClosingFuture<V> {
/** /**
* Applies this function to three inputs, or throws an exception if unable to do so. * Applies this function to three inputs, or throws an exception if unable to do so.
* *
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
ClosingFuture<U> apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3) ClosingFuture<U> apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3)
throws Exception; throws Exception;
@ -1650,9 +1592,6 @@ public final class ClosingFuture<V> {
* <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a * <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a
* {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable, * {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable,
* Executor)} instead, with a function that returns the next value directly. * Executor)} instead, with a function that returns the next value directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} for every closeable object this step creates in order to
* capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* </ul> * </ul>
@ -1717,11 +1656,6 @@ public final class ClosingFuture<V> {
U extends Object> { U extends Object> {
/** /**
* Applies this function to four inputs, or throws an exception if unable to do so. * Applies this function to four inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
U apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4) throws Exception; U apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4) throws Exception;
} }
@ -1746,11 +1680,6 @@ public final class ClosingFuture<V> {
U extends Object> { U extends Object> {
/** /**
* Applies this function to four inputs, or throws an exception if unable to do so. * Applies this function to four inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
ClosingFuture<U> apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4) ClosingFuture<U> apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4)
throws Exception; throws Exception;
@ -1834,9 +1763,6 @@ public final class ClosingFuture<V> {
* <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a * <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a
* {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable, * {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable,
* Executor)} instead, with a function that returns the next value directly. * Executor)} instead, with a function that returns the next value directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} for every closeable object this step creates in order to
* capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* </ul> * </ul>
@ -1907,11 +1833,6 @@ public final class ClosingFuture<V> {
U extends Object> { U extends Object> {
/** /**
* Applies this function to five inputs, or throws an exception if unable to do so. * Applies this function to five inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
U apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4, V5 value5) U apply(DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4, V5 value5)
throws Exception; throws Exception;
@ -1939,11 +1860,6 @@ public final class ClosingFuture<V> {
U extends Object> { U extends Object> {
/** /**
* Applies this function to five inputs, or throws an exception if unable to do so. * Applies this function to five inputs, or throws an exception if unable to do so.
*
* <p>Any objects that are passed to {@link DeferredCloser#eventuallyClose(Closeable,
* Executor) closer.eventuallyClose()} will be closed when the {@link ClosingFuture} pipeline
* is done (but not before this method completes), even if this method throws or the pipeline
* is cancelled.
*/ */
ClosingFuture<U> apply( ClosingFuture<U> apply(
DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4, V5 value5) DeferredCloser closer, V1 value1, V2 value2, V3 value3, V4 value4, V5 value5)
@ -2034,9 +1950,6 @@ public final class ClosingFuture<V> {
* <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a * <li>Use this method only when calling an API that returns a {@link ListenableFuture} or a
* {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable, * {@code ClosingFuture}. If possible, prefer calling {@link #call(CombiningCallable,
* Executor)} instead, with a function that returns the next value directly. * Executor)} instead, with a function that returns the next value directly.
* <li>Call {@link DeferredCloser#eventuallyClose(Closeable, Executor)
* closer.eventuallyClose()} for every closeable object this step creates in order to
* capture it for later closing.
* <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code * <li>Return a {@code ClosingFuture}. To turn a {@link ListenableFuture} into a {@code
* ClosingFuture} call {@link #from(ListenableFuture)}. * ClosingFuture} call {@link #from(ListenableFuture)}.
* </ul> * </ul>

View file

@ -35,21 +35,18 @@ import java.util.concurrent.TimeUnit;
public interface ListeningExecutorService extends ExecutorService { public interface ListeningExecutorService extends ExecutorService {
/** /**
* @return a {@code ListenableFuture} representing pending completion of the task * @return a {@code ListenableFuture} representing pending completion of the task
* @throws RejectedExecutionException {@inheritDoc}
*/ */
@Override @Override
<T> ListenableFuture<T> submit(Callable<T> task); <T> ListenableFuture<T> submit(Callable<T> task);
/** /**
* @return a {@code ListenableFuture} representing pending completion of the task * @return a {@code ListenableFuture} representing pending completion of the task
* @throws RejectedExecutionException {@inheritDoc}
*/ */
@Override @Override
ListenableFuture<?> submit(Runnable task); ListenableFuture<?> submit(Runnable task);
/** /**
* @return a {@code ListenableFuture} representing pending completion of the task * @return a {@code ListenableFuture} representing pending completion of the task
* @throws RejectedExecutionException {@inheritDoc}
*/ */
@Override @Override
<T> ListenableFuture<T> submit(Runnable task, T result); <T> ListenableFuture<T> submit(Runnable task, T result);
@ -69,8 +66,6 @@ public interface ListeningExecutorService extends ExecutorService {
* @return A list of {@code ListenableFuture} instances representing the tasks, in the same * @return A list of {@code ListenableFuture} instances representing the tasks, in the same
* sequential order as produced by the iterator for the given task list, each of which has * sequential order as produced by the iterator for the given task list, each of which has
* completed. * completed.
* @throws RejectedExecutionException {@inheritDoc}
* @throws NullPointerException if any task is null
*/ */
@Override @Override
<T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
@ -92,8 +87,6 @@ public interface ListeningExecutorService extends ExecutorService {
* sequential order as produced by the iterator for the given task list. If the operation did * sequential order as produced by the iterator for the given task list. If the operation did
* not time out, each task will have completed. If it did time out, some of these tasks will * not time out, each task will have completed. If it did time out, some of these tasks will
* not have completed. * not have completed.
* @throws RejectedExecutionException {@inheritDoc}
* @throws NullPointerException if any task is null
*/ */
@Override @Override
<T> List<Future<T>> invokeAll( <T> List<Future<T>> invokeAll(