Skip to content
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

Upgrade to Gradle v7.5 #2399

Merged
merged 2 commits into from Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2021 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2018-2022 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,8 +42,10 @@ public static ChannelBindException fail(SocketAddress bindAddress, @Nullable Thr
if (cause instanceof java.net.BindException ||
// With epoll/kqueue transport it is
// io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
//CHECKSTYLE:OFF
violetagg marked this conversation as resolved.
Show resolved Hide resolved
// "Unnecessary parentheses around expression"
(cause instanceof IOException && cause.getMessage() != null &&
cause.getMessage().contains("bind(..)"))) {
cause.getMessage().contains("bind(..)"))) { //CHECKSTYLE:ON
cause = null;
}
if (!(bindAddress instanceof InetSocketAddress)) {
Expand Down
Expand Up @@ -411,10 +411,13 @@ static boolean mustChunkFileTransfer(Connection c, Path file) {
return true;
}
ChannelPipeline p = c.channel().pipeline();
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
return p.get(SslHandler.class) != null ||
p.get(NettyPipeline.CompressionHandler) != null ||
(!(c.channel().eventLoop() instanceof NioEventLoop) &&
!"file".equals(file.toUri().getScheme()));
//CHECKSTYLE:ON
}

static void registerForClose(boolean shouldCleanupOnClose,
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2011-2022 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -44,6 +44,8 @@ public AbortedException(Throwable throwable) {
* @return true if connection has been simply aborted on a tcp level
*/
public static boolean isConnectionReset(Throwable err) {
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
return (err instanceof AbortedException && CONNECTION_CLOSED_BEFORE_SEND.equals(err.getMessage())) ||
(err instanceof IOException && (err.getMessage() == null ||
err.getMessage()
Expand All @@ -53,6 +55,7 @@ public static boolean isConnectionReset(Throwable err) {
(err instanceof SocketException && err.getMessage() != null &&
err.getMessage()
.contains("Connection reset by peer"));
//CHECKSTYLE:ON
}

public static AbortedException beforeSend() {
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2011-2022 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -318,7 +318,9 @@ else if (v instanceof ByteBufHolder) {
}
}

if ((receiverDemand -= e) > 0L || (e > 0L && q.size() < QUEUE_LOW_LIMIT)) {
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
if ((receiverDemand -= e) > 0L || (e > 0L && q.size() < QUEUE_LOW_LIMIT)) { //CHECKSTYLE:ON
if (needRead) {
needRead = false;
channel.config()
Expand Down
Expand Up @@ -129,11 +129,13 @@ public void onComplete() {

@Override
public void onError(Throwable t) {
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
if (bindAddress != null && (t instanceof BindException ||
// With epoll/kqueue transport it is
// io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
(t instanceof IOException && t.getMessage() != null &&
t.getMessage().contains("bind(..)")))) {
t.getMessage().contains("bind(..)")))) { //CHECKSTYLE:ON
sink.error(ChannelBindException.fail(bindAddress.get(), null));
}
else {
Expand Down
Expand Up @@ -279,8 +279,11 @@ else if (origin instanceof InetSocketAddress && target instanceof InetSocketAddr
InetSocketAddress isaTarget = (InetSocketAddress) target;
if (isaOrigin.getPort() == isaTarget.getPort()) {
InetAddress iaTarget = isaTarget.getAddress();
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
return (iaTarget != null && iaTarget.isAnyLocalAddress()) ||
Objects.equals(isaOrigin.getHostString(), isaTarget.getHostString());
Objects.equals(isaOrigin.getHostString(), isaTarget.getHostString());
//CHECKSTYLE:ON
}
}
return false;
Expand Down Expand Up @@ -428,8 +431,10 @@ PoolBuilder<T, PoolConfig<T>> newPoolInternal(
PoolBuilder.from(allocator)
.destroyHandler(destroyHandler)
.evictionPredicate(evictionPredicate
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
.or((poolable, meta) -> (maxIdleTime != -1 && meta.idleTime() >= maxIdleTime)
|| (maxLifeTime != -1 && meta.lifeTime() >= maxLifeTime)))
|| (maxLifeTime != -1 && meta.lifeTime() >= maxLifeTime))) //CHECKSTYLE:ON
.maxPendingAcquire(pendingAcquireMaxCount)
.evictInBackground(evictionInterval);

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2021 VMware, Inc. or its affiliates, All Rights Reserved.
* Copyright (c) 2011-2022 VMware, Inc. or its affiliates, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -376,7 +376,9 @@ else if ((maxPort - minPort) < numRequested) {

final TreeSet<Integer> availablePorts = new TreeSet<>();
int attemptCount = 0;
while ((++attemptCount <= numRequested + 100) && (availablePorts.size() < numRequested)) {
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
while ((++attemptCount <= numRequested + 100) && (availablePorts.size() < numRequested)) { //CHECKSTYLE:ON
availablePorts.add(findAvailablePort(minPort, maxPort));
}

Expand Down
Expand Up @@ -985,7 +985,8 @@ public void onUncaughtException(Connection connection, Throwable error) {
doOnRequestError.accept(connection.as(HttpClientOperations.class), error);
return;
}
if (doOnResponseError != null && (ops.responseState != null) && !(error instanceof RedirectClientException)) {
if (doOnResponseError != null && ops.responseState != null &&
!(error instanceof RedirectClientException)) {
doOnResponseError.accept(connection.as(HttpClientOperations.class), error);
}
}
Expand Down
Expand Up @@ -1044,7 +1044,7 @@ public void onChannelInit(ConnectionObserver observer, Channel channel, @Nullabl

if (sslProvider != null) {
ChannelPipeline pipeline = channel.pipeline();
if (redirectHttpToHttps && ((protocols & h2) != h2)) {
if (redirectHttpToHttps && (protocols & h2) != h2) {
NonSslRedirectDetector nonSslRedirectDetector = new NonSslRedirectDetector(sslProvider,
remoteAddress,
SSL_DEBUG);
Expand Down
Expand Up @@ -174,7 +174,9 @@ public void onError(Throwable t) {
if (t instanceof BindException ||
// With epoll/kqueue transport it is
// io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
(t instanceof IOException && t.getMessage() != null && t.getMessage().contains("bind(..)"))) {
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
(t instanceof IOException && t.getMessage() != null && t.getMessage().contains("bind(..)"))) { //CHECKSTYLE:ON
sink.error(ChannelBindException.fail(bindAddress, null));
}
else {
Expand Down
Expand Up @@ -137,7 +137,9 @@ public void onError(Throwable t) {
if (t instanceof BindException ||
// With epoll/kqueue transport it is
// io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
(t instanceof IOException && t.getMessage() != null && t.getMessage().contains("bind(..)"))) {
//CHECKSTYLE:OFF
// "Unnecessary parentheses around expression"
(t instanceof IOException && t.getMessage() != null && t.getMessage().contains("bind(..)"))) { //CHECKSTYLE:ON
sink.error(ChannelBindException.fail(bindAddress, null));
}
else {
Expand Down