Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8239824

Convert XxxPropertyBases to SimpleXxxPropertys

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: openjfx14
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
      None

      Description

      The codebase has many occurrances of creating properties and overriding their getName and getBean methods, such as:

                  style = new StringPropertyBase("") {

                      @Override
                      protected void invalidated() {
                          reapplyCSS();
                      }

                      @Override
                      public Object getBean() {
                          return Node.this;
                      }

                      @Override
                      public String getName() {
                          return "style";
                      }
                  }

      These can be converted to `SimpleXxxProperty`s, which is shorter and clearer:

                  style = new SimpleStringProperty(Node.this, "style", "") {

                      @Override
                      protected void invalidated() {
                          reapplyCSS();
                      }
                  }

      This pattern occurs in many classes over several modules. To prevent potential merge conflicts, it might be needed to split this issue into a few issues targeting a different subset of classes each.

        Attachments

          Activity

            People

            • Assignee:
              nlisker Nir Lisker
              Reporter:
              nlisker Nir Lisker
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: