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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      jdk1.8.0b64

      Description

      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);
          }

      }

        Attachments

          Activity

            People

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

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: