Tania Bento wrote:
Hey,
This patch just checks if the desired column number is valid. If it is
invalid, it sets it to 0. This patch is based on Harmony's
testFieldInt(test.java.awt.TextFieldTest.java).
Could someone please approve this. Thanks.
Approved.
Tom
Tania
2006-06-23 Tania Bento <[EMAIL PROTECTED]>
* java/awt/TextField.java
(TextField): Check if number of columns given as argument
is valid (>= 0) and set the number of columns accordingly.
------------------------------------------------------------------------
Index: java/awt/TextField.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/TextField.java,v
retrieving revision 1.17
diff -u -r1.17 TextField.java
--- java/awt/TextField.java 24 Feb 2006 18:50:36 -0000 1.17
+++ java/awt/TextField.java 23 Jun 2006 14:32:07 -0000
@@ -96,7 +96,7 @@
public
TextField()
{
- this("", 1);
+ this("", 0);
}
/*************************************************************************/
@@ -147,7 +147,11 @@
TextField(String text, int columns)
{
super(text);
- this.columns = columns;
+
+ if (columns < 0)
+ this.columns = 0;
+ else
+ this.columns = columns;
if (GraphicsEnvironment.isHeadless())
throw new HeadlessException ();