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

Move builders from javafx.builders to the same package as the built object

XMLWordPrintable

      Richard Bair writes:
      "Now that we've committed fully to the generated builders, I'm wondering if we ought to be distributing them in their various packages rather than having them all in the javafx.builders package. I believe this is just a switch you have to change in the code and it generates them in their correct packages, right? The thought here is that when we modularize FX, if anybody uses a builder the builders module would require all other modules. However if they are distributed, then each builder is in the module of the class it is building."

      Today the builder for javafx.scene.shape.Rectangle (for example) is javafx.builders.RectangleBuilder, and all other builders are also in javafx.builders. With the proposed change, we would have javafx.scene.shape.RectangleBuilder etc. This would also work in a more obvious way with wildcard imports, since import javafx.scene.shape.* would import both Rectangle and RectangleBuilder.

      If we make this change, all code currently using builders will have to be migrated. It is easy to identify such code just by grepping for "javafx.builders". Then deleting all imports of javafx.builders.Anything and running fix-imports is enough to bring the code up to date.

        1. apps.diff
          18 kB
        2. runtime.diff
          12 kB
        3. tests.diff
          10 kB

            rbair Richard Bair (Inactive)
            emcmanuswse Eamonn McManus (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: