diff --git a/core/src/main/java/feign/MethodInfo.java b/core/src/main/java/feign/MethodInfo.java index 453f5b3228..2469bdbf6b 100644 --- a/core/src/main/java/feign/MethodInfo.java +++ b/core/src/main/java/feign/MethodInfo.java @@ -20,19 +20,15 @@ @Experimental public class MethodInfo { - private final String configKey; private final Type underlyingReturnType; private final boolean asyncReturnType; - protected MethodInfo(String configKey, Type underlyingReturnType, boolean asyncReturnType) { - this.configKey = configKey; + protected MethodInfo(Type underlyingReturnType, boolean asyncReturnType) { this.underlyingReturnType = underlyingReturnType; this.asyncReturnType = asyncReturnType; } MethodInfo(Class targetType, Method method) { - this.configKey = Feign.configKey(targetType, method); - final Type type = Types.resolve(targetType, targetType, method.getGenericReturnType()); if (type instanceof ParameterizedType @@ -45,10 +41,6 @@ protected MethodInfo(String configKey, Type underlyingReturnType, boolean asyncR } } - String configKey() { - return configKey; - } - Type underlyingReturnType() { return underlyingReturnType; } diff --git a/core/src/test/java/feign/MethodInfoTest.java b/core/src/test/java/feign/MethodInfoTest.java index dbed1f593d..2974dd5327 100644 --- a/core/src/test/java/feign/MethodInfoTest.java +++ b/core/src/test/java/feign/MethodInfoTest.java @@ -33,7 +33,6 @@ public interface AsyncClient { @Test public void testCompletableFutureOfString() throws Exception { MethodInfo mi = new MethodInfo(AsyncClient.class, AsyncClient.class.getMethod("log")); - assertEquals("AsyncClient#log()", mi.configKey()); assertTrue(mi.isAsyncReturnType()); assertEquals(String.class, mi.underlyingReturnType()); } @@ -50,7 +49,6 @@ public interface AsyncClient extends GenericAsyncClient targetType, Method method) { - String configKey = Feign.configKey(targetType, method); - final Type type = Types.resolve(targetType, targetType, method.getGenericReturnType()); Type underlyingReturnType; @@ -38,6 +36,7 @@ static KotlinMethodInfo createInstance(Class targetType, Method method) { asyncReturnType = true; underlyingReturnType = MethodKt.getKotlinMethodReturnType(method); if (underlyingReturnType == null) { + String configKey = Feign.configKey(targetType, method); throw new IllegalArgumentException( String.format( "Method %s can't have continuation argument, only kotlin method is allowed", @@ -52,6 +51,6 @@ static KotlinMethodInfo createInstance(Class targetType, Method method) { underlyingReturnType = type; } - return new KotlinMethodInfo(configKey, underlyingReturnType, asyncReturnType); + return new KotlinMethodInfo(underlyingReturnType, asyncReturnType); } }