Better argument names.

This commit is contained in:
Gary Gregory 2021-11-15 13:43:46 -05:00
parent 99ad9d91bb
commit 9fce1d619e
1 changed files with 12 additions and 12 deletions

View File

@ -49,17 +49,17 @@ abstract class MemberUtils {
* Calling {@code setAccessible(true)} solves the problem but will only work from * Calling {@code setAccessible(true)} solves the problem but will only work from
* sufficiently privileged code. Better workarounds would be gratefully * sufficiently privileged code. Better workarounds would be gratefully
* accepted. * accepted.
* @param o the AccessibleObject to set as accessible * @param obj the AccessibleObject to set as accessible
* @return a boolean indicating whether the accessibility of the object was set to true. * @return a boolean indicating whether the accessibility of the object was set to true.
*/ */
static boolean setAccessibleWorkaround(final AccessibleObject o) { static boolean setAccessibleWorkaround(final AccessibleObject obj) {
if (o == null || o.isAccessible()) { if (obj == null || obj.isAccessible()) {
return false; return false;
} }
final Member m = (Member) o; final Member m = (Member) obj;
if (!o.isAccessible() && Modifier.isPublic(m.getModifiers()) && isPackageAccess(m.getDeclaringClass().getModifiers())) { if (!obj.isAccessible() && Modifier.isPublic(m.getModifiers()) && isPackageAccess(m.getDeclaringClass().getModifiers())) {
try { try {
o.setAccessible(true); obj.setAccessible(true);
return true; return true;
} catch (final SecurityException e) { // NOPMD } catch (final SecurityException e) { // NOPMD
// ignore in favor of subsequent IllegalAccessException // ignore in favor of subsequent IllegalAccessException
@ -79,20 +79,20 @@ abstract class MemberUtils {
/** /**
* Returns whether a {@link Member} is static. * Returns whether a {@link Member} is static.
* @param m Member to check * @param member Member to check
* @return {@code true} if {@code m} is static * @return {@code true} if {@code m} is static
*/ */
static boolean isStatic(final Member m) { static boolean isStatic(final Member member) {
return m != null && Modifier.isStatic(m.getModifiers()); return member != null && Modifier.isStatic(member.getModifiers());
} }
/** /**
* Returns whether a {@link Member} is accessible. * Returns whether a {@link Member} is accessible.
* @param m Member to check * @param member Member to check
* @return {@code true} if {@code m} is accessible * @return {@code true} if {@code m} is accessible
*/ */
static boolean isAccessible(final Member m) { static boolean isAccessible(final Member member) {
return m != null && Modifier.isPublic(m.getModifiers()) && !m.isSynthetic(); return member != null && Modifier.isPublic(member.getModifiers()) && !member.isSynthetic();
} }
/** /**