File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Samples/JavaKitSampleApp/Sources/JavaKitExample Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,12 @@ extension HelloSwift: HelloSwiftNativeMethods {
7777 }
7878
7979 // Make sure that the thread safe class is sendable
80- let threadSafe : Sendable = ThreadSafeHelperClass ( environment: javaEnvironment)
80+ let helper = ThreadSafeHelperClass ( environment: javaEnvironment)
81+ let threadSafe : Sendable = helper
82+
83+ let text : String ? = helper. textOptional
84+ let value : String ? = helper. getValueOptional ( Optional< String> . none)
85+ let textFunc : String ? = helper. getTextOptional ( )
8186
8287 return i * j
8388 }
Original file line number Diff line number Diff line change 1414
1515package com .example .swift ;
1616
17+ import java .util .Optional ;
18+
1719@ ThreadSafe
1820public class ThreadSafeHelperClass {
1921 public ThreadSafeHelperClass () { }
22+
23+ public Optional <String > text = Optional .of ("" );
24+
25+ public String getValue (Optional <String > name ) {
26+ return name .orElse ("" );
27+ }
28+
29+ public Optional <String > getText () {
30+ return text ;
31+ }
2032}
You can’t perform that action at this time.
0 commit comments