@@ -2630,6 +2630,137 @@ class SuspendFun extends jni$_.JObject {
2630
2630
.reference);
2631
2631
}
2632
2632
2633
+ static final _id_sayHelloWithoutDelay = _class.instanceMethodId (
2634
+ r'sayHelloWithoutDelay' ,
2635
+ r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;' ,
2636
+ );
2637
+
2638
+ static final _sayHelloWithoutDelay = jni$_.ProtectedJniExtensions .lookup<
2639
+ jni$_.NativeFunction <
2640
+ jni$_.JniResult Function (
2641
+ jni$_.Pointer <jni$_.Void >,
2642
+ jni$_.JMethodIDPtr ,
2643
+ jni$_.VarArgs <(jni$_.Pointer <jni$_.Void >,)>)>> (
2644
+ 'globalEnv_CallObjectMethod' )
2645
+ .asFunction<
2646
+ jni$_.JniResult Function (jni$_.Pointer <jni$_.Void >,
2647
+ jni$_.JMethodIDPtr , jni$_.Pointer <jni$_.Void >)> ();
2648
+
2649
+ /// from: `public final java.lang.Object sayHelloWithoutDelay(kotlin.coroutines.Continuation continuation)`
2650
+ /// The returned object must be released after use, by calling the [release] method.
2651
+ core$_.Future <jni$_.JString > sayHelloWithoutDelay () async {
2652
+ final $p = jni$_.ReceivePort ();
2653
+ final _$continuation = jni$_.ProtectedJniExtensions .newPortContinuation ($p);
2654
+
2655
+ final $r = _sayHelloWithoutDelay (
2656
+ reference.pointer,
2657
+ _id_sayHelloWithoutDelay as jni$_.JMethodIDPtr ,
2658
+ _$continuation.pointer)
2659
+ .object< jni$_.JObject > (const jni$_.JObjectType ());
2660
+ _$continuation.release ();
2661
+ final jni$_.JObject $o;
2662
+ if ($r.isInstanceOf (jni$_.coroutineSingletonsClass)) {
2663
+ $r.release ();
2664
+ $o = jni$_.JObject .fromReference (
2665
+ jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first)));
2666
+ if ($o.isInstanceOf (jni$_.result$FailureClass)) {
2667
+ final $e =
2668
+ jni$_.failureExceptionField.get ($o, const jni$_.JObjectType ());
2669
+ $o.release ();
2670
+ jni$_.Jni .throwException ($e.reference.toPointer ());
2671
+ }
2672
+ } else {
2673
+ $o = $r;
2674
+ }
2675
+ return $o.as (const jni$_.JStringType (), releaseOriginal: true );
2676
+ }
2677
+
2678
+ static final _id_failWithoutDelay = _class.instanceMethodId (
2679
+ r'failWithoutDelay' ,
2680
+ r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;' ,
2681
+ );
2682
+
2683
+ static final _failWithoutDelay = jni$_.ProtectedJniExtensions .lookup<
2684
+ jni$_.NativeFunction <
2685
+ jni$_.JniResult Function (
2686
+ jni$_.Pointer <jni$_.Void >,
2687
+ jni$_.JMethodIDPtr ,
2688
+ jni$_.VarArgs <(jni$_.Pointer <jni$_.Void >,)>)>> (
2689
+ 'globalEnv_CallObjectMethod' )
2690
+ .asFunction<
2691
+ jni$_.JniResult Function (jni$_.Pointer <jni$_.Void >,
2692
+ jni$_.JMethodIDPtr , jni$_.Pointer <jni$_.Void >)> ();
2693
+
2694
+ /// from: `public final java.lang.Object failWithoutDelay(kotlin.coroutines.Continuation continuation)`
2695
+ /// The returned object must be released after use, by calling the [release] method.
2696
+ core$_.Future <jni$_.JString > failWithoutDelay () async {
2697
+ final $p = jni$_.ReceivePort ();
2698
+ final _$continuation = jni$_.ProtectedJniExtensions .newPortContinuation ($p);
2699
+
2700
+ final $r = _failWithoutDelay (reference.pointer,
2701
+ _id_failWithoutDelay as jni$_.JMethodIDPtr , _$continuation.pointer)
2702
+ .object< jni$_.JObject > (const jni$_.JObjectType ());
2703
+ _$continuation.release ();
2704
+ final jni$_.JObject $o;
2705
+ if ($r.isInstanceOf (jni$_.coroutineSingletonsClass)) {
2706
+ $r.release ();
2707
+ $o = jni$_.JObject .fromReference (
2708
+ jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first)));
2709
+ if ($o.isInstanceOf (jni$_.result$FailureClass)) {
2710
+ final $e =
2711
+ jni$_.failureExceptionField.get ($o, const jni$_.JObjectType ());
2712
+ $o.release ();
2713
+ jni$_.Jni .throwException ($e.reference.toPointer ());
2714
+ }
2715
+ } else {
2716
+ $o = $r;
2717
+ }
2718
+ return $o.as (const jni$_.JStringType (), releaseOriginal: true );
2719
+ }
2720
+
2721
+ static final _id_fail = _class.instanceMethodId (
2722
+ r'fail' ,
2723
+ r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;' ,
2724
+ );
2725
+
2726
+ static final _fail = jni$_.ProtectedJniExtensions .lookup<
2727
+ jni$_.NativeFunction <
2728
+ jni$_.JniResult Function (
2729
+ jni$_.Pointer <jni$_.Void >,
2730
+ jni$_.JMethodIDPtr ,
2731
+ jni$_.VarArgs <(jni$_.Pointer <jni$_.Void >,)>)>> (
2732
+ 'globalEnv_CallObjectMethod' )
2733
+ .asFunction<
2734
+ jni$_.JniResult Function (jni$_.Pointer <jni$_.Void >,
2735
+ jni$_.JMethodIDPtr , jni$_.Pointer <jni$_.Void >)> ();
2736
+
2737
+ /// from: `public final java.lang.Object fail(kotlin.coroutines.Continuation continuation)`
2738
+ /// The returned object must be released after use, by calling the [release] method.
2739
+ core$_.Future <jni$_.JString > fail () async {
2740
+ final $p = jni$_.ReceivePort ();
2741
+ final _$continuation = jni$_.ProtectedJniExtensions .newPortContinuation ($p);
2742
+
2743
+ final $r = _fail (reference.pointer, _id_fail as jni$_.JMethodIDPtr ,
2744
+ _$continuation.pointer)
2745
+ .object< jni$_.JObject > (const jni$_.JObjectType ());
2746
+ _$continuation.release ();
2747
+ final jni$_.JObject $o;
2748
+ if ($r.isInstanceOf (jni$_.coroutineSingletonsClass)) {
2749
+ $r.release ();
2750
+ $o = jni$_.JObject .fromReference (
2751
+ jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first)));
2752
+ if ($o.isInstanceOf (jni$_.result$FailureClass)) {
2753
+ final $e =
2754
+ jni$_.failureExceptionField.get ($o, const jni$_.JObjectType ());
2755
+ $o.release ();
2756
+ jni$_.Jni .throwException ($e.reference.toPointer ());
2757
+ }
2758
+ } else {
2759
+ $o = $r;
2760
+ }
2761
+ return $o.as (const jni$_.JStringType (), releaseOriginal: true );
2762
+ }
2763
+
2633
2764
static final _id_sayHello = _class.instanceMethodId (
2634
2765
r'sayHello' ,
2635
2766
r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;' ,
@@ -2652,20 +2783,25 @@ class SuspendFun extends jni$_.JObject {
2652
2783
final $p = jni$_.ReceivePort ();
2653
2784
final _$continuation = jni$_.ProtectedJniExtensions .newPortContinuation ($p);
2654
2785
2655
- _sayHello (reference.pointer, _id_sayHello as jni$_.JMethodIDPtr ,
2786
+ final $r = _sayHello (reference.pointer, _id_sayHello as jni$_.JMethodIDPtr ,
2656
2787
_$continuation.pointer)
2657
- .object< jni$_.JObject > (const jni$_.JObjectType ())
2658
- .release ();
2788
+ .object< jni$_.JObject > (const jni$_.JObjectType ());
2659
2789
_$continuation.release ();
2660
- final $o =
2661
- jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first));
2662
- final $k = const jni$_.JStringType ().jClass.reference;
2663
- if (! jni$_.Jni .env.IsInstanceOf ($o.pointer, $k.pointer)) {
2664
- $k.release ();
2665
- throw 'Failed' ;
2790
+ final jni$_.JObject $o;
2791
+ if ($r.isInstanceOf (jni$_.coroutineSingletonsClass)) {
2792
+ $r.release ();
2793
+ $o = jni$_.JObject .fromReference (
2794
+ jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first)));
2795
+ if ($o.isInstanceOf (jni$_.result$FailureClass)) {
2796
+ final $e =
2797
+ jni$_.failureExceptionField.get ($o, const jni$_.JObjectType ());
2798
+ $o.release ();
2799
+ jni$_.Jni .throwException ($e.reference.toPointer ());
2800
+ }
2801
+ } else {
2802
+ $o = $r;
2666
2803
}
2667
- $k.release ();
2668
- return const jni$_.JStringType ().fromReference ($o);
2804
+ return $o.as (const jni$_.JStringType (), releaseOriginal: true );
2669
2805
}
2670
2806
2671
2807
static final _id_sayHello$1 = _class.instanceMethodId (
@@ -2698,20 +2834,28 @@ class SuspendFun extends jni$_.JObject {
2698
2834
final $p = jni$_.ReceivePort ();
2699
2835
final _$continuation = jni$_.ProtectedJniExtensions .newPortContinuation ($p);
2700
2836
final _$string = string.reference;
2701
- _sayHello$1 (reference.pointer, _id_sayHello$1 as jni$_.JMethodIDPtr ,
2702
- _$string.pointer, _$continuation.pointer)
2703
- .object< jni$_.JObject > (const jni$_.JObjectType ())
2704
- .release ();
2837
+ final $r = _sayHello$1 (
2838
+ reference.pointer,
2839
+ _id_sayHello$1 as jni$_.JMethodIDPtr ,
2840
+ _$string.pointer,
2841
+ _$continuation.pointer)
2842
+ .object< jni$_.JObject > (const jni$_.JObjectType ());
2705
2843
_$continuation.release ();
2706
- final $o =
2707
- jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first));
2708
- final $k = const jni$_.JStringType ().jClass.reference;
2709
- if (! jni$_.Jni .env.IsInstanceOf ($o.pointer, $k.pointer)) {
2710
- $k.release ();
2711
- throw 'Failed' ;
2844
+ final jni$_.JObject $o;
2845
+ if ($r.isInstanceOf (jni$_.coroutineSingletonsClass)) {
2846
+ $r.release ();
2847
+ $o = jni$_.JObject .fromReference (
2848
+ jni$_.JGlobalReference (jni$_.JObjectPtr .fromAddress (await $p.first)));
2849
+ if ($o.isInstanceOf (jni$_.result$FailureClass)) {
2850
+ final $e =
2851
+ jni$_.failureExceptionField.get ($o, const jni$_.JObjectType ());
2852
+ $o.release ();
2853
+ jni$_.Jni .throwException ($e.reference.toPointer ());
2854
+ }
2855
+ } else {
2856
+ $o = $r;
2712
2857
}
2713
- $k.release ();
2714
- return const jni$_.JStringType ().fromReference ($o);
2858
+ return $o.as (const jni$_.JStringType (), releaseOriginal: true );
2715
2859
}
2716
2860
}
2717
2861
0 commit comments