Skip to content

Commit 07c0213

Browse files
committed
Polishing
1 parent 667851c commit 07c0213

File tree

21 files changed

+35
-50
lines changed

21 files changed

+35
-50
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
@@ -582,7 +582,7 @@ public void registerDisposableBean(String beanName, DisposableBean bean) {
582582
public void registerContainedBean(String containedBeanName, String containingBeanName) {
583583
synchronized (this.containedBeanMap) {
584584
Set<String> containedBeans =
585-
this.containedBeanMap.computeIfAbsent(containingBeanName, k -> new LinkedHashSet<>(8));
585+
this.containedBeanMap.computeIfAbsent(containingBeanName, key -> new LinkedHashSet<>(8));
586586
if (!containedBeans.add(containedBeanName)) {
587587
return;
588588
}
@@ -601,15 +601,15 @@ public void registerDependentBean(String beanName, String dependentBeanName) {
601601

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

610610
synchronized (this.dependenciesForBeanMap) {
611611
Set<String> dependenciesForBean =
612-
this.dependenciesForBeanMap.computeIfAbsent(dependentBeanName, k -> new LinkedHashSet<>(8));
612+
this.dependenciesForBeanMap.computeIfAbsent(dependentBeanName, key -> new LinkedHashSet<>(8));
613613
dependenciesForBean.add(canonicalName);
614614
}
615615
}

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
@@ -377,7 +377,7 @@ private void processScheduledAsync(Scheduled scheduled, Method method, Object be
377377
try {
378378
task = ScheduledAnnotationReactiveSupport.createSubscriptionRunnable(method, bean, scheduled,
379379
this.registrar::getObservationRegistry,
380-
this.reactiveSubscriptions.computeIfAbsent(bean, k -> new CopyOnWriteArrayList<>()));
380+
this.reactiveSubscriptions.computeIfAbsent(bean, key -> new CopyOnWriteArrayList<>()));
381381
}
382382
catch (IllegalArgumentException ex) {
383383
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
@@ -88,9 +88,7 @@ final class AnnotationTypeMapping {
8888
this.root = (source != null ? source.getRoot() : this);
8989
this.distance = (source == null ? 0 : source.getDistance() + 1);
9090
this.annotationType = annotationType;
91-
this.metaTypes = merge(
92-
source != null ? source.getMetaTypes() : null,
93-
annotationType);
91+
this.metaTypes = merge((source != null ? source.getMetaTypes() : null), annotationType);
9492
this.annotation = annotation;
9593
this.attributes = AttributeMethods.forAnnotationType(annotationType);
9694
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
@@ -885,8 +885,7 @@ public static void registerDefaultValues(AnnotationAttributes attributes) {
885885
private static Map<String, DefaultValueHolder> getDefaultValues(
886886
Class<? extends Annotation> annotationType) {
887887

888-
return defaultValuesCache.computeIfAbsent(annotationType,
889-
AnnotationUtils::computeDefaultValues);
888+
return defaultValuesCache.computeIfAbsent(annotationType, AnnotationUtils::computeDefaultValues);
890889
}
891890

892891
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
@@ -481,7 +481,7 @@ public void add(GenericConverter converter) {
481481
}
482482

483483
private ConvertersForPair getMatchableConverters(ConvertiblePair convertiblePair) {
484-
return this.converters.computeIfAbsent(convertiblePair, k -> new ConvertersForPair());
484+
return this.converters.computeIfAbsent(convertiblePair, key -> new ConvertersForPair());
485485
}
486486

487487
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
@@ -321,8 +321,8 @@ public static SpringFactoriesLoader forResourceLocation(String resourceLocation,
321321
SpringFactoriesLoader.class.getClassLoader());
322322
Map<String, Factories> factoriesCache = cache.computeIfAbsent(
323323
resourceClassLoader, key -> new ConcurrentReferenceHashMap<>());
324-
Factories factories = factoriesCache.computeIfAbsent(resourceLocation, key ->
325-
new Factories(loadFactoriesResource(resourceClassLoader, resourceLocation)));
324+
Factories factories = factoriesCache.computeIfAbsent(resourceLocation,
325+
key -> new Factories(loadFactoriesResource(resourceClassLoader, resourceLocation)));
326326
return new SpringFactoriesLoader(classLoader, factories.byType());
327327
}
328328

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
}

spring-jms/src/main/java/org/springframework/jms/connection/CachingConnectionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public void resetConnection() {
245245
return null;
246246
}
247247

248-
Deque<Session> sessionList = this.cachedSessions.computeIfAbsent(mode, k -> new ArrayDeque<>());
248+
Deque<Session> sessionList = this.cachedSessions.computeIfAbsent(mode, key -> new ArrayDeque<>());
249249
Session session = null;
250250
synchronized (sessionList) {
251251
if (!sessionList.isEmpty()) {

0 commit comments

Comments
 (0)