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

Overloaded methods support #72

Open
uvlad7 opened this issue Mar 27, 2024 · 0 comments
Open

Overloaded methods support #72

uvlad7 opened this issue Mar 27, 2024 · 0 comments

Comments

@uvlad7
Copy link
Contributor

uvlad7 commented Mar 27, 2024

  • For "jni" methods - use long method name format. This will also make it more error-proof, protecting against inconsistent types in java and rust declarations, now it's possible to write something like
        pub extern "jni" fn getBool(self, v: bool) -> bool {
            v
        }
    public native Boolean getBool(Boolean x);

and it won't fail on System.loadLibrary call

  • For "java" methods - allow to override corresponding java method name to be able to write something like
        #[java_name(getPassword)]
        pub extern "java" fn getPasswordString(
            &self,
            env: &JNIEnv,
        ) -> JniResult<String> {}

        #[java_name(getPassword)]
        pub extern "java" fn getPasswordBytes(
            &self,
            env: &JNIEnv,
        ) -> JniResult<Box<[i8]>> {}
    public String getPassword() {
        return password;
    }
    public byte[] getPassword() {
        return password.getBytes();
    }
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

1 participant