@return {boolean}
*/
test = function(firstSpan, lastSpan, styleType) {
if (firstSpan == null || lastSpan == null)
return false;
if (firstSpan == lastSpan)
return false;
var /* @type {org.apache.flex.textLayout.elements.SpanElement} / curSpan = firstSpan.getNextLeaf();
while (curSpan) {
if (firstSpan.getStyle(styleType) != curSpan.getStyle(styleType))
return true;
if (curSpan == lastSpan)
break;
curSpan = curSpan.getNextLeaf();
}
return false;
};
results in "non-monotonic data-flow analysis" error. In stepping through it in the debugger, the flow() call in DataFlowAnalysis.java:analyze() keeps thinking that the last line in the while loop is affecting the top of the while loop so it adds the while line to the orderedWorkSet and you keep looping until you hit the MaxIterationsExceededException
I've gotten around it by specifying the type of curSpan to be ISpanElement instead. But is there something wrong with our code that the DataFlow can't get out of the loop?
The following code:
/**
results in "non-monotonic data-flow analysis" error. In stepping through it in the debugger, the flow() call in DataFlowAnalysis.java:analyze() keeps thinking that the last line in the while loop is affecting the top of the while loop so it adds the while line to the orderedWorkSet and you keep looping until you hit the MaxIterationsExceededException
I've gotten around it by specifying the type of curSpan to be ISpanElement instead. But is there something wrong with our code that the DataFlow can't get out of the loop?
TLFElements.zip