Skip to content

Commit 4401908

Browse files
authored
refactor: guard GET parameter warning with isWarnEnabled
Signed-off-by: JuHyeong <[email protected]>
1 parent 8921dff commit 4401908

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/SpringMvcContract.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,14 @@ public MethodMetadata parseAndValidateMetadata(Class<?> targetType, Method metho
240240
MethodMetadata metadata = super.parseAndValidateMetadata(targetType, method);
241241

242242
if (isGetMethod(metadata) && method.getParameterCount() > 0 && !hasHttpAnnotations(method)) {
243-
LOG.warn(String.format(
244-
"[OpenFeign Warning] Feign method '%s' is declared as GET with parameters, but none of the parameters are annotated " +
245-
"(e.g. @RequestParam, @RequestHeader, @PathVariable, etc). This may result in fallback to POST at runtime. " +
246-
"Consider explicitly annotating parameters.",
247-
method.toGenericString()
248-
));
243+
if (LOG.isWarnEnabled()) {
244+
LOG.warn(String.format(
245+
"[OpenFeign Warning] Feign method '%s' is declared as GET with parameters, but none of the parameters are annotated " +
246+
"(e.g. @RequestParam, @RequestHeader, @PathVariable, etc). This may result in fallback to POST at runtime. " +
247+
"Consider explicitly annotating parameters.",
248+
method.toGenericString()
249+
));
250+
}
249251
}
250252

251253
return metadata;

0 commit comments

Comments
 (0)