You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Roland Zwaga (JIRA)" <ji...@apache.org> on 2012/08/03 11:00:04 UTC

[jira] [Created] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Roland Zwaga created FLEX-33156:
-----------------------------------

             Summary: focusInHandler() in spark Scroller doesn't null check focusManager property before using
                 Key: FLEX-33156
                 URL: https://issues.apache.org/jira/browse/FLEX-33156
             Project: Apache Flex
          Issue Type: Bug
          Components: Spark: Scroller
    Affects Versions: Adobe Flex SDK 4.6 (Release)
            Reporter: Roland Zwaga
             Fix For: Adobe Flex SDK Next


the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.

So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.

Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by jude <fl...@gmail.com>.
I just spent the last 3 days on this error. The solution was to have the
container of the component of the event.target (in the Scroller
focusInHandler) implement the IFocusManagerContainer. Specifically the
container needs to override the systemManager getter.

Either way we should find out what, if any negative affect this may have in
added the null check, if possible. Otherwise +1.

On Sat, Aug 4, 2012 at 5:05 AM, Roland Zwaga <ro...@stackandheap.com>wrote:

> >> the super.focusHandler() implementation in UIComponent performs the
> same check,
> >> therefore I figured it would make sense here as well. Do you reckon
> otherwise?
> > Sure without tests bit hard to tell what (if any) side effect there
> might be. It looks fine to be but no way to be 100% sure. Note that
> anything to do with focus is easy to test in an automatic way. Hopefully
> the Mustella tests that should be here any day now have some tests around
> this.
>
> Hey,
>
> from what I see in the isOurFocus() method it just check if the
> event.target == this, so the event is bubbling (I suppose),
> so it performs the handler only if the event is dispatched by the
> component itself.
> But I agree that we can only be sure after running the mustella tests,
> so let's wait for that to drop.
>
> Roland
>

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by Roland Zwaga <ro...@stackandheap.com>.
>> But I agree that we can only be sure after running the mustella tests,
>> so let's wait for that to drop.
> Do you have time to give that I go? I tried but was unable to run the test (possibly) due to spaces in my project path.

I'm going to try and get mustella to run this evening, I'll let you
know if I succeeded or not ;)

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> But I agree that we can only be sure after running the mustella tests,
> so let's wait for that to drop.
Do you have time to give that I go? I tried but was unable to run the test (possibly) due to spaces in my project path.

Thanks,
Justin

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by Roland Zwaga <ro...@stackandheap.com>.
>> the super.focusHandler() implementation in UIComponent performs the same check,
>> therefore I figured it would make sense here as well. Do you reckon otherwise?
> Sure without tests bit hard to tell what (if any) side effect there might be. It looks fine to be but no way to be 100% sure. Note that anything to do with focus is easy to test in an automatic way. Hopefully the Mustella tests that should be here any day now have some tests around this.

Hey,

from what I see in the isOurFocus() method it just check if the
event.target == this, so the event is bubbling (I suppose),
so it performs the handler only if the event is dispatched by the
component itself.
But I agree that we can only be sure after running the mustella tests,
so let's wait for that to drop.

Roland

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> the super.focusHandler() implementation in UIComponent performs the same check,
> therefore I figured it would make sense here as well. Do you reckon otherwise?
Sure without tests bit hard to tell what (if any) side effect there might be. It looks fine to be but no way to be 100% sure. Note that anything to do with focus is easy to test in an automatic way. Hopefully the Mustella tests that should be here any day now have some tests around this.

Thanks,
Justin

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by Roland Zwaga <ro...@stackandheap.com>.
Hey Justin,

the super.focusHandler() implementation in UIComponent performs the same check,
therefore I figured it would make sense here as well. Do you reckon otherwise?

cheers,

Roland

On 3 August 2012 14:08, Justin Mclean <ju...@classsoftware.com> wrote:
> Hi,
>
> I assume there's also a good reason for adding the call to isOurFocus?
>
> Thanks,
> Justin



-- 
regards,
Roland

--
Roland Zwaga
Senior Consultant | Stack & Heap BVBA

+32 (0)486 16 12 62 | roland@stackandheap.com | http://www.stackandheap.com

http://zwaga.blogspot.com
http://www.springactionscript.org
http://www.as3commons.org

Re: [jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

I assume there's also a good reason for adding the call to isOurFocus?

Thanks,
Justin

[jira] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Roland Zwaga (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Zwaga updated FLEX-33156:
--------------------------------

    Attachment: Scroller.as.patch

adds a null check to the focusInHandler() method.
                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Comment Edited] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Carol Frampton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479251#comment-13479251 ] 

Carol Frampton edited comment on FLEX-33156 at 10/18/12 7:04 PM:
-----------------------------------------------------------------

I believe your change was this so you have an extra check in there.  Also I was suggesting you use fm for both the "if (fm)" and latter for "fm.getFocus()".

    var fm:IFocusManager = focusManager;
    if (fm)
    {
        if (isOurFocus(DisplayObject(event.target)))
       {
            // When we gain focus, make sure the focused element is visible
            if (viewport && ensureElementIsVisibleForSoftKeyboard)
            {
                var elt:IVisualElement = focusManager.getFocus() as IVisualElement; 
                lastFocusedElement = elt;
             }
        }
    }

                
      was (Author: cframpton):
    I believe your change was so you have an extra check in there.  Also I was suggesting you use fm for both the "if (fm)" and latter for "fm.getFocus()".

        var fm:IFocusManager = focusManager;
        if (fm)
	{
		if (isOurFocus(DisplayObject(event.target)))
		{
		        // When we gain focus, make sure the focused element is visible
		        if (viewport && ensureElementIsVisibleForSoftKeyboard)
		        {
		                var elt:IVisualElement = focusManager.getFocus() as IVisualElement; 
		                lastFocusedElement = elt;
		        }
		}
	}

                  
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Carol Frampton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479234#comment-13479234 ] 

Carol Frampton commented on FLEX-33156:
---------------------------------------

So why isn't the change?  Note the usage of fm in fm.getFocus() since you have it locally you might as well use it.

        var fm:IFocusManager = focusManager;
        
        // When we gain focus, make sure the focused element is visible
        if (fm && viewport && ensureElementIsVisibleForSoftKeyboard)
        {
            var elt:IVisualElement = fm.getFocus() as IVisualElement; 
            lastFocusedElement = elt;
        }

                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Roland Zwaga (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479240#comment-13479240 ] 

Roland Zwaga commented on FLEX-33156:
-------------------------------------

I'm not sure if I understand your question...
The difference with the previous situation is that I first retrieve a reference to 'focusManager' and then check if its null, that check wasn't present in the previous version of the code, and sometimes caused an RTE...
                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Roland Zwaga (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Zwaga updated FLEX-33156:
--------------------------------

    Description: 
the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.

So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.

Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.

I have attached a patch file which adds the null check.

  was:
the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.

So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.

Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.

    
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Carol Frampton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479251#comment-13479251 ] 

Carol Frampton commented on FLEX-33156:
---------------------------------------

I believe your change was so you have an extra check in there.  Also I was suggesting you use fm for both the "if (fm)" and latter for "fm.getFocus()".

        var fm:IFocusManager = focusManager;
        if (fm)
	{
		if (isOurFocus(DisplayObject(event.target)))
		{
		        // When we gain focus, make sure the focused element is visible
		        if (viewport && ensureElementIsVisibleForSoftKeyboard)
		        {
		                var elt:IVisualElement = focusManager.getFocus() as IVisualElement; 
		                lastFocusedElement = elt;
		        }
		}
	}

                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Carol Frampton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carol Frampton resolved FLEX-33156.
-----------------------------------

    Resolution: Fixed

Author: cframpton
Date: Tue Dec  4 15:30:50 2012
New Revision: 1416993

URL: http://svn.apache.org/viewvc?rev=1416993&view=rev
Log:
Fix RTE in focusInHandler when focusManager is null.

Modified:
    incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Scroller.as

                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>            Assignee: Carol Frampton
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Roland Zwaga (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Zwaga updated FLEX-33156:
--------------------------------

    Attachment: Scroller.as.patch

new patch containing changes suggested by Carol
                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Alex Harui (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Harui reassigned FLEX-33156:
---------------------------------

    Assignee: Carol Frampton
    
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>            Assignee: Carol Frampton
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "James Hill (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13428032#comment-13428032 ] 

James Hill commented on FLEX-33156:
-----------------------------------

I've experienced this a number of times, definitely would love it fixed!
                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Roland Zwaga (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479258#comment-13479258 ] 

Roland Zwaga commented on FLEX-33156:
-------------------------------------

aha, now I see ;) and yes, you are right, I'll make the change and submit a new patch, sorry 'bout that ;)
                
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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] [Updated] (FLEX-33156) focusInHandler() in spark Scroller doesn't null check focusManager property before using

Posted by "Roland Zwaga (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FLEX-33156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roland Zwaga updated FLEX-33156:
--------------------------------

    Attachment:     (was: Scroller.as.patch)
    
> focusInHandler() in spark Scroller doesn't null check focusManager property before using
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-33156
>                 URL: https://issues.apache.org/jira/browse/FLEX-33156
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Spark: Scroller
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>            Reporter: Roland Zwaga
>             Fix For: Adobe Flex SDK Next
>
>         Attachments: Scroller.as.patch
>
>
> the focusHandler() method wrongfully assumes that the focusManager is always a valid instance. When checking the focusManager property in UIComponent it is clear that in certain cases this property can return a null value.
> So in some cases this can lead to an RTE. I have encountered this once in my current project but find it very hard to reproduce. Basically a Scroller instance that was displayed in a popup window gave this RTE after the popup was removed.
> Reproducable or not, I believe the null check should be added seeing the fact that the focusManager property explicitly returns null in some cases.
> I have attached a patch file which adds the null check.

--
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