@@ -77,6 +77,7 @@ public class MethodParameter {
77
77
/** Map from Integer level to Integer type index */
78
78
Map <Integer , Integer > typeIndexesPerLevel ;
79
79
80
+ /** The containing class. Could also be supplied by overriding {@link #getContainingClass()} */
80
81
private volatile Class <?> containingClass ;
81
82
82
83
private volatile Class <?> parameterType ;
@@ -345,6 +346,12 @@ void setContainingClass(Class<?> containingClass) {
345
346
this .containingClass = containingClass ;
346
347
}
347
348
349
+ /**
350
+ * Return the containing class for this method parameter.
351
+ * @return a specific containing class (potentially a subclass of the
352
+ * declaring class), or otherwise simply the declaring class itself
353
+ * @see #getDeclaringClass()
354
+ */
348
355
public Class <?> getContainingClass () {
349
356
return (this .containingClass != null ? this .containingClass : getDeclaringClass ());
350
357
}
@@ -613,7 +620,7 @@ public boolean equals(Object other) {
613
620
return false ;
614
621
}
615
622
MethodParameter otherParam = (MethodParameter ) other ;
616
- return (this . containingClass == otherParam .containingClass &&
623
+ return (getContainingClass () == otherParam .getContainingClass () &&
617
624
ObjectUtils .nullSafeEquals (this .typeIndexesPerLevel , otherParam .typeIndexesPerLevel ) &&
618
625
this .nestingLevel == otherParam .nestingLevel &&
619
626
this .parameterIndex == otherParam .parameterIndex &&
0 commit comments