-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Public static Methods not found? #43
Comments
I think the best for reproducing is if you send the *.class file. Then all conditions like Java version, etc can be ignored. |
Greetings. Thank you for prompt response. JVM is Jetbrains 11 (OpenJDK 11). I have also the JAR file attached, it stems from JSQLFormatter.
|
I have deleted the Gradle Cache and run Gradle with
JDK-11 works, but throws:
|
This is the Kotlin error from #41. 101 is a small "e" and was fixed in ad93c2c
The exception is now in line 114. This means you does not use the latest version: https://github.com/i-net-software/JWebAssembly/blob/master/src/de/inetsoftware/classparser/Annotations.java You can try:
This is the ID from the last commit: https://jitpack.io/#i-net-software/jwebassembly/97f9fb39a7 |
I am sorry, but after messing around I feel like a lot of more work needs to go into deployment first:
Spelling seems to matter and https://jitpack.io/#i-net-software/jwebassembly/97f9fb39a7 explains it wrong.
I have thought this would make the latest GIT commit available, but no chance: a) Local Repo shows jwebassembly-compiler-0.4.jar and jwebassembly-compiler-0.4.pom b) while the dependency asks for JWebAssembly or jwebassembly-api --> how does this all work together please? c)
|
After a lot of trial'n error, I got access to that particular commit build. dependencies {
implementation 'com.github.i-net-software:JWebAssembly:97f9fb39a7'
implementation 'com.github.i-net-software:jwebassembly-api:master-SNAPSHOT'
}
wasm {
compilerVersion = 'com.github.i-net-software:jwebassembly:97f9fb39a7'
} Details matter! Unfortunately, this did not solve or improve anything. I still get exactly the same error message:
|
I need the file com.manticore.jsqlformatter.JSQLFormatter.class that produce the problem for analyzing. Occur this with a release version of the library? |
I can reproduce the problem. I will look into. |
Thanks a lot! I would like to offer two things:
|
|
The original problem is fixed but there is a problem with |
Good Morning and compliments of the day. Thank you again for your help and effort. dependencies {
implementation 'com.github.jsqlparser:jsqlparser:4.5-SNAPSHOT'
implementation 'com.github.i-net-software:JWebAssembly:master-SNAPSHOT'
implementation 'com.github.i-net-software:jwebassembly-api:master-SNAPSHOT'
} Will the JWebAssembly Gradle Plugin detect such dependencies automatically or will I need to create a FAT/Ueber JAR containing all the Classes? |
I am sad, that I fail to get this stuff running:
I still get the same error on Row 522 as shown above. That said, I have created a JWebAssembly branch of my project: https://github.com/manticore-projects/jsqlformatter/tree/JWebAssembly |
The problem with the JSqlParser project is that I can't find the sources of CCJSqlParser, Only CCJSqlParserUtils. https://github.com/JSQLParser/JSqlParser/tree/master/src/main/java/net/sf/jsqlparser/parser
Yes, but you need only the dependency of the jwebassembly-api. The compiler is loaded from the
I have no idea. Can it be that you have set the dependency and not the compilerVersion? If set the Gradle command line flag |
That's because it is a Parser Generator, meaning the Sources are generated only during the build.
I have used |
I have analyze the error and found the cause. It could be the cause of all the problems. At least of several problems. The cause is a SWITCH with calculated/conditional switch value like:
The Java bytecode give only the code position where the switch start with a value from stack. Wasm required the code position on which the calculation of the expression starts. The current JUnit tests was to simple. I need a new idea how I can calculate/detect the right code position and then implements it. This can take some time. |
…tion of the SWITCH value does not have to be determined. #43
… This eliminates the need to calculate the end of the SWITCH structure. #43
After fixing many bugs with SWICHES, I give up for now. I have no idea how this can be fixed. It looks like the code is generated at Java byte code level. I don't see how I can represent this in Java Syntax or WebAssembly. It seems that there are back jumps from inside a SWITCH in CCJSqlParser.JsonFunction(). A back jump can only be represent with a loop in Java and WebAssembly. But there is no end of the loop. This result in overlapping structures. This is not possible with Java Syntax and WebAssembly. But the analyze has help to make some things clearer in JWebAssembly. For example I use blocks with input parameter for the SWITCHES. |
Greetings. Thanks a lot for all your effort and I am glad to have provided a solid use case test. So I do wonder: Would it not be easier to transpile Java Source Code instead of Java Byte Code (and to use an additional De-Compiler when only Byte Code was available)? Java Source Code can be parsed with Java CC, all what was need was to de-parse/transpile it into WebAssembly. At least this is my oversimplified understanding. |
The decompilers that I have try because I does not have the source code have not work. There was an output but this output was not matching the byte code. The byte code has a structure like:
This is not valid in Java or in WebAssembly.
The TeaVM use the concept of transpiling.
I does not have the Java source code of CCJSqlParser. If you have the source code then make it available and I will look into it again. With a source code with which I can reproduce the problem then I can create simple unit test. |
Again, thanks a lot.
I have the Autobuilt Source Code attached, but you can also Git Pull the Branch I created for your tests. Please let me know any additional help/support I can render for you. |
Thanks for the sources. This will help. |
…oblems with not splitable instruction like DUP (Java) or TEE (Wasm) #43
With the library version that I try the compiler error are solved. Please try it. It ended now with a dependency to native method because
Of course ZipFile will not work because WebAssembly can't work with files. You can see the parsing order of methods if you set the debug flag. If you have any suggestion or patch this is welcome. |
Good Morning, awesome work and much appreciated. I will try as soon as possible.
Big THANK YOU and Dankeschoen again! |
|
…eplaced, referenced native methods. #43
Greetings,
after setting up the Gradle Build, I have tried to compile a simple Java Class and it fails promptly:
which refers to a
private static
method using anEnum separation
:What exactly could be the problem here please?
The text was updated successfully, but these errors were encountered: