<AWT Dev> Review request: JDK-8040322 TextArea.replaceRange() and insert() are broken with setText(null)
Sergey Bylokhov
Sergey.Bylokhov at oracle.com
Fri Sep 18 12:52:03 UTC 2015
Hi, Ambarish.
A few comments.
- The fix changed the order of methods calls. Note that if the user
overrides the "appendText" then it is called after an "append".
- It seems that before the fix we always tried to use the empty string
for a null text(we replace null to "" in the constructor and setText),
the new code should maintain the same assumption.
On 18.09.15 14:36, Ambarish Rapte wrote:
> Hi,
>
> Please review the following fix for jdk9.
>
> Bug:https://bugs.openjdk.java.net/browse/JDK-8040322
> Webrev:http://cr.openjdk.java.net/~psadhukhan/ambarish/8040322/webrev.00/
>
> Issue:
> / TextArea.setText(null)/ does not set TextArea text to
> /null/ when called after
> /TextArea.replaceRange(), TextArea.insert(), TextArea.append()./
>
> Cause:
> Variable “/text/” was not correctly updated in
>
> /TextArea.replaceRange(), TextArea.insert(), TextArea.append()/ in awt
> / TextArea.java
>
> Fix:
> Update the variable “text” correctly with the calls to
>
> /TextArea.replaceRange(), TextArea.insert(), TextArea.append()/
>
> In file awt / TextArea.java
>
> Many Thanks,
> Ambarish Rapte
>
--
Best regards, Sergey.
More information about the awt-dev
mailing list