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

Incorrect code generation for bindable property defined in errai.ui.bindableTypes

    Details

    • Steps to Reproduce:
      Hide

      See Description.

      Show
      See Description.

      Description

      
      public class CarInfo {
          // some getters and setters
      }
      
      public class CarPresenter {
          private CarInfo car;
      
          public void setCar(CarInfo car) {
              this.car = car;
          }
      
          public CarInfo getCar() {
              return car;
          }
      }
      

      CarPresenter is bindable (doesn't matter with @Bindable or through errai.ui.bindableTypes).

      If CarInfo class is annotated with @Bindable, then generated code is correct, and looks like:

      public CarPresenterProxy(CarPresenter target, InitialState initialState) {
              agent = new BindableProxyAgent<CarPresenter>(this, target, initialState);
              agent.propertyTypes.put("car", new PropertyType(CarInfo.class, true, false));
          //...
      }
      
      public void setCar(CarInfo car) {
              if (agent.binders.containsKey("car")) {
                car = (CarInfo) agent.binders.get("car").setModel(car, InitialState.FROM_MODEL, true);
              }
              CarInfo oldValue = agent.target.getCar();
          //...
      }
      

      If CarInfo defined in errai.ui.bindableTypes, then generated code is invalid, and looks like:

      public CarPresenterProxy(CarPresenter target, InitialState initialState) {
              agent = new BindableProxyAgent<CarPresenter>(this, target, initialState);
              agent.propertyTypes.put("car", new PropertyType(CarInfo.class, false, false));
          //...
      }
      
      public void setCar(CarInfo car) {
              CarInfo oldValue = agent.target.getCar();
          //...
      }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                csa Christian Sadilek
                Reporter:
                slavap Slava Pankov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: