我们可以在 Flex 库中使用静态初始化器吗?
我们在我的项目中使用 as3Crypto 库。我们已经下载了代码,进行了一些修改并开始使用它。最初,我们将完整的代码作为项目的一部分包含在内。现在我们尝试将其编译为单独的库文件(.swc)。当我们编译代码时,我们没有收到任何错误,但我们收到一个警告:
Severity and Description Path Resource Location Creation Time Id
flex2.compiler.as3.SignatureExtension.SignatureGenerationFailed[level='warning', column='23', node='ForStatement', line='214', cause='flex2.compiler.as3.SignatureAssertionRuntimeException: Unreachable Codepath
at flex2.compiler.as3.SignatureEvaluator.ASSERT(SignatureEvaluator.java:369)
at flex2.compiler.as3.SignatureEvaluator.UNREACHABLE_CODEPATH(SignatureEvaluator.java:357)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1560)
at macromedia.asc.parser.ForStatementNode.evaluate(ForStatementNode.java:50)
at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1795)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:530)
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106)
at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1795)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:454)
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)
at flex2.compiler.as3.SignatureExtension.generateSignature(SignatureExtension.java:270)
at flex2.compiler.as3.SignatureExtension.doSignatureGeneration(SignatureExtension.java:174)
at flex2.compiler.as3.SignatureExtension.parse1(SignatureExtension.java:137)
at flex2.compiler.as3.Compiler.parse1(Compiler.java:369)
', path='C:\MyData\Flex WorkSpaces\Separate\HurlantCryptoLib\src\com\hurlant\crypto\symmetric\AESKey.as'] HurlantCryptoLib/src/com/hurlant/crypto/symmetric AESKey.as line 214 1312947481229 27
当我们检查代码时,我们将其跟踪到代码文件 AESKey.as,尤其是来自静态初始化器代码堵塞。我不能简单地忽略该警告,因为它是我的应用程序安全的关键部分。
如果有人遇到这个问题,请帮助我解决这个问题。
We are using as3Crypto library in my project. We have downloaded the code, modified a bit and started using it. Initially we have included the complete code as the part of the project. Now we are trying to compile it as Separate Library file(.swc). When we compile the code, we didn't get any errors, but we got one warning saying
Severity and Description Path Resource Location Creation Time Id
flex2.compiler.as3.SignatureExtension.SignatureGenerationFailed[level='warning', column='23', node='ForStatement', line='214', cause='flex2.compiler.as3.SignatureAssertionRuntimeException: Unreachable Codepath
at flex2.compiler.as3.SignatureEvaluator.ASSERT(SignatureEvaluator.java:369)
at flex2.compiler.as3.SignatureEvaluator.UNREACHABLE_CODEPATH(SignatureEvaluator.java:357)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1560)
at macromedia.asc.parser.ForStatementNode.evaluate(ForStatementNode.java:50)
at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1795)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:530)
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106)
at flash.swf.tools.as3.EvaluatorAdapter.evaluate(EvaluatorAdapter.java:338)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:1795)
at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60)
at flex2.compiler.as3.SignatureEvaluator.evaluate(SignatureEvaluator.java:454)
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80)
at flex2.compiler.as3.SignatureExtension.generateSignature(SignatureExtension.java:270)
at flex2.compiler.as3.SignatureExtension.doSignatureGeneration(SignatureExtension.java:174)
at flex2.compiler.as3.SignatureExtension.parse1(SignatureExtension.java:137)
at flex2.compiler.as3.Compiler.parse1(Compiler.java:369)
', path='C:\MyData\Flex WorkSpaces\Separate\HurlantCryptoLib\src\com\hurlant\crypto\symmetric\AESKey.as'] HurlantCryptoLib/src/com/hurlant/crypto/symmetric AESKey.as line 214 1312947481229 27
When we check the code, we traced it to a code file AESKey.as, especially from a Static initializers code block. I can't simply ignore the warning as it is the critical part of my applications security.
If Anybody come across this problem, please help me to fix this issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要回答标题中的问题,看起来是的,您可以在 Flex 库项目中使用静态初始值设定项。这是库项目中的一个类:
这是一个使用它的 Flex 应用程序:
这会产生以下输出:
To answer the question in the title, it looks like, yes, you can use static initializers in a Flex library project. Here is a class in a library project:
And here is a Flex application that uses it:
This produces the following output: