You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2013/02/15 16:13:25 UTC

default value of maximumLength in TextInput and similar classes

Hi all,
looking at TextInput, I have just seen that the maximumLength
attribute value has a default value big (and this is Ok), but it has
the Integer.MAX_VALUE (approx. 2^32) ... so to avoid memory problems,
crash attacks, etc (and so the need for any application to change it
to a lower, safer value) I think that a default max level near 65000
chars could be more that enough (but I repeat, only as default
maximumLength) ... if someone need an higher value it only need to
call the related setter and put a value up to Integer.MAX_VALUE ...

Note that the same attribute exist even in TextArea, and even here I'd
like to lower that default, but I know that with a lot of text the
current value could makes sense ... suggestions ?

What do you think ?
I'd like to put even this small change in 2.0.3 (now, near, really) in
a related jira issue, just to have it in release notes.

Unless objections I'll commit at the beginning on next week.


And last, what do you think if I'd add this attribute even in Label ?


Tell me.
Sandro

Re: default value of maximumLength in TextInput and similar classes

Posted by Sandro Martini <sa...@gmail.com>.
Hi all, just committed in 2.0.x, and soon in trunk.
Monday I'll start to look at implementing the same limit for Labels,
unless problems with it ...

Bye

Re: default value of maximumLength in TextInput and similar classes

Posted by Sandro Martini <sa...@gmail.com>.
Hi all, just committed in 2.0.x, and soon in trunk.
Monday I'll start to look at implementing the same limit for Labels,
unless problems with it ...

Bye

Re: default value of maximumLength in TextInput and similar classes

Posted by Sandro Martini <sa...@gmail.com>.
Hi,

> Yes, I meant 65000 is too small for TextArea.  For TextInput, 65000 is
> probably fine (even 32000 is okay), and probably for Label as well.
ok, but you know, it's better to be sure :-) ...

> Suggest 1MB (1,048,576) for TextArea and TextPane,
ok

> and 65536 for TextInput and Label (for the default values).
ok, or maybe 32000 (as dot Net) ... let's see Monday :-) .

Bye

Re: default value of maximumLength in TextInput and similar classes

Posted by Sandro Martini <sa...@gmail.com>.
Hi,

> Yes, I meant 65000 is too small for TextArea.  For TextInput, 65000 is
> probably fine (even 32000 is okay), and probably for Label as well.
ok, but you know, it's better to be sure :-) ...

> Suggest 1MB (1,048,576) for TextArea and TextPane,
ok

> and 65536 for TextInput and Label (for the default values).
ok, or maybe 32000 (as dot Net) ... let's see Monday :-) .

Bye

RE: default value of maximumLength in TextInput and similar classes

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Yes, I meant 65000 is too small for TextArea.  For TextInput, 65000 is
probably fine (even 32000 is okay), and probably for Label as well.

Suggest 1MB (1,048,576) for TextArea and TextPane, and 65536 for
TextInput and Label (for the default values).

~Roger Whitcomb

RE: default value of maximumLength in TextInput and similar classes

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Yes, I meant 65000 is too small for TextArea.  For TextInput, 65000 is
probably fine (even 32000 is okay), and probably for Label as well.

Suggest 1MB (1,048,576) for TextArea and TextPane, and 65536 for
TextInput and Label (for the default values).

~Roger Whitcomb

Re: default value of maximumLength in TextInput and similar classes

Posted by Sandro Martini <sa...@gmail.com>.
Hi,

> I don't think 2G is a reasonable value as a default -- this will for
> sure fill up memory in the default JVM configurations.
me too :-) ...

> But, for me, 65000 is way too small.
Excuse me, for a TextInput field ?
Looking at other GUI frameworks even 65000 seems an high default
value, look here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.maxlength.aspx

Or is it too small only for TextArea ?

And on add this attribute even in Label (to avoid the same possible flood) ?


> So, I think somewhere around 1-2MB would be a more reasonable default.
ok ... suggestions ?
Tell me, so Monday I can do the change (and related jira issue, to
put/show it in release notes) and commit ...


Bye

Re: default value of maximumLength in TextInput and similar classes

Posted by Sandro Martini <sa...@gmail.com>.
Hi,

> I don't think 2G is a reasonable value as a default -- this will for
> sure fill up memory in the default JVM configurations.
me too :-) ...

> But, for me, 65000 is way too small.
Excuse me, for a TextInput field ?
Looking at other GUI frameworks even 65000 seems an high default
value, look here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.maxlength.aspx

Or is it too small only for TextArea ?

And on add this attribute even in Label (to avoid the same possible flood) ?


> So, I think somewhere around 1-2MB would be a more reasonable default.
ok ... suggestions ?
Tell me, so Monday I can do the change (and related jira issue, to
put/show it in release notes) and commit ...


Bye

RE: default value of maximumLength in TextInput and similar classes

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
I don't think 2G is a reasonable value as a default -- this will for
sure fill up memory in the default JVM configurations.  But, for me,
65000 is way too small.  So, I think somewhere around 1-2MB would be a
more reasonable default.

~Roger Whitcomb

-----Original Message-----
From: Sandro Martini [mailto:sandro.martini@gmail.com] 
Sent: Friday, February 15, 2013 7:13 AM
To: Users - Apache Pivot; Developers - Apache Pivot
Subject: default value of maximumLength in TextInput and similar classes

Hi all,
looking at TextInput, I have just seen that the maximumLength attribute
value has a default value big (and this is Ok), but it has the
Integer.MAX_VALUE (approx. 2^32) ... so to avoid memory problems, crash
attacks, etc (and so the need for any application to change it to a
lower, safer value) I think that a default max level near 65000 chars
could be more that enough (but I repeat, only as default
maximumLength) ... if someone need an higher value it only need to call
the related setter and put a value up to Integer.MAX_VALUE ...

Note that the same attribute exist even in TextArea, and even here I'd
like to lower that default, but I know that with a lot of text the
current value could makes sense ... suggestions ?

What do you think ?
I'd like to put even this small change in 2.0.3 (now, near, really) in a
related jira issue, just to have it in release notes.

Unless objections I'll commit at the beginning on next week.


And last, what do you think if I'd add this attribute even in Label ?


Tell me.
Sandro

RE: default value of maximumLength in TextInput and similar classes

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
I don't think 2G is a reasonable value as a default -- this will for
sure fill up memory in the default JVM configurations.  But, for me,
65000 is way too small.  So, I think somewhere around 1-2MB would be a
more reasonable default.

~Roger Whitcomb

-----Original Message-----
From: Sandro Martini [mailto:sandro.martini@gmail.com] 
Sent: Friday, February 15, 2013 7:13 AM
To: Users - Apache Pivot; Developers - Apache Pivot
Subject: default value of maximumLength in TextInput and similar classes

Hi all,
looking at TextInput, I have just seen that the maximumLength attribute
value has a default value big (and this is Ok), but it has the
Integer.MAX_VALUE (approx. 2^32) ... so to avoid memory problems, crash
attacks, etc (and so the need for any application to change it to a
lower, safer value) I think that a default max level near 65000 chars
could be more that enough (but I repeat, only as default
maximumLength) ... if someone need an higher value it only need to call
the related setter and put a value up to Integer.MAX_VALUE ...

Note that the same attribute exist even in TextArea, and even here I'd
like to lower that default, but I know that with a lot of text the
current value could makes sense ... suggestions ?

What do you think ?
I'd like to put even this small change in 2.0.3 (now, near, really) in a
related jira issue, just to have it in release notes.

Unless objections I'll commit at the beginning on next week.


And last, what do you think if I'd add this attribute even in Label ?


Tell me.
Sandro