Feign client builder should not assume all annotations are the same

Simple solution is to check for instanceof before casting.

Fixes gh-265
This commit is contained in:
Dave Syer
2015-03-19 12:13:19 +00:00
parent b03b2f5629
commit 444f3c8010
2 changed files with 4 additions and 0 deletions

View File

@@ -45,6 +45,9 @@ public class SpringMvcContract extends Contract.BaseContract {
@Override
protected void processAnnotationOnMethod(MethodMetadata data,
Annotation methodAnnotation, Method method) {
if (!(methodAnnotation instanceof RequestMapping)) {
return;
}
RequestMapping mapping = RequestMapping.class.cast(methodAnnotation);
if (mapping != null) {
// HTTP Method

View File

@@ -46,6 +46,7 @@ public class FeignClientValidationTests {
@FeignClient("foo")
interface Client {
@RequestMapping(method = RequestMethod.GET, value = "/")
@Deprecated
String get();
}