cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 160 forks source link

Using Jsweet to convert an Applet to Java Script. A null pointer exception was thrown during the conversion #564

Closed xeccgtt closed 3 years ago

xeccgtt commented 4 years ago

We are try to convert an applet to Java Script. A null pointer exception was thrown during the conversion. I obscured our source code file name.

2020-02-24 16:06:09.009 ERROR output:55 - internal transpiler error at Obscured_File_Name.java(315) dumping transpiler's strack trace: [JCMethodDecl] public String getParameter(fin... (Obscured_File_Name.java(315,5)) [JCClassDecl] public class Map extends Exten... (Obscured_File_Name.java(41,1)) ... (Obscured_File_Name.java(22,1)) java.lang.NullPointerException at org.jsweet.transpiler.Java2TypeScriptTranslator.visitMethod(Java2TypeScriptTranslator.java:2175) at org.jsweet.transpiler.Java2TypeScriptTranslator.visitMethod(Java2TypeScriptTranslator.java:2239) at org.jsweet.transpiler.Java2TypeScriptTranslator.visitMethod(Java2TypeScriptTranslator.java:146) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:898) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) at org.jsweet.transpiler.util.AbstractTreeScanner.scan(AbstractTreeScanner.java:269) at org.jsweet.transpiler.util.AbstractTreePrinter.print(AbstractTreePrinter.java:121) at org.jsweet.transpiler.Java2TypeScriptTranslator.visitClass(Java2TypeScriptTranslator.java:1746) at org.jsweet.transpiler.Java2TypeScriptTranslator.visitClass(Java2TypeScriptTranslator.java:146) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:808) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) at org.jsweet.transpiler.util.AbstractTreeScanner.scan(AbstractTreeScanner.java:269) at org.jsweet.transpiler.util.AbstractTreePrinter.print(AbstractTreePrinter.java:121) at org.jsweet.transpiler.Java2TypeScriptTranslator.visitCompilationUnit(Java2TypeScriptTranslator.java:858) at org.jsweet.transpiler.Java2TypeScriptTranslator.visitCompilationUnit(Java2TypeScriptTranslator.java:146) at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:591) at jdk.compiler/com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:82) at org.jsweet.transpiler.util.AbstractTreeScanner.scan(AbstractTreeScanner.java:269) at org.jsweet.transpiler.util.AbstractTreePrinter.print(AbstractTreePrinter.java:121) at org.jsweet.transpiler.JSweetTranspiler.generateTsFiles(JSweetTranspiler.java:880) at org.jsweet.transpiler.JSweetTranspiler.java2ts(JSweetTranspiler.java:843) at org.jsweet.transpiler.JSweetTranspiler.transpile(JSweetTranspiler.java:771) at org.jsweet.AbstractJSweetMojo.transpile(AbstractJSweetMojo.java:606) at org.jsweet.JSweetMojo.execute(JSweetMojo.java:43) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:192) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 2020-02-24 16:06:10.010 INFO JSweetTranspiler:903 - output file: Obscured_File_Name.ts 2020-02-24 16:06:10.010 INFO JSweetTranspiler:928 - created Obscured_File_Name.ts

lgrignon commented 4 years ago

Hello,

Thanks for reporting.

Which version of JSweet are you using? Could you please provide a small repro project please (repo or zip)?

lgrignon commented 4 years ago

@xeccgtt any news on this?

xeccgtt commented 4 years ago

I have not proceeded any further with jsweet because of the null pointer exception. I tried jsweet about a month ago and I believe we were using the latest version at thattime.

Sincerely

Albert Stark

From: Louis Grignon notifications@github.com Sent: Monday, April 27, 2020 1:21 PM To: cincheo/jsweet jsweet@noreply.github.com Cc: Stark, Albert J albert.stark@bnymellon.com; Mention mention@noreply.github.com Subject: Re: [cincheo/jsweet] Using Jsweet to convert an Applet to Java Script. A null pointer exception was thrown during the conversion (#564)

@xeccgtthttps://clicktime.symantec.com/3AEocw2SmbYn1phXkXAowYA7Vc?u=https%3A%2F%2Fgithub.com%2Fxeccgtt any news on this?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://clicktime.symantec.com/3U7Y5CJL5xXRbBL2LmHj2wD7Vc?u=https%3A%2F%2Fgithub.com%2Fcincheo%2Fjsweet%2Fissues%2F564%23issuecomment-620121077, or unsubscribehttps://clicktime.symantec.com/3FEsSxWsUdP7RLxGFAbNrQL7Vc?u=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFY4KDX3Z3EVDKHBUX2AFU3ROW5F7ANCNFSM4K2S3UDQ.

The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. Although we attempt to sweep e-mail and attachments for viruses, we do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of viruses.

Please refer to https://disclaimer.bnymellon.com/eu.htm for certain disclosures relating to European legal entities. We take our data protection and privacy responsibilities seriously and our privacy notice explains how we collect, use and share personal information in the course of our business activities. It can be accessed at the privacy section of www.bnymellon.com.

lgrignon commented 4 years ago

I think this is a JSweet 3 pre release bug which will be fixed soon. I keep it open

lgrignon commented 4 years ago

Hello again @xeccgtt 3.0.0-RC4 has been deployed (and maven plugin is up to date) if you want to give it a shot Warning : if you declare jsweet-core as a dependency, groupId is now <groupId>org.jsweet.v3</groupId>

I hope it will work for you 🤞

lgrignon commented 3 years ago

3.0.0-RC5 is deployed, please test it on this version if you can. groupId is org.jsweet.v3 for almost all artifacts now (please see pom.xml & build.gradle here: https://github.com/cincheo/jsweet-examples)