File tree 2 files changed +10
-10
lines changed
spring-messaging/src/main/java/org/springframework/messaging/handler
spring-web/src/main/java/org/springframework/web/method
2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2022 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.
@@ -416,21 +416,21 @@ public HandlerMethodParameter clone() {
416
416
private class ReturnValueMethodParameter extends HandlerMethodParameter {
417
417
418
418
@ Nullable
419
- private final Object returnValue ;
419
+ private final Class <?> returnValueType ;
420
420
421
421
public ReturnValueMethodParameter (@ Nullable Object returnValue ) {
422
422
super (-1 );
423
- this .returnValue = returnValue ;
423
+ this .returnValueType = ( returnValue != null ? returnValue . getClass () : null ) ;
424
424
}
425
425
426
426
protected ReturnValueMethodParameter (ReturnValueMethodParameter original ) {
427
427
super (original );
428
- this .returnValue = original .returnValue ;
428
+ this .returnValueType = original .returnValueType ;
429
429
}
430
430
431
431
@ Override
432
432
public Class <?> getParameterType () {
433
- return (this .returnValue != null ? this .returnValue . getClass () : super .getParameterType ());
433
+ return (this .returnValueType != null ? this .returnValueType : super .getParameterType ());
434
434
}
435
435
436
436
@ Override
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2022 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.
@@ -536,21 +536,21 @@ public HandlerMethodParameter clone() {
536
536
private class ReturnValueMethodParameter extends HandlerMethodParameter {
537
537
538
538
@ Nullable
539
- private final Object returnValue ;
539
+ private final Class <?> returnValueType ;
540
540
541
541
public ReturnValueMethodParameter (@ Nullable Object returnValue ) {
542
542
super (-1 );
543
- this .returnValue = returnValue ;
543
+ this .returnValueType = ( returnValue != null ? returnValue . getClass () : null ) ;
544
544
}
545
545
546
546
protected ReturnValueMethodParameter (ReturnValueMethodParameter original ) {
547
547
super (original );
548
- this .returnValue = original .returnValue ;
548
+ this .returnValueType = original .returnValueType ;
549
549
}
550
550
551
551
@ Override
552
552
public Class <?> getParameterType () {
553
- return (this .returnValue != null ? this .returnValue . getClass () : super .getParameterType ());
553
+ return (this .returnValueType != null ? this .returnValueType : super .getParameterType ());
554
554
}
555
555
556
556
@ Override
You can’t perform that action at this time.
0 commit comments