You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Josh Tynjala (JIRA)" <ji...@apache.org> on 2017/06/07 15:02:18 UTC

[jira] [Updated] (FLEX-35324) NullPointerException when setting property of class that doesn't exist in fx namespace

     [ https://issues.apache.org/jira/browse/FLEX-35324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Tynjala updated FLEX-35324:
--------------------------------
    Description: 
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}

Can reproduce with both FlexJS 0.7.0 and the latest 0.8.0 release branch nightly.

  was:
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}


> 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}
> Can reproduce with both FlexJS 0.7.0 and the latest 0.8.0 release branch nightly.



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