[jira] [Reopened] (PIVOT-861) Memory leak: Window icon ImageListenerList retains reference to closed windows, preventing garbage collection

2013-02-15 Thread Sandro Martini (JIRA)

 [ 
https://issues.apache.org/jira/browse/PIVOT-861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandro Martini reopened PIVOT-861:
--


Sorry ... but now we need a test case to reproduce this new error.


> Memory leak: Window icon ImageListenerList retains reference to closed 
> windows, preventing garbage collection
> -
>
> Key: PIVOT-861
> URL: https://issues.apache.org/jira/browse/PIVOT-861
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk, wtk-media
>Affects Versions: 2.0.2
> Environment: Windows XP, Java 1.7.0_05
>Reporter: David Keen
>Assignee: Sandro Martini
> Fix For: 2.0.3
>
> Attachments: leaktest.zip, Pivot861.launch, PivotSample.zip
>
>
> When a window or dialog is opened which has an icon, after it is closed it 
> cannot be garbage collected because a reference is retained to it through the 
> icon.  Removing the icon resolves the issue.
> As far as I've investigated, the issue appears to the in the 
> ImageListenerList which each Image contains.  I've done a heapdump of my 
> application and used the IBM HeapAnalyzer which shows this list containing a 
> reference to the window/dialog through the ImageViewSkin, but I don't know 
> the Pivot internals well enough to see where or how it should be released.
> I'll attach a simple test application to show the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PIVOT-861) Memory leak: Window icon ImageListenerList retains reference to closed windows, preventing garbage collection

2013-02-15 Thread Roger Whitcomb (JIRA)

[ 
https://issues.apache.org/jira/browse/PIVOT-861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579640#comment-13579640
 ] 

Roger Whitcomb commented on PIVOT-861:
--

I'm now getting these errors periodically (sent to System.err):

Nonexistent listener org.apache.pivot.wtk.skin.ImageViewSkin$1@99504b removed 
from org.apache.pivot.wtk.media.Image$ImageListenerList@1669e7f

I'm not sure yet under what circumstances, but it seems this fix isn't quite 
right yet.

> Memory leak: Window icon ImageListenerList retains reference to closed 
> windows, preventing garbage collection
> -
>
> Key: PIVOT-861
> URL: https://issues.apache.org/jira/browse/PIVOT-861
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk, wtk-media
>Affects Versions: 2.0.2
> Environment: Windows XP, Java 1.7.0_05
>Reporter: David Keen
>Assignee: Sandro Martini
> Fix For: 2.0.3
>
> Attachments: leaktest.zip, Pivot861.launch, PivotSample.zip
>
>
> When a window or dialog is opened which has an icon, after it is closed it 
> cannot be garbage collected because a reference is retained to it through the 
> icon.  Removing the icon resolves the issue.
> As far as I've investigated, the issue appears to the in the 
> ImageListenerList which each Image contains.  I've done a heapdump of my 
> application and used the IBM HeapAnalyzer which shows this list containing a 
> reference to the window/dialog through the ImageViewSkin, but I don't know 
> the Pivot internals well enough to see where or how it should be released.
> I'll attach a simple test application to show the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: default value of maximumLength in TextInput and similar classes

2013-02-15 Thread Sandro Martini
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


[jira] [Commented] (PIVOT-893) Set lower default value for maximumLength in TextInput and TextArea

2013-02-15 Thread Sandro Martini (JIRA)

[ 
https://issues.apache.org/jira/browse/PIVOT-893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579625#comment-13579625
 ] 

Sandro Martini commented on PIVOT-893:
--

For 2.0.x branch, set new values for TextInput and TextArea: Committed revision 
1446823.
Merge in trunk soon.

For Label, in next days (unless problems with it).


> Set lower default value for maximumLength in TextInput and TextArea
> ---
>
> Key: PIVOT-893
> URL: https://issues.apache.org/jira/browse/PIVOT-893
> Project: Pivot
>  Issue Type: Improvement
>Reporter: Sandro Martini
>Assignee: Sandro Martini
>Priority: Minor
> Fix For: 2.0.3
>
>
> To avoid flood memory in input fields, the default value for maximumLength 
> (or maximum number of chars)  has to be put to a lower value (up to now is 
> was Integer.MAX_VALUE), that could be: 
> 32768 - 1 for TextInput (like in other GUI frameworks), and 1048576 - 1 for 
> TextArea (where many times it's used to display even long multi-line text).
> Note that if/when needed, it's always possible to set maximumLength to any 
> positive value up to Integer.MAX_VALUE, using the related setter method.
> Verify if implement maximumLength even for Labels (could be useful too) with 
> the same default value of TextInput, or maybe even lower.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (PIVOT-893) Set lower default value for maximumLength in TextInput and TextArea

2013-02-15 Thread Sandro Martini (JIRA)
Sandro Martini created PIVOT-893:


 Summary: Set lower default value for maximumLength in TextInput 
and TextArea
 Key: PIVOT-893
 URL: https://issues.apache.org/jira/browse/PIVOT-893
 Project: Pivot
  Issue Type: Improvement
Reporter: Sandro Martini
Assignee: Sandro Martini
Priority: Minor
 Fix For: 2.0.3


To avoid flood memory in input fields, the default value for maximumLength (or 
maximum number of chars)  has to be put to a lower value (up to now is was 
Integer.MAX_VALUE), that could be: 
32768 - 1 for TextInput (like in other GUI frameworks), and 1048576 - 1 for 
TextArea (where many times it's used to display even long multi-line text).

Note that if/when needed, it's always possible to set maximumLength to any 
positive value up to Integer.MAX_VALUE, using the related setter method.

Verify if implement maximumLength even for Labels (could be useful too) with 
the same default value of TextInput, or maybe even lower.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PIVOT-873) Provide a style for TableVIew that allows one click to start row editing

2013-02-15 Thread Roger Whitcomb (JIRA)

[ 
https://issues.apache.org/jira/browse/PIVOT-873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579514#comment-13579514
 ] 

Roger Whitcomb commented on PIVOT-873:
--

Made another fix for SelectMode.NONE:
[branches/2.0.x]:
Sending   
wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
Transmitting file data .
Committed revision 1446780.

> Provide a style for TableVIew that allows one click to start row editing
> 
>
> Key: PIVOT-873
> URL: https://issues.apache.org/jira/browse/PIVOT-873
> Project: Pivot
>  Issue Type: Improvement
>  Components: wtk-terra
>Affects Versions: 2.0.2
> Environment: All
>Reporter: Roger Whitcomb
>Assignee: Roger Whitcomb
>Priority: Trivial
>  Labels: tableview
> Fix For: 2.0.3
>
>
> Normally, a double click is required in a TableView row to initiate editing 
> of the row.  Our users would like to start editing right away.
> The proposal is to add a new style (implemented in TerraTableViewSkin) called 
> "editOnMouseDown" that would allow the first click to begin editing.  The 
> default behavior would remain the same (edit is started on double click).
> It is not clear if I can implement it such that the first click would not 
> only initiate editing but also toggle checkboxes or select radio buttons if 
> there are any in the row editor.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: default value of maximumLength in TextInput and similar classes

2013-02-15 Thread Sandro Martini
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

2013-02-15 Thread Roger L. Whitcomb
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

2013-02-15 Thread Sandro Martini
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

2013-02-15 Thread Roger L. Whitcomb
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.mart...@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


[jira] [Resolved] (PIVOT-892) DoubleValidator and FloatValidator do not allow exponents to be entered

2013-02-15 Thread Sandro Martini (JIRA)

 [ 
https://issues.apache.org/jira/browse/PIVOT-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandro Martini resolved PIVOT-892.
--

Resolution: Fixed

The issue seems resolved.
Of course, be free to reopen in case something is still to fix.


> DoubleValidator and FloatValidator do not allow exponents to be entered
> ---
>
> Key: PIVOT-892
> URL: https://issues.apache.org/jira/browse/PIVOT-892
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk
>Affects Versions: 2.0.2
> Environment: All
>Reporter: Roger Whitcomb
>Assignee: Roger Whitcomb
>Priority: Minor
>  Labels: validation
> Fix For: 2.0.3
>
> Attachments: 892.patch, num.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> The DoubleValidator and FloatValidator classes rely on a default NumberFormat 
> instance to do parsing, however, a DecimalFormat is necessary in order to 
> recognize floating values entered with exponents.
> As a result, using one of these validators currently will fail to validate a 
> valid floating-point number such as "3.0e20".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (PIVOT-861) Memory leak: Window icon ImageListenerList retains reference to closed windows, preventing garbage collection

2013-02-15 Thread Sandro Martini (JIRA)

 [ 
https://issues.apache.org/jira/browse/PIVOT-861?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandro Martini resolved PIVOT-861.
--

Resolution: Fixed

The issue seems resolved now, otherwise tell me (or be free to reopen it).


> Memory leak: Window icon ImageListenerList retains reference to closed 
> windows, preventing garbage collection
> -
>
> Key: PIVOT-861
> URL: https://issues.apache.org/jira/browse/PIVOT-861
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk, wtk-media
>Affects Versions: 2.0.2
> Environment: Windows XP, Java 1.7.0_05
>Reporter: David Keen
>Assignee: Sandro Martini
> Fix For: 2.0.3
>
> Attachments: leaktest.zip, Pivot861.launch, PivotSample.zip
>
>
> When a window or dialog is opened which has an icon, after it is closed it 
> cannot be garbage collected because a reference is retained to it through the 
> icon.  Removing the icon resolves the issue.
> As far as I've investigated, the issue appears to the in the 
> ImageListenerList which each Image contains.  I've done a heapdump of my 
> application and used the IBM HeapAnalyzer which shows this list containing a 
> reference to the window/dialog through the ImageViewSkin, but I don't know 
> the Pivot internals well enough to see where or how it should be released.
> I'll attach a simple test application to show the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (PIVOT-888) Nullpointer Exception while editing TextArea with text property two-way bounded

2013-02-15 Thread Sandro Martini (JIRA)

 [ 
https://issues.apache.org/jira/browse/PIVOT-888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandro Martini resolved PIVOT-888.
--

Resolution: Fixed

Hi, just fixed in 2.0.x branch (merge in trunk soon):
Committed revision 1446649.

Karel, thank you very much for the help.


> Nullpointer Exception while editing TextArea with text property two-way 
> bounded
> ---
>
> Key: PIVOT-888
> URL: https://issues.apache.org/jira/browse/PIVOT-888
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk
>Affects Versions: 2.0.2
>Reporter: Karel Hübl
>Assignee: Sandro Martini
>Priority: Trivial
> Fix For: 2.0.3
>
>
> I am getting NullPointer exception trace printed to System.out when I edit 
> TextArea, which text property is two-way data bounded.
> The issue is fixed when I extend TextArea and override the setText mehtod to 
> do nothing, if the text equals to current text value:
> Fixed class:
> public class TwoWayBindableTextArea extends TextArea {
>   public void setText(String text) {
>   if (text != null && text.equals(this.getText())) {
>   return;
>   }
>   super.setText(text);
>   }
> }
> Problematic bxml:
>xmlns="org.apache.pivot.wtk"
>   xmlns:view="com.dirigent.gui.component"
>   xmlns:bxml="http://pivot.apache.org/bxml"; width="300" height="200">
> 
>   
>   
>   
>   
>   
>   
>  
> 
> 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Assigned] (PIVOT-888) Nullpointer Exception while editing TextArea with text property two-way bounded

2013-02-15 Thread Sandro Martini (JIRA)

 [ 
https://issues.apache.org/jira/browse/PIVOT-888?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sandro Martini reassigned PIVOT-888:


Assignee: Sandro Martini  (was: Roger Whitcomb)

> Nullpointer Exception while editing TextArea with text property two-way 
> bounded
> ---
>
> Key: PIVOT-888
> URL: https://issues.apache.org/jira/browse/PIVOT-888
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk
>Affects Versions: 2.0.2
>Reporter: Karel Hübl
>Assignee: Sandro Martini
>Priority: Trivial
> Fix For: 2.0.3
>
>
> I am getting NullPointer exception trace printed to System.out when I edit 
> TextArea, which text property is two-way data bounded.
> The issue is fixed when I extend TextArea and override the setText mehtod to 
> do nothing, if the text equals to current text value:
> Fixed class:
> public class TwoWayBindableTextArea extends TextArea {
>   public void setText(String text) {
>   if (text != null && text.equals(this.getText())) {
>   return;
>   }
>   super.setText(text);
>   }
> }
> Problematic bxml:
>xmlns="org.apache.pivot.wtk"
>   xmlns:view="com.dirigent.gui.component"
>   xmlns:bxml="http://pivot.apache.org/bxml"; width="300" height="200">
> 
>   
>   
>   
>   
>   
>   
>  
> 
> 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


default value of maximumLength in TextInput and similar classes

2013-02-15 Thread Sandro Martini
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


[jira] [Commented] (PIVOT-888) Nullpointer Exception while editing TextArea with text property two-way bounded

2013-02-15 Thread Sandro Martini (JIRA)

[ 
https://issues.apache.org/jira/browse/PIVOT-888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13579220#comment-13579220
 ] 

Sandro Martini commented on PIVOT-888:
--

Hi all,
just found the problem (work/fix note): in TextArea.java, line 119 , 

textArea.textAreaContentListeners.textChanged(textArea);
after this, textArea is null, so the NPE in the next line ... I'll try to look 
at this asap.


> Nullpointer Exception while editing TextArea with text property two-way 
> bounded
> ---
>
> Key: PIVOT-888
> URL: https://issues.apache.org/jira/browse/PIVOT-888
> Project: Pivot
>  Issue Type: Bug
>  Components: wtk
>Affects Versions: 2.0.2
>Reporter: Karel Hübl
>Assignee: Roger Whitcomb
>Priority: Trivial
> Fix For: 2.0.3
>
>
> I am getting NullPointer exception trace printed to System.out when I edit 
> TextArea, which text property is two-way data bounded.
> The issue is fixed when I extend TextArea and override the setText mehtod to 
> do nothing, if the text equals to current text value:
> Fixed class:
> public class TwoWayBindableTextArea extends TextArea {
>   public void setText(String text) {
>   if (text != null && text.equals(this.getText())) {
>   return;
>   }
>   super.setText(text);
>   }
> }
> Problematic bxml:
>xmlns="org.apache.pivot.wtk"
>   xmlns:view="com.dirigent.gui.component"
>   xmlns:bxml="http://pivot.apache.org/bxml"; width="300" height="200">
> 
>   
>   
>   
>   
>   
>   
>  
> 
> 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira