Uploaded image for project: 'Pivot'
  1. Pivot
  2. PIVOT-596

BXMLSerializer should call bind() on superclasses when appropriate

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.0
    • core-beans
    • None

    Description

      Scenario:

      public class A {
      }

      public class B extends A implements Bindable {
      @BXML Foo foo;

      @Override
      public void initialize(...)

      { System.out.println(foo.getClass().getSimpleName()); }

      }

      public class C extends B {
      @BXML Bar bar;

      @Override
      public void initialize(...)

      { super.initialize(); System.out.println(bar.getClass().getSimpleName()); }

      }

      Now, in test.bxml, you have:

      <C/>

      You expect the following output:

      "Foo
      Bar"

      And yet we only bind the object to class C, meaning you instead will get a NullPointerException trying to de-reference 'foo'.

      We should bind to all classes that implement Bindable.

      Attachments

        Activity

          People

            tvolkert Todd Volkert
            tvolkert Todd Volkert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: