Cleanup: fix typos
This commit is contained in:
parent
f24ffdad35
commit
50f7bcb9ce
|
@ -124,7 +124,7 @@ public extension JNICore {
|
|||
public func `throw`() {
|
||||
switch self {
|
||||
case .classNotFoundException(let message):
|
||||
assert(JNI.api.ThrowNew(JNI.env, ExceptionClass, "ClassNotFoundaException: \(message)") == 0)
|
||||
assert(JNI.api.ThrowNew(JNI.env, ExceptionClass, "ClassNotFoundException: \(message)") == 0)
|
||||
case .methodNotFoundException(let message):
|
||||
assert(JNI.api.ThrowNew(JNI.env, ExceptionClass, "MethodNotFoundException: \(message)") == 0)
|
||||
case .fieldNotFoundException(let message):
|
||||
|
@ -136,7 +136,7 @@ public extension JNICore {
|
|||
public var errorDescription: String? {
|
||||
switch self {
|
||||
case .classNotFoundException(let message):
|
||||
return "ClassNotFoundaException: \(message)"
|
||||
return "ClassNotFoundException: \(message)"
|
||||
case .methodNotFoundException(let message):
|
||||
return "MethodNotFoundException: \(message)"
|
||||
case .fieldNotFoundException(let message):
|
||||
|
|
|
@ -47,15 +47,15 @@ public extension JNIObject {
|
|||
|
||||
func callStringMethod(method: String? = nil, functionName: String = #function, _ args: JNIArgumentProtocol...) -> String {
|
||||
let methodName = method ?? String(functionName.split(separator: "(")[0])
|
||||
return String(javaObject: self.internalcallObjectMethod(method: methodName, returnType: "Ljava/lang/String;", args))
|
||||
return String(javaObject: self.internalCallObjectMethod(method: methodName, returnType: "Ljava/lang/String;", args))
|
||||
}
|
||||
|
||||
func callObjectMethod(method: String? = nil, functionName: String = #function, returnType: String, _ args: JNIArgumentProtocol...) -> jobject? {
|
||||
let methodName = method ?? String(functionName.split(separator: "(")[0])
|
||||
return self.internalcallObjectMethod(method: methodName, returnType: returnType, args)
|
||||
return self.internalCallObjectMethod(method: methodName, returnType: returnType, args)
|
||||
}
|
||||
|
||||
private func internalcallObjectMethod(method: String, returnType: String, _ args: [JNIArgumentProtocol]) -> jobject? {
|
||||
private func internalCallObjectMethod(method: String, returnType: String, _ args: [JNIArgumentProtocol]) -> jobject? {
|
||||
let sig = "(\(args.map({ $0.sig() }).joined()))\(returnType)"
|
||||
let methodID = try! JNI.getJavaMethod(forClass: self.className, method: method, sig: sig)
|
||||
return checkArgumentAndWrap(args: args, { argsPtr in
|
||||
|
|
Loading…
Reference in New Issue