Class MemberUtils
- java.lang.Object
-
- org.assertj.core.util.introspection.MemberUtils
-
abstract class MemberUtils extends Object
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 fromMethodUtils
when it was imported from Commons BeanUtils.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
ACCESS_TEST
-
Constructor Summary
Constructors Constructor Description MemberUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static boolean
isPackageAccess(int modifiers)
Returns whether a given set of modifiers implies package access.(package private) static void
setAccessibleWorkaround(AccessibleObject o)
XXX Default access superclass workaround When a public class has a default access superclass with public members, these members are accessible.
-
-
-
Field Detail
-
ACCESS_TEST
private static final int ACCESS_TEST
- See Also:
- Constant Field Values
-
-
Method Detail
-
setAccessibleWorkaround
static void setAccessibleWorkaround(AccessibleObject o)
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
-
-