Compile error: String concatentation
See original GitHub issueCompiling the class below throws an exception
public class HelloWorld {
public static String hello(String arg1, String arg2) {
return arg1 + arg2;
}
}
Exception in thread "main" java.lang.IndexOutOfBoundsException
at org.objectweb.asm.tree.InsnList.get(InsnList.java:94)
at io.neow3j.compiler.NeoMethod.convert(NeoMethod.java:486)
at io.neow3j.compiler.converters.MethodsConverter.handleUncachedMethodCall(MethodsConverter.java:193)
at io.neow3j.compiler.converters.MethodsConverter.handleMethodCall(MethodsConverter.java:167)
at io.neow3j.compiler.converters.MethodsConverter.handleInvoke(MethodsConverter.java:148)
at io.neow3j.compiler.converters.MethodsConverter.convert(MethodsConverter.java:81)
at io.neow3j.compiler.Compiler.handleInsn(Compiler.java:404)
at io.neow3j.compiler.converters.ObjectsConverter.handleStringConcatenation(ObjectsConverter.java:301)
at io.neow3j.compiler.converters.ObjectsConverter.handleNew(ObjectsConverter.java:167)
at io.neow3j.compiler.converters.ObjectsConverter.convert(ObjectsConverter.java:83)
at io.neow3j.compiler.Compiler.handleInsn(Compiler.java:404)
at io.neow3j.compiler.NeoMethod.convert(NeoMethod.java:488)
at io.neow3j.compiler.converters.MethodsConverter.handleUncachedMethodCall(MethodsConverter.java:193)
at io.neow3j.compiler.converters.MethodsConverter.handleMethodCall(MethodsConverter.java:167)
at io.neow3j.compiler.converters.MethodsConverter.handleInvoke(MethodsConverter.java:148)
at io.neow3j.compiler.converters.MethodsConverter.convert(MethodsConverter.java:81)
at io.neow3j.compiler.Compiler.handleInsn(Compiler.java:404)
at io.neow3j.compiler.NeoMethod.convert(NeoMethod.java:488)
at io.neow3j.compiler.converters.MethodsConverter.handleUncachedMethodCall(MethodsConverter.java:193)
at io.neow3j.compiler.converters.MethodsConverter.handleMethodCall(MethodsConverter.java:167)
at io.neow3j.compiler.converters.MethodsConverter.handleInvoke(MethodsConverter.java:148)
at io.neow3j.compiler.converters.MethodsConverter.convert(MethodsConverter.java:81)
at io.neow3j.compiler.Compiler.handleInsn(Compiler.java:404)
at io.neow3j.compiler.converters.ObjectsConverter.handleStringConcatenation(ObjectsConverter.java:301)
at io.neow3j.compiler.converters.ObjectsConverter.handleNew(ObjectsConverter.java:167)
at io.neow3j.compiler.converters.ObjectsConverter.convert(ObjectsConverter.java:83)
at io.neow3j.compiler.Compiler.handleInsn(Compiler.java:404)
at io.neow3j.compiler.NeoMethod.convert(NeoMethod.java:488)
at io.neow3j.compiler.Compiler.compile(Compiler.java:271)
at io.neow3j.compiler.Compiler.compile(Compiler.java:240)
at io.neow3j.examples.contractdevelopment.CompileAndDeploy.main(CompileAndDeploy.java:26)
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Swift Compiler Error: "Expression too complex" on a string ...
My understanding is that the Swift team is working on compiler optimizations ... As a result concatenating strings with interpolation ie using "...
Read more >How to correct a #VALUE! error in the CONCATENATE function
error with CONCATENATE is when you try to build a string that includes a cell reference that has an error, such as #VALUE!....
Read more >Compile-time string concatenation | Andrzej's C++ blog
Question: what happens when this program is executed? The program hits what is called static initialization order fiasco: while initializing ...
Read more >VBA Concatenate Text Strings Together (& - Ampersand)
This is the full procedure to concatenate two cells together using string variables. Sub ConcatenateStrings() Dim StringOne as String Dim ...
Read more >String concatenation documentation is unclear #664 - GitHub
js. I have no idea how to reproduce your error "TypeError: Array.prototype.concat called on null or undefined". [...].
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s good to know, so from now on ill compile my contracts using the gradle task.
openjdk version “11.0.11” 2021-04-20 OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04) OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)
Hey @gsmachado that’s great news! Unfortunately I am still running into this issue. I will add the compiled class file to this post @csmuller . I am working with java 11.
StringConcatContract3.class.zip
I also did some more testing, the compile error only happens when I concatenate 2 string variables like in bongoCat2() and bongoCat3().