Ballerina 构建错误,代码生成器空指针异常

Ballerina build error with code generator null pointer exception

Ballerina 构建包/失败并显示

ballerina: Oh no, something really went wrong. Bad. Sad.

ballerina-internal.log 文件有以下编译时错误。

ERROR {org.ballerinalang.launcher.Main} - null java.lang.NullPointerException
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.generateFinallyInstructions(CodeGenerator.java:3311)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.generateFinallyInstructions(CodeGenerator.java:3304)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:547)
at org.wso2.ballerinalang.compiler.tree.statements.BLangReturn.accept(BLangReturn.java:44)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:494)
at org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt.accept(BLangBlockStmt.java:54)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:2662)
at org.wso2.ballerinalang.compiler.tree.statements.BLangIf.accept(BLangIf.java:53)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:494)
at org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt.accept(BLangBlockStmt.java:54)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.processWorker(CodeGenerator.java:1653)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visitInvokableNode(CodeGenerator.java:1598)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:482)
at org.wso2.ballerinalang.compiler.tree.BLangFunction.accept(BLangFunction.java:66)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.lambda$visit5(CodeGenerator.java:443)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.visit(CodeGenerator.java:443)
at org.wso2.ballerinalang.compiler.tree.BLangPackage.accept(BLangPackage.java:150)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.genNode(CodeGenerator.java:1386)
at org.wso2.ballerinalang.compiler.codegen.CodeGenerator.generateBALO(CodeGenerator.java:358)
at org.wso2.ballerinalang.compiler.CompilerDriver.codegen(CompilerDriver.java:200)
at org.wso2.ballerinalang.compiler.CompilerDriver.compile(CompilerDriver.java:172)
at org.wso2.ballerinalang.compiler.CompilerDriver.compilePackageSymbol(CompilerDriver.java:139)
at org.wso2.ballerinalang.compiler.CompilerDriver.compilePackage(CompilerDriver.java:106)
at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
at java.util.stream.ReferencePipeline.accept(ReferencePipeline.java:175)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at org.wso2.ballerinalang.compiler.Compiler.compilePackages(Compiler.java:154)
at org.wso2.ballerinalang.compiler.Compiler.compilePackage(Compiler.java:173)
at org.wso2.ballerinalang.compiler.Compiler.compile(Compiler.java:85)
at org.wso2.ballerinalang.compiler.Compiler.build(Compiler.java:94)
at org.ballerinalang.packerina.BuilderUtils.compileWithTestsAndWrite(BuilderUtils.java:63)
at org.ballerinalang.packerina.cmd.BuildCommand.execute(BuildCommand.java:97)
at java.util.Optional.ifPresent(Optional.java:159)
at org.ballerinalang.launcher.Main.main(Main.java:66)

我检查了代码,如果 BLangStatement.statementLink 可以分配空值,就会发生这种情况。这个值可以赋空值吗?

这看起来像是产品中的错误。请 post 这个问题以及如何在 https://github.com/ballerina-platform/ballerina-lang

上重现它