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
@@ -383,6 +384,12 @@ void setContainingClass(Class<?> containingClass) {
383
384
this .containingClass = containingClass ;
384
385
}
385
386
387
+ /**
388
+ * Return the containing class for this method parameter.
389
+ * @return a specific containing class (potentially a subclass of the
390
+ * declaring class), or otherwise simply the declaring class itself
391
+ * @see #getDeclaringClass()
392
+ */
386
393
public Class <?> getContainingClass () {
387
394
Class <?> containingClass = this .containingClass ;
388
395
return (containingClass != null ? containingClass : getDeclaringClass ());
@@ -660,7 +667,7 @@ public boolean equals(Object other) {
660
667
return false ;
661
668
}
662
669
MethodParameter otherParam = (MethodParameter ) other ;
663
- return (this . containingClass == otherParam .containingClass &&
670
+ return (getContainingClass () == otherParam .getContainingClass () &&
664
671
ObjectUtils .nullSafeEquals (this .typeIndexesPerLevel , otherParam .typeIndexesPerLevel ) &&
665
672
this .nestingLevel == otherParam .nestingLevel &&
666
673
this .parameterIndex == otherParam .parameterIndex &&
You can’t perform that action at this time.
0 commit comments