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

Tab.hasProperties() returns true when getProperties().size() == 0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 8
    • 8
    • javafx
    • jdk1.8.0b64

      Just run the app and look at the output. Initially hasProperties() returns 'false'
      and it is fine, because no properties have been added.
      But, after calling the getter hasProperties() returns 'true'.

      Even if now properties collection is initialized it still empty.
      And according to http://docs.oracle.com/javafx/2/api/javafx/scene/control/Tab.html#hasProperties()
      I expect hasProperties() to return 'false'

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Tab;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      public class JavaFXApplication59 extends Application {

          @Override
          public void start(Stage stage) {

              Tab tab = new Tab("My tab");
              System.out.println("tab.hasProperties() = " + tab.hasProperties());
              
              int size = tab.getProperties().size();
              System.out.println("size = " + size);
              System.out.println("tab.hasProperties() = " + tab.hasProperties());
              
              HBox root = new HBox(20d);

              Scene scene = new Scene(root, 300, 250);

              stage.setScene(scene);
              stage.setTitle(System.getProperty("java.runtime.version") + "; " + System.getProperty("javafx.runtime.version"));
              stage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }

      }

            jgiles Jonathan Giles
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: