File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
spring-core/src/main/java/org/springframework/core Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ public class MethodParameter {
76
76
@ Nullable
77
77
Map <Integer , Integer > typeIndexesPerLevel ;
78
78
79
+ /** The containing class. Could also be supplied by overriding {@link #getContainingClass()} */
79
80
@ Nullable
80
81
private volatile Class <?> containingClass ;
81
82
@@ -378,6 +379,12 @@ void setContainingClass(Class<?> containingClass) {
378
379
this .containingClass = containingClass ;
379
380
}
380
381
382
+ /**
383
+ * Return the containing class for this method parameter.
384
+ * @return a specific containing class (potentially a subclass of the
385
+ * declaring class), or otherwise simply the declaring class itself
386
+ * @see #getDeclaringClass()
387
+ */
381
388
public Class <?> getContainingClass () {
382
389
Class <?> containingClass = this .containingClass ;
383
390
return (containingClass != null ? containingClass : getDeclaringClass ());
@@ -652,7 +659,7 @@ public boolean equals(Object other) {
652
659
return false ;
653
660
}
654
661
MethodParameter otherParam = (MethodParameter ) other ;
655
- return (this . containingClass == otherParam .containingClass &&
662
+ return (getContainingClass () == otherParam .getContainingClass () &&
656
663
ObjectUtils .nullSafeEquals (this .typeIndexesPerLevel , otherParam .typeIndexesPerLevel ) &&
657
664
this .nestingLevel == otherParam .nestingLevel &&
658
665
this .parameterIndex == otherParam .parameterIndex &&
You can’t perform that action at this time.
0 commit comments