Uploaded image for project: 'Errai'
  1. Errai
  2. ERRAI-277

IOC bootstrapping fails when proxied classes invoke public methods in their constructor

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0.M2
    • Component/s: None
    • Labels:
      None

      Description

      IOC bootstrapping fails with an NPE when proxied classes contain calls to public methods in their constructors. The reason for this is that the proxy implementation overrides all public methods and dispatches to the delegate. At the time the constructors of the proxied class (and its super class) run, the delegate is not initialized yet.

      GWT widget classes are affected by that as many of them call the public setStyleName() method in their constructor. A way to work around the issue is to add a producer method to provide the widget instance.

      We should investigate adding an additional initialization state to the proxied class in which it will not dispatch until the delegate (target instance) has been initialized (setProxiedInstance() has been called).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mbarkley Max Barkley
                Reporter:
                csa Christian Sadilek
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: