Skip to content

Commit 2c2c160

Browse files
committed
Remove deprecated code
See gh-24806
1 parent a18f01a commit 2c2c160

File tree

48 files changed

+89
-1149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+89
-1149
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterValue.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -93,17 +93,6 @@ public static MeterValue valueOf(String value) {
9393
return new MeterValue(DurationStyle.detectAndParse(value));
9494
}
9595

96-
/**
97-
* Return a new {@link MeterValue} instance for the given long value.
98-
* @param value the source value
99-
* @return a {@link MeterValue} instance
100-
* @deprecated as of 2.3.0 in favor of {@link #valueOf(double)}
101-
*/
102-
@Deprecated
103-
public static MeterValue valueOf(long value) {
104-
return new MeterValue(value);
105-
}
106-
10796
/**
10897
* Return a new {@link MeterValue} instance for the given double value.
10998
* @param value the source value

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import java.util.Map;
2121

2222
import org.springframework.boot.context.properties.ConfigurationProperties;
23-
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
2423
import org.springframework.boot.context.properties.NestedConfigurationProperty;
2524

2625
/**
@@ -262,12 +261,6 @@ public Map<String, double[]> getPercentiles() {
262261
return this.percentiles;
263262
}
264263

265-
@Deprecated
266-
@DeprecatedConfigurationProperty(replacement = "management.metrics.distribution.slo")
267-
public Map<String, ServiceLevelObjectiveBoundary[]> getSla() {
268-
return this.slo;
269-
}
270-
271264
public Map<String, ServiceLevelObjectiveBoundary[]> getSlo() {
272265
return this.slo;
273266
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/ServiceLevelAgreementBoundary.java

Lines changed: 0 additions & 72 deletions
This file was deleted.

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/PropertiesMeterFilterTests.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -203,15 +203,6 @@ void configureWhenAllPercentilesSetShouldSetPercentilesToValue() {
203203
.containsExactly(1, 1.5, 2);
204204
}
205205

206-
@Test
207-
@Deprecated
208-
void configureWhenHasDeprecatedSlaShouldSetSlaToValue() {
209-
PropertiesMeterFilter filter = new PropertiesMeterFilter(
210-
createProperties("distribution.sla.spring.boot=1,2,3"));
211-
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT)
212-
.getServiceLevelObjectiveBoundaries()).containsExactly(1000000, 2000000, 3000000);
213-
}
214-
215206
@Test
216207
void configureWhenHasSloShouldSetSloToValue() {
217208
PropertiesMeterFilter filter = new PropertiesMeterFilter(

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ManagementErrorEndpointTests.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -128,13 +128,12 @@ public Throwable getError(WebRequest webRequest) {
128128
}
129129

130130
@Test
131-
void errorResponseWithDefaultErrorAttributesSubclassUsingDeprecatedApiAndDelegation() {
131+
void errorResponseWithDefaultErrorAttributesSubclassUsingDelegation() {
132132
ErrorAttributes attributes = new DefaultErrorAttributes() {
133133

134134
@Override
135-
@SuppressWarnings("deprecation")
136-
public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean includeStackTrace) {
137-
Map<String, Object> response = super.getErrorAttributes(webRequest, includeStackTrace);
135+
public Map<String, Object> getErrorAttributes(WebRequest webRequest, ErrorAttributeOptions options) {
136+
Map<String, Object> response = super.getErrorAttributes(webRequest, options);
138137
response.put("error", "custom error");
139138
response.put("custom", "value");
140139
response.remove("path");
@@ -151,7 +150,7 @@ public Map<String, Object> getErrorAttributes(WebRequest webRequest, boolean inc
151150
}
152151

153152
@Test
154-
void errorResponseWithDefaultErrorAttributesSubclassUsingDeprecatedApiWithoutDelegation() {
153+
void errorResponseWithDefaultErrorAttributesSubclassWithoutDelegation() {
155154
ErrorAttributes attributes = new DefaultErrorAttributes() {
156155

157156
@Override

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoker/cache/CachingOperationInvoker.java

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -104,22 +104,6 @@ private CachedResponse createCachedResponse(Object response, long accessTime) {
104104
return new CachedResponse(response, accessTime);
105105
}
106106

107-
/**
108-
* Apply caching configuration when appropriate to the given invoker.
109-
* @param invoker the invoker to wrap
110-
* @param timeToLive the maximum time in milliseconds that a response can be cached
111-
* @return a caching version of the invoker or the original instance if caching is not
112-
* required
113-
* @deprecated as of 2.3.0 to make it package-private in 2.4
114-
*/
115-
@Deprecated
116-
public static OperationInvoker apply(OperationInvoker invoker, long timeToLive) {
117-
if (timeToLive > 0) {
118-
return new CachingOperationInvoker(invoker, timeToLive);
119-
}
120-
return invoker;
121-
}
122-
123107
/**
124108
* A cached response that encapsulates the response itself and the time at which it
125109
* was created.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/client/WebClientExchangeTags.java

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -94,30 +94,6 @@ public static Tag status(ClientResponse response, Throwable throwable) {
9494
return CLIENT_ERROR;
9595
}
9696

97-
/**
98-
* Creates a {@code status} {@code Tag} derived from the
99-
* {@link ClientResponse#statusCode()} of the given {@code response}.
100-
* @param response the response
101-
* @return the status tag
102-
* @deprecated since 2.3.0 in favor of {@link #status(ClientResponse, Throwable)}
103-
*/
104-
@Deprecated
105-
public static Tag status(ClientResponse response) {
106-
return Tag.of("status", String.valueOf(response.rawStatusCode()));
107-
}
108-
109-
/**
110-
* Creates a {@code status} {@code Tag} derived from the exception thrown by the
111-
* client.
112-
* @param throwable the exception
113-
* @return the status tag
114-
* @deprecated since 2.3.0 in favor of {@link #status(ClientResponse, Throwable)}
115-
*/
116-
@Deprecated
117-
public static Tag status(Throwable throwable) {
118-
return (throwable instanceof IOException) ? IO_ERROR : CLIENT_ERROR;
119-
}
120-
12197
/**
12298
* Create a {@code clientName} {@code Tag} derived from the
12399
* {@link java.net.URI#getHost host} of the {@link ClientRequest#url() URL} of the

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/JobLauncherCommandLineRunner.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/CouchbaseCacheConfiguration.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -39,20 +39,16 @@
3939
* Couchbase cache configuration.
4040
*
4141
* @author Stephane Nicoll
42-
* @since 1.4.0
43-
* @deprecated since 2.3.3 as this class is not intended for public use. It will be made
44-
* package-private in a future release
4542
*/
4643
@Configuration(proxyBeanMethods = false)
4744
@ConditionalOnClass({ Cluster.class, CouchbaseClientFactory.class, CouchbaseCacheManager.class })
4845
@ConditionalOnMissingBean(CacheManager.class)
4946
@ConditionalOnSingleCandidate(CouchbaseClientFactory.class)
5047
@Conditional(CacheCondition.class)
51-
@Deprecated
52-
public class CouchbaseCacheConfiguration {
48+
class CouchbaseCacheConfiguration {
5349

5450
@Bean
55-
public CouchbaseCacheManager cacheManager(CacheProperties cacheProperties, CacheManagerCustomizers customizers,
51+
CouchbaseCacheManager cacheManager(CacheProperties cacheProperties, CacheManagerCustomizers customizers,
5652
ObjectProvider<CouchbaseCacheManagerBuilderCustomizer> couchbaseCacheManagerBuilderCustomizers,
5753
CouchbaseClientFactory clientFactory) {
5854
List<String> cacheNames = cacheProperties.getCacheNames();

0 commit comments

Comments
 (0)