Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-35081

Null Pointer Exception in attempt of overriding data property in item renderer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Apache FlexJS 0.7.0
    • Apache FalconJX 0.7.0
    • FalconJX, FlexJS
    • None
    • Windows 7
      Firefox

    Description

      Example TodoListSampleApp - FlexJS repository.
      I have created org.apache.flex.html.supportClasses.DataItemRender in mxml. In attempt of compiling following code I got NPE.

      Compiled Code
      <basic:DataItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
                              xmlns:basic="library://ns.apache.org/flexjs/basic">
          <basic:beads>
              <basic:HorizontalLayout />
          </basic:beads>
          <basic:CheckBox text="{data.selected}"/>
          <basic:Label text="{data.text}"/>
          <basic:TextButton width="50" text="Remove"/>
          <fx:Script>
              <![CDATA[
              override public function set data(value:Object):void {
                  super.data = value;
              }
              ]]>
      	</fx:Script>
      </basic:DataItemRenderer>
      
      Null Pointer Exception
      Error:[TodoListSampleApp - TodoListSampleApp]: : java.lang.NullPointerException  	at org.apache.flex.compiler.internal.codegen.js.jx.BinaryOperatorEmitter.emit(BinaryOperatorEmitter.java:118)  	at org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter.emitBinaryOperator(JSFlexJSEmitter.java:675)  	at org.apache.flex.compiler.internal.codegen.as.ASBlockWalker.visitBinaryOperator(ASBlockWalker.java:525)  	at org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:349)  	at org.apache.flex.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)  	at org.apache.flex.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)  	at org.apache.flex.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:157)  	at org.apache.flex.compiler.internal.codegen.js.jx.StatementEmitter.emit(StatementEmitter.java:22)  	at org.apache.flex.compiler.internal.codegen.js.JSEmitter.emitStatement(JSEmitter.java:281)  	at org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter.emitStatement(JSFlexJSEmitter.java:762)  	at org.apache.flex.compiler.internal.codegen.as.ASBlockWalker.visitBlock(ASBlockWalker.java:335)  	at org.apache.flex.compiler.internal.visitor.as.ASNodeSwitch.handle(ASNodeSwitch.java:279)  	at org.apache.flex.compiler.internal.visitor.as.ASNodeHandler.handle(ASNodeHandler.java:85)  	at org.apache.flex.compiler.internal.visitor.as.BeforeAfterStrategy.handle(BeforeAfterStrategy.java:110)  	at org.apache.flex.compiler.internal.codegen.as.ASBlockWalker.walk(ASBlockWalker.java:157)  	at org.apache.flex.compiler.internal.codegen.as.ASEmitter.emitMethodScope(ASEmitter.java:843)  	at org.apache.flex.compiler.internal.codegen.js.jx.DefinePropertyFunctionEmitter.emit(DefinePropertyFunctionEmitter.java:117)  	at org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter.emitDefinePropertyFunction(JSFlexJSEmitter.java:714)  	at org.apache.flex.compiler.internal.codegen.js.jx.AccessorEmitter.emit(AccessorEmitter.java:212)  	at org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter.emitDocument(MXMLFlexJSEmitter.java:341)  	at org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker.visitDocument(MXMLFlexJSBlockWalker.java:69)  	at org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch.handle(MXMLNodeSwitch.java:84)  	at org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.walk(MXMLBlockWalker.java:149)  	at org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker.visitFile(MXMLFlexJSBlockWalker.java:61)  	at org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch.handle(MXMLNodeSwitch.java:90)  	at org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.walk(MXMLBlockWalker.java:149)  	at org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.visitCompilationUnit(MXMLBlockWalker.java:168)  	at org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter.writeTo(MXMLWriter.java:67)  	at org.apache.flex.compiler.clients.MXMLJSC.compile(MXMLJSC.java:480)  	at org.apache.flex.compiler.clients.MXMLJSC._mainNoExit(MXMLJSC.java:352)  	at org.apache.flex.compiler.clients.MXMLJSC.mainNoExit(MXMLJSC.java:277)  	at flex2.tools.MxmlJSC.execute(MxmlJSC.java:93)  	at flex2.tools.Tool.compile(Tool.java:81)  	at flex2.tools.Mxmlc.mxmlc(Mxmlc.java:75)  	at com.intellij.flex.compiler.flex4.Flex4Handler.compileSwf(Flex4Handler.java:81)  	at com.intellij.flex.compiler.CompilationThread.run(CompilationThread.java:48)
      

      Attachments

        Activity

          People

            aharui Alex Harui
            pete21 Piotr Zarzycki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: