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 from MethodUtils when it was imported from Commons BeanUtils.
  • Field Details

  • Constructor Details

    • MemberUtils

      MemberUtils()
  • Method Details

    • 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