@@ -69,12 +69,7 @@ struct JNIVariablesTests {
6969 """
7070 @_cdecl( " Java_com_example_swift_MyClass__00024getConstant__J " )
7171 func Java_com_example_swift_MyClass__00024getConstant__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jlong {
72- assert(self != 0, " self memory address was null " )
73- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
74- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
75- guard let self$ else {
76- fatalError( " self memory address was null in call to \\ (#function)! " )
77- }
72+ ...
7873 return self$.pointee.constant.getJNIValue(in: environment!)
7974 }
8075 """
@@ -134,23 +129,20 @@ struct JNIVariablesTests {
134129 @_cdecl( " Java_com_example_swift_MyClass__00024getMutable__J " )
135130 func Java_com_example_swift_MyClass__00024getMutable__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jlong {
136131 assert(self != 0, " self memory address was null " )
137- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
132+ ...
138133 let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
139134 guard let self$ else {
140135 fatalError( " self memory address was null in call to \\ (#function)! " )
141136 }
137+ ...
142138 return self$.pointee.mutable.getJNIValue(in: environment!)
143139 }
144140 """ ,
145141 """
146142 @_cdecl( " Java_com_example_swift_MyClass__00024setMutable__JJ " )
147143 func Java_com_example_swift_MyClass__00024setMutable__JJ(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, newValue: jlong, self: jlong) {
148144 assert(self != 0, " self memory address was null " )
149- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
150- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
151- guard let self$ else {
152- fatalError( " self memory address was null in call to \\ (#function)! " )
153- }
145+ ...
154146 self$.pointee.mutable = Int64(fromJNI: newValue, in: environment!)
155147 }
156148 """
@@ -195,12 +187,7 @@ struct JNIVariablesTests {
195187 """
196188 @_cdecl( " Java_com_example_swift_MyClass__00024getComputed__J " )
197189 func Java_com_example_swift_MyClass__00024getComputed__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jlong {
198- assert(self != 0, " self memory address was null " )
199- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
200- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
201- guard let self$ else {
202- fatalError( " self memory address was null in call to \\ (#function)! " )
203- }
190+ ...
204191 return self$.pointee.computed.getJNIValue(in: environment!)
205192 }
206193 """ ,
@@ -245,12 +232,7 @@ struct JNIVariablesTests {
245232 """
246233 @_cdecl( " Java_com_example_swift_MyClass__00024getComputedThrowing__J " )
247234 func Java_com_example_swift_MyClass__00024getComputedThrowing__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jlong {
248- assert(self != 0, " self memory address was null " )
249- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
250- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
251- guard let self$ else {
252- fatalError( " self memory address was null in call to \\ (#function)! " )
253- }
235+ ...
254236 do {
255237 return try self$.pointee.computedThrowing.getJNIValue(in: environment!)
256238 } catch {
@@ -314,24 +296,14 @@ struct JNIVariablesTests {
314296 """
315297 @_cdecl( " Java_com_example_swift_MyClass__00024getGetterAndSetter__J " )
316298 func Java_com_example_swift_MyClass__00024getGetterAndSetter__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jlong {
317- assert(self != 0, " self memory address was null " )
318- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
319- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
320- guard let self$ else {
321- fatalError( " self memory address was null in call to \\ (#function)! " )
322- }
299+ ...
323300 return self$.pointee.getterAndSetter.getJNIValue(in: environment!)
324301 }
325302 """ ,
326303 """
327304 @_cdecl( " Java_com_example_swift_MyClass__00024setGetterAndSetter__JJ " )
328305 func Java_com_example_swift_MyClass__00024setGetterAndSetter__JJ(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, newValue: jlong, self: jlong) {
329- assert(self != 0, " self memory address was null " )
330- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
331- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
332- guard let self$ else {
333- fatalError( " self memory address was null in call to \\ (#function)! " )
334- }
306+ ...
335307 self$.pointee.getterAndSetter = Int64(fromJNI: newValue, in: environment!)
336308 }
337309 """
@@ -390,24 +362,14 @@ struct JNIVariablesTests {
390362 """
391363 @_cdecl( " Java_com_example_swift_MyClass__00024isSomeBoolean__J " )
392364 func Java_com_example_swift_MyClass__00024isSomeBoolean__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jboolean {
393- assert(self != 0, " self memory address was null " )
394- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
395- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
396- guard let self$ else {
397- fatalError( " self memory address was null in call to \\ (#function)! " )
398- }
365+ ...
399366 return self$.pointee.someBoolean.getJNIValue(in: environment!)
400367 }
401368 """ ,
402369 """
403370 @_cdecl( " Java_com_example_swift_MyClass__00024setSomeBoolean__ZJ " )
404371 func Java_com_example_swift_MyClass__00024setSomeBoolean__ZJ(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, newValue: jboolean, self: jlong) {
405- assert(self != 0, " self memory address was null " )
406- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
407- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
408- guard let self$ else {
409- fatalError( " self memory address was null in call to \\ (#function)! " )
410- }
372+ ...
411373 self$.pointee.someBoolean = Bool(fromJNI: newValue, in: environment!)
412374 }
413375 """
@@ -466,24 +428,14 @@ struct JNIVariablesTests {
466428 """
467429 @_cdecl( " Java_com_example_swift_MyClass__00024isBoolean__J " )
468430 func Java_com_example_swift_MyClass__00024isBoolean__J(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, self: jlong) -> jboolean {
469- assert(self != 0, " self memory address was null " )
470- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
471- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
472- guard let self$ else {
473- fatalError( " self memory address was null in call to \\ (#function)! " )
474- }
431+ ...
475432 return self$.pointee.isBoolean.getJNIValue(in: environment!)
476433 }
477434 """ ,
478435 """
479436 @_cdecl( " Java_com_example_swift_MyClass__00024setBoolean__ZJ " )
480437 func Java_com_example_swift_MyClass__00024setBoolean__ZJ(environment: UnsafeMutablePointer<JNIEnv?>!, thisClass: jclass, newValue: jboolean, self: jlong) {
481- assert(self != 0, " self memory address was null " )
482- let selfBits$ = Int(Int64(fromJNI: self, in: environment!))
483- let self$ = UnsafeMutablePointer<MyClass>(bitPattern: selfBits$)
484- guard let self$ else {
485- fatalError( " self memory address was null in call to \\ (#function)! " )
486- }
438+ ...
487439 self$.pointee.isBoolean = Bool(fromJNI: newValue, in: environment!)
488440 }
489441 """
0 commit comments