mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.7.x' into 3.0.x
Closes gh-34938
This commit is contained in:
commit
320db790e7
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2012-2021 the original author or authors.
|
* Copyright 2012-2023 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -19,9 +19,7 @@ package org.springframework.boot.actuate.endpoint.invoker.cache;
|
|||||||
import java.security.Principal;
|
import java.security.Principal;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
@ -109,13 +107,7 @@ public class CachingOperationInvoker implements OperationInvoker {
|
|||||||
|
|
||||||
private void cleanExpiredCachedResponses(long accessTime) {
|
private void cleanExpiredCachedResponses(long accessTime) {
|
||||||
try {
|
try {
|
||||||
Iterator<Entry<CacheKey, CachedResponse>> iterator = this.cachedResponses.entrySet().iterator();
|
this.cachedResponses.entrySet().removeIf((entry) -> entry.getValue().isStale(accessTime, this.timeToLive));
|
||||||
while (iterator.hasNext()) {
|
|
||||||
Entry<CacheKey, CachedResponse> entry = iterator.next();
|
|
||||||
if (entry.getValue().isStale(accessTime, this.timeToLive)) {
|
|
||||||
iterator.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@ import java.util.Collection;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
@ -182,13 +181,8 @@ class OnBeanCondition extends FilteringSpringBootCondition implements Configurat
|
|||||||
for (String type : spec.getTypes()) {
|
for (String type : spec.getTypes()) {
|
||||||
Collection<String> typeMatches = getBeanNamesForType(classLoader, considerHierarchy, beanFactory, type,
|
Collection<String> typeMatches = getBeanNamesForType(classLoader, considerHierarchy, beanFactory, type,
|
||||||
parameterizedContainers);
|
parameterizedContainers);
|
||||||
Iterator<String> iterator = typeMatches.iterator();
|
typeMatches
|
||||||
while (iterator.hasNext()) {
|
.removeIf((match) -> beansIgnoredByType.contains(match) || ScopedProxyUtils.isScopedTarget(match));
|
||||||
String match = iterator.next();
|
|
||||||
if (beansIgnoredByType.contains(match) || ScopedProxyUtils.isScopedTarget(match)) {
|
|
||||||
iterator.remove();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (typeMatches.isEmpty()) {
|
if (typeMatches.isEmpty()) {
|
||||||
result.recordUnmatchedType(type);
|
result.recordUnmatchedType(type);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user