flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Tynjala (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLEX-35324) NullPointerException when setting property of class that doesn't exist in fx namespace
Date Wed, 07 Jun 2017 15:01:18 GMT
Josh Tynjala created FLEX-35324:
-----------------------------------

             Summary: NullPointerException when setting property of class that doesn't exist
in fx namespace
                 Key: FLEX-35324
                 URL: https://issues.apache.org/jira/browse/FLEX-35324
             Project: Apache Flex
          Issue Type: Bug
          Components: Falcon
    Affects Versions: Apache FalconJX 0.7.0
            Reporter: Josh Tynjala


Using the following code:

{code:title=src/NullExceptionFX.mxml}
<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
	xmlns:js="library://ns.apache.org/flexjs/basic">
	<fx:Declarations>
		<fx:Fake test="test"/>
	</fx:Declarations>
	<js:initialView>
		<js:View>
			<js:Label id="label" text="Hello World" x="100" y="100"/>
		</js:View>
	</js:initialView>
	<js:valuesImpl>
		<js:SimpleCSSValuesImpl />
	</js:valuesImpl>
</js:Application>
{code}
Compile with js/bin/mxmlc:

{code}
mxmlc src/NullExceptionFX.mxml
{code}

The following error will be included in the output:

{code}
Unexpected exception 'java.lang.NullPointerException'.
{code}

There is no stack trace with this exception.

If you change the namespace from fx to js, you get a proper compiler error instead of an exception.

{code}
<js:Fake test="test"/>
{code}

{code}
NullExceptionFX.mxml(5): col: 3 This tag is unexpected. It will be ignored.

                <js:Fake test="test"/>
{code}

With that in mind, I guess it must be treating the fx namespace as special and it's taking
a different path.

If you leave out the property, you also get a NullPointerException:

{code}
<fx:Fake/>
{code}

And this one includes a stack trace:

{code}
java.lang.NullPointerException org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter.emitInstance(MXMLFlexJSEmitter.java:1751)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.visitInstance(MXMLBlockWalker.java:246)org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch.handle(MXMLNodeSwitch.java:96)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.walk(MXMLBlockWalker.java:149)org.apache.flex.compiler.internal.codegen.mxml.MXMLEmitter.emitDeclarations(MXMLEmitter.java:105)org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter.emitDeclarations(MXMLFlexJSEmitter.java:507)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.visitDeclarations(MXMLBlockWalker.java:198)org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch.handle(MXMLNodeSwitch.java:78)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.walk(MXMLBlockWalker.java:149)org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSEmitter.emitDocument(MXMLFlexJSEmitter.java:546)org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker.visitDocument(MXMLFlexJSBlockWalker.java:69)org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch.handle(MXMLNodeSwitch.java:84)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.walk(MXMLBlockWalker.java:149)org.apache.flex.compiler.internal.codegen.mxml.flexjs.MXMLFlexJSBlockWalker.visitFile(MXMLFlexJSBlockWalker.java:61)org.apache.flex.compiler.internal.visitor.mxml.MXMLNodeSwitch.handle(MXMLNodeSwitch.java:90)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.walk(MXMLBlockWalker.java:149)org.apache.flex.compiler.internal.codegen.mxml.MXMLBlockWalker.visitCompilationUnit(MXMLBlockWalker.java:168)org.apache.flex.compiler.internal.codegen.mxml.MXMLWriter.writeTo(MXMLWriter.java:72)org.apache.flex.compiler.clients.MXMLJSCFlex.compile(MXMLJSCFlex.java:377)org.apache.flex.compiler.clients.MXMLJSCFlex._mainNoExit(MXMLJSCFlex.java:245)org.apache.flex.compiler.clients.MXMLJSCFlex.mainNoExit(MXMLJSCFlex.java:202)org.apache.flex.compiler.clients.MXMLJSC._mainNoExit(MXMLJSC.java:352)org.apache.flex.compiler.clients.MXMLJSC.mainNoExit(MXMLJSC.java:287)org.apache.flex.compiler.clients.MXMLJSC.staticMainNoExit(MXMLJSC.java:247)org.apache.flex.compiler.clients.MXMLJSC.main(MXMLJSC.java:229)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message