changeset 8011:a1563dbccd0e

[DOC ONLY] Fix for RT-38683: Javadoc should not suggest calling dialog.showAndWait().get() without checking isPresent()
author jgiles
date Wed, 17 Sep 2014 15:09:22 +1200
parents 639e8a288cc2
children 76ebb8a404ab
files modules/controls/src/main/java/javafx/scene/control/Dialog.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/Dialog.java	Tue Sep 16 10:30:57 2014 -0700
+++ b/modules/controls/src/main/java/javafx/scene/control/Dialog.java	Wed Sep 17 15:09:22 2014 +1200
@@ -125,7 +125,7 @@
  * 
  * <p><strong>Option 1: The 'traditional' approach</strong>
  * <pre>{@code Optional<ButtonType> result = dialog.showAndWait();
- * if (result.get() == ButtonType.OK) {
+ * if (result.isPresent() && result.get() == ButtonType.OK) {
  *     formatSystem();
  * }}</pre>
  *