Skip to content

Commit cdf0c5c

Browse files
committed
Upgrade to Gradle 5.3.1, Kotlin-1.3.30
* Fix new Sonar smell in the `CacheRequestHandlerAdvice`
1 parent 735e82e commit cdf0c5c

File tree

6 files changed

+80
-48
lines changed

6 files changed

+80
-48
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlinVersion = '1.3.21'
2+
ext.kotlinVersion = '1.3.30'
33
repositories {
44
maven { url 'https://repo.spring.io/plugins-release' }
55
}

gradle/wrapper/gradle-wrapper.jar

426 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

gradlew

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#!/usr/bin/env sh
22

3+
#
4+
# Copyright 2015 the original author or authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
319
##############################################################################
420
##
521
## Gradle start up script for UN*X
@@ -28,7 +44,7 @@ APP_NAME="Gradle"
2844
APP_BASE_NAME=`basename "$0"`
2945

3046
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31-
DEFAULT_JVM_OPTS='"-Xmx64m"'
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
3248

3349
# Use the maximum available, or set MAX_FD != -1 to use that value.
3450
MAX_FD="maximum"

gradlew.bat

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem http://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
117
@if "%DEBUG%" == "" @echo off
218
@rem ##########################################################################
319
@rem
@@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
1430
set APP_HOME=%DIRNAME%
1531

1632
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17-
set DEFAULT_JVM_OPTS="-Xmx64m"
33+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
1834

1935
@rem Find java.exe
2036
if defined JAVA_HOME goto findJavaFromJavaHome

spring-integration-core/src/main/java/org/springframework/integration/handler/advice/CacheRequestHandlerAdvice.java

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -174,59 +174,59 @@ public void afterSingletonsInstantiated() {
174174

175175
@Override
176176
protected void onInit() {
177-
List<CacheOperation> cacheOperations;
177+
List<CacheOperation> cacheOperationsToUse;
178178
if (!ObjectUtils.isEmpty(this.cacheNames)) {
179-
cacheOperations = this.cacheOperations.stream()
180-
.filter((operation) -> ObjectUtils.isEmpty(operation.getCacheNames()))
181-
.map((operation) -> {
182-
CacheOperation.Builder builder;
183-
if (operation instanceof CacheableOperation) {
184-
CacheableOperation cacheableOperation = (CacheableOperation) operation;
185-
CacheableOperation.Builder cacheableBuilder = new CacheableOperation.Builder();
186-
cacheableBuilder.setSync(cacheableOperation.isSync());
187-
String unless = cacheableOperation.getUnless();
188-
if (unless != null) {
189-
cacheableBuilder.setUnless(unless);
190-
}
191-
builder = cacheableBuilder;
192-
}
193-
else if (operation instanceof CacheEvictOperation) {
194-
CacheEvictOperation.Builder cacheEvictBuilder = new CacheEvictOperation.Builder();
195-
CacheEvictOperation cacheEvictOperation = (CacheEvictOperation) operation;
196-
cacheEvictBuilder.setBeforeInvocation(cacheEvictOperation.isBeforeInvocation());
197-
cacheEvictBuilder.setCacheWide(cacheEvictOperation.isCacheWide());
198-
builder = cacheEvictBuilder;
199-
}
200-
else {
201-
CachePutOperation cachePutOperation = (CachePutOperation) operation;
202-
CachePutOperation.Builder cachePutBuilder = new CachePutOperation.Builder();
203-
String unless = cachePutOperation.getUnless();
204-
if (unless != null) {
205-
cachePutBuilder.setUnless(unless);
206-
}
207-
builder = cachePutBuilder;
208-
}
209-
210-
builder.setName(operation.getName());
211-
builder.setCacheManager(operation.getCacheManager());
212-
builder.setCacheNames(this.cacheNames);
213-
builder.setCacheResolver(operation.getCacheResolver());
214-
builder.setCondition(operation.getCondition());
215-
builder.setKey(operation.getKey());
216-
builder.setKeyGenerator(operation.getKeyGenerator());
217-
return builder.build();
218-
})
219-
.collect(Collectors.toList());
179+
cacheOperationsToUse =
180+
this.cacheOperations.stream()
181+
.filter((operation) -> ObjectUtils.isEmpty(operation.getCacheNames()))
182+
.map((operation) -> {
183+
CacheOperation.Builder builder;
184+
if (operation instanceof CacheableOperation) {
185+
CacheableOperation cacheableOperation = (CacheableOperation) operation;
186+
CacheableOperation.Builder cacheableBuilder = new CacheableOperation.Builder();
187+
cacheableBuilder.setSync(cacheableOperation.isSync());
188+
String unless = cacheableOperation.getUnless();
189+
if (unless != null) {
190+
cacheableBuilder.setUnless(unless);
191+
}
192+
builder = cacheableBuilder;
193+
}
194+
else if (operation instanceof CacheEvictOperation) {
195+
CacheEvictOperation.Builder cacheEvictBuilder = new CacheEvictOperation.Builder();
196+
CacheEvictOperation cacheEvictOperation = (CacheEvictOperation) operation;
197+
cacheEvictBuilder.setBeforeInvocation(cacheEvictOperation.isBeforeInvocation());
198+
cacheEvictBuilder.setCacheWide(cacheEvictOperation.isCacheWide());
199+
builder = cacheEvictBuilder;
200+
}
201+
else {
202+
CachePutOperation cachePutOperation = (CachePutOperation) operation;
203+
CachePutOperation.Builder cachePutBuilder = new CachePutOperation.Builder();
204+
String unless = cachePutOperation.getUnless();
205+
if (unless != null) {
206+
cachePutBuilder.setUnless(unless);
207+
}
208+
builder = cachePutBuilder;
209+
}
210+
builder.setName(operation.getName());
211+
builder.setCacheManager(operation.getCacheManager());
212+
builder.setCacheNames(this.cacheNames);
213+
builder.setCacheResolver(operation.getCacheResolver());
214+
builder.setCondition(operation.getCondition());
215+
builder.setKey(operation.getKey());
216+
builder.setKeyGenerator(operation.getKeyGenerator());
217+
return builder.build();
218+
})
219+
.collect(Collectors.toList());
220220
}
221221
else {
222-
cacheOperations = this.cacheOperations;
222+
cacheOperationsToUse = this.cacheOperations;
223223
}
224224

225225
this.delegate.setBeanFactory(getBeanFactory());
226226
EvaluationContext evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
227227
this.delegate.setKeyGenerator((target, method, params) ->
228228
this.keyExpression.getValue(evaluationContext, params[0])); // NOSONAR
229-
this.delegate.setCacheOperationSources((method, targetClass) -> cacheOperations);
229+
this.delegate.setCacheOperationSources((method, targetClass) -> cacheOperationsToUse);
230230
this.delegate.afterPropertiesSet();
231231

232232
}

0 commit comments

Comments
 (0)