File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
spring-aop/src/main/java/org/springframework/aop/interceptor Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -286,10 +286,14 @@ else if (ListenableFuture.class.isAssignableFrom(returnType)) {
286
286
else if (Future .class .isAssignableFrom (returnType )) {
287
287
return executor .submit (task );
288
288
}
289
- else {
289
+ else if ( void . class == returnType ) {
290
290
executor .submit (task );
291
291
return null ;
292
292
}
293
+ else {
294
+ throw new IllegalArgumentException (
295
+ "Invalid return type for async method (only Future and void supported): " + returnType );
296
+ }
293
297
}
294
298
295
299
/**
You can’t perform that action at this time.
0 commit comments