Skip to content

Commit 8b96776

Browse files
committed
8286678: Fix mistakes in FX API docs
Reviewed-by: kcr
1 parent 5c00783 commit 8b96776

File tree

7 files changed

+46
-48
lines changed

7 files changed

+46
-48
lines changed

modules/javafx.base/src/main/java/com/sun/javafx/collections/ObservableSetWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,11 +321,11 @@ public boolean addAll(Collection<?extends E> c) {
321321
}
322322

323323
/**
324-
* Keeps only elements that are included the specified collection.
324+
* Keeps only elements that are included in the specified collection.
325325
* All other elements are removed. For each removed element all the
326326
* observers are called.
327327
*
328-
* @see java.util.Set in JDK API documentation
328+
* @see java.util.Set
329329
* @param c collection containing elements to be kept in this set
330330
* @return true if this set changed as a result of the call
331331
*/

modules/javafx.base/src/main/java/javafx/beans/binding/ObjectBinding.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,8 @@ public final T get() {
167167
}
168168

169169
/**
170-
* The method onInvalidating() can be overridden by extending classes to
171-
* react, if this binding becomes invalid. The default implementation is
172-
* empty.
170+
* Called when this binding becomes invalid. Can be overridden by extending classes to react to the invalidation.
171+
* The default implementation is empty.
173172
*/
174173
protected void onInvalidating() {
175174
}

modules/javafx.base/src/main/java/javafx/beans/property/Property.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
/**
3232
* Generic interface that defines the methods common to all (writable)
33-
* properties independent of their type.
34-
*
33+
* properties, independent of their type.
3534
*
3635
* @param <T>
3736
* the type of the wrapped value
@@ -91,7 +90,7 @@ public interface Property<T> extends ReadOnlyProperty<T>, WritableValue<T> {
9190
void bindBidirectional(Property<T> other);
9291

9392
/**
94-
* Remove a bidirectional binding between this {@code Property} and another
93+
* Removes a bidirectional binding between this {@code Property} and another
9594
* one.
9695
*
9796
* If no bidirectional binding between the properties exists, calling this
@@ -100,7 +99,7 @@ public interface Property<T> extends ReadOnlyProperty<T>, WritableValue<T> {
10099
* It is possible to unbind by a call on the second property. This code will work:
101100
*
102101
* <blockquote><pre>
103-
* property1.bindBirectional(property2);
102+
* property1.bindBidirectional(property2);
104103
* property2.unbindBidirectional(property1);
105104
* </pre></blockquote>
106105
*

modules/javafx.controls/src/main/java/javafx/scene/control/TextFormatter.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
* A Formatter describes a format of a {@code TextInputControl} text by using two distinct mechanisms:
3838
* <ul>
3939
* <li>A filter ({@link #getFilter()}) that can intercept and modify user input. This helps to keep the text
40-
* in the desired format. A default text supplier can be used to provide the intial text.</li>
40+
* in the desired format. A default text supplier can be used to provide the initial text.</li>
4141
* <li>A value converter ({@link #getValueConverter()}) and value ({@link #valueProperty()})
4242
* can be used to provide special format that represents a value of type {@code V}.
43-
* If the control is editable and the text is changed by the user, the value is then updated to correspond to the text.
43+
* If the control is editable and the text is changed by the user, the value is then updated to correspond to the
44+
* text.
4445
* </ul>
4546
* <p>
46-
* It's possible to have a formatter with just filter or value converter. If value converter is not provided however, setting a value will
47-
* result in an {@code IllegalStateException} and the value is always null.
47+
* It's possible to have a formatter with just a filter or a value converter. If a value converter is not provided,
48+
* setting a value will result in an {@code IllegalStateException} and the value is always {@code null}.
4849
* <p>
49-
* Since {@code Formatter} contains a value which represents the state of the {@code TextInputControl} to which it is currently assigned, a single
50-
* {@code Formatter} instance can be used only in one {@code TextInputControl} at a time.
50+
* Since {@code Formatter} contains a value that represents the state of the {@code TextInputControl} to which it is
51+
* currently assigned, a single {@code Formatter} instance can be used only in one {@code TextInputControl} at a time.
5152
*
5253
* @param <V> The type of the value
5354
* @since JavaFX 8u40

modules/javafx.graphics/src/main/java/javafx/concurrent/ScheduledService.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
import java.util.TimerTask;
4242

4343
/**
44-
* <p>The ScheduledService is a {@link Service} which will automatically restart
44+
* <p>The ScheduledService is a {@link Service} that will automatically restart
4545
* itself after a successful execution, and under some conditions will
4646
* restart even in case of failure. A new ScheduledService begins in
4747
* the READY state, just as a normal Service. After calling
@@ -70,7 +70,7 @@
7070
*
7171
* <p>If a failure occurs and <code>restartOnFailure</code> is false, then
7272
* the ScheduledService will transition to FAILED and will stop. To restart
73-
* a failed ScheduledService, you must call restart manually.</p>
73+
* a failed ScheduledService, you must call <code>restart</code> manually.</p>
7474
*
7575
* <p>If a failure occurs and <code>restartOnFailure</code> is true, then
7676
* the the ScheduledService <em>may</em> restart automatically. First,
@@ -82,7 +82,7 @@
8282
*
8383
* <p>ScheduledService defines static EXPONENTIAL_BACKOFF_STRATEGY and LOGARITHMIC_BACKOFF_STRATEGY
8484
* implementations, of which LOGARITHMIC_BACKOFF_STRATEGY is the default value for
85-
* backoffStrategy. After <code>maximumFailureCount</code> is reached, the
85+
* <code>backoffStrategy</code>. After <code>maximumFailureCount</code> is reached, the
8686
* ScheduledService will transition to FAILED in exactly the same way as if
8787
* <code>restartOnFailure</code> were false.</p>
8888
*
@@ -127,16 +127,16 @@
127127
* <p>For this purposes of this class, any Duration that answers true to {@link javafx.util.Duration#isUnknown()}
128128
* will treat that duration as if it were Duration.ZERO. Likewise, any Duration which answers true
129129
* to {@link javafx.util.Duration#isIndefinite()} will be treated as if it were a duration of Double.MAX_VALUE
130-
* milliseconds. Any null Duration is treated as Duration.ZERO. Any custom implementation of an backoff strategy
131-
* callback must be prepared to handle these different potential values.</p>
130+
* milliseconds. Any {@code null} Duration is treated as {@code Duration.ZERO}. Any custom implementation of a backoff
131+
* strategy callback must be prepared to handle these different potential values.</p>
132132
*
133-
* <p>The ScheduledService introduces a new property called {@link #lastValueProperty() lastValue}. The lastValue is the value that
134-
* was last successfully computed. Because a Service clears its {@code value} property on each run, and
135-
* because the ScheduledService will reschedule a run immediately after completion (unless it enters the
136-
* cancelled or failed states), the value property is not overly useful on a ScheduledService. In most cases
137-
* you will want to instead use the value returned by lastValue.</p>
133+
* <p>The ScheduledService introduces a new property called {@link #lastValueProperty() lastValue}. The
134+
* {@code lastValue} is the value that was last successfully computed. Because a Service clears its {@code value}
135+
* property on each run, and because the ScheduledService will reschedule a run immediately after completion (unless it
136+
* enters the cancelled or failed states), the value property is not overly useful on a ScheduledService. In most cases
137+
* you will want to instead use the value returned by {@code lastValue}.</p>
138138
*
139-
* <b>Implementer Note:</b> The {@link #ready()}, {@link #scheduled()}, {@link #running()}, {@link #succeeded()},
139+
* @implNote The {@link #ready()}, {@link #scheduled()}, {@link #running()}, {@link #succeeded()},
140140
* {@link #cancelled()}, and {@link #failed()} methods are implemented in this class. Subclasses which also
141141
* override these methods must take care to invoke the super implementation.
142142
*

modules/javafx.graphics/src/main/java/javafx/concurrent/Service.java

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,45 +64,44 @@
6464

6565
/**
6666
* <p>
67-
* A Service is a non-visual component encapsulating the information required
67+
* A {@code Service} is a non-visual component encapsulating the information required
6868
* to perform some work on one or more background threads. As part of the
69-
* JavaFX UI library, the Service knows about the JavaFX Application thread
69+
* JavaFX UI library, the {@code Service} knows about the JavaFX Application thread
7070
* and is designed to relieve the application developer from the burden
7171
* of managing multithreaded code that interacts with the user interface. As
72-
* such, all of the methods and state on the Service are intended to be
72+
* such, all of the methods and state on the {@code Service} are intended to be
7373
* invoked exclusively from the JavaFX Application thread. The only exception
74-
* to this, is when initially configuring a Service, which may safely be done
75-
* from any thread, and initially starting a Service, which may also safely
76-
* be done from any thread. However, once the Service has been initialized and
74+
* to this is when initially configuring a {@code Service}, which may safely be done
75+
* from any thread, and initially starting a {@code Service}, which may also safely
76+
* be done from any thread. However, once the {@code Service} has been initialized and
7777
* started, it may only thereafter be used from the FX thread.
7878
* </p>
7979
* <p>
80-
* A Service creates and manages a {@link Task} that performs the work
80+
* A {@code Service} creates and manages a {@link Task} that performs the work
8181
* on the background thread.
8282
* Service implements {@link Worker}. As such, you can observe the state of
8383
* the background task and optionally cancel it. Service is a reusable
84-
* Worker, meaning that it can be reset and restarted. Due to this, a Service
84+
* Worker, meaning that it can be reset and restarted. Due to this, a {@code Service}
8585
* can be constructed declaratively and restarted on demand.
86-
* Once a Service is started, it will schedule its Task and listen for
87-
* changes to the state of the Task. A Task does not hold a reference to the
88-
* Service that started it, meaning that a running Task will not prevent
89-
* the Service from being garbage collected.
86+
* Once a {@code Service} is started, it will schedule its {@code Task} and listen for
87+
* changes to the state of the {@code Task}. A {@code Task} does not hold a reference to the
88+
* {@code Service} that started it, meaning that a running {@code Task} will not prevent
89+
* the {@code Service} from being garbage collected.
9090
* </p>
9191
* <p>
92-
* If an {@link java.util.concurrent.Executor} is specified on the Service,
92+
* If an {@link java.util.concurrent.Executor} is specified on the {@code Service},
9393
* then it will be used to actually execute the service. Otherwise,
9494
* a daemon thread will be created and executed. If you wish to create
95-
* non-daemon threads, then specify a custom Executor (for example,
95+
* non-daemon threads, then specify a custom {@code Executor} (for example,
9696
* you could use a {@link ThreadPoolExecutor} with a custom
9797
* {@link java.util.concurrent.ThreadFactory}).
9898
* </p>
9999
* <p>
100-
* Because a Service is intended to simplify declarative use cases, subclasses
100+
* Because a {@code Service} is intended to simplify declarative use cases, subclasses
101101
* should expose as properties the input parameters to the work to be done.
102-
* For example, suppose I wanted to write a Service which read the first line
103-
* from any URL and returned it as a String. Such a Service might be defined,
104-
* such that it had a single property, {@code url}. It might be implemented
105-
* as:
102+
* For example, to write a {@code Service} that reads the first line
103+
* from any URL and returns it as a {@code String}, it might be defined with
104+
* a single property, {@code url}, and might be implemented as:
106105
* </p>
107106
* <pre><code>
108107
* {@literal public static class FirstLineService extends Service<String>} {
@@ -127,7 +126,7 @@
127126
* }
128127
* </code></pre>
129128
* <p>
130-
* The Service by default uses a thread pool Executor with some unspecified
129+
* The {@code Service} by default uses a {@code ThreadPoolExecutor} with some unspecified
131130
* default or maximum thread pool size. This is done so that naive code
132131
* will not completely swamp the system by creating thousands of Threads.
133132
* </p>

modules/javafx.graphics/src/main/java/javafx/concurrent/package.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
<html>
3131
<head>
3232
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
33-
<title>javafx.task</title>
33+
<title>javafx.concurrent</title>
3434
</head>
3535
<body>
36-
<p>Provides the set of classes for javafx.task.</p>
36+
<p>Provides the set of classes for javafx.concurrent.</p>
3737
<p>This package provides the ability to run application code on threads other
3838
than the JavaFX event dispatch thread. The ability to control the execution
3939
and track the progress of the application code is also provided.</p>

0 commit comments

Comments
 (0)