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

implement JavaInt conformance to JavaParameterConvertible #12

Merged
merged 2 commits into from
Aug 16, 2018
Merged

Conversation

michaelknoch
Copy link
Collaborator

breaking change: Int does no longer conform to JavaParameterConvertible use JavaInt instead


extension Int: JavaParameterConvertible, JavaInitializableFromMethod, JavaInitializableFromField {
extension JavaInt: JavaParameterConvertible, JavaInitializableFromMethod, JavaInitializableFromField {
public static var asJNIParameterString = "I"

public func toJavaParameter() -> JavaParameter {
return JavaParameter(int: JavaInt(self))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can now just read int: self

let result = try jni.GetStaticIntField(of: javaClass, id: fieldID)
return Int(result)
return JavaInt(result)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these can be directly returned now return try jni.GetStaticIntField(of: javaClass, id: fieldID)

@ephemer ephemer merged commit a2b9c15 into devel Aug 16, 2018
@ephemer ephemer deleted the javaint branch August 16, 2018 11:52
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

Successfully merging this pull request may close these issues.

2 participants