Skip to content

Commit eb842eb

Browse files
committed
Remove all deprecated methods
1 parent ac1a14f commit eb842eb

48 files changed

Lines changed: 149 additions & 488 deletions

File tree

Some content is hidden

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

‎benchmark/src/main/java/feign/benchmark/DecoderIteratorsBenchmark.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public void buildResponse() {
8181
response = Response.builder()
8282
.status(200)
8383
.reason("OK")
84-
.request(Request.create(HttpMethod.GET, "/", Collections.emptyMap(), null, Util.UTF_8))
84+
.request(
85+
Request.create(HttpMethod.GET, "/", Collections.emptyMap(), null, Util.UTF_8, null))
8586
.headers(Collections.emptyMap())
8687
.body(carsJson(Integer.parseInt(size)), Util.UTF_8)
8788
.build();

‎core/src/main/java/feign/Contract.java‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,6 @@ public List<MethodMetadata> parseAndValidateMetadata(Class<?> targetType) {
6767
return new ArrayList<>(result.values());
6868
}
6969

70-
/**
71-
* @deprecated use {@link #parseAndValidateMetadata(Class, Method)} instead.
72-
*/
73-
@Deprecated
74-
public MethodMetadata parseAndValidateMetadata(Method method) {
75-
return parseAndValidateMetadata(method.getDeclaringClass(), method);
76-
}
77-
7870
/**
7971
* Called indirectly by {@link #parseAndValidateMetadata(Class)}.
8072
*/

‎core/src/main/java/feign/Feign.java‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@ public static String configKey(Class targetType, Method method) {
8181
return builder.append(')').toString();
8282
}
8383

84-
/**
85-
* @deprecated use {@link #configKey(Class, Method)} instead.
86-
*/
87-
@Deprecated
88-
public static String configKey(Method method) {
89-
return configKey(method.getDeclaringClass(), method);
90-
}
91-
9284
/**
9385
* Returns a new instance of an HTTP API, defined by annotations in the {@link Feign Contract},
9486
* for the specified {@code target}. You should cache this result.

‎core/src/main/java/feign/FeignException.java‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,6 @@ public int status() {
103103
return this.status;
104104
}
105105

106-
/**
107-
* The Response Body, if present.
108-
*
109-
* @return the body of the response.
110-
* @deprecated use {@link #responseBody()} instead.
111-
*/
112-
@Deprecated
113-
public byte[] content() {
114-
return this.responseBody;
115-
}
116-
117106
/**
118107
* The Response body.
119108
*

‎core/src/main/java/feign/Logger.java‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -164,26 +164,9 @@ public static class JavaLogger extends Logger {
164164

165165
final java.util.logging.Logger logger;
166166

167-
/**
168-
* @deprecated Use {@link #JavaLogger(String)} or {@link #JavaLogger(Class)} instead.
169-
*
170-
* This constructor can be used to create just one logger. Example =
171-
* {@code Logger.JavaLogger().appendToFile("logs/first.log")}
172-
*
173-
* If you create multiple loggers for multiple clients and provide different files
174-
* to write log - you'll have unexpected behavior - all clients will write same log
175-
* to each file.
176-
*
177-
* That's why this constructor will be removed in future.
178-
*/
179-
@Deprecated
180-
public JavaLogger() {
181-
logger = java.util.logging.Logger.getLogger(Logger.class.getName());
182-
}
183-
184167
/**
185168
* Constructor for JavaLogger class
186-
*
169+
*
187170
* @param loggerName a name for the logger. This should be a dot-separated name and should
188171
* normally be based on the package name or class name of the subsystem, such as java.net
189172
* or javax.swing

‎core/src/main/java/feign/Param.java‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@
3535
*/
3636
Class<? extends Expander> expander() default ToStringExpander.class;
3737

38-
/**
39-
* {@code encoded} has been maintained for backward compatibility and should be deprecated. We no
40-
* longer need it as values that are already pct-encoded should be identified during expansion and
41-
* passed through without any changes
42-
*
43-
* @see QueryMap#encoded
44-
* @deprecated
45-
*/
46-
boolean encoded() default false;
47-
4838
interface Expander {
4939

5040
/**

‎core/src/main/java/feign/QueryMapEncoder.java‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,9 @@ public interface QueryMapEncoder {
3535
Map<String, Object> encode(Object object);
3636

3737
/**
38-
* @deprecated use {@link BeanQueryMapEncoder} instead. default encoder uses reflection to inspect
39-
* provided objects Fields to expand the objects values into a query string. If you
40-
* prefer that the query string be built using getter and setter methods, as defined
41-
* in the Java Beans API, please use the {@link BeanQueryMapEncoder}
38+
* Default encoder uses reflection to inspect provided objects Fields to expand the objects values
39+
* into a query string. If you prefer that the query string be built using getter and setter
40+
* methods, as defined in the Java Beans API, use the {@link BeanQueryMapEncoder}
4241
*/
4342
class Default extends FieldQueryMapEncoder {
4443
}

‎core/src/main/java/feign/Request.java‎

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -33,42 +33,6 @@ public enum HttpMethod {
3333
GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH
3434
}
3535

36-
/**
37-
* No parameters can be null except {@code body} and {@code charset}. All parameters must be
38-
* effectively immutable, via safe copies, not mutating or otherwise.
39-
*
40-
* @deprecated {@link #create(HttpMethod, String, Map, byte[], Charset)}
41-
*/
42-
@Deprecated
43-
public static Request create(String method,
44-
String url,
45-
Map<String, Collection<String>> headers,
46-
byte[] body,
47-
Charset charset) {
48-
checkNotNull(method, "httpMethod of %s", method);
49-
final HttpMethod httpMethod = HttpMethod.valueOf(method.toUpperCase());
50-
return create(httpMethod, url, headers, body, charset, null);
51-
}
52-
53-
/**
54-
* Builds a Request. All parameters must be effectively immutable, via safe copies.
55-
*
56-
* @param httpMethod for the request.
57-
* @param url for the request.
58-
* @param headers to include.
59-
* @param body of the request, can be {@literal null}
60-
* @param charset of the request, can be {@literal null}
61-
* @return a Request
62-
*/
63-
@Deprecated
64-
public static Request create(HttpMethod httpMethod,
65-
String url,
66-
Map<String, Collection<String>> headers,
67-
byte[] body,
68-
Charset charset) {
69-
return create(httpMethod, url, headers, Body.create(body, charset), null);
70-
}
71-
7236
/**
7337
* Builds a Request. All parameters must be effectively immutable, via safe copies.
7438
*
@@ -132,17 +96,6 @@ public static Request create(HttpMethod httpMethod,
13296
this.requestTemplate = requestTemplate;
13397
}
13498

135-
/**
136-
* Http Method for this request.
137-
*
138-
* @return the HttpMethod string
139-
* @deprecated @see {@link #httpMethod()}
140-
*/
141-
@Deprecated
142-
public String method() {
143-
return httpMethod.name();
144-
}
145-
14699
/**
147100
* Http Method for the request.
148101
*
@@ -235,22 +188,6 @@ public static class Options {
235188
private final TimeUnit readTimeoutUnit;
236189
private final boolean followRedirects;
237190

238-
/**
239-
* Creates a new Options instance.
240-
*
241-
* @param connectTimeoutMillis connection timeout in milliseconds.
242-
* @param readTimeoutMillis read timeout in milliseconds.
243-
* @param followRedirects if the request should follow 3xx redirections.
244-
*
245-
* @deprecated please use {@link #Options(long, TimeUnit, long, TimeUnit, boolean)}
246-
*/
247-
@Deprecated
248-
public Options(int connectTimeoutMillis, int readTimeoutMillis, boolean followRedirects) {
249-
this(connectTimeoutMillis, TimeUnit.MILLISECONDS,
250-
readTimeoutMillis, TimeUnit.MILLISECONDS,
251-
followRedirects);
252-
}
253-
254191
/**
255192
* Creates a new Options Instance.
256193
*
@@ -271,19 +208,6 @@ public Options(long connectTimeout, TimeUnit connectTimeoutUnit,
271208
this.followRedirects = followRedirects;
272209
}
273210

274-
/**
275-
* Creates a new Options instance that follows redirects by default.
276-
*
277-
* @param connectTimeoutMillis connection timeout in milliseconds.
278-
* @param readTimeoutMillis read timeout in milliseconds.
279-
*
280-
* @deprecated please use {@link #Options(long, TimeUnit, long, TimeUnit, boolean)}
281-
*/
282-
@Deprecated
283-
public Options(int connectTimeoutMillis, int readTimeoutMillis) {
284-
this(connectTimeoutMillis, readTimeoutMillis, true);
285-
}
286-
287211
/**
288212
* Creates the new Options instance using the following defaults:
289213
* <ul>
@@ -431,21 +355,6 @@ public static Body create(byte[] data, Charset charset) {
431355
return new Body(data, charset);
432356
}
433357

434-
/**
435-
* Creates a new Request Body with charset encoded data.
436-
*
437-
* @param data to be encoded.
438-
* @param charset to encode the data with. if {@literal null}, then data will be considered
439-
* binary and will not be encoded.
440-
*
441-
* @return a new Request.Body instance with the encoded data.
442-
* @deprecated please use {@link Request.Body#create(byte[], Charset)}
443-
*/
444-
@Deprecated
445-
public static Body encoded(byte[] data, Charset charset) {
446-
return create(data, charset);
447-
}
448-
449358
public static Body empty() {
450359
return new Body();
451360
}

0 commit comments

Comments
 (0)