Skip to content

Commit

Permalink
Refactor TargetSpecificationVerifier
Browse files Browse the repository at this point in the history
  • Loading branch information
wplong11 committed Oct 10, 2022
1 parent b178ea4 commit c382ae0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/src/main/java/feign/ReflectiveFeign.java
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,12 @@ public static <T> void verify(Target<T> target) {

final Type genRetType = m.getGenericReturnType();

if (!ParameterizedType.class.isInstance(genRetType)) {
if (!(genRetType instanceof ParameterizedType)) {
throw new IllegalArgumentException("Method return type is not parameterized: "
+ getFullMethodName(type, genRetType, m));
}

if (WildcardType.class
.isInstance(ParameterizedType.class.cast(genRetType).getActualTypeArguments()[0])) {
if (((ParameterizedType) genRetType).getActualTypeArguments()[0] instanceof WildcardType) {
throw new IllegalArgumentException(
"Wildcards are not supported for return-type parameters: "
+ getFullMethodName(type, genRetType, m));
Expand Down

0 comments on commit c382ae0

Please sign in to comment.