--- old/jdk/src/java.desktop/share/classes/java/awt/TextArea.java 2015-09-18 16:14:37.944736999 +0530 +++ new/jdk/src/java.desktop/share/classes/java/awt/TextArea.java 2015-09-18 16:14:37.808669000 +0530 @@ -327,9 +327,9 @@ TextAreaPeer peer = (TextAreaPeer)this.peer; if (peer != null) { peer.insert(str, pos); - } else { - text = text.substring(0, pos) + str + text.substring(pos); } + text = (text != null) ? text.substring(0, pos) + str + + text.substring(pos) : str; } /** @@ -343,7 +343,7 @@ * @since 1.1 */ public void append(String str) { - appendText(str); + insertText(str, getText().length()); } /** @@ -355,11 +355,7 @@ */ @Deprecated public synchronized void appendText(String str) { - if (peer != null) { insertText(str, getText().length()); - } else { - text = text + str; - } } /** @@ -403,9 +399,9 @@ TextAreaPeer peer = (TextAreaPeer)this.peer; if (peer != null) { peer.replaceRange(str, start, end); - } else { - text = text.substring(0, start) + str + text.substring(end); } + text = (text != null) ? text.substring(0, start) + str + + text.substring(end) : str; } /**