royale-asjs icon indicating copy to clipboard operation
royale-asjs copied to clipboard

multi line commnets under <fx:style> throws error

Open sanjeev-rajput opened this issue 3 years ago • 4 comments

compiler throws "java.lang.NullPointerException" error this is because of comments under fx:style

<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
				xmlns:js="library://ns.apache.org/royale/basic"
				xmlns:j="library://ns.apache.org/royale/jewel">
				<fx:Style>
					/*.TitleBar{
						border:solid 1px grey;
					}*/
					/*.DataContainer{
						border:solid 1px grey;
					}*/
					
				</fx:Style>

sanjeev-rajput avatar Jan 05 '23 06:01 sanjeev-rajput

I tried replacing HelloWorld.mxml with

<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:js="library://ns.apache.org/royale/basic" >
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl />
    </js:valuesImpl>
    <js:initialView>
        <js:View>
        	<js:Label text="Hello World!" />
        </js:View>
    </js:initialView>
				<fx:Style>
					/*.TitleBar{
						border:solid 1px grey;
					}*/
					/*.DataContainer{
						border:solid 1px grey;
					}*/
					
				</fx:Style>

</js:Application>

And it is compiling correctly for me. Can you please do the same and report?

yishayw avatar Jan 09 '23 13:01 yishayw

I can still see the error. something is wrong while reading the comments inside script tag. Few or the use case are

  1. I am with "<j:Application>" not "js:"
  2. it happens only with Main.mxml which uses "<j:>" tag
  3. it doesn't happens while using such comments inside other mxml component/ file

attaching my screenshot

issue

sanjeev-rajput avatar Jan 11 '23 06:01 sanjeev-rajput

Yes, I was able to reproduce it too. This is the stack trace

    [mxmlc] C:\dev\full_royale_sdk\royale-asjs\examples\royale\HelloWorld\src\main\royale\HelloWorld.mxml Error: Internal error in ABC generator subsystem, when generating code for: C:\dev\full_royale_sdk\royale-asjs\examples\royale\HelloWorld\src\main\royale\HelloWorld.mxml: java.lang.NullPointerException
    [mxmlc]     at org.antlr.runtime.tree.BaseTreeAdaptor.isNil(BaseTreeAdaptor.java:73)
    [mxmlc]     at org.antlr.runtime.tree.CommonTreeNodeStream.nextElement(CommonTreeNodeStream.java:104)
    [mxmlc]     at org.antlr.runtime.misc.LookaheadStream.fill(LookaheadStream.java:113)
    [mxmlc]     at org.antlr.runtime.misc.LookaheadStream.syncAhead(LookaheadStream.java:107)
    [mxmlc]     at org.antlr.runtime.misc.LookaheadStream.LT(LookaheadStream.java:129)
    [mxmlc]     at org.apache.royale.compiler.internal.css.CSSTree.stylesheet(CSSTree.java:204)
    [mxmlc]     at org.apache.royale.compiler.internal.css.CSSDocument.parse(CSSDocument.java:81)
    [mxmlc]     at org.apache.royale.compiler.internal.tree.mxml.MXMLStyleNode.getCSSDocument(MXMLStyleNode.java:94)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processMXMLStyle(MXMLClassDirectiveProcessor.java:4332)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processNode(MXMLClassDirectiveProcessor.java:990)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.traverse(MXMLClassDirectiveProcessor.java:864)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.traverse(MXMLClassDirectiveProcessor.java:834)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.MXMLClassDirectiveProcessor.processMainClassDefinitionNode(MXMLClassDirectiveProcessor.java:656)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.GlobalDirectiveProcessor.declareMXMLDocument(GlobalDirectiveProcessor.java:551)
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.processNode(DirectiveProcessor.java:236) 
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.DirectiveProcessor.traverse(DirectiveProcessor.java:192)    
    [mxmlc]     at org.apache.royale.compiler.internal.as.codegen.ABCGenerator.generate(ABCGenerator.java:126)
    [mxmlc]     at org.apache.royale.compiler.internal.units.MXMLCompilationUnit.handleABCBytesRequest(MXMLCompilationUnit.java:202)
    [mxmlc]     at org.apache.royale.compiler.internal.units.CompilationUnitBase.processABCBytesRequest(CompilationUnitBase.java:876)
    [mxmlc]     at org.apache.royale.compiler.internal.units.CompilationUnitBase.access$300(CompilationUnitBase.java:109)2.078204 seconds
    [mxmlc]
    [mxmlc]     at org.apache.royale.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:313)       
    [mxmlc]     at org.apache.royale.compiler.internal.units.CompilationUnitBase$4$1.call(CompilationUnitBase.java:309)       
    [mxmlc]     at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:228)
    [mxmlc]     at org.apache.royale.compiler.internal.units.requests.RequestMaker$1.call(RequestMaker.java:222)
    [mxmlc]     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    [mxmlc]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    [mxmlc]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    [mxmlc]     at java.lang.Thread.run(Thread.java:748)
    [mxmlc]
    [mxmlc]
    [mxmlc]
    [mxmlc] Error: Unexpected exception 'java.lang.NullPointerException' at org.antlr.runtime.tree.BaseTreeAdaptor.isNil:73   
    [mxmlc]

yishayw avatar Jan 11 '23 13:01 yishayw

I think this guy had a similar issue, but I am not sure how to implement his solution in our case.

yishayw avatar Jan 19 '23 09:01 yishayw

Closed in apache/royale-compiler@79276bf122b05d1553eaa0616fdb6936da39d272

joshtynjala avatar Jul 11 '24 15:07 joshtynjala