For nowhere land

I guess nobody is still using flex, but I still have to debug legacy code and I run into this nice compiler error:

    [mxmlc] Error: null
    [mxmlc] 
    [mxmlc] java.lang.NullPointerException
    [mxmlc] 	at flex2.compiler.util.QName.hashCode(QName.java:131)
    [mxmlc] 	at java.util.HashMap.hash(HashMap.java:366)
    [mxmlc] 	at java.util.HashMap.getEntry(HashMap.java:466)
    [mxmlc] 	at java.util.HashMap.get(HashMap.java:421)
    [mxmlc] 	at flex2.compiler.util.QNameMap.get(QNameMap.java:46)
    [mxmlc] 	at flex2.compiler.as3.reflect.Class.getVariable(Class.java:194)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.findEvents(DataBindingFirstPassEvaluator.java:702)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.findEvents(DataBindingFirstPassEvaluator.java:662)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.watchExpression(DataBindingFirstPassEvaluator.java:959)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:635)
    [mxmlc] 	at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:85)
    [mxmlc] 	at macromedia.asc.parser.QualifiedExpressionNode.evaluate(QualifiedExpressionNode.java:43)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:436)
    [mxmlc] 	at macromedia.asc.parser.GetExpressionNode.evaluate(GetExpressionNode.java:55)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:613)
    [mxmlc] 	at macromedia.asc.parser.MemberExpressionNode.evaluate(MemberExpressionNode.java:57)
    [mxmlc] 	at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:316)
    [mxmlc] 	at macromedia.asc.parser.ListNode.evaluate(ListNode.java:44)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:224)
    [mxmlc] 	at macromedia.asc.parser.ArgumentListNode.evaluate(ArgumentListNode.java:45)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:651)
    [mxmlc] 	at macromedia.asc.parser.SetExpressionNode.evaluate(SetExpressionNode.java:58)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:613)
    [mxmlc] 	at macromedia.asc.parser.MemberExpressionNode.evaluate(MemberExpressionNode.java:57)
    [mxmlc] 	at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:316)
    [mxmlc] 	at macromedia.asc.parser.ListNode.evaluate(ListNode.java:44)
    [mxmlc] 	at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:359)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:405)
    [mxmlc] 	at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:104)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingFirstPassEvaluator.evaluate(DataBindingFirstPassEvaluator.java:325)
    [mxmlc] 	at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106)
    [mxmlc] 	at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
    [mxmlc] 	at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
    [mxmlc] 	at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:923)
    [mxmlc] 	at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)
    [mxmlc] 	at flex2.compiler.as3.binding.DataBindingExtension.generate(DataBindingExtension.java:87)
    [mxmlc] 	at flex2.compiler.as3.Compiler.generate(Compiler.java:696)
    [mxmlc] 	at flex2.compiler.mxml.ImplementationCompiler.generate(ImplementationCompiler.java:308)
    [mxmlc] 	at flex2.compiler.mxml.Compiler.generate(Compiler.java:159)
    [mxmlc] 	at flex2.compiler.API.generate(API.java:3514)
    [mxmlc] 	at flex2.compiler.API.generate(API.java:3477)
    [mxmlc] 	at flex2.compiler.API.batch2(API.java:416)
    [mxmlc] 	at flex2.compiler.API.batch(API.java:1117)
    [mxmlc] 	at flex2.compiler.API.compile(API.java:1290)
    [mxmlc] 	at flex2.compiler.API.compile(API.java:1210)
    [mxmlc] 	at flex2.tools.Compiler.mxmlc(Compiler.java:275)
    [mxmlc] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [mxmlc] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at flex.ant.FlexTask.executeInProcess(FlexTask.java:283)
    [mxmlc] 	at flex.ant.FlexTask.execute(FlexTask.java:225)
    [mxmlc] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    [mxmlc] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.Task.perform(Task.java:348)
    [mxmlc] 	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    [mxmlc] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [mxmlc] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [mxmlc] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
    [mxmlc] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    [mxmlc] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.Task.perform(Task.java:348)
    [mxmlc] 	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    [mxmlc] 	at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
    [mxmlc] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [mxmlc] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
    [mxmlc] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    [mxmlc] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.Task.perform(Task.java:348)
    [mxmlc] 	at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
    [mxmlc] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    [mxmlc] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.Task.perform(Task.java:348)
    [mxmlc] 	at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
    [mxmlc] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
    [mxmlc] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    [mxmlc] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [mxmlc] 	at java.lang.reflect.Method.invoke(Method.java:606)
    [mxmlc] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    [mxmlc] 	at org.apache.tools.ant.Task.perform(Task.java:348)
    [mxmlc] 	at org.apache.tools.ant.Target.execute(Target.java:435)
    [mxmlc] 	at org.apache.tools.ant.Target.performTasks(Target.java:456)
    [mxmlc] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
    [mxmlc] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
    [mxmlc] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    [mxmlc] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
    [mxmlc] 	at org.apache.tools.ant.Main.runBuild(Main.java:851)
    [mxmlc] 	at org.apache.tools.ant.Main.startAnt(Main.java:235)
    [mxmlc] 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    [mxmlc] 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by this small modification in code:

<mx:TextInput id="motpPin"
text="{editedItem.@motpPin}"
change="{setValue(editedItem, '@motpPin' + selectedAuthNo, motpPin)}"/>
<mx:TextInput id="motpPin"
text="{editedItem.@['motpPin' + selectedAuthNo]}"
change="{setValue(editedItem, '@motpPin' + selectedAuthNo, motpPin)}"/>

Leave a Reply

*