The pre-existing comment
"Creates a listener that is responsible that updates the UI based on how the tree
changes."
is bad grammar and should be fixed too.
Perhaps this would be a good time to make clear in the docs
that createPropertyChangeListener
does not create a new listener every time :-
So "Creates a listener if one does not already exist, otherwise
gets the existing listener, that is responsible for updating
the UI based on changes in the tree."
Or may be use the phrase, 'creates the listener, used on all
the subsequent methods like createMouseListener which implies a singleton
982 /**
983 * Creates a listener that is responsible that updates the UI based on
984 * how the tree changes.
985 *
986 * @return an instance of the {@code PropertyChangeListener}
987 */
988 protected PropertyChangeListener createPropertyChangeListener() {
989 return getHandler();
990 }
991
992 private Handler getHandler() {
993 if (handler == null) {
994 handler = new Handler();
995 }
996 return handler;
997 }
998
999 /**
1000 * Creates the listener responsible for updating the selection based on
1001 * mouse events.
1002 *
1003 * @return an instance of the {@code MouseListener}
1004 */
1005 protected MouseListener createMouseListener() {
1006 return getHandler();
1007 }
1008
On 7/14/2014 7:39 AM, Petr Pchelko wrote:
Hello, Andrei.
The fix looks good to me.
With best regards. Petr.
On 11 июля 2014 г., at 19:12, andrei.eremeev <[email protected]> wrote:
Hi Swing team,
Please, review the fix for the issue:
https://bugs.openjdk.java.net/browse/JDK-8050009
The fix is available at:
http://cr.openjdk.java.net/~yan/8050009/
Andrei