Click
  1. Click
  2. CLK-77

Make ClickUtils.invokeListener handle anonyoumous innerclasses

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Anonymous innerclasses are handy if you don't want to 'polute' your api with a class which does just a very specific task. Typically they are used for listeners. This is not how click does it (for good reason) still there are people who prefer it this way and there are other situations. Ie I have a use case where I define an ajax-action as an anoymous inner class the action creates controls adds them to the page etc and than registers itself as an listener (like a page normally does). But the listener part does not work.

      Anyway as said on the mailing-list I'd like to setAccessible(true) for public methods on such anonyomous innerclasse. I don't know wheter this causes security isses on other AppServers. However the setAccesible(true) in the following code is restricted to anonymous innerclasses public methods only (all other methods are not effected) . So IMO if an AppServer makes problems the way to go is either give ClickUtils the privilege or just don't use anon innerclasses as listeners. In my tests on Jetty and Tomcat there are no problems.

        Activity

        Hide
        Christian Essl added a comment -

        The patch for ClickUtils

        Show
        Christian Essl added a comment - The patch for ClickUtils
        Hide
        Christian Essl added a comment -

        A testcase. The testcase is in a different package than ClickUtils (like all the users of it are), because otherwise the whole package-private problem of anon innerclasses does not show up.

        Show
        Christian Essl added a comment - A testcase. The testcase is in a different package than ClickUtils (like all the users of it are), because otherwise the whole package-private problem of anon innerclasses does not show up.
        Hide
        Malcolm Edgar added a comment -

        Hi Christian,

        the patch looks good, would you mind applying this. I will organise a friend to test this on WebSphere.

        regards Malcolm Edgar

        Show
        Malcolm Edgar added a comment - Hi Christian, the patch looks good, would you mind applying this. I will organise a friend to test this on WebSphere. regards Malcolm Edgar
        Hide
        Christian Essl added a comment -

        Hi Malcolm,

        Have applied the patch and the TestCase.

        Christian

        Show
        Christian Essl added a comment - Hi Malcolm, Have applied the patch and the TestCase. Christian
        Hide
        Christian Essl added a comment -

        Hi Malcolm,

        Thanks that you'll ask your friend to test it. I think until it fails I close the issue.

        Christian

        Show
        Christian Essl added a comment - Hi Malcolm, Thanks that you'll ask your friend to test it. I think until it fails I close the issue. Christian
        Hide
        Malcolm Edgar added a comment -

        Hi Christian,

        please leave this as resolved, until it can be tested. The general practice I have been following it only to resolve issues during development, and closing them just prior to release when testing has been completed.

        regards Malcolm

        Show
        Malcolm Edgar added a comment - Hi Christian, please leave this as resolved, until it can be tested. The general practice I have been following it only to resolve issues during development, and closing them just prior to release when testing has been completed. regards Malcolm
        Hide
        Malcolm Edgar added a comment -

        Changes checked into CVS, will be available in release 0.19.

        Show
        Malcolm Edgar added a comment - Changes checked into CVS, will be available in release 0.19.

          People

          • Assignee:
            Christian Essl
            Reporter:
            Christian Essl
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development