4765383: JTextArea.append(String) not thread safe
Several swing.text methods are not marked thread-safe anymore. Reviewed-by: gsm
This commit is contained in:
parent
a61087c762
commit
f3cc321cb2
@ -1120,11 +1120,6 @@ public class JEditorPane extends JTextComponent {
|
|||||||
* current selection. The replacement text will have the
|
* current selection. The replacement text will have the
|
||||||
* attributes currently defined for input. If the component is not
|
* attributes currently defined for input. If the component is not
|
||||||
* editable, beep and return.
|
* editable, beep and return.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param content the content to replace the selection with. This
|
* @param content the content to replace the selection with. This
|
||||||
* value can be <code>null</code>
|
* value can be <code>null</code>
|
||||||
@ -1395,11 +1390,6 @@ public class JEditorPane extends JTextComponent {
|
|||||||
* create a StringReader and call the read method. In this case the model
|
* 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
|
* would be replaced after it was initialized with the contents of the
|
||||||
* string.
|
* string.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param t the new text to be set; if <code>null</code> the old
|
* @param t the new text to be set; if <code>null</code> the old
|
||||||
* text will be deleted
|
* text will be deleted
|
||||||
|
@ -444,11 +444,6 @@ public class JTextArea extends JTextComponent {
|
|||||||
/**
|
/**
|
||||||
* Inserts the specified text at the specified position. Does nothing
|
* Inserts the specified text at the specified position. Does nothing
|
||||||
* if the model is null or if the text is null or empty.
|
* if the model is null or if the text is null or empty.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param str the text to insert
|
* @param str the text to insert
|
||||||
* @param pos the position at which to insert >= 0
|
* @param pos the position at which to insert >= 0
|
||||||
@ -471,11 +466,6 @@ public class JTextArea extends JTextComponent {
|
|||||||
/**
|
/**
|
||||||
* Appends the given text to the end of the document. Does nothing if
|
* Appends the given text to the end of the document. Does nothing if
|
||||||
* the model is null or the string is null or empty.
|
* the model is null or the string is null or empty.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param str the text to insert
|
* @param str the text to insert
|
||||||
* @see #insert
|
* @see #insert
|
||||||
@ -494,11 +484,6 @@ public class JTextArea extends JTextComponent {
|
|||||||
* Replaces text from the indicated start to end position with the
|
* Replaces text from the indicated start to end position with the
|
||||||
* new text specified. Does nothing if the model is null. Simply
|
* new text specified. Does nothing if the model is null. Simply
|
||||||
* does a delete if the new string is null or empty.
|
* does a delete if the new string is null or empty.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param str the text to use as the replacement
|
* @param str the text to use as the replacement
|
||||||
* @param start the start position >= 0
|
* @param start the start position >= 0
|
||||||
|
@ -167,11 +167,6 @@ public class JTextPane extends JEditorPane {
|
|||||||
* current selection. The replacement text will have the
|
* current selection. The replacement text will have the
|
||||||
* attributes currently defined for input at the point of
|
* attributes currently defined for input at the point of
|
||||||
* insertion. If the document is not editable, beep and return.
|
* insertion. If the document is not editable, beep and return.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param content the content to replace the selection with
|
* @param content the content to replace the selection with
|
||||||
*/
|
*/
|
||||||
@ -229,11 +224,6 @@ public class JTextPane extends JEditorPane {
|
|||||||
* a value of <code>0.75</code> will cause 75 percent of the
|
* a value of <code>0.75</code> will cause 75 percent of the
|
||||||
* component to be above the baseline, and 25 percent of the
|
* component to be above the baseline, and 25 percent of the
|
||||||
* component to be below the baseline.
|
* component to be below the baseline.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param c the component to insert
|
* @param c the component to insert
|
||||||
*/
|
*/
|
||||||
@ -252,11 +242,6 @@ public class JTextPane extends JEditorPane {
|
|||||||
* current position of the caret. This is represented in
|
* current position of the caret. This is represented in
|
||||||
* the associated document as an attribute of one character
|
* the associated document as an attribute of one character
|
||||||
* of content.
|
* of content.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param g the icon to insert
|
* @param g the icon to insert
|
||||||
* @see Icon
|
* @see Icon
|
||||||
@ -320,11 +305,6 @@ public class JTextPane extends JEditorPane {
|
|||||||
* through the logical style assigned to the paragraph, which
|
* through the logical style assigned to the paragraph, which
|
||||||
* in term may resolve through some hierarchy completely
|
* in term may resolve through some hierarchy completely
|
||||||
* independent of the element hierarchy in the document.
|
* independent of the element hierarchy in the document.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param s the logical style to assign to the paragraph,
|
* @param s the logical style to assign to the paragraph,
|
||||||
* or <code>null</code> for no style
|
* or <code>null</code> for no style
|
||||||
@ -367,11 +347,6 @@ public class JTextPane extends JEditorPane {
|
|||||||
* is no selection, the attributes are applied to
|
* is no selection, the attributes are applied to
|
||||||
* the input attribute set which defines the attributes
|
* the input attribute set which defines the attributes
|
||||||
* for any new text that gets inserted.
|
* for any new text that gets inserted.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param attr the attributes
|
* @param attr the attributes
|
||||||
* @param replace if true, then replace the existing attributes first
|
* @param replace if true, then replace the existing attributes first
|
||||||
@ -412,11 +387,6 @@ public class JTextPane extends JEditorPane {
|
|||||||
* to the paragraphs that intersect the selection.
|
* to the paragraphs that intersect the selection.
|
||||||
* If there is no selection, the attributes are applied
|
* If there is no selection, the attributes are applied
|
||||||
* to the paragraph at the current caret position.
|
* to the paragraph at the current caret position.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param attr the non-<code>null</code> attributes
|
* @param attr the non-<code>null</code> attributes
|
||||||
* @param replace if true, replace the existing attributes first
|
* @param replace if true, replace the existing attributes first
|
||||||
|
@ -1349,11 +1349,6 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
|
|||||||
* This is the method that is used by the default implementation
|
* This is the method that is used by the default implementation
|
||||||
* of the action for inserting content that gets bound to the
|
* of the action for inserting content that gets bound to the
|
||||||
* keymap actions.
|
* keymap actions.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
* @param content the content to replace the selection with
|
* @param content the content to replace the selection with
|
||||||
*/
|
*/
|
||||||
@ -1687,12 +1682,8 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A
|
|||||||
* or empty, has the effect of simply deleting the old text.
|
* or empty, has the effect of simply deleting the old text.
|
||||||
* When text has been inserted, the resulting caret location
|
* When text has been inserted, the resulting caret location
|
||||||
* is determined by the implementation of the caret class.
|
* is determined by the implementation of the caret class.
|
||||||
* <p>
|
|
||||||
* This method is thread safe, although most Swing methods
|
|
||||||
* are not. Please see
|
|
||||||
* <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
|
|
||||||
* to Use Threads</A> for more information.
|
|
||||||
*
|
*
|
||||||
|
* <p>
|
||||||
* Note that text is not a bound property, so no <code>PropertyChangeEvent
|
* Note that text is not a bound property, so no <code>PropertyChangeEvent
|
||||||
* </code> is fired when it changes. To listen for changes to the text,
|
* </code> is fired when it changes. To listen for changes to the text,
|
||||||
* use <code>DocumentListener</code>.
|
* use <code>DocumentListener</code>.
|
||||||
|
Loading…
Reference in New Issue
Block a user