2727/**
2828 * Contains common code for working with {@link java.lang.reflect.Method Methods}/{@link java.lang.reflect.Constructor Constructors},
2929 * extracted and refactored from {@link MethodUtils} when it was imported from Commons BeanUtils.
30- *
31- * @since 2.5
3230 */
3331final class MemberUtils {
3432 // TODO extract an interface to implement compareParameterSets(...)?
3533
3634 /**
37- * A class providing a subset of the API of java.lang.reflect.Executable in Java 1.8,
35+ * A class providing a subset of the API of java.lang.reflect.Executable in Java 1.8,
3836 * providing a common representation for function signatures for Constructors and Methods.
3937 */
4038 private static final class Executable {
@@ -87,50 +85,39 @@ public boolean isVarArgs() {
8785 };
8886
8987 /**
90- * Compares the relative fitness of two Constructors in terms of how well they
91- * match a set of runtime parameter types, such that a list ordered
92- * by the results of the comparison would return the best match first
93- * (least).
88+ * Compares the relative fitness of two Constructors in terms of how well they match a set of runtime parameter types, such that a list ordered by the
89+ * results of the comparison would return the best match first (least).
9490 *
95- * @param left the "left" Constructor
96- * @param right the "right" Constructor
97- * @param actual the runtime parameter types to match against
98- * {@code left}/{@code right}
99- * @return int consistent with {@code compare} semantics
100- * @since 3.5
91+ * @param left the "left" Constructor.
92+ * @param right the "right" Constructor.
93+ * @param actual the runtime parameter types to match against. {@code left}/{@code right}.
94+ * @return int consistent with {@code compare} semantics.
10195 */
10296 static int compareConstructorFit (final Constructor <?> left , final Constructor <?> right , final Class <?>[] actual ) {
10397 return compareParameterTypes (Executable .of (left ), Executable .of (right ), actual );
10498 }
10599
106100 /**
107- * Compares the relative fitness of two Methods in terms of how well they
108- * match a set of runtime parameter types, such that a list ordered
109- * by the results of the comparison would return the best match first
110- * (least).
101+ * Compares the relative fitness of two Methods in terms of how well they match a set of runtime parameter types, such that a list ordered by the results of
102+ * the comparison would return the best match first (least).
111103 *
112- * @param left the "left" Method
113- * @param right the "right" Method
114- * @param actual the runtime parameter types to match against
115- * {@code left}/{@code right}
116- * @return int consistent with {@code compare} semantics
117- * @since 3.5
104+ * @param left the "left" Method.
105+ * @param right the "right" Method.
106+ * @param actual the runtime parameter types to match against. {@code left}/{@code right}.
107+ * @return int consistent with {@code compare} semantics.
118108 */
119109 static int compareMethodFit (final Method left , final Method right , final Class <?>[] actual ) {
120110 return compareParameterTypes (Executable .of (left ), Executable .of (right ), actual );
121111 }
122112
123113 /**
124- * Compares the relative fitness of two Executables in terms of how well they
125- * match a set of runtime parameter types, such that a list ordered
126- * by the results of the comparison would return the best match first
127- * (least).
114+ * Compares the relative fitness of two Executables in terms of how well they match a set of runtime parameter types, such that a list ordered by the
115+ * results of the comparison would return the best match first (least).
128116 *
129- * @param left the "left" Executable
130- * @param right the "right" Executable
131- * @param actual the runtime parameter types to match against
132- * {@code left}/{@code right}
133- * @return int consistent with {@code compare} semantics
117+ * @param left the "left" Executable.
118+ * @param right the "right" Executable.
119+ * @param actual the runtime parameter types to match against. {@code left}/{@code right}.
120+ * @return int consistent with {@code compare} semantics.
134121 */
135122 private static int compareParameterTypes (final Executable left , final Executable right , final Class <?>[] actual ) {
136123 final float leftCost = getTotalTransformationCost (actual , left );
@@ -141,9 +128,9 @@ private static int compareParameterTypes(final Executable left, final Executable
141128 /**
142129 * Gets the number of steps needed to turn the source class into the destination class. This represents the number of steps in the object hierarchy graph.
143130 *
144- * @param srcClass The source class
145- * @param destClass The destination class
146- * @return The cost of transforming an object
131+ * @param srcClass The source class.
132+ * @param destClass The destination class.
133+ * @return The cost of transforming an object.
147134 */
148135 private static float getObjectTransformationCost (Class <?> srcClass , final Class <?> destClass ) {
149136 if (destClass .isPrimitive ()) {
@@ -173,11 +160,11 @@ private static float getObjectTransformationCost(Class<?> srcClass, final Class<
173160 }
174161
175162 /**
176- * Gets the number of steps required to promote a primitive number to another type.
163+ * Gets the number of steps required to promote a primitive to another type.
177164 *
178- * @param srcClass the (primitive) source class
179- * @param destClass the (primitive) destination class
180- * @return The cost of promoting the primitive
165+ * @param srcClass the (primitive) source class.
166+ * @param destClass the (primitive) destination class.
167+ * @return The cost of promoting the primitive.
181168 */
182169 private static float getPrimitivePromotionCost (final Class <?> srcClass , final Class <?> destClass ) {
183170 if (srcClass == null ) {
@@ -204,9 +191,9 @@ private static float getPrimitivePromotionCost(final Class<?> srcClass, final Cl
204191 /**
205192 * Gets the sum of the object transformation cost for each class in the source argument list.
206193 *
207- * @param srcArgs The source arguments
208- * @param executable The executable to calculate transformation costs for
209- * @return The total transformation cost
194+ * @param srcArgs The source arguments.
195+ * @param executable The executable to calculate transformation costs for.
196+ * @return The total transformation cost.
210197 */
211198 private static float getTotalTransformationCost (final Class <?>[] srcArgs , final Executable executable ) {
212199 final Class <?>[] destArgs = executable .getParameterTypes ();
@@ -249,7 +236,7 @@ private static float getTotalTransformationCost(final Class<?>[] srcArgs, final
249236 * Tests whether a {@link Member} is accessible.
250237 *
251238 * @param member Member to test, may be null.
252- * @return {@code true} if {@code m} is accessible
239+ * @return {@code true} if {@code m} is accessible.
253240 */
254241 static boolean isAccessible (final Member member ) {
255242 return isPublic (member ) && !member .isSynthetic ();
0 commit comments