Commit 444f3c80 by Dave Syer

Feign client builder should not assume all annotations are the same

Simple solution is to check for instanceof before casting. Fixes gh-265
parent b03b2f56
...@@ -45,6 +45,9 @@ public class SpringMvcContract extends Contract.BaseContract { ...@@ -45,6 +45,9 @@ public class SpringMvcContract extends Contract.BaseContract {
@Override @Override
protected void processAnnotationOnMethod(MethodMetadata data, protected void processAnnotationOnMethod(MethodMetadata data,
Annotation methodAnnotation, Method method) { Annotation methodAnnotation, Method method) {
if (!(methodAnnotation instanceof RequestMapping)) {
return;
}
RequestMapping mapping = RequestMapping.class.cast(methodAnnotation); RequestMapping mapping = RequestMapping.class.cast(methodAnnotation);
if (mapping != null) { if (mapping != null) {
// HTTP Method // HTTP Method
......
...@@ -46,6 +46,7 @@ public class FeignClientValidationTests { ...@@ -46,6 +46,7 @@ public class FeignClientValidationTests {
@FeignClient("foo") @FeignClient("foo")
interface Client { interface Client {
@RequestMapping(method = RequestMethod.GET, value = "/") @RequestMapping(method = RequestMethod.GET, value = "/")
@Deprecated
String get(); String get();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment