@@ -64,7 +64,6 @@ public final class MethodSelector implements DiscoverySelector {
6464 private final String className ;
6565 private final String methodName ;
6666 private final String parameterTypeNames ;
67- private final @ Nullable String declaringClassName ;
6867
6968 private volatile @ Nullable Class <?> javaClass ;
7069
@@ -76,19 +75,22 @@ public final class MethodSelector implements DiscoverySelector {
7675 * @since 1.10
7776 */
7877 MethodSelector (@ Nullable ClassLoader classLoader , String className , String methodName , String parameterTypeNames ) {
79- this (classLoader , className , methodName , parameterTypeNames , null );
78+ this .classLoader = classLoader ;
79+ this .className = className ;
80+ this .methodName = methodName ;
81+ this .parameterTypeNames = parameterTypeNames ;
8082 }
8183
8284 MethodSelector (Class <?> javaClass , String methodName , String parameterTypeNames ) {
83- this (javaClass .getClassLoader (), javaClass .getName (), methodName , parameterTypeNames , null );
85+ this (javaClass .getClassLoader (), javaClass .getName (), methodName , parameterTypeNames );
8486 this .javaClass = javaClass ;
8587 }
8688
8789 /**
8890 * @since 1.10
8991 */
9092 MethodSelector (@ Nullable ClassLoader classLoader , String className , String methodName , Class <?>... parameterTypes ) {
91- this (classLoader , className , methodName , ClassUtils .nullSafeToString (Class ::getTypeName , parameterTypes ), null );
93+ this (classLoader , className , methodName , ClassUtils .nullSafeToString (Class ::getTypeName , parameterTypes ));
9294 this .parameterTypes = parameterTypes .clone ();
9395 }
9496
@@ -97,7 +99,7 @@ public final class MethodSelector implements DiscoverySelector {
9799 */
98100 MethodSelector (Class <?> javaClass , String methodName , Class <?>... parameterTypes ) {
99101 this (javaClass .getClassLoader (), javaClass .getName (), methodName ,
100- ClassUtils .nullSafeToString (Class ::getTypeName , parameterTypes ), null );
102+ ClassUtils .nullSafeToString (Class ::getTypeName , parameterTypes ));
101103 this .javaClass = javaClass ;
102104 this .parameterTypes = parameterTypes .clone ();
103105 }
@@ -108,21 +110,12 @@ public final class MethodSelector implements DiscoverySelector {
108110
109111 private MethodSelector (Class <?> javaClass , Method method , Class <?>... parameterTypes ) {
110112 this (javaClass .getClassLoader (), javaClass .getName (), method .getName (),
111- ClassUtils .nullSafeToString (Class ::getTypeName , parameterTypes ), method . getDeclaringClass (). getName () );
113+ ClassUtils .nullSafeToString (Class ::getTypeName , parameterTypes ));
112114 this .javaClass = javaClass ;
113115 this .javaMethod = method ;
114116 this .parameterTypes = parameterTypes ;
115117 }
116118
117- private MethodSelector (@ Nullable ClassLoader classLoader , String className , String methodName ,
118- String parameterTypeNames , @ Nullable String declaringClassName ) {
119- this .classLoader = classLoader ;
120- this .className = className ;
121- this .methodName = methodName ;
122- this .parameterTypeNames = parameterTypeNames ;
123- this .declaringClassName = className .equals (declaringClassName ) ? null : declaringClassName ;
124- }
125-
126119 /**
127120 * Get the {@link ClassLoader} used to load the specified class.
128121 *
@@ -278,8 +271,7 @@ public boolean equals(Object o) {
278271 MethodSelector that = (MethodSelector ) o ;
279272 return Objects .equals (this .className , that .className )//
280273 && Objects .equals (this .methodName , that .methodName )//
281- && Objects .equals (this .parameterTypeNames , that .parameterTypeNames )//
282- && Objects .equals (this .declaringClassName , that .declaringClassName );
274+ && Objects .equals (this .parameterTypeNames , that .parameterTypeNames );
283275 }
284276
285277 /**
@@ -288,7 +280,7 @@ public boolean equals(Object o) {
288280 @ API (status = STABLE , since = "1.3" )
289281 @ Override
290282 public int hashCode () {
291- return Objects .hash (this .className , this .methodName , this .parameterTypeNames , this . declaringClassName );
283+ return Objects .hash (this .className , this .methodName , this .parameterTypeNames );
292284 }
293285
294286 @ Override
0 commit comments