Class MemberUtils
java.lang.Object
org.assertj.core.util.introspection.MemberUtils
Shameless copy from Apache commons lang and then modified to keep only the interesting stuff for AssertJ.
Contains common code for working with Methods/Constructors, extracted and
refactored from
MethodUtils
when it was imported from Commons
BeanUtils.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static boolean
isPackageAccess
(int modifiers) Returns whether a given set of modifiers implies package access.(package private) static void
XXX Default access superclass workaround When a public class has a default access superclass with public members, these members are accessible.
-
Field Details
-
ACCESS_TEST
private static final int ACCESS_TEST- See Also:
-
-
Constructor Details
-
MemberUtils
MemberUtils()
-
-
Method Details
-
setAccessibleWorkaround
XXX Default access superclass workaround When a public class has a default access superclass with public members, these members are accessible. Calling them from compiled code works fine. Unfortunately, on some JVMs, using reflection to invoke these members seems to (wrongly) prevent access even when the modifier is public. Calling setAccessible(true) solves the problem but will only work from sufficiently privileged code. Better workarounds would be gratefully accepted.- Parameters:
o
- the AccessibleObject to set as accessible
-
isPackageAccess
static boolean isPackageAccess(int modifiers) Returns whether a given set of modifiers implies package access.- Parameters:
modifiers
- to test- Returns:
- true unless package/protected/private modifier detected
-