Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-1043

Private method observer is not working properly while processing second and next events

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.8
    • Fix Version/s: 1.1.9
    • Component/s: Events
    • Labels:
      None

      Description

      I found a strange behavior while handling events by private methods. First event was processed successfully, but the next ones not.
      Look at the
      /org/apache/webbeans/event/ObserverMethodImpl.java:216
      isPrivateMethod is true, then accessible flag sets to true. This means that next time isPrivateMethod will be false even observer method has a private access . Invocation of such method will be the same as invocation of public methods, but invocation handler won't be invoked for private methods.
      In this situation proxy instance's method will be invoked, but not a method of the contextual bean instance.
      In my case I get a NPE when calling any injected bean methods (each injected beans are null inside assist proxy)

      Seems that this code should be changed:
      boolean isPrivateMethod = !observerMethod.isAccessible();

        Attachments

          Activity

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              exmortal V L
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: