# HG changeset patch # User peterz # Date 1207559224 -14400 # Node ID 4bc25999f850fca70046b404112cdc0c9e659186 # Parent eaa6e0cc0aeac4531f3485e34f659fb5e5084847 4765383: JTextArea.append(String) not thread safe Summary: Several swing.text methods are not marked thread-safe anymore. Reviewed-by: gsm diff -r eaa6e0cc0aea -r 4bc25999f850 jdk/src/share/classes/javax/swing/JEditorPane.java --- a/jdk/src/share/classes/javax/swing/JEditorPane.java Thu Apr 03 16:41:43 2008 +0400 +++ b/jdk/src/share/classes/javax/swing/JEditorPane.java Mon Apr 07 13:07:04 2008 +0400 @@ -1120,11 +1120,6 @@ * current selection. The replacement text will have the * attributes currently defined for input. If the component is not * editable, beep and return. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param content the content to replace the selection with. This * value can be null @@ -1395,11 +1390,6 @@ * create a StringReader and call the read method. In this case the model * would be replaced after it was initialized with the contents of the * string. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param t the new text to be set; if null the old * text will be deleted diff -r eaa6e0cc0aea -r 4bc25999f850 jdk/src/share/classes/javax/swing/JTextArea.java --- a/jdk/src/share/classes/javax/swing/JTextArea.java Thu Apr 03 16:41:43 2008 +0400 +++ b/jdk/src/share/classes/javax/swing/JTextArea.java Mon Apr 07 13:07:04 2008 +0400 @@ -444,11 +444,6 @@ /** * Inserts the specified text at the specified position. Does nothing * if the model is null or if the text is null or empty. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param str the text to insert * @param pos the position at which to insert >= 0 @@ -471,11 +466,6 @@ /** * Appends the given text to the end of the document. Does nothing if * the model is null or the string is null or empty. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param str the text to insert * @see #insert @@ -494,11 +484,6 @@ * Replaces text from the indicated start to end position with the * new text specified. Does nothing if the model is null. Simply * does a delete if the new string is null or empty. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param str the text to use as the replacement * @param start the start position >= 0 diff -r eaa6e0cc0aea -r 4bc25999f850 jdk/src/share/classes/javax/swing/JTextPane.java --- a/jdk/src/share/classes/javax/swing/JTextPane.java Thu Apr 03 16:41:43 2008 +0400 +++ b/jdk/src/share/classes/javax/swing/JTextPane.java Mon Apr 07 13:07:04 2008 +0400 @@ -167,11 +167,6 @@ * current selection. The replacement text will have the * attributes currently defined for input at the point of * insertion. If the document is not editable, beep and return. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param content the content to replace the selection with */ @@ -229,11 +224,6 @@ * a value of 0.75 will cause 75 percent of the * component to be above the baseline, and 25 percent of the * component to be below the baseline. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param c the component to insert */ @@ -252,11 +242,6 @@ * current position of the caret. This is represented in * the associated document as an attribute of one character * of content. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param g the icon to insert * @see Icon @@ -320,11 +305,6 @@ * through the logical style assigned to the paragraph, which * in term may resolve through some hierarchy completely * independent of the element hierarchy in the document. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param s the logical style to assign to the paragraph, * or null for no style @@ -367,11 +347,6 @@ * is no selection, the attributes are applied to * the input attribute set which defines the attributes * for any new text that gets inserted. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param attr the attributes * @param replace if true, then replace the existing attributes first @@ -412,11 +387,6 @@ * to the paragraphs that intersect the selection. * If there is no selection, the attributes are applied * to the paragraph at the current caret position. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param attr the non-null attributes * @param replace if true, replace the existing attributes first diff -r eaa6e0cc0aea -r 4bc25999f850 jdk/src/share/classes/javax/swing/text/JTextComponent.java --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java Thu Apr 03 16:41:43 2008 +0400 +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java Mon Apr 07 13:07:04 2008 +0400 @@ -1349,11 +1349,6 @@ * This is the method that is used by the default implementation * of the action for inserting content that gets bound to the * keymap actions. - *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. * * @param content the content to replace the selection with */ @@ -1687,12 +1682,8 @@ * or empty, has the effect of simply deleting the old text. * When text has been inserted, the resulting caret location * is determined by the implementation of the caret class. + * *

- * This method is thread safe, although most Swing methods - * are not. Please see - * How - * to Use Threads for more information. - * * Note that text is not a bound property, so no PropertyChangeEvent * is fired when it changes. To listen for changes to the text, * use DocumentListener.