Skip to content

Commit abb296c

Browse files
committed
Remove Java code dependency on CoWebFilter
To avoid compilation errors in Eclipse which does not support Java code dependency on Kotlin code. See spring-projectsgh-27522
1 parent b6fdfe8 commit abb296c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import org.springframework.web.method.HandlerMethod;
5050
import org.springframework.web.reactive.BindingContext;
5151
import org.springframework.web.reactive.HandlerResult;
52-
import org.springframework.web.server.CoWebFilter;
5352
import org.springframework.web.server.ServerWebExchange;
5453

5554
/**
@@ -292,13 +291,16 @@ private boolean isResponseHandled(Object[] args, ServerWebExchange exchange) {
292291
*/
293292
private static class KotlinDelegate {
294293

294+
// Copy of CoWebFilter.COROUTINE_CONTEXT_ATTRIBUTE value to avoid compilation errors in Eclipse
295+
private static final String COROUTINE_CONTEXT_ATTRIBUTE = "org.springframework.web.server.CoWebFilter.context";
296+
295297
@Nullable
296298
@SuppressWarnings("deprecation")
297299
public static Object invokeFunction(Method method, Object target, Object[] args, boolean isSuspendingFunction,
298300
ServerWebExchange exchange) {
299301

300302
if (isSuspendingFunction) {
301-
Object coroutineContext = exchange.getAttribute(CoWebFilter.COROUTINE_CONTEXT_ATTRIBUTE);
303+
Object coroutineContext = exchange.getAttribute(COROUTINE_CONTEXT_ATTRIBUTE);
302304
if (coroutineContext == null) {
303305
return CoroutinesUtils.invokeSuspendingFunction(method, target, args);
304306
}

0 commit comments

Comments
 (0)