Skip to content
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

Problem: JNI generator generates invalid code if a reserved Java keyword is used #947

Closed
sappo opened this issue Aug 1, 2017 · 4 comments
Assignees

Comments

@sappo
Copy link
Member

sappo commented Aug 1, 2017

Prefix or Suffix the variable/function to escape the issue

@jimklimov
Copy link
Member

FWIW, here is a helpful list of the 53 reserved keywords in Java (to help make a generic solution, rather than a "real fix" for zeromq/czmq#1719 alone) : https://en.wikipedia.org/wiki/List_of_Java_keywords

@bluca
Copy link
Member

bluca commented Sep 3, 2017

We have the same problem with Python and zyre now - the zyre_peer class has a "print" API, which clashes with Python's print function.

So it looks like a generic way to handle reserved keyword in zproject bindings generation is what we need

@bluca
Copy link
Member

bluca commented Mar 31, 2018

There is another problem with return types:

--- a/bindings/jni/src/main/java/org/zeromq/czmq/Zconfig.java
+++ b/bindings/jni/src/main/java/org/zeromq/czmq/Zconfig.java
@@ -229,10 +229,9 @@ public class Zconfig implements AutoCloseable{
     }
     /*
     Destroy node and subtree (all children)
-    WARNING: manually fixed void -> long
     */
     native static long __remove (long self);
-    public long remove () {
+    public void remove () {
         self = __remove (self);
         return 0;
     }

Manually fixed in zeromq/czmq#1822 but needs a resolution in the zproject template (not sure how though)

bluca added a commit to bluca/czmq that referenced this issue Mar 31, 2018
Solution: mark the zproject regen job as allow_fail until the zproject
zeromq/zproject#947 issue is solved
bluca added a commit to bluca/czmq that referenced this issue Mar 31, 2018
Solution: mark the zproject regen job as allow_fail until the zproject
zeromq/zproject#947 issue is solved
bluca added a commit to bluca/czmq that referenced this issue Mar 31, 2018
Solution: mark the zproject regen job as allow_fail until the zproject
zeromq/zproject#947 issue is solved
bluca added a commit to bluca/czmq that referenced this issue Mar 31, 2018
Solution: mark the zproject regen job as allow_fail until the zproject
zeromq/zproject#947 issue is solved
bluca added a commit to bluca/czmq that referenced this issue Mar 31, 2018
Solution: mark the zproject regen job as allow_fail until the zproject
zeromq/zproject#947 issue is solved
@hgourvest
Copy link
Contributor

fixed with this merge #1133

@bluca bluca closed this as completed Dec 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants