Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-671

Support beans that are defined in nested private classes but have public property read/write methods or fields

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.3-milestone-1
    • Fix Version/s: 6.3-milestone-2
    • Component/s: Properties
    • Labels:
      None
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      It is an apparently well known problem with java reflections that does not allow dynamic method invocation on private nested classes, even if the method modifiers are public.

      We should apply by default the official workaround by issuing a

      setAccessible(true)

      on the methods to be invoked().

      In the unlikely event that a security manager will reject our request for setAccessible(true), we can just log the exception and move along.

      The other option is for beans to avoid being private classes in the first place, but IMO it would be better for us to avoid problems altogether.

        Attachments

          Activity

            People

            • Assignee:
              enygma Eduard Moraru
              Reporter:
              enygma Eduard Moraru
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: