[
https://issues.apache.org/jira/browse/FLEX-35100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15337815#comment-15337815
]
Mihai Chira edited comment on FLEX-35100 at 6/18/16 2:26 PM:
-------------------------------------------------------------
The only other instance of this error I could find (though the stack traces are
not identical, the null object reference error happens in the same function)
was in [a comment on
FLEX-33409|https://issues.apache.org/jira/browse/FLEX-33409?focusedCommentId=13745886&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13745886],
where the line in question was '{{textLine.x = this.x}}', implying that
{{textLine}} is {{null}}. This means that {{TextBlock.createTextLine()}} or
{{TextBlock.recreateTextLine()}} returned {{null}}.
This was the same as I had inferred (we didn't have the line numbers in the
stack trace). Here's my debugging investigation on this stack trace:
* what can be null in {{TextFlowLine.recreateTextLine()}}: {{_para}},
{{textFlow}}, {{textFlow.computedFormat}}, {{flowComposer}}, {{swfContext}},
{{textBlock}}, *{{textLine}}*, {{elem}}, {{_para.getAncestorWithContainer()}}.
However:
** there are no adornments possible (bold, strikethrough, etc.) in the text
field in question, so we can exclude {{elem}} and
{{_para.getAncestorWithContainer()}}.
** we know from {{BaseCompose.composeBlockElement()}} that {{para}}, which
becomes {{BaseCompose._curParaElement}}, which then reaches
{{TextFlowLine._para}} through {{TextFlowLine.initialize()}}, cannot be null
(due to the null-checking {{if}} statement surrounding the function call). So
we can exclude {{_para}}.
** We can also exclude {{textFlow}} because {{FlowElement.getTextFlow()}}
cannot return {{null}}.
** Same for {{textFlow.computedFormat}}, because {{FlowElement.computedFormat}}
cannot return {{null}}
** We'll also exclude {{flowComposer}} because every time it's set through the
{{TextFlow.flowComposer}} setter it's set to a non-null value.
** {{swfContext}} also cannot be {{null}} by virtue of how it's instantiated.
** {{textBlock}} is also not {{null}} because in the calling function
({{TextFlowLine.getTextLineInternal()}}) it already had one of its members
called.
** So it must be that {{textLine}} is {{null}}. Which means that one of
{{TextBlock.createTextLine()}} or {{TextBlock.recreateTextLine()}} returns
{{null}} for the arguments given it.
* {{forceValid == true}} in {{TextFlowLine.getTextLine()}}
* {{StandardFlowComposer._composing == false}} in
{{StandardFlowComposer.updateToController}}
* {{StandardFlowComposer.internalCompose()}} called with {{(-1, int.MAX_VALUE}}
* in {{TextFlowLine.getTextLine()}}, {{TextFlowLine.validity ==
FlowDamageType.GEOMETRY || TextFlowLine.validity == TextLineValidity.VALID}}
* The text the user had in the text field in the bug screenshot is "The
Creative Design and development of 3 x web pages, 3 x emailers, 3 x 2 page
product literature".
* The (description) text field was still focused when the screenshot was taken.
* {{StandardFlowComposer.updateAllControllers()}} is called with every new
character introduced in the text field.
* {{TextBlock.createTextLine()}} and {{TextBlock.recreateTextLine()}} return
{{null}} when: {{width}} is insufficient for at least one character (unless the
{{fitSomething}} parameter is {{true}}); when there's no more text to create
lines for (as indicated by the {{previousLine}} parameter); the TextBlock's
content's {{text}} is {{null}} or {{""}}. (For details see
TextBlock_FLEX_35100_Test.as)
** Note that when the {{textLine}} and {{previousLine}} parameters are equal,
this function throws an {{ArgumentError}}.
** Given that {{fitSomething}} parameter is {{true}} for the calls in question,
we can exclude the insufficient {{width}} scenario.
** Also, if the TextBlock were the wrong one, we'd get an ArgumentError.
was (Author: evolverine):
The only other instance of this error I could find (though the stack traces are
not identical, the null object reference error happens in the same function)
was in [a comment on
FLEX-33409|https://issues.apache.org/jira/browse/FLEX-33409?focusedCommentId=13745886&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13745886],
where the line in question was '{{textLine.x = this.x}}', implying that
{{textLine}} is {{null}}. This means that {{TextBlock.createTextLine()}} or
{{TextBlock.recreateTextLine()}} returned {{null}}.
This was the same as I had inferred (we didn't have the line numbers in the
stack trace). Here's my debugging investigation on this stack trace:
* what can be null in {{TextFlowLine.recreateTextLine()}}: {{_para}},
{{textFlow}}, {{textFlow.computedFormat}}, {{flowComposer}}, {{swfContext}},
{{textBlock}}, *{{textLine}}*, {{elem}}, {{_para.getAncestorWithContainer()}}.
However:
** there are no adornments possible (bold, strikethrough, etc.) in the text
field in question, so we can exclude {{elem}} and
{{_para.getAncestorWithContainer()}}.
** we know from {{BaseCompose.composeBlockElement()}} that {{para}}, which
becomes {{BaseCompose._curParaElement}}, which then reaches
{{TextFlowLine._para}} through {{TextFlowLine.initialize()}}, cannot be null
(due to the null-checking {{if}} statement surrounding the function call). So
we can exclude {{_para}}.
** We can also exclude {{textFlow}} because {{FlowElement.getTextFlow()}}
cannot return {{null}}.
** Same for {{textFlow.computedFormat}}, because {{FlowElement.computedFormat}}
cannot return {{null}}
** We'll also exclude {{flowComposer}} because every time it's set through the
{{TextFlow.flowComposer}} setter it's set to a non-null value.
** {{swfContext}} also cannot be {{null}} by virtue of how it's instantiated.
** {{textBlock}} is also not {{null}} because in the calling function
({{TextFlowLine.getTextLineInternal()}}) it already had one of its members
called.
** So it must be that {{textLine}} is {{null}}. Which means that one of
{{TextBlock.createTextLine()}} or {{TextBlock.recreateTextLine()}} returns
{{null}} for the arguments given it.
* {{forceValid == true}} in {{TextFlowLine.getTextLine()}}
* {{StandardFlowComposer._composing == false}} in
{{StandardFlowComposer.updateToController}}
* {{StandardFlowComposer.internalCompose()}} called with {{(-1, int.MAX_VALUE}}
* in {{TextFlowLine.getTextLine()}}, {{TextFlowLine.validity ==
FlowDamageType.GEOMETRY || TextFlowLine.validity == TextLineValidity.VALID}}
* The text the user had in the text field in the bug screenshot is "The
Creative Design and development of 3 x web pages, 3 x emailers, 3 x 2 page
product literature".
* The (description) text field was still focused when the screenshot was taken.
* {{StandardFlowComposer.updateAllControllers()}} is called with every new
character introduced in the text field.
* {{TextBlock.createTextLine()}} and {{TextBlock.recreateTextLine()}} return
{{null}} when: {{width}} is insufficient for at least one character (unless the
{{fitSomething}} parameter is {{true}}); when there's no more text to create
lines for (as indicated by the {{previousLine}} parameter); the TextBlock's
content's {{text}} is {{null}} or {{""}}.
** Note that when the {{textLine}} and {{previousLine}} parameters are equal,
this function throws an {{ArgumentError}}.
** Given that {{fitSomething}} parameter is {{true}} for the calls in question,
we can exclude the insufficient {{width}} scenario.
** Also, if the TextBlock were the wrong one, we'd get an ArgumentError.
> TextFlowLine.recreateTextLine() throws a null object reference error
> --------------------------------------------------------------------
>
> Key: FLEX-35100
> URL: https://issues.apache.org/jira/browse/FLEX-35100
> Project: Apache Flex
> Issue Type: Bug
> Components: TLF
> Affects Versions: Apache Flex 4.14.1
> Reporter: Mihai Chira
> Assignee: Mihai Chira
> Priority: Minor
>
> A user of our application (at the time running on Flex SDK 4.14.1) has
> reported encountering this fatal error:
> {noformat}
> TypeError: Error #1009
> at
> flashx.textLayout.compose::TextFlowLine/http://ns.adobe.com/textLayout/internal/2008::recreateTextLine()
> at flashx.textLayout.compose::TextFlowLine/getTextLineInternal()
> at flashx.textLayout.compose::TextFlowLine/getTextLine()
> at flashx.textLayout.compose::ComposeState/composeNextLine()
> at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()
> at flashx.textLayout.compose::BaseCompose/composeParagraphElement()
> at flashx.textLayout.compose::ComposeState/composeParagraphElement()
> at flashx.textLayout.compose::BaseCompose/composeBlockElement()
> at flashx.textLayout.compose::BaseCompose/composeInternal()
> at flashx.textLayout.compose::ComposeState/composeInternal()
> at flashx.textLayout.compose::BaseCompose/composeTextFlow()
> at flashx.textLayout.compose::ComposeState/composeTextFlow()
> at
> flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()
> at flashx.textLayout.compose::StandardFlowComposer/internalCompose()
> at flashx.textLayout.compose::StandardFlowComposer/updateToController()
> at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()
> at flashx.textLayout.container::TextContainerManager/updateContainer()
> at spark.components::RichEditableText/updateDisplayList()
> at mx.core::UIComponent/validateDisplayList()
> at mx.managers::LayoutManager/validateDisplayList()
> at mx.managers::LayoutManager/doPhasedInstantiation()
> at mx.managers::LayoutManager/doPhasedInstantiationCallback()
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)