Skip to content

Commit 68ee7af

Browse files
velokdavisk6
authored andcommitted
Removing @deprecated methods marked for removal on feign 10 (#739)
1 parent c346b96 commit 68ee7af

File tree

5 files changed

+8
-77
lines changed

5 files changed

+8
-77
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
### Version 10.0
22
* Feign baseline is now JDK 8
3+
* Removed @Deprecated methods marked for removal on feign 10
34

45
### Version 9.6
56
* Feign builder now supports flag `doNotCloseAfterDecode` to support lazy iteration of responses.

benchmark/src/main/java/feign/benchmark/WhatShouldWeCacheBenchmarks.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ public List<MethodMetadata> parseAndValidatateMetadata(Class<?> declaring) {
6868
public Response execute(Request request, Request.Options options) throws IOException {
6969
Map<String, Collection<String>> headers =
7070
new LinkedHashMap<String, Collection<String>>();
71-
return Response.create(200, "ok", headers, (byte[]) null);
71+
return Response.builder()
72+
.body((byte[]) null)
73+
.status(200)
74+
.headers(headers)
75+
.reason("ok")
76+
.request(request)
77+
.build();
7278
}
7379
};
7480
cachedFakeFeign = Feign.builder().client(fakeClient).build();

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,6 @@ protected abstract void processAnnotationOnMethod(
202202
protected abstract boolean processAnnotationsOnParameter(
203203
MethodMetadata data, Annotation[] annotations, int paramIndex);
204204

205-
/**
206-
* @deprecated dead-code will remove in feign 10
207-
*/
208-
@Deprecated
209-
// deprecated as only used in a sub-type
210-
protected Collection<String> addTemplatedParam(Collection<String> possiblyNull, String name) {
211-
if (possiblyNull == null) {
212-
possiblyNull = new ArrayList<String>();
213-
}
214-
possiblyNull.add(String.format("{%s}", name));
215-
return possiblyNull;
216-
}
217-
218205
/** links a parameter name to its index in the method signature. */
219206
protected void nameParam(MethodMetadata data, String name, int i) {
220207
Collection<String> names =

core/src/main/java/feign/Response.java

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -51,65 +51,6 @@ private Response(Builder builder) {
5151
this.request = builder.request; // nullable
5252
}
5353

54-
/**
55-
* @deprecated To be removed in Feign 10
56-
*/
57-
@Deprecated
58-
public static Response create(
59-
int status,
60-
String reason,
61-
Map<String, Collection<String>> headers,
62-
InputStream inputStream,
63-
Integer length) {
64-
return Response.builder()
65-
.status(status)
66-
.reason(reason)
67-
.headers(headers)
68-
.body(InputStreamBody.orNull(inputStream, length))
69-
.build();
70-
}
71-
72-
/**
73-
* @deprecated To be removed in Feign 10
74-
*/
75-
@Deprecated
76-
public static Response create(
77-
int status, String reason, Map<String, Collection<String>> headers, byte[] data) {
78-
return Response.builder()
79-
.status(status)
80-
.reason(reason)
81-
.headers(headers)
82-
.body(ByteArrayBody.orNull(data))
83-
.build();
84-
}
85-
86-
/**
87-
* @deprecated To be removed in Feign 10
88-
*/
89-
@Deprecated
90-
public static Response create(
91-
int status,
92-
String reason,
93-
Map<String, Collection<String>> headers,
94-
String text,
95-
Charset charset) {
96-
return Response.builder()
97-
.status(status)
98-
.reason(reason)
99-
.headers(headers)
100-
.body(ByteArrayBody.orNull(text, charset))
101-
.build();
102-
}
103-
104-
/**
105-
* @deprecated To be removed in Feign 10
106-
*/
107-
@Deprecated
108-
public static Response create(
109-
int status, String reason, Map<String, Collection<String>> headers, Body body) {
110-
return Response.builder().status(status).reason(reason).headers(headers).body(body).build();
111-
}
112-
11354
public Builder toBuilder() {
11455
return new Builder(this);
11556
}

core/src/main/java/feign/SynchronousMethodHandler.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ Object executeAndDecode(RequestTemplate template) throws Throwable {
103103
long start = System.nanoTime();
104104
try {
105105
response = client.execute(request, options);
106-
// ensure the request is set. TODO: remove in Feign 10
107-
response.toBuilder().request(request).build();
108106
} catch (IOException e) {
109107
if (logLevel != Logger.Level.NONE) {
110108
logger.logIOException(metadata.configKey(), logLevel, e, elapsedTime(start));
@@ -118,8 +116,6 @@ Object executeAndDecode(RequestTemplate template) throws Throwable {
118116
if (logLevel != Logger.Level.NONE) {
119117
response =
120118
logger.logAndRebufferResponse(metadata.configKey(), logLevel, response, elapsedTime);
121-
// ensure the request is set. TODO: remove in Feign 10
122-
response.toBuilder().request(request).build();
123119
}
124120
if (Response.class == metadata.returnType()) {
125121
if (response.body() == null) {

0 commit comments

Comments
 (0)