Skip to content

Commit 1fd1d8d

Browse files
committed
Polishing
(cherry picked from commit 07c0213)
1 parent afc40d7 commit 1fd1d8d

File tree

21 files changed

+35
-51
lines changed

21 files changed

+35
-51
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ public void registerDisposableBean(String beanName, DisposableBean bean) {
585585
public void registerContainedBean(String containedBeanName, String containingBeanName) {
586586
synchronized (this.containedBeanMap) {
587587
Set<String> containedBeans =
588-
this.containedBeanMap.computeIfAbsent(containingBeanName, k -> new LinkedHashSet<>(8));
588+
this.containedBeanMap.computeIfAbsent(containingBeanName, key -> new LinkedHashSet<>(8));
589589
if (!containedBeans.add(containedBeanName)) {
590590
return;
591591
}
@@ -604,15 +604,15 @@ public void registerDependentBean(String beanName, String dependentBeanName) {
604604

605605
synchronized (this.dependentBeanMap) {
606606
Set<String> dependentBeans =
607-
this.dependentBeanMap.computeIfAbsent(canonicalName, k -> new LinkedHashSet<>(8));
607+
this.dependentBeanMap.computeIfAbsent(canonicalName, key -> new LinkedHashSet<>(8));
608608
if (!dependentBeans.add(dependentBeanName)) {
609609
return;
610610
}
611611
}
612612

613613
synchronized (this.dependenciesForBeanMap) {
614614
Set<String> dependenciesForBean =
615-
this.dependenciesForBeanMap.computeIfAbsent(dependentBeanName, k -> new LinkedHashSet<>(8));
615+
this.dependenciesForBeanMap.computeIfAbsent(dependentBeanName, key -> new LinkedHashSet<>(8));
616616
dependenciesForBean.add(canonicalName);
617617
}
618618
}

spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheApiTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ void setup() {
5151
this.cacheManager.createCache(CACHE_NAME_NO_NULL, new MutableConfiguration<>());
5252
this.nativeCache = this.cacheManager.getCache(CACHE_NAME);
5353
this.cache = new JCacheCache(this.nativeCache);
54-
Cache<Object, Object> nativeCacheNoNull =
55-
this.cacheManager.getCache(CACHE_NAME_NO_NULL);
54+
Cache<Object, Object> nativeCacheNoNull = this.cacheManager.getCache(CACHE_NAME_NO_NULL);
5655
this.cacheNoNull = new JCacheCache(nativeCacheNoNull, false);
5756
}
5857

spring-context/src/main/java/org/springframework/cache/config/CacheAdviceParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private RootBeanDefinition parseDefinitionSource(Element definition, ParserConte
113113
builder.setUnless(getAttributeValue(opElement, "unless", ""));
114114
builder.setSync(Boolean.parseBoolean(getAttributeValue(opElement, "sync", "false")));
115115

116-
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, k -> new ArrayList<>(2));
116+
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, key -> new ArrayList<>(2));
117117
col.add(builder.build());
118118
}
119119

@@ -136,7 +136,7 @@ private RootBeanDefinition parseDefinitionSource(Element definition, ParserConte
136136
builder.setBeforeInvocation(Boolean.parseBoolean(after.trim()));
137137
}
138138

139-
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, k -> new ArrayList<>(2));
139+
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, key -> new ArrayList<>(2));
140140
col.add(builder.build());
141141
}
142142

@@ -150,7 +150,7 @@ private RootBeanDefinition parseDefinitionSource(Element definition, ParserConte
150150
parserContext.getReaderContext(), new CachePutOperation.Builder());
151151
builder.setUnless(getAttributeValue(opElement, "unless", ""));
152152

153-
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, k -> new ArrayList<>(2));
153+
Collection<CacheOperation> col = cacheOpMap.computeIfAbsent(nameHolder, key -> new ArrayList<>(2));
154154
col.add(builder.build());
155155
}
156156

spring-context/src/main/java/org/springframework/scheduling/annotation/ScheduledAnnotationBeanPostProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private void processScheduledAsync(Scheduled scheduled, Method method, Object be
383383
try {
384384
task = ScheduledAnnotationReactiveSupport.createSubscriptionRunnable(method, bean, scheduled,
385385
this.registrar::getObservationRegistry,
386-
this.reactiveSubscriptions.computeIfAbsent(bean, k -> new CopyOnWriteArrayList<>()));
386+
this.reactiveSubscriptions.computeIfAbsent(bean, key -> new CopyOnWriteArrayList<>()));
387387
}
388388
catch (IllegalArgumentException ex) {
389389
throw new IllegalStateException("Could not create recurring task for @Scheduled method '" +

spring-core/src/main/java/org/springframework/cglib/core/internal/CustomizerRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public void add(KeyFactoryCustomizer customizer) {
2222
Class<? extends KeyFactoryCustomizer> klass = customizer.getClass();
2323
for (Class type : customizerTypes) {
2424
if (type.isAssignableFrom(klass)) {
25-
List<KeyFactoryCustomizer> list = customizers.computeIfAbsent(type, k -> new ArrayList<>());
25+
List<KeyFactoryCustomizer> list = customizers.computeIfAbsent(type, key -> new ArrayList<>());
2626
list.add(customizer);
2727
}
2828
}

spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ final class AnnotationTypeMapping {
112112
this.root = (source != null ? source.getRoot() : this);
113113
this.distance = (source == null ? 0 : source.getDistance() + 1);
114114
this.annotationType = annotationType;
115-
this.metaTypes = merge(
116-
source != null ? source.getMetaTypes() : null,
117-
annotationType);
115+
this.metaTypes = merge((source != null ? source.getMetaTypes() : null), annotationType);
118116
this.annotation = annotation;
119117
this.attributes = AttributeMethods.forAnnotationType(annotationType);
120118
this.mirrorSets = new MirrorSets();

spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,8 +894,7 @@ public static void registerDefaultValues(AnnotationAttributes attributes) {
894894
private static Map<String, DefaultValueHolder> getDefaultValues(
895895
Class<? extends Annotation> annotationType) {
896896

897-
return defaultValuesCache.computeIfAbsent(annotationType,
898-
AnnotationUtils::computeDefaultValues);
897+
return defaultValuesCache.computeIfAbsent(annotationType, AnnotationUtils::computeDefaultValues);
899898
}
900899

901900
private static Map<String, DefaultValueHolder> computeDefaultValues(

spring-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ public void add(GenericConverter converter) {
490490
}
491491

492492
private ConvertersForPair getMatchableConverters(ConvertiblePair convertiblePair) {
493-
return this.converters.computeIfAbsent(convertiblePair, k -> new ConvertersForPair());
493+
return this.converters.computeIfAbsent(convertiblePair, key -> new ConvertersForPair());
494494
}
495495

496496
public void remove(Class<?> sourceType, Class<?> targetType) {

spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ public static SpringFactoriesLoader forResourceLocation(String resourceLocation,
323323
SpringFactoriesLoader.class.getClassLoader());
324324
Map<String, Factories> factoriesCache = cache.computeIfAbsent(
325325
resourceClassLoader, key -> new ConcurrentReferenceHashMap<>());
326-
Factories factories = factoriesCache.computeIfAbsent(resourceLocation, key ->
327-
new Factories(loadFactoriesResource(resourceClassLoader, resourceLocation)));
326+
Factories factories = factoriesCache.computeIfAbsent(resourceLocation,
327+
key -> new Factories(loadFactoriesResource(resourceClassLoader, resourceLocation)));
328328
return new SpringFactoriesLoader(classLoader, factories.byType());
329329
}
330330

spring-core/src/main/java/org/springframework/util/xml/SimpleNamespaceContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void bindNamespaceUri(String prefix, String namespaceUri) {
125125
else {
126126
this.prefixToNamespaceUri.put(prefix, namespaceUri);
127127
Set<String> prefixes =
128-
this.namespaceUriToPrefixes.computeIfAbsent(namespaceUri, k -> new LinkedHashSet<>());
128+
this.namespaceUriToPrefixes.computeIfAbsent(namespaceUri, key -> new LinkedHashSet<>());
129129
prefixes.add(prefix);
130130
}
131131
}

0 commit comments

Comments
 (0)