flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Mazuruk (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLEX-33987) FocusManager NPE
Date Tue, 10 Dec 2013 17:34:09 GMT

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

Alexander Mazuruk commented on FLEX-33987:
------------------------------------------

Actually this is a spaghetti code? Don't you see it?
Unfortunately I have no definite test case for it, just had to impose my monkey patches as
issues to you guys, to make sdk code a better quality.
Just open the code and read it:

	private function getNextFocusManagerComponent2(
                            backward:Boolean = false, 
                            fromObject:DisplayObject = null,
                            fromIndex:int = FROM_INDEX_UNSPECIFIED):FocusInfo
                            
    {
        if (focusableObjects.length == 0)
            return null;

This is your test case, here it is "return null;"


> FocusManager NPE
> ----------------
>
>                 Key: FLEX-33987
>                 URL: https://issues.apache.org/jira/browse/FLEX-33987
>             Project: Apache Flex
>          Issue Type: Bug
>    Affects Versions: Apache Flex 4.11.0
>            Reporter: Alexander Mazuruk
>            Priority: Critical
>
> FocusManager Null pointer exception occurs.
> This:
>     public function getNextFocusManagerComponent(
>                             backward:Boolean = false):IFocusManagerComponent
> 	{
> 		return getNextFocusManagerComponent2(backward, fauxFocus).displayObject as IFocusManagerComponent;
> 	}
> Must be rewritten as:
> public function getNextFocusManagerComponent(
>                             backward:Boolean = false):IFocusManagerComponent
> 	{
>         const focusInfo:FocusInfo = getNextFocusManagerComponent2(backward, fauxFocus);
>         return focusInfo ? focusInfo.displayObject as IFocusManagerComponent : null;
> 	}



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message