From 69ebb49141d7e699fdd27d32e7fe7e1b418194bd Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Mon, 18 Nov 2024 10:50:03 +0100 Subject: [PATCH 01/50] [jni][jnigen] Publish 0.12.2 (#1725) --- pkgs/jni/CHANGELOG.md | 2 +- pkgs/jni/pubspec.yaml | 2 +- pkgs/jnigen/CHANGELOG.md | 2 +- pkgs/jnigen/pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index bee6695c0..85cd7545a 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.12.1-wip +## 0.12.2 - Add `JniUtils.fromReferenceAddress` which helps with sending `JObject`s through method channels. You can send the address of the pointer as `long` and diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index f25f74752..b45b2ad15 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml @@ -4,7 +4,7 @@ name: jni description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. -version: 0.12.1-wip +version: 0.12.2 repository: https://github.com/dart-lang/native/tree/main/pkgs/jni issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajni diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 39f93a42f..68a4b6903 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.12.2-wip +## 0.12.2 - Now excludes invalid identifiers by default. - Fixed a bug where if multiple jars have classes within the same package, only diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index b4b34ce4d..8104afd73 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml @@ -4,7 +4,7 @@ name: jnigen description: A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. -version: 0.12.2-wip +version: 0.12.2 repository: https://github.com/dart-lang/native/tree/main/pkgs/jnigen issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajnigen From 52177b6b5c739450034eed2828e805cd1a276d17 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Mon, 18 Nov 2024 07:48:48 -0800 Subject: [PATCH 02/50] Reduces the changes of duplicate symbols by adding a `DOBJC_` prefix. (#1727) --- pkgs/objective_c/CHANGELOG.md | 4 ++ pkgs/objective_c/ffigen_c.yaml | 20 ++++----- pkgs/objective_c/ffigen_objc.yaml | 10 +++-- .../lib/src/c_bindings_generated.dart | 25 ++++++++--- .../src/objective_c_bindings_generated.dart | 44 ++++++++++--------- pkgs/objective_c/pubspec.yaml | 2 +- pkgs/objective_c/src/input_stream_adapter.h | 7 +-- pkgs/objective_c/src/input_stream_adapter.m | 4 +- pkgs/objective_c/src/objective_c.c | 18 ++++---- pkgs/objective_c/src/objective_c.h | 12 ++--- pkgs/objective_c/src/objective_c.m | 2 +- pkgs/objective_c/src/proxy.h | 8 ++-- pkgs/objective_c/src/proxy.m | 22 +++++----- .../test/interface_lists_test.dart | 5 ++- pkgs/objective_c/test/setup.dart | 6 +-- 15 files changed, 106 insertions(+), 83 deletions(-) diff --git a/pkgs/objective_c/CHANGELOG.md b/pkgs/objective_c/CHANGELOG.md index 928718d76..3607b54cc 100644 --- a/pkgs/objective_c/CHANGELOG.md +++ b/pkgs/objective_c/CHANGELOG.md @@ -1,3 +1,7 @@ +## 4.0.1-wip + +- Reduces the changes of duplicate symbols by adding a `DOBJC_` prefix. + ## 4.0.0 - Use ffigen 16.0.0 diff --git a/pkgs/objective_c/ffigen_c.yaml b/pkgs/objective_c/ffigen_c.yaml index d9831533f..a499dc5b2 100644 --- a/pkgs/objective_c/ffigen_c.yaml +++ b/pkgs/objective_c/ffigen_c.yaml @@ -20,24 +20,24 @@ functions: - 'sel_getName' - 'protocol_getMethodDescription' - 'protocol_getName' - - 'disposeObjCBlockWithClosure' - - 'isValidBlock' - - 'isValidObject' - 'Dart_InitializeApiDL' - 'newFinalizableHandle' - - 'newBlockFinalizableHandle' - - 'deleteFinalizableHandle' - - 'newFinalizableBool' + - 'DOBJC_.*' leaf: include: - '.*' exclude: - 'objc_msgSend.*' - - 'disposeObjCBlockWithClosure' - - 'newFinalizableHandle' - - 'deleteFinalizableHandle' - - 'newFinalizableBool' + - 'DOBJC_deleteFinalizableHandle' + - 'DOBJC_disposeObjCBlockWithClosure' + - 'DOBJC_newFinalizableBool' + - 'DOBJC_newFinalizableHandle' rename: + 'DOBJC_disposeObjCBlockWithClosure': 'disposeObjCBlockWithClosure' + 'DOBJC_isValidBlock': 'isValidBlock' + 'DOBJC_newFinalizableHandle': 'newFinalizableHandle' + 'DOBJC_deleteFinalizableHandle': 'deleteFinalizableHandle' + 'DOBJC_newFinalizableBool': 'newFinalizableBool' 'sel_registerName': 'registerName' 'sel_getName': 'getName' 'objc_getClass': 'getClass' diff --git a/pkgs/objective_c/ffigen_objc.yaml b/pkgs/objective_c/ffigen_objc.yaml index 472d2d308..b7a691287 100644 --- a/pkgs/objective_c/ffigen_objc.yaml +++ b/pkgs/objective_c/ffigen_objc.yaml @@ -24,9 +24,9 @@ external-versions: objc-interfaces: # Keep in sync with ffigen's ObjCBuiltInFunctions.builtInInterfaces. include: - - DartInputStreamAdapter - - DartProxy - - DartProxyBuilder + - DOBJCDartInputStreamAdapter + - DOBJCDartProxy + - DOBJCDartProxyBuilder - NSArray - NSCharacterSet - NSCoder @@ -63,6 +63,10 @@ objc-interfaces: - NSURLHandle - NSValue - Protocol + rename: + 'DOBJCDartInputStreamAdapter': 'DartInputStreamAdapter' + 'DOBJCDartProxy': 'DartProxy' + 'DOBJCDartProxyBuilder': 'DartProxyBuilder' objc-protocols: include: - NSStreamDelegate diff --git a/pkgs/objective_c/lib/src/c_bindings_generated.dart b/pkgs/objective_c/lib/src/c_bindings_generated.dart index 15b471697..a2fc5f973 100644 --- a/pkgs/objective_c/lib/src/c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/c_bindings_generated.dart @@ -20,6 +20,16 @@ library; import 'dart:ffi' as ffi; +@ffi.Native< + ffi.Void Function( + ffi.Pointer< + ffi.NativeFunction)>>, + ffi.Pointer)>(isLeaf: true) +external void DOBJC_runOnMainThread( + ffi.Pointer)>> fn, + ffi.Pointer arg, +); + /// \mainpage Dynamically Linked Dart API /// /// This exposes a subset of symbols from dart_api.h and dart_native_api.h @@ -72,13 +82,15 @@ external ffi.Pointer> copyClassList( ffi.Pointer count, ); -@ffi.Native() +@ffi.Native( + symbol: "DOBJC_deleteFinalizableHandle") external void deleteFinalizableHandle( Dart_FinalizableHandle handle, Object owner, ); -@ffi.Native)>() +@ffi.Native)>( + symbol: "DOBJC_disposeObjCBlockWithClosure") external void disposeObjCBlockWithClosure( ffi.Pointer block, ); @@ -126,7 +138,8 @@ external ffi.Pointer getProtocolName( ffi.Pointer proto, ); -@ffi.Native)>(isLeaf: true) +@ffi.Native)>( + symbol: "DOBJC_isValidBlock", isLeaf: true) external bool isValidBlock( ffi.Pointer block, ); @@ -140,13 +153,15 @@ external void msgSendFpret(); @ffi.Native(symbol: "objc_msgSend_stret") external void msgSendStret(); -@ffi.Native Function(ffi.Handle)>() +@ffi.Native Function(ffi.Handle)>( + symbol: "DOBJC_newFinalizableBool") external ffi.Pointer newFinalizableBool( Object owner, ); @ffi.Native< - Dart_FinalizableHandle Function(ffi.Handle, ffi.Pointer)>() + Dart_FinalizableHandle Function(ffi.Handle, ffi.Pointer)>( + symbol: "DOBJC_newFinalizableHandle") external Dart_FinalizableHandle newFinalizableHandle( Object owner, ffi.Pointer object, diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart index 3fc3c4475..4a8f27735 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart @@ -93,13 +93,13 @@ class DartInputStreamAdapter extends NSInputStream { /// Returns whether [obj] is an instance of [DartInputStreamAdapter]. static bool isInstance(objc.ObjCObjectBase obj) { - return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_DartInputStreamAdapter); + return _objc_msgSend_69e0x1(obj.ref.pointer, _sel_isKindOfClass_, + _class_DOBJCDartInputStreamAdapter); } /// inputStreamWithData: static DartInputStreamAdapter? inputStreamWithData_(NSData data) { - final _ret = _objc_msgSend_62nh5j(_class_DartInputStreamAdapter, + final _ret = _objc_msgSend_62nh5j(_class_DOBJCDartInputStreamAdapter, _sel_inputStreamWithData_, data.ref.pointer); return _ret.address == 0 ? null @@ -109,7 +109,7 @@ class DartInputStreamAdapter extends NSInputStream { /// inputStreamWithFileAtPath: static DartInputStreamAdapter? inputStreamWithFileAtPath_(NSString path) { - final _ret = _objc_msgSend_62nh5j(_class_DartInputStreamAdapter, + final _ret = _objc_msgSend_62nh5j(_class_DOBJCDartInputStreamAdapter, _sel_inputStreamWithFileAtPath_, path.ref.pointer); return _ret.address == 0 ? null @@ -122,15 +122,15 @@ class DartInputStreamAdapter extends NSInputStream { /// -1 => The `NSInputStream` has been closed and the port can be closed. /// _ => The number of types being required in a `read:maxLength` call. static DartInputStreamAdapter inputStreamWithPort_(int sendPort) { - final _ret = _objc_msgSend_r25hnf( - _class_DartInputStreamAdapter, _sel_inputStreamWithPort_, sendPort); + final _ret = _objc_msgSend_r25hnf(_class_DOBJCDartInputStreamAdapter, + _sel_inputStreamWithPort_, sendPort); return DartInputStreamAdapter.castFromPointer(_ret, retain: true, release: true); } /// inputStreamWithURL: static DartInputStreamAdapter? inputStreamWithURL_(NSURL url) { - final _ret = _objc_msgSend_62nh5j(_class_DartInputStreamAdapter, + final _ret = _objc_msgSend_62nh5j(_class_DOBJCDartInputStreamAdapter, _sel_inputStreamWithURL_, url.ref.pointer); return _ret.address == 0 ? null @@ -186,14 +186,14 @@ class DartInputStreamAdapter extends NSInputStream { void stream_handleEvent_(NSStream aStream, NSStreamEvent eventCode) { if (!objc.respondsToSelector(this.ref.pointer, _sel_stream_handleEvent_)) { throw objc.UnimplementedOptionalMethodException( - 'DartInputStreamAdapter', 'stream:handleEvent:'); + 'DOBJCDartInputStreamAdapter', 'stream:handleEvent:'); } _objc_msgSend_hglvhy(this.ref.pointer, _sel_stream_handleEvent_, aStream.ref.pointer, eventCode.value); } } -/// DartProxy +/// DOBJCDartProxy class DartProxy extends NSProxy { DartProxy._(ffi.Pointer pointer, {bool retain = false, bool release = false}) @@ -211,19 +211,19 @@ class DartProxy extends NSProxy { /// Returns whether [obj] is an instance of [DartProxy]. static bool isInstance(objc.ObjCObjectBase obj) { return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_DartProxy); + obj.ref.pointer, _sel_isKindOfClass_, _class_DOBJCDartProxy); } /// alloc static objc.ObjCObjectBase alloc() { - final _ret = _objc_msgSend_1x359cv(_class_DartProxy, _sel_alloc); + final _ret = _objc_msgSend_1x359cv(_class_DOBJCDartProxy, _sel_alloc); return objc.ObjCObjectBase(_ret, retain: false, release: true); } /// newFromBuilder: static DartProxy newFromBuilder_(DartProxyBuilder builder) { final _ret = _objc_msgSend_62nh5j( - _class_DartProxy, _sel_newFromBuilder_, builder.ref.pointer); + _class_DOBJCDartProxy, _sel_newFromBuilder_, builder.ref.pointer); return DartProxy.castFromPointer(_ret, retain: false, release: true); } @@ -273,7 +273,7 @@ class DartProxy extends NSProxy { } } -/// DartProxyBuilder +/// DOBJCDartProxyBuilder class DartProxyBuilder extends NSObject { DartProxyBuilder._(ffi.Pointer pointer, {bool retain = false, bool release = false}) @@ -291,25 +291,26 @@ class DartProxyBuilder extends NSObject { /// Returns whether [obj] is an instance of [DartProxyBuilder]. static bool isInstance(objc.ObjCObjectBase obj) { return _objc_msgSend_69e0x1( - obj.ref.pointer, _sel_isKindOfClass_, _class_DartProxyBuilder); + obj.ref.pointer, _sel_isKindOfClass_, _class_DOBJCDartProxyBuilder); } /// alloc static DartProxyBuilder alloc() { - final _ret = _objc_msgSend_1x359cv(_class_DartProxyBuilder, _sel_alloc); + final _ret = + _objc_msgSend_1x359cv(_class_DOBJCDartProxyBuilder, _sel_alloc); return DartProxyBuilder.castFromPointer(_ret, retain: false, release: true); } /// allocWithZone: static DartProxyBuilder allocWithZone_(ffi.Pointer<_NSZone> zone) { final _ret = _objc_msgSend_hzlb60( - _class_DartProxyBuilder, _sel_allocWithZone_, zone); + _class_DOBJCDartProxyBuilder, _sel_allocWithZone_, zone); return DartProxyBuilder.castFromPointer(_ret, retain: false, release: true); } /// new static DartProxyBuilder new1() { - final _ret = _objc_msgSend_1x359cv(_class_DartProxyBuilder, _sel_new); + final _ret = _objc_msgSend_1x359cv(_class_DOBJCDartProxyBuilder, _sel_new); return DartProxyBuilder.castFromPointer(_ret, retain: false, release: true); } @@ -10826,10 +10827,11 @@ class Protocol extends objc.ObjCObjectBase { final class _NSZone extends ffi.Opaque {} -late final _class_DartInputStreamAdapter = - objc.getClass("DartInputStreamAdapter"); -late final _class_DartProxy = objc.getClass("DartProxy"); -late final _class_DartProxyBuilder = objc.getClass("DartProxyBuilder"); +late final _class_DOBJCDartInputStreamAdapter = + objc.getClass("DOBJCDartInputStreamAdapter"); +late final _class_DOBJCDartProxy = objc.getClass("DOBJCDartProxy"); +late final _class_DOBJCDartProxyBuilder = + objc.getClass("DOBJCDartProxyBuilder"); late final _class_NSArray = objc.getClass("NSArray"); late final _class_NSCharacterSet = objc.getClass("NSCharacterSet"); late final _class_NSCoder = objc.getClass("NSCoder"); diff --git a/pkgs/objective_c/pubspec.yaml b/pkgs/objective_c/pubspec.yaml index 5669f4725..3889e91a4 100644 --- a/pkgs/objective_c/pubspec.yaml +++ b/pkgs/objective_c/pubspec.yaml @@ -4,7 +4,7 @@ name: objective_c description: 'A library to access Objective C from Flutter that acts as a support library for package:ffigen.' -version: 4.0.0 +version: 4.0.1-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/objective_c issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aobjective_c diff --git a/pkgs/objective_c/src/input_stream_adapter.h b/pkgs/objective_c/src/input_stream_adapter.h index 77f9e42ce..6322fb94f 100644 --- a/pkgs/objective_c/src/input_stream_adapter.h +++ b/pkgs/objective_c/src/input_stream_adapter.h @@ -2,16 +2,13 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -#ifndef INPUT_STREAM_ADAPTER_H_ -#define INPUT_STREAM_ADAPTER_H_ - #include "include/dart_api_dl.h" #import #import /// Helper class to adapt a Dart stream into a `NSInputStream`. -@interface DartInputStreamAdapter : NSInputStream +@interface DOBJCDartInputStreamAdapter : NSInputStream /// Creates the adapter. /// @param sendPort A port to that is will receive two types of messages: @@ -23,5 +20,3 @@ - (void)setDone; - (void)setError:(NSError *)error; @end - -#endif // INPUT_STREAM_ADAPTER_H_ diff --git a/pkgs/objective_c/src/input_stream_adapter.m b/pkgs/objective_c/src/input_stream_adapter.m index 4ccabdfd1..08db429cd 100644 --- a/pkgs/objective_c/src/input_stream_adapter.m +++ b/pkgs/objective_c/src/input_stream_adapter.m @@ -7,7 +7,7 @@ #import #include -@implementation DartInputStreamAdapter { +@implementation DOBJCDartInputStreamAdapter { Dart_Port _sendPort; NSCondition *_dataCondition; NSMutableData *_data; @@ -18,7 +18,7 @@ @implementation DartInputStreamAdapter { } + (instancetype)inputStreamWithPort:(Dart_Port)sendPort { - DartInputStreamAdapter *stream = [[DartInputStreamAdapter alloc] init]; + DOBJCDartInputStreamAdapter *stream = [[DOBJCDartInputStreamAdapter alloc] init]; if (stream != nil) { stream->_sendPort = sendPort; stream->_dataCondition = [[NSCondition alloc] init]; diff --git a/pkgs/objective_c/src/objective_c.c b/pkgs/objective_c/src/objective_c.c index fb360ad40..29ccd3244 100644 --- a/pkgs/objective_c/src/objective_c.c +++ b/pkgs/objective_c/src/objective_c.c @@ -12,11 +12,11 @@ // Dispose helper for ObjC blocks that wrap a Dart closure. For these blocks, // the target is an int ID, and the dispose_port is listening for these IDs. -void disposeObjCBlockWithClosure(ObjCBlockImpl* block) { +void DOBJC_disposeObjCBlockWithClosure(ObjCBlockImpl* block) { Dart_PostInteger_DL(block->dispose_port, (int64_t)block->target); } -bool isValidBlock(ObjCBlockImpl* block) { +bool DOBJC_isValidBlock(ObjCBlockImpl* block) { if (block == NULL) return false; void* isa = block->isa; return isa == &_NSConcreteStackBlock || isa == &_NSConcreteMallocBlock || @@ -24,23 +24,23 @@ bool isValidBlock(ObjCBlockImpl* block) { isa == &_NSConcreteGlobalBlock || isa == &_NSConcreteWeakBlockVariable; } -void finalizeObject(void* isolate_callback_data, void* peer) { +void DOBJC_finalizeObject(void* isolate_callback_data, void* peer) { // objc_release works for Objects and Blocks. - runOnMainThread((void (*)(void*))objc_release, peer); + DOBJC_runOnMainThread((void (*)(void*))objc_release, peer); } -Dart_FinalizableHandle newFinalizableHandle(Dart_Handle owner, +Dart_FinalizableHandle DOBJC_newFinalizableHandle(Dart_Handle owner, ObjCObject* object) { - return Dart_NewFinalizableHandle_DL(owner, object, 0, finalizeObject); + return Dart_NewFinalizableHandle_DL(owner, object, 0, DOBJC_finalizeObject); } -void deleteFinalizableHandle(Dart_FinalizableHandle handle, Dart_Handle owner) { +void DOBJC_deleteFinalizableHandle(Dart_FinalizableHandle handle, Dart_Handle owner) { Dart_DeleteFinalizableHandle_DL(handle, owner); } -void finalizeMalloc(void* isolate_callback_data, void* peer) { free(peer); } +static void finalizeMalloc(void* isolate_callback_data, void* peer) { free(peer); } -bool* newFinalizableBool(Dart_Handle owner) { +bool* DOBJC_newFinalizableBool(Dart_Handle owner) { bool* pointer = (bool*)malloc(1); *pointer = false; Dart_NewFinalizableHandle_DL(owner, pointer, 1, finalizeMalloc); diff --git a/pkgs/objective_c/src/objective_c.h b/pkgs/objective_c/src/objective_c.h index 8f66066b0..8d64c9ba1 100644 --- a/pkgs/objective_c/src/objective_c.h +++ b/pkgs/objective_c/src/objective_c.h @@ -9,24 +9,24 @@ #include "objective_c_runtime.h" // Dispose helper for ObjC blocks that wrap a Dart closure. -void disposeObjCBlockWithClosure(ObjCBlockImpl* block); +void DOBJC_disposeObjCBlockWithClosure(ObjCBlockImpl* block); // Returns whether the block is valid and live. The pointer must point to // readable memory, or be null. May (rarely) return false positives. -bool isValidBlock(ObjCBlockImpl* block); +bool DOBJC_isValidBlock(ObjCBlockImpl* block); // Returns a new Dart_FinalizableHandle that will clean up the object when the // Dart owner is garbage collected. -Dart_FinalizableHandle newFinalizableHandle( +Dart_FinalizableHandle DOBJC_newFinalizableHandle( Dart_Handle owner, ObjCObject *object); // Delete a finalizable handle. Doesn't run the finalization callback, so // doesn't clean up the assocated pointer. -void deleteFinalizableHandle(Dart_FinalizableHandle handle, Dart_Handle owner); +void DOBJC_deleteFinalizableHandle(Dart_FinalizableHandle handle, Dart_Handle owner); // Returns a newly allocated bool* (initialized to false) that will be deleted // by a Dart_FinalizableHandle when the owner is garbage collected. -bool* newFinalizableBool(Dart_Handle owner); +bool* DOBJC_newFinalizableBool(Dart_Handle owner); // Runs fn(arg) on the main thread. If runOnMainThread is already running on the // main thread, fn(arg) is invoked synchronously. Otherwise it is dispatched to @@ -35,6 +35,6 @@ bool* newFinalizableBool(Dart_Handle owner); // This assumes that the main thread is executing its queue. If not, #define // NO_MAIN_THREAD_DISPATCH to disable this, and run fn(arg) synchronously. The // flutter runner does execute the main dispatch queue, but the Dart VM doesn't. -void runOnMainThread(void (*fn)(void*), void* arg); +void DOBJC_runOnMainThread(void (*fn)(void*), void* arg); #endif // OBJECTIVE_C_SRC_OBJECTIVE_C_H_ diff --git a/pkgs/objective_c/src/objective_c.m b/pkgs/objective_c/src/objective_c.m index 5cf87fe48..b3256e09f 100644 --- a/pkgs/objective_c/src/objective_c.m +++ b/pkgs/objective_c/src/objective_c.m @@ -5,7 +5,7 @@ #import #import -void runOnMainThread(void (*fn)(void*), void* arg) { +void DOBJC_runOnMainThread(void (*fn)(void*), void* arg) { #ifdef NO_MAIN_THREAD_DISPATCH fn(arg); #else diff --git a/pkgs/objective_c/src/proxy.h b/pkgs/objective_c/src/proxy.h index adb2955be..2857172b1 100644 --- a/pkgs/objective_c/src/proxy.h +++ b/pkgs/objective_c/src/proxy.h @@ -7,7 +7,7 @@ #import -@interface DartProxyBuilder : NSObject +@interface DOBJCDartProxyBuilder : NSObject + (instancetype)new; - (instancetype)init; - (void)implementMethod:(SEL) sel @@ -15,9 +15,9 @@ andBlock:(void*)block; @end -@interface DartProxy : NSProxy -+ (instancetype)newFromBuilder:(__strong DartProxyBuilder*)builder; -- (instancetype)initFromBuilder:(__strong DartProxyBuilder*)builder; +@interface DOBJCDartProxy : NSProxy ++ (instancetype)newFromBuilder:(__strong DOBJCDartProxyBuilder*)builder; +- (instancetype)initFromBuilder:(__strong DOBJCDartProxyBuilder*)builder; - (BOOL)respondsToSelector:(SEL)sel; - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel; - (void)forwardInvocation:(__strong NSInvocation *)invocation; diff --git a/pkgs/objective_c/src/proxy.m b/pkgs/objective_c/src/proxy.m index 570ccfa20..3307f3e28 100644 --- a/pkgs/objective_c/src/proxy.m +++ b/pkgs/objective_c/src/proxy.m @@ -13,14 +13,14 @@ #error "This file must be compiled with ARC enabled" #endif -@interface ProxyMethod : NSObject +@interface DOBJCProxyMethod : NSObject @property(strong) NSMethodSignature *signature; @property(strong) id block; @end -@implementation ProxyMethod +@implementation DOBJCProxyMethod @end -@implementation DartProxyBuilder { +@implementation DOBJCDartProxyBuilder { NSMutableDictionary *methods; } @@ -35,7 +35,7 @@ - (instancetype)init { return self; } -- (void)implement:(SEL)sel withMethod:(ProxyMethod*)m { +- (void)implement:(SEL)sel withMethod:(DOBJCProxyMethod*)m { @synchronized(methods) { [methods setObject:m forKey:[NSValue valueWithPointer:sel]]; } @@ -44,7 +44,7 @@ - (void)implement:(SEL)sel withMethod:(ProxyMethod*)m { - (void)implementMethod:(SEL)sel withSignature:(NSMethodSignature *)signature andBlock:(void*)block { - ProxyMethod *m = [ProxyMethod new]; + DOBJCProxyMethod *m = [DOBJCProxyMethod new]; m.signature = signature; m.block = (__bridge id)block; [self implement:sel withMethod:m]; @@ -55,19 +55,19 @@ - (NSDictionary*)copyMethods NS_RETURNS_RETAINED { } @end -@implementation DartProxy { +@implementation DOBJCDartProxy { NSDictionary *methods; } -- (ProxyMethod*)getMethod:(SEL)sel { +- (DOBJCProxyMethod*)getMethod:(SEL)sel { return [methods objectForKey:[NSValue valueWithPointer:sel]]; } -+ (instancetype)newFromBuilder:(DartProxyBuilder*)builder { ++ (instancetype)newFromBuilder:(DOBJCDartProxyBuilder*)builder { return [[self alloc] initFromBuilder:builder]; } -- (instancetype)initFromBuilder:(DartProxyBuilder*)builder { +- (instancetype)initFromBuilder:(DOBJCDartProxyBuilder*)builder { if (self) { methods = [builder copyMethods]; } @@ -79,13 +79,13 @@ - (BOOL)respondsToSelector:(SEL)sel { } - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { - ProxyMethod *m = [self getMethod:sel]; + DOBJCProxyMethod *m = [self getMethod:sel]; return m != nil ? m.signature : nil; } - (void)forwardInvocation:(NSInvocation *)invocation { [invocation retainArguments]; - ProxyMethod *m = [self getMethod:invocation.selector]; + DOBJCProxyMethod *m = [self getMethod:invocation.selector]; if (m != nil) { [invocation invokeWithTarget:m.block]; } diff --git a/pkgs/objective_c/test/interface_lists_test.dart b/pkgs/objective_c/test/interface_lists_test.dart index 3f8a73365..410697890 100644 --- a/pkgs/objective_c/test/interface_lists_test.dart +++ b/pkgs/objective_c/test/interface_lists_test.dart @@ -24,9 +24,12 @@ void main() { setUpAll(() { final yaml = loadYaml(File('ffigen_objc.yaml').readAsStringSync()) as YamlMap; + final interfaceRenames = + (yaml['objc-interfaces'] as YamlMap)['rename'] as YamlMap; yamlInterfaces = ((yaml['objc-interfaces'] as YamlMap)['include'] as YamlList) - .map((dynamic i) => i as String) + .map( + (dynamic name) => (interfaceRenames[name] ?? name) as String) .toList() ..sort(); final structRenames = (yaml['structs'] as YamlMap)['rename'] as YamlMap; diff --git a/pkgs/objective_c/test/setup.dart b/pkgs/objective_c/test/setup.dart index 95e707bce..c9dcc83bb 100644 --- a/pkgs/objective_c/test/setup.dart +++ b/pkgs/objective_c/test/setup.dart @@ -90,10 +90,10 @@ void main(List arguments) { // Sanity check that the dylib was created correctly. final lib = DynamicLibrary.open(outputFile); - lib.lookup('disposeObjCBlockWithClosure'); // objective_c.c - lib.lookup('runOnMainThread'); // objective_c.m + lib.lookup('DOBJC_disposeObjCBlockWithClosure'); // objective_c.c + lib.lookup('DOBJC_runOnMainThread'); // objective_c.m lib.lookup('Dart_InitializeApiDL'); // dart_api_dl.c - lib.lookup('OBJC_CLASS_\$_DartProxy'); // proxy.m + lib.lookup('OBJC_CLASS_\$_DOBJCDartProxy'); // proxy.m // objective_c_bindings_generated.m lib.lookup('_ObjectiveCBindings_wrapListenerBlock_ovsamd'); } From 8165cbbb5f24489a167e689d0e7325a562a553c7 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 19 Nov 2024 09:00:03 +1100 Subject: [PATCH 03/50] [swift2objc] More little fixes (#1729) --- .../lib/src/ast/_core/shared/parameter.dart | 3 +++ .../src/ast/_core/shared/referred_type.dart | 3 +++ .../compounds/members/method_declaration.dart | 5 ++++ pkgs/swift2objc/lib/src/config.dart | 2 +- .../lib/src/parser/_core/utils.dart | 24 +++++++++++++++++++ .../parse_compound_declaration.dart | 5 +++- .../parser/parsers/parse_declarations.dart | 4 ++++ .../src/transformer/transformers/const.dart | 8 +++++++ .../transformers/transform_compound.dart | 2 ++ .../transformers/transform_function.dart | 7 +++++- .../transformers/transform_variable.dart | 7 +++++- 11 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 pkgs/swift2objc/lib/src/transformer/transformers/const.dart diff --git a/pkgs/swift2objc/lib/src/ast/_core/shared/parameter.dart b/pkgs/swift2objc/lib/src/ast/_core/shared/parameter.dart index 0d82bb7b1..19b4421fc 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/shared/parameter.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/shared/parameter.dart @@ -15,4 +15,7 @@ class Parameter { this.internalName, required this.type, }); + + @override + String toString() => '$name $internalName: $type'; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart index b9cf0bad1..268be6eb1 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart @@ -45,6 +45,9 @@ class DeclaredType implements ReferredType { required this.declaration, this.typeParams = const [], }); + + @override + String toString() => name; } /// Describes a reference of a generic type diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart index 49e8575eb..1a312ac82 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart @@ -38,6 +38,11 @@ class MethodDeclaration bool isStatic; + String get fullName => [ + name, + for (final p in params) p.name, + ].join(':'); + MethodDeclaration({ required this.id, required this.name, diff --git a/pkgs/swift2objc/lib/src/config.dart b/pkgs/swift2objc/lib/src/config.dart index ad803c737..4f2ac6eba 100644 --- a/pkgs/swift2objc/lib/src/config.dart +++ b/pkgs/swift2objc/lib/src/config.dart @@ -96,7 +96,7 @@ class ModuleInputConfig implements InputConfig { @override Command? get symbolgraphCommand => Command( - executable: 'swiftc', + executable: 'swift', args: [ 'symbolgraph-extract', '-module-name', diff --git a/pkgs/swift2objc/lib/src/parser/_core/utils.dart b/pkgs/swift2objc/lib/src/parser/_core/utils.dart index baf2e7f37..698bfb5bc 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/utils.dart @@ -88,3 +88,27 @@ ReferredType parseTypeFromId(String typeId, ParsedSymbolgraph symbolgraph) { return paramTypeDeclaration.asDeclaredType; } + +final class ObsoleteException implements Exception { + final String symbol; + ObsoleteException(this.symbol); + + @override + String toString() => '$runtimeType: Symbol is obsolete: $symbol'; +} + +bool isObsoleted(Json symbolJson) { + final availability = symbolJson['availability']; + if (!availability.exists) return false; + for (final entry in availability) { + if (entry['domain'].get() == 'Swift' && entry['obsoleted'].exists) { + return true; + } + } + return false; +} + +extension Deduper on Iterable { + Iterable dedupeBy(K Function(T) id) => + {for (final t in this) id(t): t}.values; +} diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart index 8b10ac69e..20b05aa3d 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart @@ -61,10 +61,13 @@ T _parseCompoundDeclaration( }, ) .nonNulls + .dedupeBy((decl) => decl.id) .toList(); compound.methods.addAll( - memberDeclarations.whereType(), + memberDeclarations + .whereType() + .dedupeBy((m) => m.fullName), ); compound.properties.addAll( memberDeclarations.whereType(), diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart index e3aa57322..674e0ac5c 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart @@ -35,6 +35,10 @@ Declaration parseDeclaration( final symbolJson = parsedSymbol.json; + if (isObsoleted(symbolJson)) { + throw ObsoleteException(parseSymbolId(symbolJson)); + } + final symbolType = symbolJson['kind']['identifier'].get(); parsedSymbol.declaration = switch (symbolType) { diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/const.dart b/pkgs/swift2objc/lib/src/transformer/transformers/const.dart new file mode 100644 index 000000000..8881e8b21 --- /dev/null +++ b/pkgs/swift2objc/lib/src/transformer/transformers/const.dart @@ -0,0 +1,8 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Certain methods are not allowed to be overriden in swift. +const disallowedMethods = { + 'hashValue', +}; diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart index 84a7208c9..989f530a8 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart @@ -48,6 +48,7 @@ ClassDeclaration transformCompound( globalNamer, transformationMap, )) + .nonNulls .toList() ..sort((Declaration a, Declaration b) => a.id.compareTo(b.id)); @@ -68,6 +69,7 @@ ClassDeclaration transformCompound( globalNamer, transformationMap, )) + .nonNulls .toList() ..sort((Declaration a, Declaration b) => a.id.compareTo(b.id)); diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart index e0b42daaf..5f6cfd830 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart @@ -11,6 +11,7 @@ import '../../ast/declarations/globals/globals.dart'; import '../_core/unique_namer.dart'; import '../_core/utils.dart'; import '../transform.dart'; +import 'const.dart'; import 'transform_referred_type.dart'; // The main difference between generating a wrapper method for a global function @@ -19,12 +20,16 @@ import 'transform_referred_type.dart'; // wrapped class instance in the wrapper class. In global function case, // it can be referenced directly since it's not a member of any entity. -MethodDeclaration transformMethod( +MethodDeclaration? transformMethod( MethodDeclaration originalMethod, PropertyDeclaration wrappedClassInstance, UniqueNamer globalNamer, TransformationMap transformationMap, ) { + if (disallowedMethods.contains(originalMethod.name)) { + return null; + } + return _transformFunction( originalMethod, globalNamer, diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart index 75382bfdd..fd0c20892 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart @@ -4,6 +4,7 @@ import '../../ast/declarations/globals/globals.dart'; import '../_core/unique_namer.dart'; import '../_core/utils.dart'; import '../transform.dart'; +import 'const.dart'; import 'transform_referred_type.dart'; // The main difference between generating a wrapper property for a global @@ -12,12 +13,16 @@ import 'transform_referred_type.dart'; // through the wrapped class instance in the wrapper class. In global variable // case, it can be referenced directly since it's not a member of any entity. -PropertyDeclaration transformProperty( +PropertyDeclaration? transformProperty( PropertyDeclaration originalProperty, PropertyDeclaration wrappedClassInstance, UniqueNamer globalNamer, TransformationMap transformationMap, ) { + if (disallowedMethods.contains(originalProperty.name)) { + return null; + } + final propertySource = originalProperty.isStatic ? wrappedClassInstance.type.name : wrappedClassInstance.name; From b2aca7e77f41b79d7c836971b6747facbfc0adc0 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 20 Nov 2024 09:04:13 +1100 Subject: [PATCH 04/50] [swift2objc] Support failable initializers (#1734) --- .../members/initializer_declaration.dart | 3 + .../generator/generators/class_generator.dart | 8 +- .../swift2objc/lib/src/parser/_core/json.dart | 4 + .../lib/src/parser/_core/utils.dart | 23 ++- .../parse_initializer_declaration.dart | 29 ++-- .../src/transformer/_core/unique_namer.dart | 7 +- .../lib/src/transformer/_core/utils.dart | 4 + .../transformers/transform_compound.dart | 1 + .../transformers/transform_initializer.dart | 19 ++- .../classes_and_initializers_input.swift | 9 ++ .../classes_and_initializers_output.swift | 8 + .../test/integration/integration_test.dart | 5 + .../structs_and_initializers_input.swift | 9 ++ .../structs_and_initializers_output.swift | 8 + .../unit/parse_initializer_param_test.dart | 150 ++++++++---------- 15 files changed, 178 insertions(+), 109 deletions(-) diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart index 15c4dd6be..287afbbbf 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart @@ -29,6 +29,8 @@ class InitializerDeclaration @override bool isOverriding; + bool isFailable; + @override List params; @@ -41,5 +43,6 @@ class InitializerDeclaration this.statements = const [], required this.hasObjCAnnotation, required this.isOverriding, + required this.isFailable, }); } diff --git a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart index 56a1bdb6f..9f335e26f 100644 --- a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart @@ -68,7 +68,13 @@ List _generateInitializers(ClassDeclaration declaration) { header.write('override '); } - header.write('init(${generateParameters(initializer.params)})'); + header.write('init'); + + if (initializer.isFailable) { + header.write('?'); + } + + header.write('(${generateParameters(initializer.params)})'); return ['$header {', initializer.statements.join('\n').indent(), '}'] .join('\n'); diff --git a/pkgs/swift2objc/lib/src/parser/_core/json.dart b/pkgs/swift2objc/lib/src/parser/_core/json.dart index c2b7b711e..3f8fd5a59 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/json.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/json.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:collection'; +import 'dart:convert'; /// This is a helper class that helps with parsing Json values. It supports /// accessing the json content using the subscript syntax similar to `List` @@ -101,6 +102,9 @@ class Json extends IterableBase { ), ); } + + @override + String toString() => jsonEncode(_json); } class _JsonIterator implements Iterator { diff --git a/pkgs/swift2objc/lib/src/parser/_core/utils.dart b/pkgs/swift2objc/lib/src/parser/_core/utils.dart index 698bfb5bc..9bb0ba3d7 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/utils.dart @@ -38,6 +38,11 @@ extension TopLevelOnly on List { ).toList(); } +/// Matches fragments, which look like {"kind": "foo", "spelling": "bar"}. +bool matchFragment(Json fragment, String kind, String spelling) => + fragment['kind'].get() == kind && + fragment['spelling'].get() == spelling; + String parseSymbolId(Json symbolJson) { final idJson = symbolJson['identifier']['precise']; final id = idJson.get(); @@ -56,23 +61,13 @@ String parseSymbolName(Json symbolJson) { } bool parseSymbolHasObjcAnnotation(Json symbolJson) { - return symbolJson['declarationFragments'].any( - (json) => - json['kind'].exists && - json['kind'].get() == 'attribute' && - json['spelling'].exists && - json['spelling'].get() == '@objc', - ); + return symbolJson['declarationFragments'] + .any((json) => matchFragment(json, 'attribute', '@objc')); } bool parseIsOverriding(Json symbolJson) { - return symbolJson['declarationFragments'].any( - (json) => - json['kind'].exists && - json['kind'].get() == 'keyword' && - json['spelling'].exists && - json['spelling'].get() == 'override', - ); + return symbolJson['declarationFragments'] + .any((json) => matchFragment(json, 'keyword', 'override')); } ReferredType parseTypeFromId(String typeId, ParsedSymbolgraph symbolgraph) { diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index bbd26f254..d5cb9192f 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -8,22 +8,33 @@ InitializerDeclaration parseInitializerDeclaration( Json initializerSymbolJson, ParsedSymbolgraph symbolgraph, ) { + final id = parseSymbolId(initializerSymbolJson); + + // Initializers don't have `functionSignature` field in symbolgraph like + // methods do, so we have our only option is to use `declarationFragments`. + final declarationFragments = initializerSymbolJson['declarationFragments']; + + // All initializers should start with an `init` keyword. + if (!matchFragment(declarationFragments[0], 'keyword', 'init')) { + throw Exception('Invalid initializer at ${declarationFragments.path}: $id'); + } + return InitializerDeclaration( - id: parseSymbolId(initializerSymbolJson), - params: parseInitializerParams(initializerSymbolJson, symbolgraph), + id: id, + params: parseInitializerParams(declarationFragments, symbolgraph), hasObjCAnnotation: parseSymbolHasObjcAnnotation(initializerSymbolJson), isOverriding: parseIsOverriding(initializerSymbolJson), + isFailable: parseIsFailableInit(id, declarationFragments), ); } +bool parseIsFailableInit(String id, Json declarationFragments) => + matchFragment(declarationFragments[1], 'text', '?('); + List parseInitializerParams( - Json initializerSymbolJson, + Json declarationFragments, ParsedSymbolgraph symbolgraph, ) { - // Initializers don't have `functionSignature` field in symbolgraph like - // methods do, so we have our only option is to use `declarationFragments`. - final fragments = initializerSymbolJson['declarationFragments']; - // `declarationFragments` describes each part of the initializer declaration, // things like `init` keyword, brackets, spaces, etc. We only care about the // parameter fragments here, and they always appear in this order: @@ -51,7 +62,7 @@ List parseInitializerParams( final parameters = []; - for (final fragmentJson in fragments) { + for (final fragmentJson in declarationFragments) { final kind = fragmentJson['kind'].get(); final invalidOrderException = Exception( 'Invalid fragments order at ${fragmentJson.path}', @@ -94,7 +105,7 @@ List parseInitializerParams( // of `declarationFragments` array. if (externalParam != null || internalParam != null || typeId != null) { throw Exception( - 'Missing parameter fragments at the end of ${fragments.path}', + 'Missing parameter fragments at the end of ${declarationFragments.path}', ); } diff --git a/pkgs/swift2objc/lib/src/transformer/_core/unique_namer.dart b/pkgs/swift2objc/lib/src/transformer/_core/unique_namer.dart index 9af08ae67..8a13e1202 100644 --- a/pkgs/swift2objc/lib/src/transformer/_core/unique_namer.dart +++ b/pkgs/swift2objc/lib/src/transformer/_core/unique_namer.dart @@ -1,9 +1,14 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + import '../../ast/_core/interfaces/compound_declaration.dart'; class UniqueNamer { final Set _usedNames; - UniqueNamer(Iterable usedNames) : _usedNames = usedNames.toSet(); + UniqueNamer([Iterable usedNames = const []]) + : _usedNames = usedNames.toSet(); UniqueNamer.inCompound(CompoundDeclaration compoundDeclaration) : _usedNames = { diff --git a/pkgs/swift2objc/lib/src/transformer/_core/utils.dart b/pkgs/swift2objc/lib/src/transformer/_core/utils.dart index 8561d6a0f..33b99b58d 100644 --- a/pkgs/swift2objc/lib/src/transformer/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/transformer/_core/utils.dart @@ -1,3 +1,7 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + import '../../ast/_core/interfaces/declaration.dart'; import '../../ast/_core/shared/referred_type.dart'; import '../../ast/declarations/compounds/class_declaration.dart'; diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart index 989f530a8..7ccd5f0b0 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart @@ -89,6 +89,7 @@ InitializerDeclaration _buildWrapperInitializer( ) ], isOverriding: false, + isFailable: false, statements: ['self.${wrappedClassInstance.name} = wrappedInstance'], hasObjCAnnotation: wrappedClassInstance.hasObjCAnnotation, ); diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart index 2d5667041..2fa043edd 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart @@ -34,6 +34,7 @@ InitializerDeclaration transformInitializer( id: originalInitializer.id, params: transformedParams, hasObjCAnnotation: true, + isFailable: originalInitializer.isFailable, // Because the wrapper class extends NSObject that has an initializer with // no parameters. If we make a similar parameterless initializer we need // to add `override` keyword. @@ -54,13 +55,14 @@ List _generateInitializerStatements( InitializerDeclaration transformedInitializer, ) { final argumentsList = []; + final localNamer = UniqueNamer(); for (var i = 0; i < originalInitializer.params.length; i++) { final originalParam = originalInitializer.params[i]; final transformedParam = transformedInitializer.params[i]; - final transformedParamName = - transformedParam.internalName ?? transformedParam.name; + final transformedParamName = localNamer + .makeUnique(transformedParam.internalName ?? transformedParam.name); final (unwrappedParamValue, unwrappedType) = maybeUnwrapValue( transformedParam.type, @@ -77,5 +79,16 @@ List _generateInitializerStatements( final arguments = argumentsList.join(', '); final instanceConstruction = '${wrappedClassInstance.type.name}($arguments)'; - return ['${wrappedClassInstance.name} = $instanceConstruction']; + if (originalInitializer.isFailable) { + final instance = localNamer.makeUnique('instance'); + return [ + 'if let $instance = $instanceConstruction {', + ' ${wrappedClassInstance.name} = $instance', + '} else {', + ' return nil', + '}', + ]; + } else { + return ['${wrappedClassInstance.name} = $instanceConstruction']; + } } diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift index e8ce0fbab..46977f5ab 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift @@ -8,6 +8,15 @@ public class MyClass { self.representableProperty = representableProperty self.customProperty = customProperty } + + public init?(outerLabel x: Int) { + if x == 0 { + return nil + } else { + self.representableProperty = x + self.customProperty = MyOtherClass() + } + } } public class MyOtherClass {} diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift index 7d4604b22..235624df8 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift @@ -32,4 +32,12 @@ import Foundation @objc init(outerLabel representableProperty: Int, customProperty: MyOtherClassWrapper) { wrappedInstance = MyClass(outerLabel: representableProperty, customProperty: customProperty.wrappedInstance) } + + @objc init?(outerLabel x: Int) { + if let instance = MyClass(outerLabel: x) { + wrappedInstance = instance + } else { + return nil + } + } } diff --git a/pkgs/swift2objc/test/integration/integration_test.dart b/pkgs/swift2objc/test/integration/integration_test.dart index 5a1317d3d..e762ce9cb 100644 --- a/pkgs/swift2objc/test/integration/integration_test.dart +++ b/pkgs/swift2objc/test/integration/integration_test.dart @@ -4,6 +4,7 @@ import 'dart:io'; +import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:swift2objc/swift2objc.dart'; import 'package:test/test.dart'; @@ -11,6 +12,10 @@ import 'package:test/test.dart'; const regenerateExpectedOutputs = false; void main() { + Logger.root.onRecord.listen((record) { + stderr.writeln('${record.level.name}: ${record.message}'); + }); + group('Integration tests', () { const inputSuffix = '_input.swift'; const outputSuffix = '_output.swift'; diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift index f8617f0e2..fa505854d 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift @@ -8,6 +8,15 @@ public class MyStruct { self.representableProperty = representableProperty self.customProperty = customProperty } + + public init?(outerLabel x: Int) { + if x == 0 { + return nil + } else { + self.representableProperty = x + self.customProperty = MyOtherStruct() + } + } } public struct MyOtherStruct {} diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift index 72ee5e4ea..14031a883 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift @@ -20,4 +20,12 @@ import Foundation @objc init(outerLabel representableProperty: Int, customProperty: MyOtherStructWrapper) { wrappedInstance = MyStruct(outerLabel: representableProperty, customProperty: customProperty.wrappedInstance) } + + @objc init?(outerLabel x: Int) { + if let instance = MyStruct(outerLabel: x) { + wrappedInstance = instance + } else { + return nil + } + } } diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart b/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart index 05693aa35..26a7707ec 100644 --- a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart +++ b/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart @@ -34,30 +34,28 @@ void main() { test('Two params with one internal name', () { final json = Json(jsonDecode( ''' - { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "externalParam", "spelling": "outerLabel" }, - { "kind": "text", "spelling": " " }, - { "kind": "internalParam", "spelling": "internalLabel" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ", " }, - { "kind": "externalParam", "spelling": "singleLabel" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ")" } - ] - } + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "outerLabel" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "internalLabel" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ", " }, + { "kind": "externalParam", "spelling": "singleLabel" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] ''', )); @@ -80,20 +78,18 @@ void main() { test('One param', () { final json = Json(jsonDecode( ''' - { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "externalParam", "spelling": "parameter" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ")" } - ] - } + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] ''', )); @@ -112,12 +108,10 @@ void main() { test('No params', () { final json = Json(jsonDecode( ''' - { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "()" } - ] - } + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "()" } + ] ''', )); @@ -131,20 +125,18 @@ void main() { test('Parameter with no outer label', () { final json = Json(jsonDecode( ''' - { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "internalParam", "spelling": "internalLabel" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ")" } - ] - } + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "internalParam", "spelling": "internalLabel" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] ''', )); @@ -157,16 +149,14 @@ void main() { test('Parameter with no type', () { final json = Json(jsonDecode( ''' - { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "externalParam", "spelling": "outerLabel" }, - { "kind": "text", "spelling": " " }, - { "kind": "internalParam", "spelling": "internalLabel" }, - { "kind": "text", "spelling": ")" } - ] - } + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "outerLabel" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "internalLabel" }, + { "kind": "text", "spelling": ")" } + ] ''', )); @@ -179,19 +169,17 @@ void main() { test('Parameter with just a type (no label)', () { final json = Json(jsonDecode( ''' - { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ")" } - ] - } + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ")" } + ] ''', )); From 9b8d79b4c67def0347a0024a139bd86a68f9bd08 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 20 Nov 2024 09:04:28 +1100 Subject: [PATCH 05/50] Support globals with explicit getters/setters (#1733) --- .../parse_variable_declaration.dart | 4 +++- .../global_variables_and_functions_input.swift | 3 +++ .../global_variables_and_functions_output.swift | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart index 783c6bb48..171fc2acf 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart @@ -29,11 +29,13 @@ GlobalVariableDeclaration parseGlobalVariableDeclaration( ParsedSymbolgraph symbolgraph, { bool isStatic = false, }) { + final isConstant = _parseVariableIsConstant(variableSymbolJson); + final hasSetter = _parsePropertyHasSetter(variableSymbolJson); return GlobalVariableDeclaration( id: parseSymbolId(variableSymbolJson), name: parseSymbolName(variableSymbolJson), type: _parseVariableType(variableSymbolJson, symbolgraph), - isConstant: _parseVariableIsConstant(variableSymbolJson), + isConstant: isConstant || !hasSetter, ); } diff --git a/pkgs/swift2objc/test/integration/global_variables_and_functions_input.swift b/pkgs/swift2objc/test/integration/global_variables_and_functions_input.swift index cd838a0df..8f7a222a6 100644 --- a/pkgs/swift2objc/test/integration/global_variables_and_functions_input.swift +++ b/pkgs/swift2objc/test/integration/global_variables_and_functions_input.swift @@ -6,6 +6,9 @@ public let globalRepresentableConstant = 1 public var globalCustomVariable = MyOtherClass() public let globalCustomConstant = MyOtherClass() +public var globalGetterVariable: Double { get { 123 } } +public var globalSetterVariable: Double { get { 123 } set {} } + public func globalCustomFunction(label1 param1: Int, param2: MyOtherClass) -> MyOtherClass { return MyOtherClass() } diff --git a/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift b/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift index 79e680af0..9409f4d2d 100644 --- a/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift +++ b/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift @@ -18,6 +18,21 @@ import Foundation } } + @objc static public var globalGetterVariableWrapper: Double { + get { + globalGetterVariable + } + } + + @objc static public var globalSetterVariableWrapper: Double { + get { + globalSetterVariable + } + set { + globalSetterVariable = newValue + } + } + @objc static public var globalRepresentableConstantWrapper: Int { get { globalRepresentableConstant From ee2215e57292c90de302a56df7c8e42d09a47509 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Tue, 19 Nov 2024 14:15:39 -0800 Subject: [PATCH 06/50] Annotate variables used in `NSCAssert` as being possibly unused (#1736) --- pkgs/objective_c/src/input_stream_adapter.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/objective_c/src/input_stream_adapter.m b/pkgs/objective_c/src/input_stream_adapter.m index 08db429cd..1dbc386a1 100644 --- a/pkgs/objective_c/src/input_stream_adapter.m +++ b/pkgs/objective_c/src/input_stream_adapter.m @@ -73,7 +73,7 @@ - (void)close { [_dataCondition lock]; _status = NSStreamStatusClosed; if (!_done && _error == nil) { - const bool success = Dart_PostInteger_DL(_sendPort, -1); + __unused const bool success = Dart_PostInteger_DL(_sendPort, -1); NSCAssert(success, @"DartInputStreamAdapter: Dart_PostCObject_DL failed."); } [_dataCondition unlock]; @@ -122,7 +122,7 @@ - (NSInteger)read:(uint8_t *)buffer maxLength:(NSUInteger)len { [_dataCondition lock]; while (([_data length] == 0) && !_done && _error == nil) { - const bool success = Dart_PostInteger_DL(_sendPort, len); + __unused const bool success = Dart_PostInteger_DL(_sendPort, len); NSCAssert(success, @"DartInputStreamAdapter: Dart_PostCObject_DL failed."); [_dataCondition wait]; From 7afad0b895d87e684520bc7bf1f67195154fdd7c Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 20 Nov 2024 17:14:07 +0100 Subject: [PATCH 07/50] [native_toolchain_c] Use 16 kb pages for Android by default (#1740) Closes: https://github.com/dart-lang/native/issues/1611 --- pkgs/native_toolchain_c/CHANGELOG.md | 3 ++ .../lib/src/cbuilder/run_cbuilder.dart | 3 ++ .../cbuilder/cbuilder_cross_android_test.dart | 31 ++++++++++++- pkgs/native_toolchain_c/test/helpers.dart | 45 +++++++++++++++++++ 4 files changed, 80 insertions(+), 2 deletions(-) diff --git a/pkgs/native_toolchain_c/CHANGELOG.md b/pkgs/native_toolchain_c/CHANGELOG.md index 30e6d1e13..f23a38722 100644 --- a/pkgs/native_toolchain_c/CHANGELOG.md +++ b/pkgs/native_toolchain_c/CHANGELOG.md @@ -1,5 +1,8 @@ ## 0.6.1-wip +- For Android, produce dylibs with page-size set to 16kb by default. + https://github.com/dart-lang/native/issues/1611 + ## 0.6.0 - Address analyzer info diagnostic about multi-line if requiring a block body. diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart index 4bbbe69a3..3b3327059 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart @@ -276,6 +276,9 @@ class RunCBuilder { cppLinkStdLib ?? defaultCppLinkStdLib[config.targetOS]! ], ...linkerOptions?.preSourcesFlags(toolInstance.tool, sourceFiles) ?? [], + // Support Android 15 page size by default, can be overridden by + // passing [flags]. + if (config.targetOS == OS.android) '-Wl,-z,max-page-size=16384', ...flags, for (final MapEntry(key: name, :value) in defines.entries) if (value == null) '-D$name' else '-D$name=$value', diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index 2225a8bd9..e44305e44 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -67,6 +67,9 @@ void main() { .firstWhere((e) => e.contains('file format')); expect(machine, contains(objdumpFileFormat[target])); } + if (linkMode == DynamicLoadingBundled()) { + await expectPageSize(libUri, 16 * 1024); + } }); } } @@ -95,14 +98,37 @@ void main() { // Identical API levels should lead to an identical binary. expect(bytes2, bytes3); }); + + test('page size override', () async { + const target = Architecture.arm64; + final linkMode = DynamicLoadingBundled(); + const apiLevel1 = flutterAndroidNdkVersionLowestSupported; + final tempUri = await tempDirForTest(); + final outUri = tempUri.resolve('out1/'); + await Directory.fromUri(outUri).create(); + const pageSize = 4 * 1024; + final libUri = await buildLib( + outUri, + target, + apiLevel1, + linkMode, + flags: ['-Wl,-z,max-page-size=$pageSize'], + ); + if (Platform.isMacOS || Platform.isLinux) { + final address = await textSectionAddress(libUri); + expect(address, greaterThanOrEqualTo(pageSize)); + expect(address, isNot(greaterThanOrEqualTo(pageSize * 4))); + } + }); } Future buildLib( Uri tempUri, Architecture targetArchitecture, int androidNdkApi, - LinkMode linkMode, -) async { + LinkMode linkMode, { + List flags = const [], +}) async { final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; @@ -140,6 +166,7 @@ Future buildLib( name: name, assetName: name, sources: [addCUri.toFilePath()], + flags: flags, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/helpers.dart b/pkgs/native_toolchain_c/test/helpers.dart index 60b758e6f..ac5a51034 100644 --- a/pkgs/native_toolchain_c/test/helpers.dart +++ b/pkgs/native_toolchain_c/test/helpers.dart @@ -255,3 +255,48 @@ Future expectSymbols({ throw UnimplementedError(); } } + +Future textSectionAddress(Uri dylib) async { + if (Platform.isMacOS) { + // Find the line in the objdump output that looks like: + // 11 .text 00000046 00000000000045a0 TEXT + final result = await runProcess( + executable: Uri.file('objdump'), + arguments: ['--headers', dylib.toFilePath()], + logger: logger, + ); + expect(result.exitCode, 0); + final textSection = + result.stdout.split('\n').firstWhere((e) => e.contains('.text')); + final parsed = textSection.split(' ').where((e) => e.isNotEmpty).toList(); + expect(parsed[1], '.text'); + expect(parsed[4], 'TEXT'); + final vma = int.parse(parsed[3], radix: 16); + return vma; + } + if (Platform.isLinux) { + // Find the line in the readelf output that looks like: + // [11] .text PROGBITS 00004328 000328 000064 00 AX 0 0 4 + final result = await readelf(dylib.toFilePath(), 'S'); + final textSection = + result.split('\n').firstWhere((e) => e.contains('.text')); + final parsed = textSection.split(' ').where((e) => e.isNotEmpty).toList(); + expect(parsed[1], '.text'); + expect(parsed[2], 'PROGBITS'); + final addr = int.parse(parsed[3], radix: 16); + return addr; + } + throw UnimplementedError(); +} + +Future expectPageSize( + Uri dylib, + int pageSize, +) async { + if (Platform.isMacOS || Platform.isLinux) { + // If page size is 16kb, the `.text` section address should be + // above 0x4000. With smaller page sizes it's above 0x1000. + final vma = await textSectionAddress(dylib); + expect(vma, greaterThanOrEqualTo(pageSize)); + } +} From 579688bb4566801018b30b47126c7b842a4ed4d2 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 25 Nov 2024 10:58:12 +0100 Subject: [PATCH 08/50] [native_toolchain_c] Compile with `-Os` by default (#1744) Closes: https://github.com/dart-lang/native/issues/1267 --- pkgs/native_toolchain_c/CHANGELOG.md | 2 + .../lib/native_toolchain_c.dart | 1 + .../lib/src/cbuilder/cbuilder.dart | 4 ++ .../lib/src/cbuilder/clinker.dart | 3 + .../lib/src/cbuilder/ctool.dart | 5 ++ .../lib/src/cbuilder/optimization_level.dart | 56 +++++++++++++++++++ .../lib/src/cbuilder/run_cbuilder.dart | 7 +++ .../cbuilder/cbuilder_cross_android_test.dart | 14 ++++- .../cbuilder/cbuilder_cross_ios_test.dart | 12 +++- .../cbuilder_cross_linux_host_test.dart | 10 +++- .../cbuilder_cross_macos_host_test.dart | 12 +++- .../cbuilder_cross_windows_host_test.dart | 10 +++- 12 files changed, 129 insertions(+), 7 deletions(-) create mode 100644 pkgs/native_toolchain_c/lib/src/cbuilder/optimization_level.dart diff --git a/pkgs/native_toolchain_c/CHANGELOG.md b/pkgs/native_toolchain_c/CHANGELOG.md index f23a38722..c3c04d05c 100644 --- a/pkgs/native_toolchain_c/CHANGELOG.md +++ b/pkgs/native_toolchain_c/CHANGELOG.md @@ -2,6 +2,8 @@ - For Android, produce dylibs with page-size set to 16kb by default. https://github.com/dart-lang/native/issues/1611 +- Make optimization level configurable. Defaults to `-Os` and `/Os`. + https://github.com/dart-lang/native/issues/1267 ## 0.6.0 diff --git a/pkgs/native_toolchain_c/lib/native_toolchain_c.dart b/pkgs/native_toolchain_c/lib/native_toolchain_c.dart index fa001799d..2d4580f1d 100644 --- a/pkgs/native_toolchain_c/lib/native_toolchain_c.dart +++ b/pkgs/native_toolchain_c/lib/native_toolchain_c.dart @@ -9,5 +9,6 @@ export 'src/cbuilder/cbuilder.dart' show CBuilder; export 'src/cbuilder/clinker.dart' show CLinker; export 'src/cbuilder/language.dart' show Language; export 'src/cbuilder/linker_options.dart' show LinkerOptions; +export 'src/cbuilder/optimization_level.dart'; export 'src/cbuilder/output_type.dart' show OutputType; export 'src/utils/env_from_bat.dart'; diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart index d8994f315..c3a97f8b7 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart @@ -11,6 +11,7 @@ import 'package:native_assets_cli/code_assets_builder.dart'; import 'ctool.dart'; import 'language.dart'; import 'linkmode.dart'; +import 'optimization_level.dart'; import 'output_type.dart'; import 'run_cbuilder.dart'; @@ -67,6 +68,7 @@ class CBuilder extends CTool implements Builder { super.language = Language.c, super.cppLinkStdLib, super.linkModePreference, + super.optimizationLevel = OptimizationLevel.oS, }) : super(type: OutputType.library); CBuilder.executable({ @@ -87,6 +89,7 @@ class CBuilder extends CTool implements Builder { super.std, super.language = Language.c, super.cppLinkStdLib, + super.optimizationLevel = OptimizationLevel.oS, }) : super( type: OutputType.executable, assetName: null, @@ -158,6 +161,7 @@ class CBuilder extends CTool implements Builder { std: std, language: language, cppLinkStdLib: cppLinkStdLib, + optimizationLevel: optimizationLevel, ); await task.run(); } diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart index 5283603d9..9a10f504a 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart @@ -12,6 +12,7 @@ import 'ctool.dart'; import 'language.dart'; import 'linker_options.dart'; import 'linkmode.dart'; +import 'optimization_level.dart'; import 'output_type.dart'; import 'run_cbuilder.dart'; @@ -36,6 +37,7 @@ class CLinker extends CTool implements Linker { super.language = Language.c, super.cppLinkStdLib, super.linkModePreference, + super.optimizationLevel = OptimizationLevel.oS, }) : super(type: OutputType.library); /// Runs the C Linker with on this C build spec. @@ -84,6 +86,7 @@ class CLinker extends CTool implements Linker { std: std, language: language, cppLinkStdLib: cppLinkStdLib, + optimizationLevel: optimizationLevel, ); await task.run(); diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart index 47e8c7456..1a977e106 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart @@ -7,6 +7,7 @@ import 'package:native_assets_cli/code_assets.dart'; import 'cbuilder.dart'; import 'language.dart'; +import 'optimization_level.dart'; import 'output_type.dart'; abstract class CTool { @@ -120,6 +121,9 @@ abstract class CTool { /// the value is instead retrieved from the [LinkConfig]. final LinkModePreference? linkModePreference; + /// What optimization level should be used for compiling. + final OptimizationLevel optimizationLevel; + CTool({ required this.name, required this.assetName, @@ -135,5 +139,6 @@ abstract class CTool { required this.cppLinkStdLib, required this.linkModePreference, required this.type, + required this.optimizationLevel, }); } diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/optimization_level.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/optimization_level.dart new file mode 100644 index 000000000..2c8398f89 --- /dev/null +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/optimization_level.dart @@ -0,0 +1,56 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// Optimization level for code compilation. +/// +/// For more information refer to compiler documentation: +/// * https://clang.llvm.org/docs/CommandGuide/clang.html#code-generation-options +/// * https://learn.microsoft.com/en-us/cpp/build/reference/o-options-optimize-code?view=msvc-170 +final class OptimizationLevel { + /// The optimization level. + final String _level; + + const OptimizationLevel._(this._level); + + /// No optimization; prioritize fast compilation. + static const OptimizationLevel o0 = OptimizationLevel._('O0'); + + /// Basic optimizations; balance compilation speed and code size. + static const OptimizationLevel o1 = OptimizationLevel._('O1'); + + /// More aggressive optimizations; prioritize code size reduction. + static const OptimizationLevel o2 = OptimizationLevel._('O2'); + + /// The most aggressive optimizations; prioritize runtime performance. + /// + /// Not supported in MSVC, defaults to [o2] for MSVC. + static const OptimizationLevel o3 = OptimizationLevel._('O3'); + + /// Optimize for code size, even if it impacts runtime performance. + static const OptimizationLevel oS = OptimizationLevel._('Os'); + + /// Unspecified optimization level; the default or compiler-chosen level. + static const OptimizationLevel unspecified = + OptimizationLevel._('unspecified'); + + /// Returns the string representation of the optimization level. + @override + String toString() => _level; + + String clangFlag() => '-$_level'; + + String msvcFlag() => switch (this) { + o3 => o2.msvcFlag(), + _ => '/$_level', + }; + + static const List values = [ + o0, + o1, + o2, + o3, + oS, + unspecified, + ]; +} diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart index 3b3327059..8342f109c 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart @@ -16,6 +16,7 @@ import '../utils/run_process.dart'; import 'compiler_resolver.dart'; import 'language.dart'; import 'linker_options.dart'; +import 'optimization_level.dart'; class RunCBuilder { /// The options are for linking only, so this will be non-null iff a linker @@ -45,6 +46,7 @@ class RunCBuilder { final String? std; final Language language; final String? cppLinkStdLib; + final OptimizationLevel optimizationLevel; RunCBuilder({ required this.config, @@ -64,6 +66,7 @@ class RunCBuilder { this.std, this.language = Language.c, this.cppLinkStdLib, + required this.optimizationLevel, }) : outDir = config.outputDirectory, assert([executable, dynamicLibrary, staticLibrary] .whereType() @@ -275,6 +278,8 @@ class RunCBuilder { '-l', cppLinkStdLib ?? defaultCppLinkStdLib[config.targetOS]! ], + if (optimizationLevel != OptimizationLevel.unspecified) + optimizationLevel.clangFlag(), ...linkerOptions?.preSourcesFlags(toolInstance.tool, sourceFiles) ?? [], // Support Android 15 page size by default, can be overridden by // passing [flags]. @@ -327,6 +332,8 @@ class RunCBuilder { final result = await runProcess( executable: tool.uri, arguments: [ + if (optimizationLevel != OptimizationLevel.unspecified) + optimizationLevel.msvcFlag(), if (std != null) '/std:$std', if (language == Language.cpp) '/TP', ...flags, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index e44305e44..f785bbfbc 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -36,6 +36,9 @@ void main() { /// From https://docs.flutter.dev/reference/supported-platforms. const flutterAndroidNdkVersionHighestSupported = 34; + const optimizationLevels = OptimizationLevel.values; + var selectOptimizationLevel = 0; + for (final linkMode in [DynamicLoadingBundled(), StaticLinking()]) { for (final target in targets) { for (final apiLevel in [ @@ -43,14 +46,20 @@ void main() { flutterAndroidNdkVersionLowestSupported, flutterAndroidNdkVersionHighestSupported, ]) { - test('CBuilder $linkMode library $target minSdkVersion $apiLevel', - () async { + // Cycle through all optimization levels. + final optimizationLevel = optimizationLevels[selectOptimizationLevel]; + selectOptimizationLevel = + (selectOptimizationLevel + 1) % optimizationLevels.length; + test( + 'CBuilder $linkMode library $target minSdkVersion $apiLevel ' + '$optimizationLevel', () async { final tempUri = await tempDirForTest(); final libUri = await buildLib( tempUri, target, apiLevel, linkMode, + optimizationLevel: optimizationLevel, ); if (Platform.isLinux) { final machine = await readelfMachine(libUri.path); @@ -128,6 +137,7 @@ Future buildLib( int androidNdkApi, LinkMode linkMode, { List flags = const [], + OptimizationLevel optimizationLevel = OptimizationLevel.o3, }) async { final addCUri = packageUri.resolve('test/cbuilder/testfiles/add/src/add.c'); const name = 'add'; diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index 006f5c262..ad765d690 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -35,6 +35,9 @@ void main() { const name = 'add'; + const optimizationLevels = OptimizationLevel.values; + var selectOptimizationLevel = 0; + for (final language in [Language.c, Language.objectiveC]) { for (final linkMode in [DynamicLoadingBundled(), StaticLinking()]) { for (final targetIOSSdk in IOSSdk.values) { @@ -42,16 +45,20 @@ void main() { if (target == Architecture.x64 && targetIOSSdk == IOSSdk.iPhoneOS) { continue; } - final libName = OS.iOS.libraryFileName(name, linkMode); for (final installName in [ null, if (linkMode == DynamicLoadingBundled()) Uri.file('@executable_path/Frameworks/$libName'), ]) { + // Cycle through all optimization levels. + final optimizationLevel = + optimizationLevels[selectOptimizationLevel]; + selectOptimizationLevel = + (selectOptimizationLevel + 1) % optimizationLevels.length; test( 'CBuilder $linkMode $language library $targetIOSSdk $target' - ' ${installName ?? ''}' + ' ${installName ?? ''} $optimizationLevel' .trim(), () async { final tempUri = await tempDirForTest(); final tempUri2 = await tempDirForTest(); @@ -97,6 +104,7 @@ void main() { sources: [sourceUri.toFilePath()], installName: installName, language: language, + optimizationLevel: optimizationLevel, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index 48a08286a..5e2e4a74a 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -26,9 +26,16 @@ void main() { Architecture.riscv64, ]; + const optimizationLevels = OptimizationLevel.values; + var selectOptimizationLevel = 0; + for (final linkMode in [DynamicLoadingBundled(), StaticLinking()]) { for (final target in targets) { - test('CBuilder $linkMode library $target', () async { + // Cycle through all optimization levels. + final optimizationLevel = optimizationLevels[selectOptimizationLevel]; + selectOptimizationLevel = + (selectOptimizationLevel + 1) % optimizationLevels.length; + test('CBuilder $linkMode library $target $optimizationLevel', () async { final tempUri = await tempDirForTest(); final tempUri2 = await tempDirForTest(); final addCUri = @@ -66,6 +73,7 @@ void main() { name: name, assetName: name, sources: [addCUri.toFilePath()], + optimizationLevel: optimizationLevel, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index 4c66cbacc..a698efb0d 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -33,10 +33,19 @@ void main() { Architecture.x64: '64-bit x86-64', }; + const optimizationLevels = OptimizationLevel.values; + var selectOptimizationLevel = 0; + for (final language in [Language.c, Language.objectiveC]) { for (final linkMode in [DynamicLoadingBundled(), StaticLinking()]) { for (final target in targets) { - test('CBuilder $linkMode $language library $target', () async { + // Cycle through all optimization levels. + final optimizationLevel = optimizationLevels[selectOptimizationLevel]; + selectOptimizationLevel = + (selectOptimizationLevel + 1) % optimizationLevels.length; + + test('CBuilder $linkMode $language library $target $optimizationLevel', + () async { final tempUri = await tempDirForTest(); final tempUri2 = await tempDirForTest(); final sourceUri = switch (language) { @@ -79,6 +88,7 @@ void main() { assetName: name, sources: [sourceUri.toFilePath()], language: language, + optimizationLevel: optimizationLevel, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index 60b509844..6058db4e5 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -40,6 +40,9 @@ void main() { Architecture.x64: 'x64', }; + const optimizationLevels = OptimizationLevel.values; + var selectOptimizationLevel = 0; + final dumpbinFileType = { DynamicLoadingBundled(): 'DLL', StaticLinking(): 'LIBRARY', @@ -47,7 +50,11 @@ void main() { for (final linkMode in [DynamicLoadingBundled(), StaticLinking()]) { for (final target in targets) { - test('CBuilder $linkMode library $target', () async { + // Cycle through all optimization levels. + final optimizationLevel = optimizationLevels[selectOptimizationLevel]; + selectOptimizationLevel = + (selectOptimizationLevel + 1) % optimizationLevels.length; + test('CBuilder $linkMode library $target $optimizationLevel', () async { final tempUri = await tempDirForTest(); final tempUri2 = await tempDirForTest(); final addCUri = @@ -85,6 +92,7 @@ void main() { name: name, assetName: name, sources: [addCUri.toFilePath()], + optimizationLevel: optimizationLevel, ); await cbuilder.run( config: buildConfig, From fccabe3e550cedb9a17b3a6a20d389b9361d38c3 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Mon, 25 Nov 2024 15:37:36 +0100 Subject: [PATCH 09/50] Generate null-safe Java code (#1692) * As a result `JObject` can no longer have a `nullptr` reference. * Add a series of `FooNullableType` accessible through `Foo.nullableType` which is equivalent to `Foo?` or `@Nullable Foo` in Java used in generic types and arrays. * Add configuration options to add other custom annotations for nullable and non-nullable types. --- .github/workflows/jnigen.yaml | 6 +- pkgs/jni/CHANGELOG.md | 6 +- pkgs/jni/lib/jni_symbols.yaml | 17 + pkgs/jni/lib/src/accessors.dart | 2 +- pkgs/jni/lib/src/jarray.dart | 71 +- pkgs/jni/lib/src/jclass.dart | 94 +- pkgs/jni/lib/src/jimplementer.dart | 4 +- pkgs/jni/lib/src/jni.dart | 10 +- pkgs/jni/lib/src/jobject.dart | 66 +- pkgs/jni/lib/src/jreference.dart | 6 - pkgs/jni/lib/src/jvalues.dart | 3 +- pkgs/jni/lib/src/lang/jboolean.dart | 43 +- pkgs/jni/lib/src/lang/jbyte.dart | 41 + pkgs/jni/lib/src/lang/jcharacter.dart | 43 +- pkgs/jni/lib/src/lang/jdouble.dart | 42 + pkgs/jni/lib/src/lang/jfloat.dart | 42 + pkgs/jni/lib/src/lang/jinteger.dart | 42 + pkgs/jni/lib/src/lang/jlong.dart | 41 + pkgs/jni/lib/src/lang/jnumber.dart | 48 +- pkgs/jni/lib/src/lang/jshort.dart | 42 + pkgs/jni/lib/src/lang/jstring.dart | 43 +- pkgs/jni/lib/src/method_invocation.dart | 12 +- pkgs/jni/lib/src/nio/jbuffer.dart | 44 +- pkgs/jni/lib/src/nio/jbyte_buffer.dart | 63 +- pkgs/jni/lib/src/types.dart | 35 +- pkgs/jni/lib/src/util/jiterator.dart | 71 +- pkgs/jni/lib/src/util/jlist.dart | 134 +- pkgs/jni/lib/src/util/jmap.dart | 105 +- pkgs/jni/lib/src/util/jset.dart | 139 +- pkgs/jni/pubspec.yaml | 2 +- pkgs/jni/test/isolate_test.dart | 3 +- pkgs/jni/test/jarray_test.dart | 87 +- pkgs/jni/test/jbyte_buffer_test.dart | 4 +- pkgs/jni/test/jlist_test.dart | 9 +- pkgs/jni/test/jobject_test.dart | 11 +- pkgs/jni/test/type_test.dart | 270 +- pkgs/jnigen/CHANGELOG.md | 5 + pkgs/jnigen/README.md | 2 + .../in_app_java/lib/android_utils.dart | 2299 ++++-- pkgs/jnigen/example/in_app_java/lib/main.dart | 6 +- .../kotlin_plugin/example/lib/main.dart | 4 +- .../kotlin_plugin/lib/kotlin_bindings.dart | 68 +- .../notification_plugin/example/lib/main.dart | 1 - .../lib/notifications.dart | 64 +- .../dart_example/bin/pdf_info.dart | 13 +- .../pdfbox_plugin/example/lib/main.dart | 24 +- .../org/apache/pdfbox/pdmodel/PDDocument.dart | 588 +- .../pdfbox/pdmodel/PDDocumentInformation.dart | 179 +- .../apache/pdfbox/text/PDFTextStripper.dart | 174 +- .../disasm/AsmAnnotatedElementVisitor.java | 23 - .../apisummarizer/disasm/AsmClassVisitor.java | 68 +- .../apisummarizer/disasm/AsmFieldVisitor.java | 15 +- .../disasm/AsmMethodVisitor.java | 62 +- .../disasm/AsmTypeUsageSignatureVisitor.java | 37 +- .../apisummarizer/disasm/TypeUtils.java | 57 +- .../apisummarizer/doclet/ElementBuilders.java | 114 +- .../apisummarizer/elements/ClassDecl.java | 3 +- .../apisummarizer/elements/TypeParam.java | 1 + .../apisummarizer/elements/TypeUsage.java | 10 +- .../lib/src/bindings/dart_generator.dart | 368 +- pkgs/jnigen/lib/src/bindings/descriptor.dart | 2 +- .../lib/src/bindings/kotlin_processor.dart | 12 +- pkgs/jnigen/lib/src/bindings/linker.dart | 75 +- pkgs/jnigen/lib/src/bindings/printer.dart | 149 + pkgs/jnigen/lib/src/bindings/renamer.dart | 8 +- pkgs/jnigen/lib/src/config/config_types.dart | 22 +- pkgs/jnigen/lib/src/elements/elements.dart | 315 +- pkgs/jnigen/lib/src/elements/elements.g.dart | 27 +- pkgs/jnigen/lib/src/generate_bindings.dart | 4 + pkgs/jnigen/pubspec.yaml | 2 +- .../runtime_test_registrant.dart | 6 +- .../fasterxml/jackson/core/JsonFactory.dart | 677 +- .../fasterxml/jackson/core/JsonParser.dart | 554 +- .../com/fasterxml/jackson/core/JsonToken.dart | 78 +- .../test/kotlin_test/bindings/kotlin.dart | 406 +- .../kotlin_test/runtime_test_registrant.dart | 4 +- .../bindings/simple_package.dart | 6862 ++++++++++++++--- .../test/simple_package_test/generate.dart | 6 + .../jnigen/annotations/Annotated.java | 297 + .../dart_lang/jnigen/annotations/NotNull.java | 17 + .../jnigen/annotations/Nullable.java | 17 + .../runtime_test_registrant.dart | 558 +- pkgs/jnigen/test/summary_test.dart | 2 +- pkgs/jnigen/test/type_path_test.dart | 18 + 84 files changed, 12779 insertions(+), 3225 deletions(-) delete mode 100644 pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmAnnotatedElementVisitor.java create mode 100644 pkgs/jnigen/lib/src/bindings/printer.dart create mode 100644 pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Annotated.java create mode 100644 pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/NotNull.java create mode 100644 pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Nullable.java create mode 100644 pkgs/jnigen/test/type_path_test.dart diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml index e694e262c..8eb4aa321 100644 --- a/.github/workflows/jnigen.yaml +++ b/.github/workflows/jnigen.yaml @@ -46,9 +46,10 @@ jobs: channel: ${{ matrix.sdk }} cache: true cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' - - uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a + - uses: axel-op/googlejavaformat-action@0dc4ef525e7ed73d8dff50b1b062a4d441d014b5 name: 'Check Java formatting with google-java-format' with: + version: 'v1.24.0' args: '--set-exit-if-changed' - id: install name: Install dependencies @@ -136,9 +137,10 @@ jobs: with: distribution: 'zulu' java-version: '17' - - uses: axel-op/googlejavaformat-action@fe78db8a90171b6a836449f8d0e982d5d71e5c5a + - uses: axel-op/googlejavaformat-action@0dc4ef525e7ed73d8dff50b1b062a4d441d014b5 name: 'Check Java formatting with google-java-format' with: + version: 'v1.24.0' args: '--set-exit-if-changed' - name: install clang tools & CMake run: | diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 85cd7545a..7faae37d9 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,6 +1,10 @@ +## 0.13.0-wip + +- Added nullable type classes for all Java objects. + ## 0.12.2 -- Add `JniUtils.fromReferenceAddress` which helps with sending `JObject`s +- Added `JniUtils.fromReferenceAddress` which helps with sending `JObject`s through method channels. You can send the address of the pointer as `long` and reconstruct the class using the helper method. - Fixed a bug where it would be possible for a type class inference to fail. diff --git a/pkgs/jni/lib/jni_symbols.yaml b/pkgs/jni/lib/jni_symbols.yaml index ac4a74c0c..c06c5eb91 100644 --- a/pkgs/jni/lib/jni_symbols.yaml +++ b/pkgs/jni/lib/jni_symbols.yaml @@ -4,50 +4,62 @@ files: 'java.lang.Object': name: JObject type_class: JObjectType + nullable_type_class: JObjectNullableType super_count: 0 'java.lang.String': name: JString type_class: JStringType + nullable_type_class: JStringNullableType super_count: 1 'java.lang.Number': name: JNumber type_class: JNumberType + nullable_type_class: JNumberNullableType super_count: 1 'java.lang.Byte': name: JByte type_class: JByteType + nullable_type_class: JByteNullableType super_count: 2 'java.lang.Short': name: JShort type_class: JShortType + nullable_type_class: JShortNullableType super_count: 2 'java.lang.Integer': name: JInteger type_class: JIntegerType + nullable_type_class: JIntegerNullableType super_count: 2 'java.lang.Long': name: JLong type_class: JLongType + nullable_type_class: JLongNullableType super_count: 2 'java.lang.Float': name: JFloat type_class: JFloatType + nullable_type_class: JFloatNullableType super_count: 2 'java.lang.Double': name: JDouble type_class: JDoubleType + nullable_type_class: JDoubleNullableType super_count: 2 'java.lang.Boolean': name: JBoolean type_class: JBooleanType + nullable_type_class: JBooleanNullableType super_count: 1 'java.lang.Character': name: JCharacter type_class: JCharacterType + nullable_type_class: JCharacterNullableType super_count: 1 'java.util.Set': name: JSet type_class: JSetType + nullable_type_class: JSetNullableType super_count: 1 type_params: E: @@ -55,6 +67,7 @@ files: 'java.util.List': name: JList type_class: JListType + nullable_type_class: JListNullableType super_count: 1 type_params: E: @@ -62,6 +75,7 @@ files: 'java.util.Iterator': name: JIterator type_class: JIteratorType + nullable_type_class: JIteratorNullableType super_count: 1 type_params: E: @@ -69,6 +83,7 @@ files: 'java.util.Map': name: JMap type_class: JMapType + nullable_type_class: JMapNullableType super_count: 1 type_params: K: @@ -78,8 +93,10 @@ files: 'java.nio.Buffer': name: JBuffer type_class: JBufferType + nullable_type_class: JBufferNullableType super_count: 1 'java.nio.ByteBuffer': name: JByteBuffer type_class: JByteBufferType + nullable_type_class: JByteBufferNullableType super_count: 2 diff --git a/pkgs/jni/lib/src/accessors.dart b/pkgs/jni/lib/src/accessors.dart index c90bd9529..548acb4cd 100644 --- a/pkgs/jni/lib/src/accessors.dart +++ b/pkgs/jni/lib/src/accessors.dart @@ -67,7 +67,7 @@ extension JniResultMethods on JniResult { return pointer == nullptr ? jNullReference : JGlobalReference(pointer); } - T object(JObjType type) { + T object(JObjType type) { return type.fromReference(reference); } diff --git a/pkgs/jni/lib/src/jarray.dart b/pkgs/jni/lib/src/jarray.dart index ff31034b8..60dca97c1 100644 --- a/pkgs/jni/lib/src/jarray.dart +++ b/pkgs/jni/lib/src/jarray.dart @@ -6,6 +6,45 @@ part of 'types.dart'; +final class JArrayNullableType extends JObjType?> { + @internal + final JArrayElementType elementType; + + @internal + const JArrayNullableType(this.elementType); + + @internal + @override + String get signature => '[${elementType.signature}'; + + @internal + @override + JArray? fromReference(JReference reference) => + reference.isNull ? null : JArray.fromReference(elementType, reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType?> get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => Object.hash(JArrayNullableType, elementType); + + @override + bool operator ==(Object other) { + return other.runtimeType == (JArrayNullableType) && + other is JArrayNullableType && + elementType == other.elementType; + } +} + final class JArrayType extends JObjType> { @internal final JArrayElementType elementType; @@ -26,6 +65,10 @@ final class JArrayType extends JObjType> { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType?> get nullableType => JArrayNullableType(elementType); + @internal @override final int superCount = 1; @@ -53,6 +96,11 @@ class JArray extends JObject { static JArrayType type(JArrayElementType innerType) => JArrayType(innerType); + /// The type which includes information such as the signature of this class. + static JArrayNullableType nullableType( + JArrayElementType innerType) => + JArrayNullableType(innerType); + /// Construct a new [JArray] with [reference] as its underlying reference. JArray.fromReference(this.elementType, JReference reference) : $type = type(elementType), @@ -61,7 +109,16 @@ class JArray extends JObject { /// Creates a [JArray] of the given length from the given [elementType]. /// /// The [length] must be a non-negative integer. + /// For objects, [elementType] must be a nullable type as this constructor + /// initializes all elements with `null`. factory JArray(JArrayElementType elementType, int length) { + RangeError.checkNotNegative(length); + if (elementType is JObjType && + !(elementType as JObjType).isNullable) { + throw StateError('Element type of JArray must be nullable when ' + 'all elements with null\n\n' + 'Try using .nullableType instead'); + } return elementType._newArray(length); } @@ -366,17 +423,21 @@ extension DoubleArray on JArray { } } -extension ObjectArray on JArray { +extension ObjectArray on JArray { T operator [](int index) { RangeError.checkValidIndex(index, this); - return (elementType as JObjType).fromReference(JGlobalReference( - Jni.env.GetObjectArrayElement(reference.pointer, index))); + final pointer = Jni.env.GetObjectArrayElement(reference.pointer, index); + if (pointer == nullptr) { + return null as T; + } + return (elementType as JObjType) + .fromReference(JGlobalReference(pointer)); } void operator []=(int index, T value) { RangeError.checkValidIndex(index, this); - Jni.env.SetObjectArrayElement( - reference.pointer, index, value.reference.pointer); + final valueRef = value?.reference ?? jNullReference; + Jni.env.SetObjectArrayElement(reference.pointer, index, valueRef.pointer); } void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { diff --git a/pkgs/jni/lib/src/jclass.dart b/pkgs/jni/lib/src/jclass.dart index 7f9bb4dfc..4807580e0 100644 --- a/pkgs/jni/lib/src/jclass.dart +++ b/pkgs/jni/lib/src/jclass.dart @@ -40,38 +40,48 @@ class JClass extends JObject { /// A thin wrapper over a [JFieldIDPtr] of an instance field. extension type JInstanceFieldId._fromPointer(JFieldIDPtr pointer) { JInstanceFieldId._(JClass jClass, String name, String signature) - : pointer = using((arena) => Jni.env.GetFieldID( - jClass.reference.pointer, - name.toNativeChars(arena), - signature.toNativeChars(arena), - )); + : pointer = using((arena) { + final jClassRef = jClass.reference; + return Jni.env.GetFieldID( + jClassRef.pointer, + name.toNativeChars(arena), + signature.toNativeChars(arena), + ); + }); DartT get(JObject object, JAccessible type) { - return type._instanceGet(object.reference.pointer, this as JFieldIDPtr); + final objectRef = object.reference; + return type._instanceGet(objectRef.pointer, this as JFieldIDPtr); } void set( JObject object, JAccessible type, DartT value) { - type._instanceSet(object.reference.pointer, this as JFieldIDPtr, value); + final objectRef = object.reference; + type._instanceSet(objectRef.pointer, this as JFieldIDPtr, value); } } /// A thin wrapper over a [JFieldIDPtr] of an static field. extension type JStaticFieldId._fromPointer(JFieldIDPtr pointer) { JStaticFieldId._(JClass jClass, String name, String signature) - : pointer = using((arena) => Jni.env.GetStaticFieldID( - jClass.reference.pointer, - name.toNativeChars(arena), - signature.toNativeChars(arena), - )); + : pointer = using((arena) { + final jClassRef = jClass.reference; + return Jni.env.GetStaticFieldID( + jClassRef.pointer, + name.toNativeChars(arena), + signature.toNativeChars(arena), + ); + }); DartT get(JClass jClass, JAccessible type) { - return type._staticGet(jClass.reference.pointer, this as JFieldIDPtr); + final jClassRef = jClass.reference; + return type._staticGet(jClassRef.pointer, this as JFieldIDPtr); } void set( JObject object, JAccessible type, DartT value) { - type._staticSet(object.reference.pointer, this as JFieldIDPtr, value); + final objectRef = object.reference; + type._staticSet(objectRef.pointer, this as JFieldIDPtr, value); } } @@ -81,11 +91,14 @@ extension type JInstanceMethodId._fromPointer(JMethodIDPtr pointer) { JClass jClass, String name, String signature, - ) : pointer = using((arena) => Jni.env.GetMethodID( - jClass.reference.pointer, - name.toNativeChars(arena), - signature.toNativeChars(arena), - )); + ) : pointer = using((arena) { + final jClassRef = jClass.reference; + return Jni.env.GetMethodID( + jClassRef.pointer, + name.toNativeChars(arena), + signature.toNativeChars(arena), + ); + }); /// Calls the instance method on [object] with the given arguments. DartT call( @@ -93,8 +106,11 @@ extension type JInstanceMethodId._fromPointer(JMethodIDPtr pointer) { JCallable returnType, List args, ) { - return using((arena) => returnType._instanceCall(object.reference.pointer, - this as JMethodIDPtr, toJValues(args, allocator: arena))); + return using((arena) { + final objectRef = object.reference; + return returnType._instanceCall(objectRef.pointer, this as JMethodIDPtr, + toJValues(args, allocator: arena)); + }); } } @@ -104,11 +120,14 @@ extension type JStaticMethodId._fromPointer(JMethodIDPtr pointer) { JClass jClass, String name, String signature, - ) : pointer = using((arena) => Jni.env.GetStaticMethodID( - jClass.reference.pointer, - name.toNativeChars(arena), - signature.toNativeChars(arena), - )); + ) : pointer = using((arena) { + final jClassRef = jClass.reference; + return Jni.env.GetStaticMethodID( + jClassRef.pointer, + name.toNativeChars(arena), + signature.toNativeChars(arena), + ); + }); /// Calls the static method on [jClass] with the given arguments. DartT call( @@ -116,7 +135,8 @@ extension type JStaticMethodId._fromPointer(JMethodIDPtr pointer) { JCallable returnType, List args, ) { - return using((arena) => returnType._staticCall(jClass.reference.pointer, + final jClassRef = jClass.reference; + return using((arena) => returnType._staticCall(jClassRef.pointer, this as JMethodIDPtr, toJValues(args, allocator: arena))); } } @@ -126,16 +146,22 @@ extension type JConstructorId._fromPointer(JMethodIDPtr pointer) { JConstructorId._( JClass jClass, String signature, - ) : pointer = using((arena) => Jni.env.GetMethodID( - jClass.reference.pointer, - ''.toNativeChars(arena), - signature.toNativeChars(arena), - )); + ) : pointer = using((arena) { + final jClassRef = jClass.reference; + return Jni.env.GetMethodID( + jClassRef.pointer, + ''.toNativeChars(arena), + signature.toNativeChars(arena), + ); + }); /// Constructs an instance of [jClass] with the given arguments. DartT call(JClass jClass, JConstructable returnType, List args) { - return using((arena) => returnType._newObject(jClass.reference.pointer, - this as JMethodIDPtr, toJValues(args, allocator: arena))); + return using((arena) { + final jClassRef = jClass.reference; + return returnType._newObject(jClassRef.pointer, this as JMethodIDPtr, + toJValues(args, allocator: arena)); + }); } } diff --git a/pkgs/jni/lib/src/jimplementer.dart b/pkgs/jni/lib/src/jimplementer.dart index 8b66b8a8f..6d77cd2d3 100644 --- a/pkgs/jni/lib/src/jimplementer.dart +++ b/pkgs/jni/lib/src/jimplementer.dart @@ -70,10 +70,12 @@ class JImplementer extends JObject { List asyncMethods, ) { using((arena) { + final binaryNameRef = + (binaryName.toJString()..releasedBy(arena)).reference; _addImplementation( reference.pointer, _addImplementationId as JMethodIDPtr, - (binaryName.toJString()..releasedBy(arena)).reference.pointer, + binaryNameRef.pointer, port.sendPort.nativePort, pointer.address, (asyncMethods diff --git a/pkgs/jni/lib/src/jni.dart b/pkgs/jni/lib/src/jni.dart index 6d19e844d..29423de00 100644 --- a/pkgs/jni/lib/src/jni.dart +++ b/pkgs/jni/lib/src/jni.dart @@ -249,10 +249,12 @@ extension ProtectedJniExtensions on Jni { /// Returns a new DartException. static Pointer newDartException(Object exception) { JObjectPtr? cause; - if (exception is JObject && - Jni.env.IsInstanceOf( - exception.reference.pointer, _jThrowableClass.reference.pointer)) { - cause = exception.reference.pointer; + if (exception is JObject) { + final exceptionRef = exception.reference; + if (Jni.env.IsInstanceOf( + exceptionRef.pointer, _jThrowableClass.reference.pointer)) { + cause = exceptionRef.pointer; + } } return Jni._bindings .DartException__ctor( diff --git a/pkgs/jni/lib/src/jobject.dart b/pkgs/jni/lib/src/jobject.dart index f25fdb59a..537e99605 100644 --- a/pkgs/jni/lib/src/jobject.dart +++ b/pkgs/jni/lib/src/jobject.dart @@ -3,14 +3,50 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:ffi'; -import 'package:ffi/ffi.dart'; import 'package:meta/meta.dart' show internal; -import 'jni.dart'; +import '../jni.dart'; import 'jreference.dart'; -import 'lang/jstring.dart'; import 'types.dart'; +final class JObjectNullableType extends JObjType { + @internal + const JObjectNullableType(); + + @internal + @override + String get signature => 'Ljava/lang/Object;'; + + @internal + @override + JObject? fromReference(JReference reference) => + reference.isNull ? null : JObject.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + // TODO(#70): Once interface implementation lands, other than [superType], + // we should have a list of implemented interfaces. + + @internal + @override + final int superCount = 0; + + @override + int get hashCode => (JObjectNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JObjectNullableType && + other is JObjectNullableType; + } +} + final class JObjectType extends JObjType { @internal const JObjectType(); @@ -28,6 +64,10 @@ final class JObjectType extends JObjType { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType get nullableType => const JObjectNullableType(); + // TODO(#70): Once interface implementation lands, other than [superType], // we should have a list of implemented interfaces. @@ -57,8 +97,14 @@ class JObject { /// The type which includes information such as the signature of this class. static const JObjType type = JObjectType(); + static const JObjType nullableType = JObjectNullableType(); + /// Constructs a [JObject] with the underlying [reference]. - JObject.fromReference(this.reference); + JObject.fromReference(this.reference) { + if (reference.isNull) { + throw JNullError(); + } + } /// Returns [JClass] corresponding to concrete class of this object. /// @@ -71,8 +117,6 @@ class JObject { return JClass.fromReference(JGlobalReference(classRef)); } - bool get isNull => reference.isNull; - /// Releases the underlying [reference]. /// /// Releasing in one isolate while using or releasing in another isolate might @@ -84,7 +128,7 @@ class JObject { /// Casts this object to another [type]. /// /// If [releaseOriginal] is `true`, the casted object will be released. - T as( + T as( JObjType type, { bool releaseOriginal = false, }) { @@ -111,7 +155,7 @@ class JObject { static final _hashCodeId = _class.instanceMethodId(r'hashCode', r'()I'); @override - int get hashCode => _hashCodeId(this, const jintType(), []); + int get hashCode => _hashCodeId(this, const jintType(), [])!; static final _equalsId = _class.instanceMethodId(r'equals', r'(Ljava/lang/Object;)Z'); @@ -120,16 +164,14 @@ class JObject { if (other is! JObject) { return false; } - return _equalsId(this, const jbooleanType(), [other.reference.pointer]); + final otherRef = other.reference; + return _equalsId(this, const jbooleanType(), [otherRef.pointer])!; } static final _toStringId = _class.instanceMethodId(r'toString', r'()Ljava/lang/String;'); @override String toString() { - if (reference.isNull) { - return 'null'; - } return _toStringId(this, const JStringType(), []) .toDartString(releaseOriginal: true); } diff --git a/pkgs/jni/lib/src/jreference.dart b/pkgs/jni/lib/src/jreference.dart index 411bf5bfe..9a5655f9f 100644 --- a/pkgs/jni/lib/src/jreference.dart +++ b/pkgs/jni/lib/src/jreference.dart @@ -17,12 +17,6 @@ extension ProtectedJReference on JReference { _setAsReleased(); } - void ensureNotNull() { - if (isNull) { - throw JNullError(); - } - } - /// Similar to [pointer]. /// /// Detaches the finalizer so the underlying pointer will not be deleted. diff --git a/pkgs/jni/lib/src/jvalues.dart b/pkgs/jni/lib/src/jvalues.dart index 0b95e5b22..950c6f515 100644 --- a/pkgs/jni/lib/src/jvalues.dart +++ b/pkgs/jni/lib/src/jvalues.dart @@ -5,12 +5,13 @@ import 'dart:ffi'; import '../_internal.dart'; - import 'jobject.dart'; import 'third_party/generated_bindings.dart'; void _fillJValue(Pointer pos, dynamic arg) { switch (arg) { + case null: + pos.ref.l = nullptr; case JObject(): pos.ref.l = arg.reference.pointer; case JReference(): diff --git a/pkgs/jni/lib/src/lang/jboolean.dart b/pkgs/jni/lib/src/lang/jboolean.dart index 0513ab745..db172bfbe 100644 --- a/pkgs/jni/lib/src/lang/jboolean.dart +++ b/pkgs/jni/lib/src/lang/jboolean.dart @@ -8,6 +8,41 @@ import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; +final class JBooleanNullableType extends JObjType { + @internal + const JBooleanNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Boolean;'; + + @internal + @override + JBoolean? fromReference(JReference reference) => + reference.isNull ? null : JBoolean.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JBooleanNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JBooleanNullableType && + other is JBooleanNullableType; + } +} + final class JBooleanType extends JObjType { @internal const JBooleanType(); @@ -25,6 +60,10 @@ final class JBooleanType extends JObjType { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType get nullableType => const JBooleanNullableType(); + @internal @override final superCount = 2; @@ -51,6 +90,9 @@ class JBoolean extends JObject { /// The type which includes information such as the signature of this class. static const type = JBooleanType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JBooleanNullableType(); + static final _class = JClass.forName(r'java/lang/Boolean'); static final _ctorId = _class.constructorId(r'(Z)V'); @@ -61,7 +103,6 @@ class JBoolean extends JObject { _class.instanceMethodId(r'booleanValue', r'()Z'); bool booleanValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _booleanValueId(this, const jbooleanType(), []); if (releaseOriginal) { release(); diff --git a/pkgs/jni/lib/src/lang/jbyte.dart b/pkgs/jni/lib/src/lang/jbyte.dart index db4a39ca3..8435dee27 100644 --- a/pkgs/jni/lib/src/lang/jbyte.dart +++ b/pkgs/jni/lib/src/lang/jbyte.dart @@ -9,6 +9,40 @@ import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; +final class JByteNullableType extends JObjType { + @internal + const JByteNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Byte;'; + + @internal + @override + JByte? fromReference(JReference reference) => + reference.isNull ? null : JByte.fromReference(reference); + + @internal + @override + JObjType get superType => const JNumberNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JByteNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JByteNullableType && other is JByteNullableType; + } +} + final class JByteType extends JObjType { @internal const JByteType(); @@ -25,6 +59,10 @@ final class JByteType extends JObjType { @override JObjType get superType => const JNumberType(); + @internal + @override + JObjType get nullableType => const JByteNullableType(); + @internal @override final superCount = 2; @@ -51,6 +89,9 @@ class JByte extends JNumber { /// The type which includes information such as the signature of this class. static const type = JByteType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JByteNullableType(); + static final _class = JClass.forName(r'java/lang/Byte'); static final _ctorId = _class.constructorId(r'(B)V'); diff --git a/pkgs/jni/lib/src/lang/jcharacter.dart b/pkgs/jni/lib/src/lang/jcharacter.dart index 4730d73fa..1c49d5bba 100644 --- a/pkgs/jni/lib/src/lang/jcharacter.dart +++ b/pkgs/jni/lib/src/lang/jcharacter.dart @@ -9,6 +9,41 @@ import '../jreference.dart'; import '../jvalues.dart'; import '../types.dart'; +final class JCharacterNullableType extends JObjType { + @internal + const JCharacterNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Character;'; + + @internal + @override + JCharacter? fromReference(JReference reference) => + reference.isNull ? null : JCharacter.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => (JCharacterNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JCharacterNullableType && + other is JCharacterNullableType; + } +} + final class JCharacterType extends JObjType { @internal const JCharacterType(); @@ -26,6 +61,10 @@ final class JCharacterType extends JObjType { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType get nullableType => const JCharacterNullableType(); + @internal @override final superCount = 1; @@ -52,6 +91,9 @@ class JCharacter extends JObject { /// The type which includes information such as the signature of this class. static const type = JCharacterType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JCharacterNullableType(); + static final _class = JClass.forName(r'java/lang/Character'); static final _ctorId = _class.constructorId(r'(C)V'); @@ -62,7 +104,6 @@ class JCharacter extends JObject { static final _charValueId = _class.instanceMethodId(r'charValue', r'()C'); int charValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _charValueId(this, const jcharType(), []); if (releaseOriginal) { release(); diff --git a/pkgs/jni/lib/src/lang/jdouble.dart b/pkgs/jni/lib/src/lang/jdouble.dart index 6bad5c65b..902fa2ab3 100644 --- a/pkgs/jni/lib/src/lang/jdouble.dart +++ b/pkgs/jni/lib/src/lang/jdouble.dart @@ -8,6 +8,41 @@ import '../jreference.dart'; import '../types.dart'; import 'jnumber.dart'; +final class JDoubleNullableType extends JObjType { + @internal + const JDoubleNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Double;'; + + @internal + @override + JDouble? fromReference(JReference reference) => + reference.isNull ? null : JDouble.fromReference(reference); + + @internal + @override + JObjType get superType => const JNumberNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JDoubleNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JDoubleNullableType && + other is JDoubleNullableType; + } +} + final class JDoubleType extends JObjType { @internal const JDoubleType(); @@ -25,6 +60,10 @@ final class JDoubleType extends JObjType { @override JObjType get superType => const JNumberType(); + @internal + @override + JObjType get nullableType => const JDoubleNullableType(); + @internal @override final superCount = 2; @@ -51,6 +90,9 @@ class JDouble extends JNumber { /// The type which includes information such as the signature of this class. static const type = JDoubleType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JDoubleNullableType(); + static final _class = JClass.forName(r'java/lang/Double'); static final _ctorId = _class.constructorId(r'(D)V'); diff --git a/pkgs/jni/lib/src/lang/jfloat.dart b/pkgs/jni/lib/src/lang/jfloat.dart index 744a91528..672d6095b 100644 --- a/pkgs/jni/lib/src/lang/jfloat.dart +++ b/pkgs/jni/lib/src/lang/jfloat.dart @@ -9,6 +9,41 @@ import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; +final class JFloatNullableType extends JObjType { + @internal + const JFloatNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Float;'; + + @internal + @override + JFloat? fromReference(JReference reference) => + reference.isNull ? null : JFloat.fromReference(reference); + + @internal + @override + JObjType get superType => const JNumberNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JFloatNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JFloatNullableType && + other is JFloatNullableType; + } +} + final class JFloatType extends JObjType { @internal const JFloatType(); @@ -25,6 +60,10 @@ final class JFloatType extends JObjType { @override JObjType get superType => const JNumberType(); + @internal + @override + JObjType get nullableType => const JFloatNullableType(); + @internal @override final superCount = 2; @@ -51,6 +90,9 @@ class JFloat extends JNumber { /// The type which includes information such as the signature of this class. static const type = JFloatType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JFloatNullableType(); + static final _class = JClass.forName(r'java/lang/Float'); static final _ctorId = _class.constructorId(r'(F)V'); diff --git a/pkgs/jni/lib/src/lang/jinteger.dart b/pkgs/jni/lib/src/lang/jinteger.dart index a527cde11..2d0408dcb 100644 --- a/pkgs/jni/lib/src/lang/jinteger.dart +++ b/pkgs/jni/lib/src/lang/jinteger.dart @@ -9,6 +9,41 @@ import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; +final class JIntegerNullableType extends JObjType { + @internal + const JIntegerNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Integer;'; + + @internal + @override + JInteger? fromReference(JReference reference) => + reference.isNull ? null : JInteger.fromReference(reference); + + @internal + @override + JObjType get superType => const JNumberNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JIntegerNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JIntegerNullableType && + other is JIntegerNullableType; + } +} + final class JIntegerType extends JObjType { @internal const JIntegerType(); @@ -26,6 +61,10 @@ final class JIntegerType extends JObjType { @override JObjType get superType => const JNumberType(); + @internal + @override + JObjType get nullableType => const JIntegerNullableType(); + @internal @override final superCount = 2; @@ -52,6 +91,9 @@ class JInteger extends JNumber { /// The type which includes information such as the signature of this class. static const type = JIntegerType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JIntegerNullableType(); + static final _class = JClass.forName(r'java/lang/Integer'); static final _ctorId = _class.constructorId('(I)V'); diff --git a/pkgs/jni/lib/src/lang/jlong.dart b/pkgs/jni/lib/src/lang/jlong.dart index 5dc9c8530..0097b4953 100644 --- a/pkgs/jni/lib/src/lang/jlong.dart +++ b/pkgs/jni/lib/src/lang/jlong.dart @@ -8,6 +8,40 @@ import '../jreference.dart'; import '../types.dart'; import 'jnumber.dart'; +final class JLongNullableType extends JObjType { + @internal + const JLongNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Long;'; + + @internal + @override + JLong? fromReference(JReference reference) => + reference.isNull ? null : JLong.fromReference(reference); + + @internal + @override + JObjType get superType => const JNumberNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JLongNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JLongNullableType && other is JLongNullableType; + } +} + final class JLongType extends JObjType { @internal const JLongType(); @@ -24,6 +58,10 @@ final class JLongType extends JObjType { @override JObjType get superType => const JNumberType(); + @internal + @override + JObjType get nullableType => const JLongNullableType(); + @internal @override final superCount = 2; @@ -50,6 +88,9 @@ class JLong extends JNumber { /// The type which includes information such as the signature of this class. static const type = JLongType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JLongNullableType(); + static final _class = JClass.forName(r'java/lang/Long'); static final _ctorId = _class.constructorId(r'(J)V'); diff --git a/pkgs/jni/lib/src/lang/jnumber.dart b/pkgs/jni/lib/src/lang/jnumber.dart index e0295296a..bdad3b477 100644 --- a/pkgs/jni/lib/src/lang/jnumber.dart +++ b/pkgs/jni/lib/src/lang/jnumber.dart @@ -16,6 +16,41 @@ import 'jinteger.dart'; import 'jlong.dart'; import 'jshort.dart'; +final class JNumberNullableType extends JObjType { + @internal + const JNumberNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Number;'; + + @internal + @override + JNumber? fromReference(JReference reference) => + reference.isNull ? null : JNumber.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => (JNumberNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JNumberNullableType && + other is JNumberNullableType; + } +} + final class JNumberType extends JObjType { @internal const JNumberType(); @@ -33,6 +68,10 @@ final class JNumberType extends JObjType { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType get nullableType => const JNumberNullableType(); + @internal @override final superCount = 1; @@ -60,6 +99,9 @@ class JNumber extends JObject { /// The type which includes information such as the signature of this class. static const type = JNumberType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JNumberNullableType(); static final _ctorId = _class.constructorId(r'()V'); JNumber() : super.fromReference(_ctorId(_class, referenceType, [])); @@ -67,7 +109,6 @@ class JNumber extends JObject { static final _intValueId = _class.instanceMethodId(r'intValue', r'()I'); int intValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _intValueId(this, const jintType(), []); if (releaseOriginal) { release(); @@ -78,7 +119,6 @@ class JNumber extends JObject { static final _longValueId = _class.instanceMethodId(r'longValue', r'()J'); int longValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _longValueId(this, const jlongType(), []); if (releaseOriginal) { release(); @@ -89,7 +129,6 @@ class JNumber extends JObject { static final _floatValueId = _class.instanceMethodId(r'floatValue', r'()F'); double floatValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _floatValueId(this, const jfloatType(), []); if (releaseOriginal) { release(); @@ -100,7 +139,6 @@ class JNumber extends JObject { static final _doubleValueId = _class.instanceMethodId(r'doubleValue', r'()D'); double doubleValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _doubleValueId(this, const jdoubleType(), []); if (releaseOriginal) { release(); @@ -111,7 +149,6 @@ class JNumber extends JObject { static final _byteValueId = _class.instanceMethodId(r'byteValue', r'()B'); int byteValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _byteValueId(this, const jbyteType(), []); if (releaseOriginal) { release(); @@ -122,7 +159,6 @@ class JNumber extends JObject { static final _shortValueId = _class.instanceMethodId(r'shortValue', r'()S'); int shortValue({bool releaseOriginal = false}) { - reference.ensureNotNull(); final ret = _shortValueId(this, const jshortType(), []); if (releaseOriginal) { release(); diff --git a/pkgs/jni/lib/src/lang/jshort.dart b/pkgs/jni/lib/src/lang/jshort.dart index 52715169c..e7970ef82 100644 --- a/pkgs/jni/lib/src/lang/jshort.dart +++ b/pkgs/jni/lib/src/lang/jshort.dart @@ -9,6 +9,41 @@ import '../jvalues.dart'; import '../types.dart'; import 'jnumber.dart'; +final class JShortNullableType extends JObjType { + @internal + const JShortNullableType(); + + @internal + @override + String get signature => r'Ljava/lang/Short;'; + + @internal + @override + JShort? fromReference(JReference reference) => + reference.isNull ? null : JShort.fromReference(reference); + + @internal + @override + JObjType get superType => const JNumberNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JShortNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JShortNullableType && + other is JShortNullableType; + } +} + final class JShortType extends JObjType { @internal const JShortType(); @@ -25,6 +60,10 @@ final class JShortType extends JObjType { @override JObjType get superType => const JNumberType(); + @internal + @override + JObjType get nullableType => const JShortNullableType(); + @internal @override final superCount = 2; @@ -51,6 +90,9 @@ class JShort extends JNumber { /// The type which includes information such as the signature of this class. static const type = JShortType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JShortNullableType(); + static final _class = JClass.forName(r'java/lang/Short'); static final _ctorId = _class.constructorId(r'(S)V'); diff --git a/pkgs/jni/lib/src/lang/jstring.dart b/pkgs/jni/lib/src/lang/jstring.dart index 9df267d4d..dfcfe5496 100644 --- a/pkgs/jni/lib/src/lang/jstring.dart +++ b/pkgs/jni/lib/src/lang/jstring.dart @@ -9,6 +9,41 @@ import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; +final class JStringNullableType extends JObjType { + @internal + const JStringNullableType(); + + @internal + @override + String get signature => 'Ljava/lang/String;'; + + @internal + @override + JString? fromReference(JReference reference) => + reference.isNull ? null : JString.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JStringNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JStringNullableType && + other is JStringNullableType; + } +} + final class JStringType extends JObjType { @internal const JStringType(); @@ -26,6 +61,10 @@ final class JStringType extends JObjType { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType get nullableType => const JStringNullableType(); + @internal @override final int superCount = 1; @@ -48,6 +87,9 @@ class JString extends JObject { /// The type which includes information such as the signature of this class. static const JObjType type = JStringType(); + /// The type which includes information such as the signature of this class. + static const JObjType nullableType = JStringNullableType(); + /// Construct a new [JString] with [reference] as its underlying reference. JString.fromReference(super.reference) : super.fromReference(); @@ -63,7 +105,6 @@ class JString extends JObject { /// If [releaseOriginal] is true, the underlying reference is deleted /// after conversion and this object will be marked as released. String toDartString({bool releaseOriginal = false}) { - reference.ensureNotNull(); final result = Jni.env.toDartString(reference.pointer); if (releaseOriginal) { release(); diff --git a/pkgs/jni/lib/src/method_invocation.dart b/pkgs/jni/lib/src/method_invocation.dart index ee779b55f..9c42237d9 100644 --- a/pkgs/jni/lib/src/method_invocation.dart +++ b/pkgs/jni/lib/src/method_invocation.dart @@ -16,7 +16,7 @@ import 'types.dart'; class MethodInvocation { final Pointer result; final JString methodDescriptor; - final JArray args; + final JArray? args; MethodInvocation._(this.result, this.methodDescriptor, this.args); @@ -29,10 +29,12 @@ class MethodInvocation { Pointer.fromAddress(resultAddress), JString.fromReference( JGlobalReference(Pointer.fromAddress(descriptorAddress))), - JArray.fromReference( - const JObjectType(), - JGlobalReference(Pointer.fromAddress(argsAddress)), - ), + argsAddress == 0 + ? null + : JArray.fromReference( + const JObjectNullableType(), + JGlobalReference(Pointer.fromAddress(argsAddress)), + ), ); } diff --git a/pkgs/jni/lib/src/nio/jbuffer.dart b/pkgs/jni/lib/src/nio/jbuffer.dart index f26f57955..8663654b4 100644 --- a/pkgs/jni/lib/src/nio/jbuffer.dart +++ b/pkgs/jni/lib/src/nio/jbuffer.dart @@ -10,6 +10,41 @@ import '../jvalues.dart'; import '../types.dart'; import 'jbyte_buffer.dart'; +final class JBufferNullableType extends JObjType { + @internal + const JBufferNullableType(); + + @internal + @override + String get signature => r'Ljava/nio/Buffer;'; + + @internal + @override + JBuffer? fromReference(JReference reference) => + reference.isNull ? null : JBuffer.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => (JBufferNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JBufferNullableType && + other is JBufferNullableType; + } +} + final class JBufferType extends JObjType { @internal const JBufferType(); @@ -27,6 +62,10 @@ final class JBufferType extends JObjType { @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType get nullableType => const JBufferNullableType(); + @internal @override final superCount = 1; @@ -66,6 +105,9 @@ class JBuffer extends JObject { /// The type which includes information such as the signature of this class. static const type = JBufferType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JBufferNullableType(); + static final _capacityId = _class.instanceMethodId(r'capacity', r'()I'); /// The number of elements this buffer contains. @@ -213,7 +255,7 @@ class JBuffer extends JObject { /// * `UnsupportedOperationException` - If this buffer is not backed by an /// accessible array JObject get array { - return _arrayId(this, const JObjectType(), []); + return _arrayId(this, const JObjectType(), [])!; } static final _arrayOffsetId = _class.instanceMethodId(r'arrayOffset', r'()I'); diff --git a/pkgs/jni/lib/src/nio/jbyte_buffer.dart b/pkgs/jni/lib/src/nio/jbyte_buffer.dart index 54e5bcaae..b0154d68c 100644 --- a/pkgs/jni/lib/src/nio/jbyte_buffer.dart +++ b/pkgs/jni/lib/src/nio/jbyte_buffer.dart @@ -14,6 +14,41 @@ import '../jvalues.dart'; import '../types.dart'; import 'jbuffer.dart'; +final class JByteBufferNullableType extends JObjType { + @internal + const JByteBufferNullableType(); + + @internal + @override + String get signature => r'Ljava/nio/ByteBuffer;'; + + @internal + @override + JByteBuffer? fromReference(JReference reference) => + reference.isNull ? null : JByteBuffer.fromReference(reference); + + @internal + @override + JObjType get superType => const JByteBufferNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final superCount = 2; + + @override + int get hashCode => (JByteBufferNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JByteBufferNullableType && + other is JByteBufferNullableType; + } +} + final class JByteBufferType extends JObjType { @internal const JByteBufferType(); @@ -31,6 +66,10 @@ final class JByteBufferType extends JObjType { @override JObjType get superType => const JBufferType(); + @internal + @override + JObjType get nullableType => const JByteBufferNullableType(); + @internal @override final superCount = 2; @@ -108,6 +147,9 @@ class JByteBuffer extends JBuffer { /// The type which includes information such as the signature of this class. static const type = JByteBufferType(); + /// The type which includes information such as the signature of this class. + static const nullableType = JByteBufferNullableType(); + static final _allocateDirectId = _class.staticMethodId(r'allocateDirect', r'(I)Ljava/nio/ByteBuffer;'); @@ -117,7 +159,7 @@ class JByteBuffer extends JBuffer { /// * `IllegalArgumentException` - If the capacity is a negative integer factory JByteBuffer.allocateDirect(int capacity) { return _allocateDirectId( - _class, const JByteBufferType(), [JValueInt(capacity)]); + _class, const JByteBufferType(), [JValueInt(capacity)])!; } static final _allocateId = @@ -128,7 +170,7 @@ class JByteBuffer extends JBuffer { /// Throws: /// * `IllegalArgumentException` - If the capacity is a negative integer factory JByteBuffer.allocate(int capacity) { - return _allocateId(_class, const JByteBufferType(), [JValueInt(capacity)]); + return _allocateId(_class, const JByteBufferType(), [JValueInt(capacity)])!; } static final _wrapWholeId = @@ -146,20 +188,21 @@ class JByteBuffer extends JBuffer { int? offset, int? length, ]) { + final arrayRef = array.reference; if (offset == null && length == null) { return _wrapWholeId( _class, const JByteBufferType(), - [array.reference.pointer], - ); + [arrayRef.pointer], + )!; } offset ??= 0; length ??= array.length - offset; return _wrapId( _class, const JByteBufferType(), - [array.reference.pointer, JValueInt(offset), JValueInt(length)], - ); + [arrayRef.pointer, JValueInt(offset), JValueInt(length)], + )!; } /// Creates a [JByteBuffer] from the content of [list]. @@ -177,7 +220,7 @@ class JByteBuffer extends JBuffer { /// Creates a new byte buffer whose content is a shared subsequence of this /// buffer's content. JByteBuffer slice() { - return _sliceId(this, const JByteBufferType(), []); + return _sliceId(this, const JByteBufferType(), [])!; } static final _duplicateId = @@ -185,7 +228,7 @@ class JByteBuffer extends JBuffer { /// Creates a new byte buffer that shares this buffer's content. JByteBuffer duplicate() { - return _duplicateId(this, const JByteBufferType(), []); + return _duplicateId(this, const JByteBufferType(), [])!; } static final _asReadOnlyBufferId = @@ -193,7 +236,7 @@ class JByteBuffer extends JBuffer { /// Creates a new, read-only byte buffer that shares this buffer's content. JByteBuffer asReadOnlyBuffer() { - return _asReadOnlyBufferId(this, const JByteBufferType(), []); + return _asReadOnlyBufferId(this, const JByteBufferType(), [])!; } static final _getId = _class.instanceMethodId(r'get', r'()B'); @@ -226,7 +269,7 @@ class JByteBuffer extends JBuffer { @override JArray get array { - return _arrayId(this, const JArrayType(jbyteType()), []); + return _arrayId(this, const JArrayType(jbyteType()), [])!; } void _ensureIsDirect() { diff --git a/pkgs/jni/lib/src/types.dart b/pkgs/jni/lib/src/types.dart index 50ce5e817..5b0bf2781 100644 --- a/pkgs/jni/lib/src/types.dart +++ b/pkgs/jni/lib/src/types.dart @@ -79,7 +79,7 @@ final class _ReferenceType extends JType } @internal -abstract class JObjType extends JType +abstract class JObjType extends JType with JCallable, JConstructable, @@ -90,6 +90,10 @@ abstract class JObjType extends JType JObjType get superType; + JObjType get nullableType; + + bool get isNullable => this == nullableType; + const JObjType(); /// Creates an object from this type using the reference. @@ -104,8 +108,8 @@ abstract class JObjType extends JType @override T _staticCall(JClassPtr clazz, JMethodIDPtr methodID, Pointer args) { - return fromReference(JGlobalReference( - Jni.env.CallStaticObjectMethodA(clazz, methodID, args))); + final result = Jni.env.CallStaticObjectMethodA(clazz, methodID, args); + return fromReference(JGlobalReference(result)); } @override @@ -127,8 +131,9 @@ abstract class JObjType extends JType } @override - void _instanceSet(JObjectPtr obj, JFieldIDPtr fieldID, T val) { - Jni.env.SetObjectField(obj, fieldID, val.reference.pointer); + void _instanceSet(JObjectPtr obj, JFieldIDPtr fieldID, T? val) { + final valRef = val?.reference ?? jNullReference; + Jni.env.SetObjectField(obj, fieldID, valRef.pointer); } @override @@ -138,22 +143,24 @@ abstract class JObjType extends JType } @override - void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, T val) { - Jni.env.SetStaticObjectField(clazz, fieldID, val.reference.pointer); + void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, T? val) { + final valRef = val?.reference ?? jNullReference; + Jni.env.SetStaticObjectField(clazz, fieldID, valRef.pointer); } @override JArray _newArray(int length, [T? fill]) { - final clazz = jClass; + final classRef = jClass.reference; + final fillRef = fill?.reference ?? jNullReference; final array = JArray.fromReference( this, JGlobalReference(Jni.env.NewObjectArray( length, - clazz.reference.pointer, - fill == null ? nullptr : fill.reference.pointer, + classRef.pointer, + fillRef.pointer, )), ); - clazz.release(); + classRef.release(); return array; } } @@ -161,6 +168,12 @@ abstract class JObjType extends JType /// Lowest common ancestor of two types in the inheritance tree. JObjType _lowestCommonAncestor( JObjType a, JObjType b) { + if (a is! JObjType || b is! JObjType) { + // If one of the types are nullable, the common super type should also be + // nullable. + a = a.nullableType; + b = b.nullableType; + } while (a.superCount > b.superCount) { a = a.superType; } diff --git a/pkgs/jni/lib/src/util/jiterator.dart b/pkgs/jni/lib/src/util/jiterator.dart index d3bb4421e..d644506e8 100644 --- a/pkgs/jni/lib/src/util/jiterator.dart +++ b/pkgs/jni/lib/src/util/jiterator.dart @@ -8,7 +8,49 @@ import '../jobject.dart'; import '../jreference.dart'; import '../types.dart'; -final class JIteratorType<$E extends JObject> extends JObjType> { +final class JIteratorNullableType<$E extends JObject?> + extends JObjType?> { + @internal + final JObjType<$E> E; + + @internal + const JIteratorNullableType( + this.E, + ); + + @internal + @override + String get signature => r'Ljava/util/Iterator;'; + + @internal + @override + JIterator<$E>? fromReference(JReference reference) => + reference.isNull ? null : JIterator<$E>.fromReference(E, reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType?> get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => Object.hash(JIteratorNullableType, E); + + @override + bool operator ==(Object other) { + return other.runtimeType == (JIteratorNullableType<$E>) && + other is JIteratorNullableType<$E> && + E == other.E; + } +} + +final class JIteratorType<$E extends JObject?> extends JObjType> { @internal final JObjType<$E> E; @@ -24,12 +66,16 @@ final class JIteratorType<$E extends JObject> extends JObjType> { @internal @override JIterator<$E> fromReference(JReference reference) => - JIterator.fromReference(E, reference); + JIterator<$E>.fromReference(E, reference); @internal @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType?> get nullableType => JIteratorNullableType<$E>(E); + @internal @override final superCount = 1; @@ -45,7 +91,7 @@ final class JIteratorType<$E extends JObject> extends JObjType> { } } -class JIterator<$E extends JObject> extends JObject implements Iterator<$E> { +class JIterator<$E extends JObject?> extends JObject implements Iterator<$E> { @internal @override // ignore: overridden_fields @@ -57,18 +103,23 @@ class JIterator<$E extends JObject> extends JObject implements Iterator<$E> { JIterator.fromReference( this.E, JReference reference, - ) : $type = type(E), + ) : $type = type<$E>(E), super.fromReference(reference); static final _class = JClass.forName(r'java/util/Iterator'); /// The type which includes information such as the signature of this class. - static JIteratorType<$E> type<$E extends JObject>( + static JIteratorType<$E> type<$E extends JObject?>( + JObjType<$E> E, + ) { + return JIteratorType<$E>(E); + } + + /// The type which includes information such as the signature of this class. + static JIteratorNullableType<$E> nullableType<$E extends JObject?>( JObjType<$E> E, ) { - return JIteratorType( - E, - ); + return JIteratorNullableType<$E>(E); } $E? _current; @@ -78,13 +129,13 @@ class JIterator<$E extends JObject> extends JObject implements Iterator<$E> { static final _hasNextId = _class.instanceMethodId(r'hasNext', r'()Z'); bool _hasNext() { - return _hasNextId(this, const jbooleanType(), []); + return _hasNextId(this, const jbooleanType(), [])!; } static final _nextId = _class.instanceMethodId(r'next', r'()Ljava/lang/Object;'); $E _next() { - return _nextId(this, E, []); + return _nextId(this, E, [])!; } @override diff --git a/pkgs/jni/lib/src/util/jlist.dart b/pkgs/jni/lib/src/util/jlist.dart index 368bc55e8..8648ff4b0 100644 --- a/pkgs/jni/lib/src/util/jlist.dart +++ b/pkgs/jni/lib/src/util/jlist.dart @@ -14,7 +14,49 @@ import '../types.dart'; import 'jiterator.dart'; import 'jset.dart'; -final class JListType<$E extends JObject> extends JObjType> { +final class JListNullableType<$E extends JObject?> + extends JObjType?> { + @internal + final JObjType<$E> E; + + @internal + const JListNullableType( + this.E, + ); + + @internal + @override + String get signature => r'Ljava/util/List;'; + + @internal + @override + JList<$E>? fromReference(JReference reference) => + reference.isNull ? null : JList<$E>.fromReference(E, reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType?> get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => Object.hash(JListNullableType, E); + + @override + bool operator ==(Object other) { + return other.runtimeType == (JListNullableType<$E>) && + other is JListNullableType<$E> && + E == other.E; + } +} + +final class JListType<$E extends JObject?> extends JObjType> { @internal final JObjType<$E> E; @@ -30,12 +72,16 @@ final class JListType<$E extends JObject> extends JObjType> { @internal @override JList<$E> fromReference(JReference reference) => - JList.fromReference(E, reference); + JList<$E>.fromReference(E, reference); @internal @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType?> get nullableType => JListNullableType<$E>(E); + @internal @override final superCount = 1; @@ -51,7 +97,7 @@ final class JListType<$E extends JObject> extends JObjType> { } } -class JList<$E extends JObject> extends JObject with ListMixin<$E> { +class JList<$E extends JObject?> extends JObject with ListMixin<$E> { @internal @override // ignore: overridden_fields @@ -63,35 +109,39 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { JList.fromReference( this.E, JReference reference, - ) : $type = type(E), + ) : $type = type<$E>(E), super.fromReference(reference); static final _class = JClass.forName(r'java/util/List'); /// The type which includes information such as the signature of this class. - static JListType<$E> type<$E extends JObject>( + static JListType<$E> type<$E extends JObject?>( JObjType<$E> E, ) { - return JListType( - E, - ); + return JListType<$E>(E); + } + + /// The type which includes information such as the signature of this class. + static JListNullableType<$E> nullableType<$E extends JObject?>( + JObjType<$E> E) { + return JListNullableType<$E>(E); } static final _arrayListClassRef = JClass.forName(r'java/util/ArrayList'); static final _ctorId = _arrayListClassRef.constructorId(r'()V'); JList.array(this.E) - : $type = type(E), + : $type = type<$E>(E), super.fromReference(_ctorId(_arrayListClassRef, referenceType, [])); static final _sizeId = _class.instanceMethodId(r'size', r'()I'); @override - int get length => _sizeId(this, const jintType(), []); + int get length => _sizeId(this, const jintType(), [])!; @override set length(int newLength) { RangeError.checkNotNegative(newLength); while (length < newLength) { - add(E.fromReference(jNullReference)); + add(null as $E); } while (newLength < length) { removeAt(length - 1); @@ -126,11 +176,13 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { _class.instanceMethodId(r'addAll', r'(Ljava/util/Collection;)Z'); @override void addAll(Iterable<$E> iterable) { - if (iterable is JObject && - Jni.env.IsInstanceOf((iterable as JObject).reference.pointer, - _collectionClass.reference.pointer)) { - _addAllId(this, const jbooleanType(), [(iterable as JObject)]); - return; + if (iterable is JObject) { + final iterableRef = (iterable as JObject).reference; + if (Jni.env.IsInstanceOf( + iterableRef.pointer, _collectionClass.reference.pointer)) { + _addAllId(this, const jbooleanType(), [iterableRef.pointer]); + return; + } } return super.addAll(iterable); } @@ -146,7 +198,8 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { @override bool contains(Object? element) { if (element is! JObject) return false; - return _containsId(this, const jbooleanType(), [element.reference.pointer]); + final elementRef = element.reference; + return _containsId(this, const jbooleanType(), [elementRef.pointer])!; } static final _getRangeId = @@ -154,7 +207,8 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { @override JList<$E> getRange(int start, int end) { RangeError.checkValidRange(start, end, this.length); - return _getRangeId(this, JListType(E), [JValueInt(start), JValueInt(end)]); + return _getRangeId( + this, JListType<$E>(E), [JValueInt(start), JValueInt(end)])!; } static final _indexOfId = @@ -163,14 +217,15 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { int indexOf(Object? element, [int start = 0]) { if (element is! JObject) return -1; if (start < 0) start = 0; + final elementRef = element.reference; if (start == 0) { - return _indexOfId(this, const jintType(), [element.reference.pointer]); + return _indexOfId(this, const jintType(), [elementRef.pointer])!; } return _indexOfId( getRange(start, length), const jintType(), - [element.reference.pointer], - ); + [elementRef.pointer], + )!; } static final _insertId = @@ -184,22 +239,24 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { _class.instanceMethodId(r'addAll', r'(ILjava/util/Collection;)Z'); @override void insertAll(int index, Iterable<$E> iterable) { - if (iterable is JObject && - Jni.env.IsInstanceOf((iterable as JObject).reference.pointer, - _collectionClass.reference.pointer)) { - _insertAllId( - this, - const jbooleanType(), - [JValueInt(index), iterable], - ); - return; + if (iterable is JObject) { + final iterableRef = (iterable as JObject).reference; + if (Jni.env.IsInstanceOf( + iterableRef.pointer, _collectionClass.reference.pointer)) { + _insertAllId( + this, + const jbooleanType(), + [JValueInt(index), iterableRef.pointer], + ); + return; + } } super.insertAll(index, iterable); } static final _isEmptyId = _class.instanceMethodId(r'isEmpty', r'()Z'); @override - bool get isEmpty => _isEmptyId(this, const jbooleanType(), []); + bool get isEmpty => _isEmptyId(this, const jbooleanType(), [])!; @override bool get isNotEmpty => !isEmpty; @@ -207,7 +264,7 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { static final _iteratorId = _class.instanceMethodId(r'iterator', r'()Ljava/util/Iterator;'); @override - JIterator<$E> get iterator => _iteratorId(this, JIteratorType(E), []); + JIterator<$E> get iterator => _iteratorId(this, JIteratorType<$E>(E), [])!; static final _lastIndexOfId = _class.instanceMethodId(r'lastIndexOf', r'(Ljava/lang/Object;)I'); @@ -215,15 +272,15 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { int lastIndexOf(Object? element, [int? start]) { if (element is! JObject) return -1; if (start == null || start >= this.length) start = this.length - 1; + final elementRef = element.reference; if (start == this.length - 1) { - return _lastIndexOfId( - this, const jintType(), [element.reference.pointer]); + return _lastIndexOfId(this, const jintType(), [elementRef.pointer]); } final range = getRange(start, length); final res = _lastIndexOfId( range, const jintType(), - [element], + [elementRef.pointer], ); range.release(); return res; @@ -234,14 +291,15 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { @override bool remove(Object? element) { if (element is! JObject) return false; - return _removeId(this, const jbooleanType(), [element.reference.pointer]); + final elementRef = element.reference; + return _removeId(this, const jbooleanType(), [elementRef.pointer]); } static final _removeAtId = _class.instanceMethodId(r'remove', r'(I)Ljava/lang/Object;'); @override $E removeAt(int index) { - return _removeAtId(this, E, [JValueInt(index)]); + return _removeAtId(this, E, [JValueInt(index)])!; } @override @@ -257,7 +315,7 @@ class JList<$E extends JObject> extends JObject with ListMixin<$E> { } } -extension ToJavaList on Iterable { +extension ToJavaList on Iterable { JList toJList(JObjType type) { final list = JList.array(type); list.addAll(this); diff --git a/pkgs/jni/lib/src/util/jmap.dart b/pkgs/jni/lib/src/util/jmap.dart index 59eed41d0..cc9071780 100644 --- a/pkgs/jni/lib/src/util/jmap.dart +++ b/pkgs/jni/lib/src/util/jmap.dart @@ -11,7 +11,54 @@ import '../jreference.dart'; import '../types.dart'; import 'jset.dart'; -final class JMapType<$K extends JObject, $V extends JObject> +final class JMapNullableType<$K extends JObject?, $V extends JObject?> + extends JObjType?> { + @internal + final JObjType<$K> K; + + @internal + final JObjType<$V> V; + + @internal + const JMapNullableType( + this.K, + this.V, + ); + + @internal + @override + String get signature => r'Ljava/util/Map;'; + + @internal + @override + JMap<$K, $V>? fromReference(JReference reference) => + reference.isNull ? null : JMap<$K, $V>.fromReference(K, V, reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType?> get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => Object.hash(JMapNullableType, K, V); + + @override + bool operator ==(Object other) { + return other.runtimeType == (JMapNullableType<$K, $V>) && + other is JMapNullableType<$K, $V> && + K == other.K && + V == other.V; + } +} + +final class JMapType<$K extends JObject?, $V extends JObject?> extends JObjType> { @internal final JObjType<$K> K; @@ -32,12 +79,16 @@ final class JMapType<$K extends JObject, $V extends JObject> @internal @override JMap<$K, $V> fromReference(JReference reference) => - JMap.fromReference(K, V, reference); + JMap<$K, $V>.fromReference(K, V, reference); @internal @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType?> get nullableType => JMapNullableType<$K, $V>(K, V); + @internal @override final superCount = 1; @@ -54,7 +105,7 @@ final class JMapType<$K extends JObject, $V extends JObject> } } -class JMap<$K extends JObject, $V extends JObject> extends JObject +class JMap<$K extends JObject?, $V extends JObject?> extends JObject with MapMixin<$K, $V> { @internal @override @@ -71,26 +122,32 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject this.K, this.V, JReference reference, - ) : $type = type(K, V), + ) : $type = type<$K, $V>(K, V), super.fromReference(reference); static final _class = JClass.forName(r'java/util/Map'); /// The type which includes information such as the signature of this class. - static JMapType<$K, $V> type<$K extends JObject, $V extends JObject>( + static JMapType<$K, $V> type<$K extends JObject?, $V extends JObject?>( + JObjType<$K> K, + JObjType<$V> V, + ) { + return JMapType<$K, $V>(K, V); + } + + /// The type which includes information such as the signature of this class. + static JMapNullableType<$K, $V> + nullableType<$K extends JObject?, $V extends JObject?>( JObjType<$K> K, JObjType<$V> V, ) { - return JMapType( - K, - V, - ); + return JMapNullableType<$K, $V>(K, V); } static final _hashMapClass = JClass.forName(r'java/util/HashMap'); static final _ctorId = _hashMapClass.constructorId(r'()V'); JMap.hash(this.K, this.V) - : $type = type(K, V), + : $type = type<$K, $V>(K, V), super.fromReference(_ctorId(_hashMapClass, referenceType, [])); static final _getId = _class.instanceMethodId( @@ -100,15 +157,18 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject if (key is! JObject) { return null; } - final value = _getId(this, V, [key.reference.pointer]); - return value.isNull ? null : value; + final keyRef = key.reference; + final value = _getId(this, V.nullableType, [keyRef.pointer]); + return value; } static final _putId = _class.instanceMethodId( r'put', r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;'); @override void operator []=($K key, $V value) { - _putId(this, V, [key.reference.pointer, value.reference.pointer]); + final keyRef = key?.reference ?? jNullReference; + final valueRef = value?.reference ?? jNullReference; + _putId(this, V.nullableType, [keyRef.pointer, valueRef.pointer]); } static final _addAllId = @@ -116,7 +176,8 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject @override void addAll(Map<$K, $V> other) { if (other is JMap<$K, $V>) { - _addAllId(this, const jvoidType(), [other.reference.pointer]); + final otherRef = other.reference; + _addAllId(this, const jvoidType(), [otherRef.pointer]); return; } super.addAll(other); @@ -135,7 +196,8 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject if (key is! JObject) { return false; } - return _containsKeyId(this, const jbooleanType(), [key.reference.pointer]); + final keyRef = key.reference; + return _containsKeyId(this, const jbooleanType(), [keyRef.pointer]); } static final _containsValueId = @@ -145,8 +207,8 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject if (value is! JObject) { return false; } - return _containsValueId( - this, const jbooleanType(), [value.reference.pointer]); + final valueRef = value.reference; + return _containsValueId(this, const jbooleanType(), [valueRef.pointer]); } static final isEmptyId = _class.instanceMethodId(r'isEmpty', r'()Z'); @@ -159,7 +221,7 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject static final _keysId = _class.instanceMethodId(r'keySet', r'()Ljava/util/Set;'); @override - JSet<$K> get keys => _keysId(this, JSetType(K), []); + JSet<$K> get keys => _keysId(this, JSetType<$K>(K), [])!; static final _sizeId = _class.instanceMethodId(r'size', r'()I'); @override @@ -172,12 +234,13 @@ class JMap<$K extends JObject, $V extends JObject> extends JObject if (key is! JObject) { return null; } - final value = _removeId(this, V, [key.reference.pointer]); - return value.isNull ? null : value; + final keyRef = key.reference; + final value = _removeId(this, V.nullableType, [keyRef.pointer]); + return value; } } -extension ToJavaMap on Map { +extension ToJavaMap on Map { JMap toJMap(JObjType keyType, JObjType valueType) { final map = JMap.hash(keyType, valueType); map.addAll(this); diff --git a/pkgs/jni/lib/src/util/jset.dart b/pkgs/jni/lib/src/util/jset.dart index 44e6998cb..7f656471b 100644 --- a/pkgs/jni/lib/src/util/jset.dart +++ b/pkgs/jni/lib/src/util/jset.dart @@ -12,7 +12,48 @@ import '../jreference.dart'; import '../types.dart'; import 'jiterator.dart'; -final class JSetType<$E extends JObject> extends JObjType> { +final class JSetNullableType<$E extends JObject?> extends JObjType?> { + @internal + final JObjType<$E> E; + + @internal + const JSetNullableType( + this.E, + ); + + @internal + @override + String get signature => r'Ljava/util/Set;'; + + @internal + @override + JSet<$E>? fromReference(JReference reference) => + reference.isNull ? null : JSet<$E>.fromReference(E, reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType?> get nullableType => this; + + @internal + @override + final superCount = 1; + + @override + int get hashCode => Object.hash(JSetNullableType, E); + + @override + bool operator ==(Object other) { + return other.runtimeType == (JSetNullableType<$E>) && + other is JSetNullableType<$E> && + E == other.E; + } +} + +final class JSetType<$E extends JObject?> extends JObjType> { @internal final JObjType<$E> E; @@ -28,12 +69,16 @@ final class JSetType<$E extends JObject> extends JObjType> { @internal @override JSet<$E> fromReference(JReference reference) => - JSet.fromReference(E, reference); + JSet<$E>.fromReference(E, reference); @internal @override JObjType get superType => const JObjectType(); + @internal + @override + JObjType?> get nullableType => JSetNullableType<$E>(E); + @internal @override final superCount = 1; @@ -49,7 +94,7 @@ final class JSetType<$E extends JObject> extends JObjType> { } } -class JSet<$E extends JObject> extends JObject with SetMixin<$E> { +class JSet<$E extends JObject?> extends JObject with SetMixin<$E> { @internal @override // ignore: overridden_fields @@ -61,47 +106,56 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { JSet.fromReference( this.E, JReference reference, - ) : $type = type(E), + ) : $type = type<$E>(E), super.fromReference(reference); static final _class = JClass.forName(r'java/util/Set'); /// The type which includes information such as the signature of this class. - static JSetType<$E> type<$E extends JObject>( + static JSetType<$E> type<$E extends JObject?>( + JObjType<$E> E, + ) { + return JSetType<$E>(E); + } + + /// The type which includes information such as the signature of this class. + static JSetNullableType<$E> nullableType<$E extends JObject?>( JObjType<$E> E, ) { - return JSetType( - E, - ); + return JSetNullableType<$E>(E); } static final _hashSetClass = JClass.forName(r'java/util/HashSet'); static final _ctorId = _hashSetClass.constructorId(r'()V'); JSet.hash(this.E) - : $type = type(E), + : $type = type<$E>(E), super.fromReference(_ctorId(_hashSetClass, referenceType, [])); static final _addId = _class.instanceMethodId(r'add', r'(Ljava/lang/Object;)Z'); @override bool add($E value) { - return _addId(this, const jbooleanType(), [value.reference.pointer]); + final valueRef = value?.reference ?? jNullReference; + return _addId(this, const jbooleanType(), [valueRef.pointer]); } static final _addAllId = _class.instanceMethodId(r'addAll', r'(Ljava/util/Collection;)Z'); @override void addAll(Iterable<$E> elements) { - if (elements is JObject && - Jni.env.IsInstanceOf((elements as JObject).reference.pointer, - _collectionClass.reference.pointer)) { - _addAllId( - this, - const jbooleanType(), - [(elements as JObject).reference.pointer], - ); - return; + if (elements is JObject) { + final elementsRef = (elements as JObject).reference; + if (Jni.env.IsInstanceOf( + elementsRef.pointer, _collectionClass.reference.pointer)) { + _addAllId( + this, + const jbooleanType(), + [elementsRef.pointer], + ); + return; + } } + return super.addAll(elements); } @@ -119,7 +173,8 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { if (element is! JObject) { return false; } - return _containsId(this, const jbooleanType(), [element.reference.pointer]); + final elementRef = element.reference; + return _containsId(this, const jbooleanType(), [elementRef.pointer]); } static final _containsAllId = @@ -127,11 +182,12 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { static final _collectionClass = JClass.forName('java/util/Collection'); @override bool containsAll(Iterable other) { - if (other is JObject && - Jni.env.IsInstanceOf((other as JObject).reference.pointer, - _collectionClass.reference.pointer)) { - return _containsAllId( - this, const jbooleanType(), [(other as JObject).reference.pointer]); + if (other is JObject) { + final otherRef = (other as JObject).reference; + if (Jni.env + .IsInstanceOf(otherRef.pointer, _collectionClass.reference.pointer)) { + return _containsAllId(this, const jbooleanType(), [otherRef.pointer]); + } } return super.containsAll(other); } @@ -146,7 +202,7 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { static final _iteratorId = _class.instanceMethodId(r'iterator', r'()Ljava/util/Iterator;'); @override - JIterator<$E> get iterator => _iteratorId(this, JIteratorType(E), []); + JIterator<$E> get iterator => _iteratorId(this, JIteratorType<$E>(E), [])!; static final _sizeId = _class.instanceMethodId(r'size', r'()I'); @override @@ -159,19 +215,21 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { if (value is! $E) { return false; } - return _removeId(this, const jbooleanType(), [value.reference.pointer]); + final valueRef = value?.reference ?? jNullReference; + return _removeId(this, const jbooleanType(), [valueRef.pointer]); } static final _removeAllId = _class.instanceMethodId(r'removeAll', r'(Ljava/util/Collection;)Z'); @override void removeAll(Iterable elements) { - if (elements is JObject && - Jni.env.IsInstanceOf((elements as JObject).reference.pointer, - _collectionClass.reference.pointer)) { - _removeAllId(this, const jbooleanType(), - [(elements as JObject).reference.pointer]); - return; + if (elements is JObject) { + final elementsRef = (elements as JObject).reference; + if (Jni.env.IsInstanceOf( + elementsRef.pointer, _collectionClass.reference.pointer)) { + _removeAllId(this, const jbooleanType(), [elementsRef.pointer]); + return; + } } return super.removeAll(elements); } @@ -180,12 +238,13 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { _class.instanceMethodId(r'retainAll', r'(Ljava/util/Collection;)Z'); @override void retainAll(Iterable elements) { - if (elements is JObject && - Jni.env.IsInstanceOf((elements as JObject).reference.pointer, - _collectionClass.reference.pointer)) { - _retainAllId(this, const jbooleanType(), - [(elements as JObject).reference.pointer]); - return; + if (elements is JObject) { + final elementsRef = (elements as JObject).reference; + if (Jni.env.IsInstanceOf( + elementsRef.pointer, _collectionClass.reference.pointer)) { + _retainAllId(this, const jbooleanType(), [elementsRef.pointer]); + return; + } } return super.retainAll(elements); } @@ -202,7 +261,7 @@ class JSet<$E extends JObject> extends JObject with SetMixin<$E> { } } -extension ToJavaSet on Iterable { +extension ToJavaSet on Iterable { JSet toJSet(JObjType type) { final set = JSet.hash(type); set.addAll(this); diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index b45b2ad15..23ac046ba 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml @@ -4,7 +4,7 @@ name: jni description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. -version: 0.12.2 +version: 0.13.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/jni issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajni diff --git a/pkgs/jni/test/isolate_test.dart b/pkgs/jni/test/isolate_test.dart index 0230ad7d2..0f8501880 100644 --- a/pkgs/jni/test/isolate_test.dart +++ b/pkgs/jni/test/isolate_test.dart @@ -20,8 +20,7 @@ void main() { } void run({required TestRunnerCallback testRunner}) { - testRunner('Sharing JObject across isolates', - skip: 'Not yet available on Dart stable', () async { + testRunner('Sharing JObject across isolates', () async { final foo = 'foo'.toJString(); final port = ReceivePort(); await Isolate.spawn((sendPort) { diff --git a/pkgs/jni/test/jarray_test.dart b/pkgs/jni/test/jarray_test.dart index e22afdfe4..d62184562 100644 --- a/pkgs/jni/test/jarray_test.dart +++ b/pkgs/jni/test/jarray_test.dart @@ -311,14 +311,14 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java string array', () { using((arena) { - final array = JArray(JString.type, 3)..releasedBy(arena); + final array = JArray(JString.nullableType, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 'حس'.toJString()..releasedBy(arena); array[1] = '\$'.toJString()..releasedBy(arena); array[2] = '33'.toJString()..releasedBy(arena); - expect(array[0].toDartString(releaseOriginal: true), 'حس'); - expect(array[1].toDartString(releaseOriginal: true), '\$'); - expect(array[2].toDartString(releaseOriginal: true), '33'); + expect(array[0]!.toDartString(releaseOriginal: true), 'حس'); + expect(array[1]!.toDartString(releaseOriginal: true), '\$'); + expect(array[2]!.toDartString(releaseOriginal: true), '33'); array.setRange( 0, 3, @@ -330,9 +330,9 @@ void run({required TestRunnerCallback testRunner}) { ], 1, ); - expect(array[0].toDartString(releaseOriginal: true), '55'); - expect(array[1].toDartString(releaseOriginal: true), '66'); - expect(array[2].toDartString(releaseOriginal: true), '77'); + expect(array[0]!.toDartString(releaseOriginal: true), '55'); + expect(array[1]!.toDartString(releaseOriginal: true), '66'); + expect(array[2]!.toDartString(releaseOriginal: true), '77'); expect(() { final _ = array[-1]; }, throwsRangeError); @@ -346,11 +346,11 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java object array', () { using((arena) { - final array = JArray(JObject.type, 3)..releasedBy(arena); + final array = JArray(JObject.nullableType, 3)..releasedBy(arena); expect(array.length, 3); - expect(array[0].reference.pointer, nullptr); - expect(array[1].reference.pointer, nullptr); - expect(array[2].reference.pointer, nullptr); + expect(array[0], isNull); + expect(array[1], isNull); + expect(array[2], isNull); }); }); testRunner('Java 2d array', () { @@ -359,18 +359,19 @@ void run({required TestRunnerCallback testRunner}) { array[0] = 1; array[1] = 2; array[2] = 3; - final twoDimArray = JArray(JArray.type(jint.type), 3)..releasedBy(arena); + final twoDimArray = JArray(JArray.nullableType(jint.type), 3) + ..releasedBy(arena); expect(twoDimArray.length, 3); twoDimArray[0] = array; twoDimArray[1] = array; twoDimArray[2] = array; for (var i = 0; i < 3; ++i) { - expect(twoDimArray[i][0], 1); - expect(twoDimArray[i][1], 2); - expect(twoDimArray[i][2], 3); + expect(twoDimArray[i]![0], 1); + expect(twoDimArray[i]![1], 2); + expect(twoDimArray[i]![2], 3); } - twoDimArray[2][2] = 4; - expect(twoDimArray[2][2], 4); + twoDimArray[2]![2] = 4; + expect(twoDimArray[2]![2], 4); }); }); testRunner('JArray.filled', () { @@ -378,7 +379,7 @@ void run({required TestRunnerCallback testRunner}) { final string = 'abc'.toJString()..releasedBy(arena); final array = JArray.filled(3, string)..releasedBy(arena); expect( - () => JArray.filled(-3, JString.fromReference(jNullReference)), + () => JArray.filled(-3, 'abc'.toJString()..releasedBy(arena)), throwsA(isA()), ); expect(array.length, 3); @@ -389,75 +390,77 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('JArray of JByte', () { using((arena) { - final arr = JArray(JByte.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JByte.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JShort', () { using((arena) { - final arr = JArray(JShort.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JShort.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JInteger', () { using((arena) { - final arr = JArray(JInteger.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JInteger.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JCharacter', () { using((arena) { - final arr = JArray(JCharacter.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JCharacter.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JLong', () { using((arena) { - final arr = JArray(JLong.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JLong.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JFloat', () { using((arena) { - final arr = JArray(JFloat.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JFloat.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JDouble', () { using((arena) { - final arr = JArray(JDouble.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JDouble.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JBoolean', () { using((arena) { - final arr = JArray(JBoolean.type, 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JBoolean.nullableType, 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JSet', () { using((arena) { - final arr = JArray(JSet.type(JString.type), 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JSet.nullableType(JString.type), 1)..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JList', () { using((arena) { - final arr = JArray(JList.type(JString.type), 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JList.nullableType(JString.type), 1) + ..releasedBy(arena); + expect(arr[0], isNull); }); }); testRunner('JArray of JMap', () { using((arena) { - final arr = JArray(JMap.type(JString.type, JString.type), 1) + final arr = JArray(JMap.nullableType(JString.type, JString.type), 1) ..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + expect(arr[0], isNull); }); }); testRunner('JArray of JIterator', () { using((arena) { - final arr = JArray(JIterator.type(JString.type), 1)..releasedBy(arena); - expect((arr[0]..releasedBy(arena)).isNull, true); + final arr = JArray(JIterator.nullableType(JString.type), 1) + ..releasedBy(arena); + expect(arr[0], isNull); }); }); } diff --git a/pkgs/jni/test/jbyte_buffer_test.dart b/pkgs/jni/test/jbyte_buffer_test.dart index fae8a6d5b..a26126d73 100644 --- a/pkgs/jni/test/jbyte_buffer_test.dart +++ b/pkgs/jni/test/jbyte_buffer_test.dart @@ -201,8 +201,8 @@ void run({required TestRunnerCallback testRunner}) { final b = testDataBuffer(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); - final c = JBuffer.fromReference(jNullReference); - final d = JBuffer.fromReference(jNullReference); + final c = JBuffer.fromReference(a.reference); + final d = JBuffer.fromReference(b.reference); expect(c.$type, d.$type); expect(c.$type.hashCode, d.$type.hashCode); diff --git a/pkgs/jni/test/jlist_test.dart b/pkgs/jni/test/jlist_test.dart index 30d062511..a967950cf 100644 --- a/pkgs/jni/test/jlist_test.dart +++ b/pkgs/jni/test/jlist_test.dart @@ -36,12 +36,17 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('length set', () { using((arena) { - final list = testDataList(arena); + final list = [ + '1'.toJString()..releasedBy(arena), + '2'.toJString()..releasedBy(arena), + '3'.toJString()..releasedBy(arena), + ].toJList(JString.nullableType) + ..releasedBy(arena); list.length = 2; expect(list.length, 2); list.length = 3; expect(list.length, 3); - expect(list.last.isNull, true); + expect(list.last, isNull); }); }); testRunner('[]', () { diff --git a/pkgs/jni/test/jobject_test.dart b/pkgs/jni/test/jobject_test.dart index ecb64bdfc..414f3df43 100644 --- a/pkgs/jni/test/jobject_test.dart +++ b/pkgs/jni/test/jobject_test.dart @@ -297,15 +297,10 @@ void run({required TestRunnerCallback testRunner}) { ); }); - testRunner('toString', () { - final long = JLong(1); - expect( - long.toString(), - '1', - ); + testRunner('Disallow construction of null JObject', () { expect( - JLong.fromReference(jNullReference).toString(), - 'null', + () => JObject.fromReference(jNullReference), + throwsA(isA()), ); }); } diff --git a/pkgs/jni/test/type_test.dart b/pkgs/jni/test/type_test.dart index c42e3ddd2..333945946 100644 --- a/pkgs/jni/test/type_test.dart +++ b/pkgs/jni/test/type_test.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:io'; - import 'package:jni/_internal.dart'; import 'package:jni/jni.dart'; import 'package:jni/src/types.dart'; @@ -26,6 +24,38 @@ class A extends JObject { JObjType get $type => $AType(); } +final class $ANullableType extends JObjType { + @internal + @override + A? fromReference(JReference reference) { + return reference.isNull ? null : A.fromReference(reference); + } + + @internal + @override + String get signature => 'A'; + + @internal + @override + int get superCount => superType.superCount + 1; + + @internal + @override + JObjType get superType => JObject.nullableType; + + @internal + @override + JObjType get nullableType => this; + + @override + int get hashCode => ($ANullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == $ANullableType && other is $ANullableType; + } +} + final class $AType extends JObjType { @internal @override @@ -45,6 +75,10 @@ final class $AType extends JObjType { @override JObjType get superType => JObject.type; + @internal + @override + JObjType get nullableType => $ANullableType(); + @override int get hashCode => ($AType).hashCode; @@ -60,6 +94,38 @@ class B extends JObject { JObjType get $type => $BType(); } +final class $BNullableType extends JObjType { + @internal + @override + B? fromReference(JReference reference) { + return reference.isNull ? null : B.fromReference(reference); + } + + @internal + @override + String get signature => 'B'; + + @internal + @override + int get superCount => superType.superCount + 1; + + @internal + @override + JObjType get superType => JObject.nullableType; + + @internal + @override + JObjType get nullableType => this; + + @override + int get hashCode => ($BNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == $BNullableType && other is $BNullableType; + } +} + final class $BType extends JObjType { @internal @override @@ -79,6 +145,10 @@ final class $BType extends JObjType { @override JObjType get superType => JObject.type; + @internal + @override + JObjType get nullableType => $BNullableType(); + @override int get hashCode => ($BType).hashCode; @@ -95,6 +165,38 @@ class C extends A { JObjType get $type => $CType(); } +final class $CNullableType extends JObjType { + @internal + @override + C? fromReference(JReference reference) { + return reference.isNull ? null : C.fromReference(reference); + } + + @internal + @override + String get signature => 'C'; + + @internal + @override + int get superCount => superType.superCount + 1; + + @internal + @override + JObjType get superType => $ANullableType(); + + @internal + @override + JObjType get nullableType => this; + + @override + int get hashCode => ($CNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == $CNullableType && other is $CNullableType; + } +} + final class $CType extends JObjType { @internal @override @@ -114,6 +216,10 @@ final class $CType extends JObjType { @override JObjType get superType => $AType(); + @internal + @override + JObjType get nullableType => $CNullableType(); + @override int get hashCode => ($CType).hashCode; @@ -130,6 +236,38 @@ class D extends A { JObjType get $type => $DType(); } +final class $DNullableType extends JObjType { + @internal + @override + D? fromReference(JReference reference) { + return reference.isNull ? null : D.fromReference(reference); + } + + @internal + @override + String get signature => 'D'; + + @internal + @override + int get superCount => superType.superCount + 1; + + @internal + @override + JObjType get superType => $ANullableType(); + + @internal + @override + JObjType get nullableType => this; + + @override + int get hashCode => ($DNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == $DNullableType && other is $DNullableType; + } +} + final class $DType extends JObjType { @internal @override @@ -149,6 +287,10 @@ final class $DType extends JObjType { @override JObjType get superType => $AType(); + @internal + @override + JObjType get nullableType => $DNullableType(); + @override int get hashCode => ($DType).hashCode; @@ -165,6 +307,38 @@ class E extends B { JObjType get $type => $EType(); } +final class $ENullableType extends JObjType { + @internal + @override + E? fromReference(JReference reference) { + return reference.isNull ? null : E.fromReference(reference); + } + + @internal + @override + String get signature => 'E'; + + @internal + @override + int get superCount => superType.superCount + 1; + + @internal + @override + JObjType get superType => $BNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @override + int get hashCode => ($ENullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == $ENullableType && other is $ENullableType; + } +} + final class $EType extends JObjType { @internal @override @@ -184,6 +358,10 @@ final class $EType extends JObjType { @override JObjType get superType => $BType(); + @internal + @override + JObjType get nullableType => $ENullableType(); + @override int get hashCode => ($EType).hashCode; @@ -200,6 +378,38 @@ class F extends C { JObjType get $type => $FType(); } +final class $FNullableType extends JObjType { + @internal + @override + F? fromReference(JReference reference) { + return reference.isNull ? null : F.fromReference(reference); + } + + @internal + @override + String get signature => 'F'; + + @internal + @override + int get superCount => superType.superCount + 1; + + @internal + @override + JObjType get superType => $CNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @override + int get hashCode => ($FNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == $FNullableType && other is $FNullableType; + } +} + final class $FType extends JObjType { @internal @override @@ -219,6 +429,10 @@ final class $FType extends JObjType { @override JObjType get superType => $CType(); + @internal + @override + JObjType get nullableType => $FNullableType(); + @override int get hashCode => ($FType).hashCode; @@ -229,10 +443,6 @@ final class $FType extends JObjType { } void main() { - if (!Platform.isAndroid) { - checkDylibIsUpToDate(); - spawnJvm(); - } run(testRunner: test); } @@ -261,6 +471,21 @@ void run({required TestRunnerCallback testRunner}) { expect(lowestCommonSuperType([JByte.type, JBoolean.type]), JObject.type); }); + testRunner('Nullable boxed types', () { + expect( + lowestCommonSuperType([ + JByte.type, + JInteger.type, + JLong.type, + JShort.nullableType, // A single nullable type, + JDouble.type, + JFloat.type, + ]), + JNumber.nullableType, // Makes the common super class nullable. + ); + expect(lowestCommonSuperType([JByte.type, JBoolean.type]), JObject.type); + }); + testRunner('array types', () { using((arena) { expect( @@ -348,4 +573,37 @@ void run({required TestRunnerCallback testRunner}) { expect(lowestCommonSuperType([$EType(), $BType()]), $BType()); expect(lowestCommonSuperType([$BType(), $BType()]), $BType()); }); + + testRunner('Mocked nullable type tree', () { + // As a reminder, this is how the type tree looks like: + // JObject + // | \ + // A B + // / \ \ + // C D E + // / + // F + expect(lowestCommonSuperType([$AType(), $BNullableType()]), + JObject.nullableType); + expect(lowestCommonSuperType([$CNullableType(), $BType()]), + JObject.nullableType); + expect(lowestCommonSuperType([$FNullableType(), $BNullableType()]), + JObject.nullableType); + expect(lowestCommonSuperType([$ENullableType(), $CType(), $FType()]), + JObject.nullableType); + + expect( + lowestCommonSuperType([$CType(), $DNullableType()]), $ANullableType()); + expect( + lowestCommonSuperType([$FNullableType(), $DType()]), $ANullableType()); + expect(lowestCommonSuperType([$FType(), $CNullableType(), $DType()]), + $ANullableType()); + + expect( + lowestCommonSuperType([$ENullableType(), $BType()]), $BNullableType()); + expect( + lowestCommonSuperType([$BNullableType(), $BType()]), $BNullableType()); + expect(lowestCommonSuperType([$BNullableType(), $BNullableType()]), + $BNullableType()); + }); } diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 68a4b6903..7d94206cb 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.13.0-wip + +- **Breaking Change**([#1644](https://github.com/dart-lang/native/issues/1644)): + Generate null-safe Dart bindings. + ## 0.12.2 - Now excludes invalid identifiers by default. diff --git a/pkgs/jnigen/README.md b/pkgs/jnigen/README.md index 87debcbb3..a300c2772 100644 --- a/pkgs/jnigen/README.md +++ b/pkgs/jnigen/README.md @@ -214,6 +214,8 @@ A `*` denotes required configuration. | `output:` >> `dart:` | (Subsection) | This subsection specifies Dart output configuration. | | `output:` >> `dart:` >> `structure` | `package_structure` / `single_file` | Whether to map resulting dart bindings to file-per-class source layout, or write all bindings to single file. | `output:` >> `dart:` >> `path` * | Directory path or File path | Path to write Dart bindings. Should end in `.dart` for `single_file` configurations, and end in `/` for `package_structure` (default) configuration. | +| `non_null_annotations:` | List of annotation fully qualified names | List of custom annotations that specify if the annotation type is non-nullable. | +| `nullable_annotations:` | List of annotation fully qualified names | List of custom annotations that specify if the annotation type is nullable. | | `maven_downloads:` | (Subsection) | This subsection will contain configuration for automatically downloading Java dependencies (source and JAR) through maven. | | `maven_downloads:` >> `source_deps` | List of maven package coordinates | Source packages to download and unpack using maven. The names should be valid maven artifact coordinates. (Eg: `org.apache.pdfbox:pdfbox:2.0.26`). The downloads do not include transitive dependencies. | | `maven_downloads:` >> `source_dir` | Path | Directory in which maven sources are extracted. Defaults to `mvn_java`. It's not required to list this explicitly in source_path. | diff --git a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart index 8c03e0107..62bc1d88d 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -20,6 +20,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -50,6 +51,7 @@ class R_drawable extends _$jni.JObject { _$jni.JClass.forName(r'com/example/in_app_java/R$drawable'); /// The type which includes information such as the signature of this class. + static const nullableType = $R_drawable$NullableType(); static const type = $R_drawable$Type(); static final _id_launch_background = _class.staticFieldId( r'launch_background', @@ -65,6 +67,43 @@ class R_drawable extends _$jni.JObject { _id_launch_background.set(_class, const _$jni.jintType(), value); } +final class $R_drawable$NullableType extends _$jni.JObjType { + @_$jni.internal + const $R_drawable$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/example/in_app_java/R$drawable;'; + + @_$jni.internal + @_$core.override + R_drawable? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : R_drawable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($R_drawable$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($R_drawable$NullableType) && + other is $R_drawable$NullableType; + } +} + final class $R_drawable$Type extends _$jni.JObjType { @_$jni.internal const $R_drawable$Type(); @@ -76,11 +115,17 @@ final class $R_drawable$Type extends _$jni.JObjType { @_$jni.internal @_$core.override R_drawable fromReference(_$jni.JReference reference) => - R_drawable.fromReference(reference); + R_drawable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $R_drawable$NullableType(); @_$jni.internal @_$core.override @@ -111,6 +156,7 @@ class R_mipmap extends _$jni.JObject { _$jni.JClass.forName(r'com/example/in_app_java/R$mipmap'); /// The type which includes information such as the signature of this class. + static const nullableType = $R_mipmap$NullableType(); static const type = $R_mipmap$Type(); static final _id_ic_launcher = _class.staticFieldId( r'ic_launcher', @@ -126,6 +172,43 @@ class R_mipmap extends _$jni.JObject { _id_ic_launcher.set(_class, const _$jni.jintType(), value); } +final class $R_mipmap$NullableType extends _$jni.JObjType { + @_$jni.internal + const $R_mipmap$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/example/in_app_java/R$mipmap;'; + + @_$jni.internal + @_$core.override + R_mipmap? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : R_mipmap.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($R_mipmap$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($R_mipmap$NullableType) && + other is $R_mipmap$NullableType; + } +} + final class $R_mipmap$Type extends _$jni.JObjType { @_$jni.internal const $R_mipmap$Type(); @@ -136,12 +219,16 @@ final class $R_mipmap$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - R_mipmap fromReference(_$jni.JReference reference) => - R_mipmap.fromReference(reference); + R_mipmap fromReference(_$jni.JReference reference) => R_mipmap.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $R_mipmap$NullableType(); @_$jni.internal @_$core.override @@ -172,6 +259,7 @@ class R_style extends _$jni.JObject { _$jni.JClass.forName(r'com/example/in_app_java/R$style'); /// The type which includes information such as the signature of this class. + static const nullableType = $R_style$NullableType(); static const type = $R_style$Type(); static final _id_LaunchTheme = _class.staticFieldId( r'LaunchTheme', @@ -200,6 +288,43 @@ class R_style extends _$jni.JObject { _id_NormalTheme.set(_class, const _$jni.jintType(), value); } +final class $R_style$NullableType extends _$jni.JObjType { + @_$jni.internal + const $R_style$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/example/in_app_java/R$style;'; + + @_$jni.internal + @_$core.override + R_style? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : R_style.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($R_style$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($R_style$NullableType) && + other is $R_style$NullableType; + } +} + final class $R_style$Type extends _$jni.JObjType { @_$jni.internal const $R_style$Type(); @@ -210,12 +335,16 @@ final class $R_style$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - R_style fromReference(_$jni.JReference reference) => - R_style.fromReference(reference); + R_style fromReference(_$jni.JReference reference) => R_style.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $R_style$NullableType(); @_$jni.internal @_$core.override @@ -245,9 +374,46 @@ class R extends _$jni.JObject { static final _class = _$jni.JClass.forName(r'com/example/in_app_java/R'); /// The type which includes information such as the signature of this class. + static const nullableType = $R$NullableType(); static const type = $R$Type(); } +final class $R$NullableType extends _$jni.JObjType { + @_$jni.internal + const $R$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/example/in_app_java/R;'; + + @_$jni.internal + @_$core.override + R? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : R.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($R$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($R$NullableType) && other is $R$NullableType; + } +} + final class $R$Type extends _$jni.JObjType { @_$jni.internal const $R$Type(); @@ -258,11 +424,16 @@ final class $R$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - R fromReference(_$jni.JReference reference) => R.fromReference(reference); + R fromReference(_$jni.JReference reference) => R.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $R$NullableType(); @_$jni.internal @_$core.override @@ -293,6 +464,8 @@ class EmojiCompat_CodepointSequenceMatchResult extends _$jni.JObject { r'androidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult'); /// The type which includes information such as the signature of this class. + static const nullableType = + $EmojiCompat_CodepointSequenceMatchResult$NullableType(); static const type = $EmojiCompat_CodepointSequenceMatchResult$Type(); /// Maps a specific port to the implemented interface. @@ -378,6 +551,50 @@ final class _$EmojiCompat_CodepointSequenceMatchResult _$EmojiCompat_CodepointSequenceMatchResult(); } +final class $EmojiCompat_CodepointSequenceMatchResult$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_CodepointSequenceMatchResult$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult;'; + + @_$jni.internal + @_$core.override + EmojiCompat_CodepointSequenceMatchResult? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_CodepointSequenceMatchResult.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + ($EmojiCompat_CodepointSequenceMatchResult$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($EmojiCompat_CodepointSequenceMatchResult$NullableType) && + other is $EmojiCompat_CodepointSequenceMatchResult$NullableType; + } +} + final class $EmojiCompat_CodepointSequenceMatchResult$Type extends _$jni.JObjType { @_$jni.internal @@ -392,11 +609,17 @@ final class $EmojiCompat_CodepointSequenceMatchResult$Type @_$core.override EmojiCompat_CodepointSequenceMatchResult fromReference( _$jni.JReference reference) => - EmojiCompat_CodepointSequenceMatchResult.fromReference(reference); + EmojiCompat_CodepointSequenceMatchResult.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_CodepointSequenceMatchResult$NullableType(); @_$jni.internal @_$core.override @@ -429,6 +652,7 @@ class EmojiCompat_Config extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$Config'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_Config$NullableType(); static const type = $EmojiCompat_Config$Type(); static final _id_registerInitCallback = _class.instanceMethodId( r'registerInitCallback', @@ -448,14 +672,15 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config registerInitCallback( - EmojiCompat_InitCallback initCallback, + EmojiCompat_Config? registerInitCallback( + EmojiCompat_InitCallback? initCallback, ) { + final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; return _registerInitCallback( reference.pointer, _id_registerInitCallback as _$jni.JMethodIDPtr, - initCallback.reference.pointer) - .object(const $EmojiCompat_Config$Type()); + _$initCallback.pointer) + .object(const $EmojiCompat_Config$NullableType()); } static final _id_unregisterInitCallback = _class.instanceMethodId( @@ -476,14 +701,15 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config unregisterInitCallback( - EmojiCompat_InitCallback initCallback, + EmojiCompat_Config? unregisterInitCallback( + EmojiCompat_InitCallback? initCallback, ) { + final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; return _unregisterInitCallback( reference.pointer, _id_unregisterInitCallback as _$jni.JMethodIDPtr, - initCallback.reference.pointer) - .object(const $EmojiCompat_Config$Type()); + _$initCallback.pointer) + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setReplaceAll = _class.instanceMethodId( @@ -503,12 +729,12 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setReplaceAll(boolean z)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setReplaceAll( + EmojiCompat_Config? setReplaceAll( bool z, ) { return _setReplaceAll(reference.pointer, _id_setReplaceAll as _$jni.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_Config$Type()); + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setUseEmojiAsDefaultStyle = _class.instanceMethodId( @@ -528,12 +754,12 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setUseEmojiAsDefaultStyle( + EmojiCompat_Config? setUseEmojiAsDefaultStyle( bool z, ) { return _setUseEmojiAsDefaultStyle(reference.pointer, _id_setUseEmojiAsDefaultStyle as _$jni.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_Config$Type()); + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setUseEmojiAsDefaultStyle$1 = _class.instanceMethodId( @@ -558,16 +784,17 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z, java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setUseEmojiAsDefaultStyle$1( + EmojiCompat_Config? setUseEmojiAsDefaultStyle$1( bool z, - _$jni.JList<_$jni.JInteger> list, + _$jni.JList<_$jni.JInteger?>? list, ) { + final _$list = list?.reference ?? _$jni.jNullReference; return _setUseEmojiAsDefaultStyle$1( reference.pointer, _id_setUseEmojiAsDefaultStyle$1 as _$jni.JMethodIDPtr, z ? 1 : 0, - list.reference.pointer) - .object(const $EmojiCompat_Config$Type()); + _$list.pointer) + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setEmojiSpanIndicatorEnabled = _class.instanceMethodId( @@ -587,12 +814,12 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorEnabled(boolean z)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setEmojiSpanIndicatorEnabled( + EmojiCompat_Config? setEmojiSpanIndicatorEnabled( bool z, ) { return _setEmojiSpanIndicatorEnabled(reference.pointer, _id_setEmojiSpanIndicatorEnabled as _$jni.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_Config$Type()); + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setEmojiSpanIndicatorColor = _class.instanceMethodId( @@ -612,12 +839,12 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorColor(int i)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setEmojiSpanIndicatorColor( + EmojiCompat_Config? setEmojiSpanIndicatorColor( int i, ) { return _setEmojiSpanIndicatorColor(reference.pointer, _id_setEmojiSpanIndicatorColor as _$jni.JMethodIDPtr, i) - .object(const $EmojiCompat_Config$Type()); + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setMetadataLoadStrategy = _class.instanceMethodId( @@ -637,12 +864,12 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setMetadataLoadStrategy(int i)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setMetadataLoadStrategy( + EmojiCompat_Config? setMetadataLoadStrategy( int i, ) { return _setMetadataLoadStrategy(reference.pointer, _id_setMetadataLoadStrategy as _$jni.JMethodIDPtr, i) - .object(const $EmojiCompat_Config$Type()); + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setSpanFactory = _class.instanceMethodId( @@ -663,14 +890,13 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setSpanFactory(androidx.emoji2.text.EmojiCompat$SpanFactory spanFactory)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setSpanFactory( - EmojiCompat_SpanFactory spanFactory, + EmojiCompat_Config? setSpanFactory( + EmojiCompat_SpanFactory? spanFactory, ) { - return _setSpanFactory( - reference.pointer, - _id_setSpanFactory as _$jni.JMethodIDPtr, - spanFactory.reference.pointer) - .object(const $EmojiCompat_Config$Type()); + final _$spanFactory = spanFactory?.reference ?? _$jni.jNullReference; + return _setSpanFactory(reference.pointer, + _id_setSpanFactory as _$jni.JMethodIDPtr, _$spanFactory.pointer) + .object(const $EmojiCompat_Config$NullableType()); } static final _id_setGlyphChecker = _class.instanceMethodId( @@ -691,14 +917,52 @@ class EmojiCompat_Config extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setGlyphChecker(androidx.emoji2.text.EmojiCompat$GlyphChecker glyphChecker)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config setGlyphChecker( - EmojiCompat_GlyphChecker glyphChecker, + EmojiCompat_Config? setGlyphChecker( + EmojiCompat_GlyphChecker? glyphChecker, ) { - return _setGlyphChecker( - reference.pointer, - _id_setGlyphChecker as _$jni.JMethodIDPtr, - glyphChecker.reference.pointer) - .object(const $EmojiCompat_Config$Type()); + final _$glyphChecker = glyphChecker?.reference ?? _$jni.jNullReference; + return _setGlyphChecker(reference.pointer, + _id_setGlyphChecker as _$jni.JMethodIDPtr, _$glyphChecker.pointer) + .object(const $EmojiCompat_Config$NullableType()); + } +} + +final class $EmojiCompat_Config$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_Config$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat$Config;'; + + @_$jni.internal + @_$core.override + EmojiCompat_Config? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_Config.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_Config$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_Config$NullableType) && + other is $EmojiCompat_Config$NullableType; } } @@ -714,11 +978,17 @@ final class $EmojiCompat_Config$Type @_$jni.internal @_$core.override EmojiCompat_Config fromReference(_$jni.JReference reference) => - EmojiCompat_Config.fromReference(reference); + EmojiCompat_Config.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_Config$NullableType(); @_$jni.internal @_$core.override @@ -750,6 +1020,7 @@ class EmojiCompat_DefaultSpanFactory extends _$jni.JObject { r'androidx/emoji2/text/EmojiCompat$DefaultSpanFactory'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_DefaultSpanFactory$NullableType(); static const type = $EmojiCompat_DefaultSpanFactory$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -793,12 +1064,55 @@ class EmojiCompat_DefaultSpanFactory extends _$jni.JObject { /// from: `public androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer typefaceEmojiRasterizer)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject createSpan( - _$jni.JObject typefaceEmojiRasterizer, + _$jni.JObject? createSpan( + _$jni.JObject? typefaceEmojiRasterizer, ) { + final _$typefaceEmojiRasterizer = + typefaceEmojiRasterizer?.reference ?? _$jni.jNullReference; return _createSpan(reference.pointer, _id_createSpan as _$jni.JMethodIDPtr, - typefaceEmojiRasterizer.reference.pointer) - .object(const _$jni.JObjectType()); + _$typefaceEmojiRasterizer.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + } +} + +final class $EmojiCompat_DefaultSpanFactory$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_DefaultSpanFactory$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/EmojiCompat$DefaultSpanFactory;'; + + @_$jni.internal + @_$core.override + EmojiCompat_DefaultSpanFactory? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_DefaultSpanFactory.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_DefaultSpanFactory$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($EmojiCompat_DefaultSpanFactory$NullableType) && + other is $EmojiCompat_DefaultSpanFactory$NullableType; } } @@ -815,11 +1129,17 @@ final class $EmojiCompat_DefaultSpanFactory$Type @_$jni.internal @_$core.override EmojiCompat_DefaultSpanFactory fromReference(_$jni.JReference reference) => - EmojiCompat_DefaultSpanFactory.fromReference(reference); + EmojiCompat_DefaultSpanFactory.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_DefaultSpanFactory$NullableType(); @_$jni.internal @_$core.override @@ -851,6 +1171,7 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$GlyphChecker'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_GlyphChecker$NullableType(); static const type = $EmojiCompat_GlyphChecker$Type(); static final _id_hasGlyph = _class.instanceMethodId( r'hasGlyph', @@ -875,13 +1196,14 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { /// from: `public abstract boolean hasGlyph(java.lang.CharSequence charSequence, int i, int i1, int i2)` bool hasGlyph( - _$jni.JObject charSequence, + _$jni.JObject? charSequence, int i, int i1, int i2, ) { + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; return _hasGlyph(reference.pointer, _id_hasGlyph as _$jni.JMethodIDPtr, - charSequence.reference.pointer, i, i1, i2) + _$charSequence.pointer, i, i1, i2) .boolean; } @@ -917,14 +1239,14 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { final $a = $i.args; if ($d == r'hasGlyph(Ljava/lang/CharSequence;III)Z') { final $r = _$impls[$p]!.hasGlyph( - $a[0].as(const _$jni.JObjectType(), releaseOriginal: true), - $a[1] + $a![0]?.as(const _$jni.JObjectType(), releaseOriginal: true), + $a![1]! .as(const _$jni.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), - $a[2] + $a![2]! .as(const _$jni.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), - $a[3] + $a![3]! .as(const _$jni.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), ); @@ -974,27 +1296,66 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { abstract base mixin class $EmojiCompat_GlyphChecker { factory $EmojiCompat_GlyphChecker({ - required bool Function(_$jni.JObject charSequence, int i, int i1, int i2) + required bool Function(_$jni.JObject? charSequence, int i, int i1, int i2) hasGlyph, }) = _$EmojiCompat_GlyphChecker; - bool hasGlyph(_$jni.JObject charSequence, int i, int i1, int i2); + bool hasGlyph(_$jni.JObject? charSequence, int i, int i1, int i2); } final class _$EmojiCompat_GlyphChecker with $EmojiCompat_GlyphChecker { _$EmojiCompat_GlyphChecker({ - required bool Function(_$jni.JObject charSequence, int i, int i1, int i2) + required bool Function(_$jni.JObject? charSequence, int i, int i1, int i2) hasGlyph, }) : _hasGlyph = hasGlyph; - final bool Function(_$jni.JObject charSequence, int i, int i1, int i2) + final bool Function(_$jni.JObject? charSequence, int i, int i1, int i2) _hasGlyph; - bool hasGlyph(_$jni.JObject charSequence, int i, int i1, int i2) { + bool hasGlyph(_$jni.JObject? charSequence, int i, int i1, int i2) { return _hasGlyph(charSequence, i, i1, i2); } } +final class $EmojiCompat_GlyphChecker$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_GlyphChecker$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat$GlyphChecker;'; + + @_$jni.internal + @_$core.override + EmojiCompat_GlyphChecker? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_GlyphChecker.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_GlyphChecker$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_GlyphChecker$NullableType) && + other is $EmojiCompat_GlyphChecker$NullableType; + } +} + final class $EmojiCompat_GlyphChecker$Type extends _$jni.JObjType { @_$jni.internal @@ -1007,11 +1368,17 @@ final class $EmojiCompat_GlyphChecker$Type @_$jni.internal @_$core.override EmojiCompat_GlyphChecker fromReference(_$jni.JReference reference) => - EmojiCompat_GlyphChecker.fromReference(reference); + EmojiCompat_GlyphChecker.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_GlyphChecker$NullableType(); @_$jni.internal @_$core.override @@ -1043,6 +1410,7 @@ class EmojiCompat_InitCallback extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$InitCallback'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_InitCallback$NullableType(); static const type = $EmojiCompat_InitCallback$Type(); static final _id_onInitialized = _class.instanceMethodId( r'onInitialized', @@ -1085,14 +1453,54 @@ class EmojiCompat_InitCallback extends _$jni.JObject { /// from: `public void onFailed(java.lang.Throwable throwable)` void onFailed( - _$jni.JObject throwable, + _$jni.JObject? throwable, ) { + final _$throwable = throwable?.reference ?? _$jni.jNullReference; _onFailed(reference.pointer, _id_onFailed as _$jni.JMethodIDPtr, - throwable.reference.pointer) + _$throwable.pointer) .check(); } } +final class $EmojiCompat_InitCallback$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_InitCallback$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat$InitCallback;'; + + @_$jni.internal + @_$core.override + EmojiCompat_InitCallback? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_InitCallback.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_InitCallback$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_InitCallback$NullableType) && + other is $EmojiCompat_InitCallback$NullableType; + } +} + final class $EmojiCompat_InitCallback$Type extends _$jni.JObjType { @_$jni.internal @@ -1105,11 +1513,17 @@ final class $EmojiCompat_InitCallback$Type @_$jni.internal @_$core.override EmojiCompat_InitCallback fromReference(_$jni.JReference reference) => - EmojiCompat_InitCallback.fromReference(reference); + EmojiCompat_InitCallback.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_InitCallback$NullableType(); @_$jni.internal @_$core.override @@ -1141,6 +1555,7 @@ class EmojiCompat_LoadStrategy extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$LoadStrategy'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_LoadStrategy$NullableType(); static const type = $EmojiCompat_LoadStrategy$Type(); /// Maps a specific port to the implemented interface. @@ -1223,6 +1638,45 @@ final class _$EmojiCompat_LoadStrategy with $EmojiCompat_LoadStrategy { _$EmojiCompat_LoadStrategy(); } +final class $EmojiCompat_LoadStrategy$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_LoadStrategy$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat$LoadStrategy;'; + + @_$jni.internal + @_$core.override + EmojiCompat_LoadStrategy? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_LoadStrategy.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_LoadStrategy$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_LoadStrategy$NullableType) && + other is $EmojiCompat_LoadStrategy$NullableType; + } +} + final class $EmojiCompat_LoadStrategy$Type extends _$jni.JObjType { @_$jni.internal @@ -1235,11 +1689,17 @@ final class $EmojiCompat_LoadStrategy$Type @_$jni.internal @_$core.override EmojiCompat_LoadStrategy fromReference(_$jni.JReference reference) => - EmojiCompat_LoadStrategy.fromReference(reference); + EmojiCompat_LoadStrategy.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_LoadStrategy$NullableType(); @_$jni.internal @_$core.override @@ -1271,6 +1731,7 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoader'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_MetadataRepoLoader$NullableType(); static const type = $EmojiCompat_MetadataRepoLoader$Type(); static final _id_load = _class.instanceMethodId( r'load', @@ -1290,10 +1751,12 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { /// from: `public abstract void load(androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback metadataRepoLoaderCallback)` void load( - EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback, + EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback, ) { + final _$metadataRepoLoaderCallback = + metadataRepoLoaderCallback?.reference ?? _$jni.jNullReference; _load(reference.pointer, _id_load as _$jni.JMethodIDPtr, - metadataRepoLoaderCallback.reference.pointer) + _$metadataRepoLoaderCallback.pointer) .check(); } @@ -1330,7 +1793,7 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { if ($d == r'load(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V') { _$impls[$p]!.load( - $a[0].as(const $EmojiCompat_MetadataRepoLoaderCallback$Type(), + $a![0]?.as(const $EmojiCompat_MetadataRepoLoaderCallback$Type(), releaseOriginal: true), ); return _$jni.nullptr; @@ -1383,30 +1846,72 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { abstract base mixin class $EmojiCompat_MetadataRepoLoader { factory $EmojiCompat_MetadataRepoLoader({ required void Function( - EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback) + EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) load, bool load$async, }) = _$EmojiCompat_MetadataRepoLoader; - void load(EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback); - bool get load$async => false; -} + void load(EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback); + bool get load$async => false; +} + +final class _$EmojiCompat_MetadataRepoLoader + with $EmojiCompat_MetadataRepoLoader { + _$EmojiCompat_MetadataRepoLoader({ + required void Function( + EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) + load, + this.load$async = false, + }) : _load = load; + + final void Function( + EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) _load; + final bool load$async; + + void load( + EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) { + return _load(metadataRepoLoaderCallback); + } +} + +final class $EmojiCompat_MetadataRepoLoader$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_MetadataRepoLoader$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;'; + + @_$jni.internal + @_$core.override + EmojiCompat_MetadataRepoLoader? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_MetadataRepoLoader.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; -final class _$EmojiCompat_MetadataRepoLoader - with $EmojiCompat_MetadataRepoLoader { - _$EmojiCompat_MetadataRepoLoader({ - required void Function( - EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback) - load, - this.load$async = false, - }) : _load = load; + @_$jni.internal + @_$core.override + final superCount = 1; - final void Function( - EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback) _load; - final bool load$async; + @_$core.override + int get hashCode => ($EmojiCompat_MetadataRepoLoader$NullableType).hashCode; - void load(EmojiCompat_MetadataRepoLoaderCallback metadataRepoLoaderCallback) { - return _load(metadataRepoLoaderCallback); + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($EmojiCompat_MetadataRepoLoader$NullableType) && + other is $EmojiCompat_MetadataRepoLoader$NullableType; } } @@ -1423,11 +1928,17 @@ final class $EmojiCompat_MetadataRepoLoader$Type @_$jni.internal @_$core.override EmojiCompat_MetadataRepoLoader fromReference(_$jni.JReference reference) => - EmojiCompat_MetadataRepoLoader.fromReference(reference); + EmojiCompat_MetadataRepoLoader.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_MetadataRepoLoader$NullableType(); @_$jni.internal @_$core.override @@ -1459,6 +1970,8 @@ class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback'); /// The type which includes information such as the signature of this class. + static const nullableType = + $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); static const type = $EmojiCompat_MetadataRepoLoaderCallback$Type(); static final _id_onLoaded = _class.instanceMethodId( r'onLoaded', @@ -1478,10 +1991,11 @@ class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { /// from: `public abstract void onLoaded(androidx.emoji2.text.MetadataRepo metadataRepo)` void onLoaded( - _$jni.JObject metadataRepo, + _$jni.JObject? metadataRepo, ) { + final _$metadataRepo = metadataRepo?.reference ?? _$jni.jNullReference; _onLoaded(reference.pointer, _id_onLoaded as _$jni.JMethodIDPtr, - metadataRepo.reference.pointer) + _$metadataRepo.pointer) .check(); } @@ -1503,14 +2017,59 @@ class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { /// from: `public abstract void onFailed(java.lang.Throwable throwable)` void onFailed( - _$jni.JObject throwable, + _$jni.JObject? throwable, ) { + final _$throwable = throwable?.reference ?? _$jni.jNullReference; _onFailed(reference.pointer, _id_onFailed as _$jni.JMethodIDPtr, - throwable.reference.pointer) + _$throwable.pointer) .check(); } } +final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;'; + + @_$jni.internal + @_$core.override + EmojiCompat_MetadataRepoLoaderCallback? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_MetadataRepoLoaderCallback.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + ($EmojiCompat_MetadataRepoLoaderCallback$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($EmojiCompat_MetadataRepoLoaderCallback$NullableType) && + other is $EmojiCompat_MetadataRepoLoaderCallback$NullableType; + } +} + final class $EmojiCompat_MetadataRepoLoaderCallback$Type extends _$jni.JObjType { @_$jni.internal @@ -1525,11 +2084,17 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$Type @_$core.override EmojiCompat_MetadataRepoLoaderCallback fromReference( _$jni.JReference reference) => - EmojiCompat_MetadataRepoLoaderCallback.fromReference(reference); + EmojiCompat_MetadataRepoLoaderCallback.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); @_$jni.internal @_$core.override @@ -1562,6 +2127,7 @@ class EmojiCompat_ReplaceStrategy extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$ReplaceStrategy'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_ReplaceStrategy$NullableType(); static const type = $EmojiCompat_ReplaceStrategy$Type(); /// Maps a specific port to the implemented interface. @@ -1644,6 +2210,45 @@ final class _$EmojiCompat_ReplaceStrategy with $EmojiCompat_ReplaceStrategy { _$EmojiCompat_ReplaceStrategy(); } +final class $EmojiCompat_ReplaceStrategy$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_ReplaceStrategy$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat$ReplaceStrategy;'; + + @_$jni.internal + @_$core.override + EmojiCompat_ReplaceStrategy? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_ReplaceStrategy.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_ReplaceStrategy$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_ReplaceStrategy$NullableType) && + other is $EmojiCompat_ReplaceStrategy$NullableType; + } +} + final class $EmojiCompat_ReplaceStrategy$Type extends _$jni.JObjType { @_$jni.internal @@ -1656,11 +2261,17 @@ final class $EmojiCompat_ReplaceStrategy$Type @_$jni.internal @_$core.override EmojiCompat_ReplaceStrategy fromReference(_$jni.JReference reference) => - EmojiCompat_ReplaceStrategy.fromReference(reference); + EmojiCompat_ReplaceStrategy.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_ReplaceStrategy$NullableType(); @_$jni.internal @_$core.override @@ -1692,6 +2303,7 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$SpanFactory'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat_SpanFactory$NullableType(); static const type = $EmojiCompat_SpanFactory$Type(); static final _id_createSpan = _class.instanceMethodId( r'createSpan', @@ -1711,12 +2323,14 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { /// from: `public abstract androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer typefaceEmojiRasterizer)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject createSpan( - _$jni.JObject typefaceEmojiRasterizer, + _$jni.JObject? createSpan( + _$jni.JObject? typefaceEmojiRasterizer, ) { + final _$typefaceEmojiRasterizer = + typefaceEmojiRasterizer?.reference ?? _$jni.jNullReference; return _createSpan(reference.pointer, _id_createSpan as _$jni.JMethodIDPtr, - typefaceEmojiRasterizer.reference.pointer) - .object(const _$jni.JObjectType()); + _$typefaceEmojiRasterizer.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } /// Maps a specific port to the implemented interface. @@ -1752,12 +2366,13 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { if ($d == r'createSpan(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;') { final $r = _$impls[$p]!.createSpan( - $a[0].as(const _$jni.JObjectType(), releaseOriginal: true), + $a![0]?.as(const _$jni.JObjectType(), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } } catch (e) { return _$jni.ProtectedJniExtensions.newDartException(e); @@ -1803,27 +2418,66 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { abstract base mixin class $EmojiCompat_SpanFactory { factory $EmojiCompat_SpanFactory({ - required _$jni.JObject Function(_$jni.JObject typefaceEmojiRasterizer) + required _$jni.JObject? Function(_$jni.JObject? typefaceEmojiRasterizer) createSpan, }) = _$EmojiCompat_SpanFactory; - _$jni.JObject createSpan(_$jni.JObject typefaceEmojiRasterizer); + _$jni.JObject? createSpan(_$jni.JObject? typefaceEmojiRasterizer); } final class _$EmojiCompat_SpanFactory with $EmojiCompat_SpanFactory { _$EmojiCompat_SpanFactory({ - required _$jni.JObject Function(_$jni.JObject typefaceEmojiRasterizer) + required _$jni.JObject? Function(_$jni.JObject? typefaceEmojiRasterizer) createSpan, }) : _createSpan = createSpan; - final _$jni.JObject Function(_$jni.JObject typefaceEmojiRasterizer) + final _$jni.JObject? Function(_$jni.JObject? typefaceEmojiRasterizer) _createSpan; - _$jni.JObject createSpan(_$jni.JObject typefaceEmojiRasterizer) { + _$jni.JObject? createSpan(_$jni.JObject? typefaceEmojiRasterizer) { return _createSpan(typefaceEmojiRasterizer); } } +final class $EmojiCompat_SpanFactory$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat_SpanFactory$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat$SpanFactory;'; + + @_$jni.internal + @_$core.override + EmojiCompat_SpanFactory? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : EmojiCompat_SpanFactory.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat_SpanFactory$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat_SpanFactory$NullableType) && + other is $EmojiCompat_SpanFactory$NullableType; + } +} + final class $EmojiCompat_SpanFactory$Type extends _$jni.JObjType { @_$jni.internal @@ -1836,11 +2490,17 @@ final class $EmojiCompat_SpanFactory$Type @_$jni.internal @_$core.override EmojiCompat_SpanFactory fromReference(_$jni.JReference reference) => - EmojiCompat_SpanFactory.fromReference(reference); + EmojiCompat_SpanFactory.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat_SpanFactory$NullableType(); @_$jni.internal @_$core.override @@ -1872,6 +2532,7 @@ class EmojiCompat extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat'); /// The type which includes information such as the signature of this class. + static const nullableType = $EmojiCompat$NullableType(); static const type = $EmojiCompat$Type(); static final _id_EDITOR_INFO_METAVERSION_KEY = _class.staticFieldId( r'EDITOR_INFO_METAVERSION_KEY', @@ -1880,8 +2541,9 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public final java.lang.String EDITOR_INFO_METAVERSION_KEY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get EDITOR_INFO_METAVERSION_KEY => - _id_EDITOR_INFO_METAVERSION_KEY.get(_class, const _$jni.JStringType()); + static _$jni.JString? get EDITOR_INFO_METAVERSION_KEY => + _id_EDITOR_INFO_METAVERSION_KEY.get( + _class, const _$jni.JStringNullableType()); static final _id_EDITOR_INFO_REPLACE_ALL_KEY = _class.staticFieldId( r'EDITOR_INFO_REPLACE_ALL_KEY', @@ -1890,8 +2552,9 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public final java.lang.String EDITOR_INFO_REPLACE_ALL_KEY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get EDITOR_INFO_REPLACE_ALL_KEY => - _id_EDITOR_INFO_REPLACE_ALL_KEY.get(_class, const _$jni.JStringType()); + static _$jni.JString? get EDITOR_INFO_REPLACE_ALL_KEY => + _id_EDITOR_INFO_REPLACE_ALL_KEY.get( + _class, const _$jni.JStringNullableType()); /// from: `static public final int LOAD_STATE_DEFAULT` static const LOAD_STATE_DEFAULT = 3; @@ -1946,12 +2609,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat init(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat init( - _$jni.JObject context, + static EmojiCompat? init( + _$jni.JObject? context, ) { + final _$context = context?.reference ?? _$jni.jNullReference; return _init(_class.reference.pointer, _id_init as _$jni.JMethodIDPtr, - context.reference.pointer) - .object(const $EmojiCompat$Type()); + _$context.pointer) + .object(const $EmojiCompat$NullableType()); } static final _id_init$1 = _class.staticMethodId( @@ -1978,17 +2642,17 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory defaultEmojiCompatConfigFactory)` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat init$1( - _$jni.JObject context, - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory + static EmojiCompat? init$1( + _$jni.JObject? context, + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory? defaultEmojiCompatConfigFactory, ) { - return _init$1( - _class.reference.pointer, - _id_init$1 as _$jni.JMethodIDPtr, - context.reference.pointer, - defaultEmojiCompatConfigFactory.reference.pointer) - .object(const $EmojiCompat$Type()); + final _$context = context?.reference ?? _$jni.jNullReference; + final _$defaultEmojiCompatConfigFactory = + defaultEmojiCompatConfigFactory?.reference ?? _$jni.jNullReference; + return _init$1(_class.reference.pointer, _id_init$1 as _$jni.JMethodIDPtr, + _$context.pointer, _$defaultEmojiCompatConfigFactory.pointer) + .object(const $EmojiCompat$NullableType()); } static final _id_init$2 = _class.staticMethodId( @@ -2009,12 +2673,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat init(androidx.emoji2.text.EmojiCompat$Config config)` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat init$2( - EmojiCompat_Config config, + static EmojiCompat? init$2( + EmojiCompat_Config? config, ) { + final _$config = config?.reference ?? _$jni.jNullReference; return _init$2(_class.reference.pointer, _id_init$2 as _$jni.JMethodIDPtr, - config.reference.pointer) - .object(const $EmojiCompat$Type()); + _$config.pointer) + .object(const $EmojiCompat$NullableType()); } static final _id_isConfigured = _class.staticMethodId( @@ -2059,12 +2724,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat$Config config)` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat reset( - EmojiCompat_Config config, + static EmojiCompat? reset( + EmojiCompat_Config? config, ) { + final _$config = config?.reference ?? _$jni.jNullReference; return _reset(_class.reference.pointer, _id_reset as _$jni.JMethodIDPtr, - config.reference.pointer) - .object(const $EmojiCompat$Type()); + _$config.pointer) + .object(const $EmojiCompat$NullableType()); } static final _id_reset$1 = _class.staticMethodId( @@ -2085,12 +2751,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat emojiCompat)` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat reset$1( - EmojiCompat emojiCompat, + static EmojiCompat? reset$1( + EmojiCompat? emojiCompat, ) { + final _$emojiCompat = emojiCompat?.reference ?? _$jni.jNullReference; return _reset$1(_class.reference.pointer, _id_reset$1 as _$jni.JMethodIDPtr, - emojiCompat.reference.pointer) - .object(const $EmojiCompat$Type()); + _$emojiCompat.pointer) + .object(const $EmojiCompat$NullableType()); } static final _id_skipDefaultConfigurationLookup = _class.staticMethodId( @@ -2136,9 +2803,9 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat get()` /// The returned object must be released after use, by calling the [release] method. - static EmojiCompat get() { + static EmojiCompat? get() { return _get(_class.reference.pointer, _id_get as _$jni.JMethodIDPtr) - .object(const $EmojiCompat$Type()); + .object(const $EmojiCompat$NullableType()); } static final _id_load = _class.instanceMethodId( @@ -2181,12 +2848,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `public void registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void registerInitCallback( - EmojiCompat_InitCallback initCallback, + EmojiCompat_InitCallback? initCallback, ) { + final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; _registerInitCallback( reference.pointer, _id_registerInitCallback as _$jni.JMethodIDPtr, - initCallback.reference.pointer) + _$initCallback.pointer) .check(); } @@ -2208,12 +2876,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void unregisterInitCallback( - EmojiCompat_InitCallback initCallback, + EmojiCompat_InitCallback? initCallback, ) { + final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; _unregisterInitCallback( reference.pointer, _id_unregisterInitCallback as _$jni.JMethodIDPtr, - initCallback.reference.pointer) + _$initCallback.pointer) .check(); } @@ -2310,14 +2979,12 @@ class EmojiCompat extends _$jni.JObject { /// from: `public int getEmojiStart(java.lang.CharSequence charSequence, int i)` int getEmojiStart( - _$jni.JObject charSequence, + _$jni.JObject? charSequence, int i, ) { - return _getEmojiStart( - reference.pointer, - _id_getEmojiStart as _$jni.JMethodIDPtr, - charSequence.reference.pointer, - i) + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + return _getEmojiStart(reference.pointer, + _id_getEmojiStart as _$jni.JMethodIDPtr, _$charSequence.pointer, i) .integer; } @@ -2340,14 +3007,12 @@ class EmojiCompat extends _$jni.JObject { /// from: `public int getEmojiEnd(java.lang.CharSequence charSequence, int i)` int getEmojiEnd( - _$jni.JObject charSequence, + _$jni.JObject? charSequence, int i, ) { - return _getEmojiEnd( - reference.pointer, - _id_getEmojiEnd as _$jni.JMethodIDPtr, - charSequence.reference.pointer, - i) + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + return _getEmojiEnd(reference.pointer, + _id_getEmojiEnd as _$jni.JMethodIDPtr, _$charSequence.pointer, i) .integer; } @@ -2377,16 +3042,18 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public boolean handleOnKeyDown(android.text.Editable editable, int i, android.view.KeyEvent keyEvent)` static bool handleOnKeyDown( - _$jni.JObject editable, + _$jni.JObject? editable, int i, - _$jni.JObject keyEvent, + _$jni.JObject? keyEvent, ) { + final _$editable = editable?.reference ?? _$jni.jNullReference; + final _$keyEvent = keyEvent?.reference ?? _$jni.jNullReference; return _handleOnKeyDown( _class.reference.pointer, _id_handleOnKeyDown as _$jni.JMethodIDPtr, - editable.reference.pointer, + _$editable.pointer, i, - keyEvent.reference.pointer) + _$keyEvent.pointer) .boolean; } @@ -2421,17 +3088,20 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection inputConnection, android.text.Editable editable, int i, int i1, boolean z)` static bool handleDeleteSurroundingText( - _$jni.JObject inputConnection, - _$jni.JObject editable, + _$jni.JObject? inputConnection, + _$jni.JObject? editable, int i, int i1, bool z, ) { + final _$inputConnection = + inputConnection?.reference ?? _$jni.jNullReference; + final _$editable = editable?.reference ?? _$jni.jNullReference; return _handleDeleteSurroundingText( _class.reference.pointer, _id_handleDeleteSurroundingText as _$jni.JMethodIDPtr, - inputConnection.reference.pointer, - editable.reference.pointer, + _$inputConnection.pointer, + _$editable.pointer, i, i1, z ? 1 : 0) @@ -2456,12 +3126,11 @@ class EmojiCompat extends _$jni.JObject { /// from: `public boolean hasEmojiGlyph(java.lang.CharSequence charSequence)` bool hasEmojiGlyph( - _$jni.JObject charSequence, + _$jni.JObject? charSequence, ) { - return _hasEmojiGlyph( - reference.pointer, - _id_hasEmojiGlyph as _$jni.JMethodIDPtr, - charSequence.reference.pointer) + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + return _hasEmojiGlyph(reference.pointer, + _id_hasEmojiGlyph as _$jni.JMethodIDPtr, _$charSequence.pointer) .boolean; } @@ -2484,13 +3153,14 @@ class EmojiCompat extends _$jni.JObject { /// from: `public boolean hasEmojiGlyph(java.lang.CharSequence charSequence, int i)` bool hasEmojiGlyph$1( - _$jni.JObject charSequence, + _$jni.JObject? charSequence, int i, ) { + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; return _hasEmojiGlyph$1( reference.pointer, _id_hasEmojiGlyph$1 as _$jni.JMethodIDPtr, - charSequence.reference.pointer, + _$charSequence.pointer, i) .boolean; } @@ -2514,14 +3184,12 @@ class EmojiCompat extends _$jni.JObject { /// from: `public int getEmojiMatch(java.lang.CharSequence charSequence, int i)` int getEmojiMatch( - _$jni.JObject charSequence, + _$jni.JObject? charSequence, int i, ) { - return _getEmojiMatch( - reference.pointer, - _id_getEmojiMatch as _$jni.JMethodIDPtr, - charSequence.reference.pointer, - i) + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + return _getEmojiMatch(reference.pointer, + _id_getEmojiMatch as _$jni.JMethodIDPtr, _$charSequence.pointer, i) .integer; } @@ -2543,12 +3211,13 @@ class EmojiCompat extends _$jni.JObject { /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject process( - _$jni.JObject charSequence, + _$jni.JObject? process( + _$jni.JObject? charSequence, ) { + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; return _process(reference.pointer, _id_process as _$jni.JMethodIDPtr, - charSequence.reference.pointer) - .object(const _$jni.JObjectType()); + _$charSequence.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_process$1 = _class.instanceMethodId( @@ -2573,14 +3242,15 @@ class EmojiCompat extends _$jni.JObject { /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject process$1( - _$jni.JObject charSequence, + _$jni.JObject? process$1( + _$jni.JObject? charSequence, int i, int i1, ) { + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; return _process$1(reference.pointer, _id_process$1 as _$jni.JMethodIDPtr, - charSequence.reference.pointer, i, i1) - .object(const _$jni.JObjectType()); + _$charSequence.pointer, i, i1) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_process$2 = _class.instanceMethodId( @@ -2606,15 +3276,16 @@ class EmojiCompat extends _$jni.JObject { /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1, int i2)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject process$2( - _$jni.JObject charSequence, + _$jni.JObject? process$2( + _$jni.JObject? charSequence, int i, int i1, int i2, ) { + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; return _process$2(reference.pointer, _id_process$2 as _$jni.JMethodIDPtr, - charSequence.reference.pointer, i, i1, i2) - .object(const _$jni.JObjectType()); + _$charSequence.pointer, i, i1, i2) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_process$3 = _class.instanceMethodId( @@ -2647,16 +3318,17 @@ class EmojiCompat extends _$jni.JObject { /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1, int i2, int i3)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject process$3( - _$jni.JObject charSequence, + _$jni.JObject? process$3( + _$jni.JObject? charSequence, int i, int i1, int i2, int i3, ) { + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; return _process$3(reference.pointer, _id_process$3 as _$jni.JMethodIDPtr, - charSequence.reference.pointer, i, i1, i2, i3) - .object(const _$jni.JObjectType()); + _$charSequence.pointer, i, i1, i2, i3) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getAssetSignature = _class.instanceMethodId( @@ -2678,10 +3350,10 @@ class EmojiCompat extends _$jni.JObject { /// from: `public java.lang.String getAssetSignature()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getAssetSignature() { + _$jni.JString? getAssetSignature() { return _getAssetSignature( reference.pointer, _id_getAssetSignature as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_updateEditorInfo = _class.instanceMethodId( @@ -2702,16 +3374,52 @@ class EmojiCompat extends _$jni.JObject { /// from: `public void updateEditorInfo(android.view.inputmethod.EditorInfo editorInfo)` void updateEditorInfo( - _$jni.JObject editorInfo, + _$jni.JObject? editorInfo, ) { - _updateEditorInfo( - reference.pointer, - _id_updateEditorInfo as _$jni.JMethodIDPtr, - editorInfo.reference.pointer) + final _$editorInfo = editorInfo?.reference ?? _$jni.jNullReference; + _updateEditorInfo(reference.pointer, + _id_updateEditorInfo as _$jni.JMethodIDPtr, _$editorInfo.pointer) .check(); } } +final class $EmojiCompat$NullableType extends _$jni.JObjType { + @_$jni.internal + const $EmojiCompat$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/EmojiCompat;'; + + @_$jni.internal + @_$core.override + EmojiCompat? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : EmojiCompat.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($EmojiCompat$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($EmojiCompat$NullableType) && + other is $EmojiCompat$NullableType; + } +} + final class $EmojiCompat$Type extends _$jni.JObjType { @_$jni.internal const $EmojiCompat$Type(); @@ -2723,11 +3431,17 @@ final class $EmojiCompat$Type extends _$jni.JObjType { @_$jni.internal @_$core.override EmojiCompat fromReference(_$jni.JReference reference) => - EmojiCompat.fromReference(reference); + EmojiCompat.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $EmojiCompat$NullableType(); @_$jni.internal @_$core.override @@ -2761,6 +3475,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory'); /// The type which includes information such as the signature of this class. + static const nullableType = + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type(); static final _id_new$ = _class.constructorId( @@ -2781,14 +3497,16 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory /// from: `public void (androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper defaultEmojiCompatConfigHelper)` /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory( - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper? defaultEmojiCompatConfigHelper, ) { + final _$defaultEmojiCompatConfigHelper = + defaultEmojiCompatConfigHelper?.reference ?? _$jni.jNullReference; return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory .fromReference(_new$( _class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, - defaultEmojiCompatConfigHelper.reference.pointer) + _$defaultEmojiCompatConfigHelper.pointer) .reference); } @@ -2810,12 +3528,61 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory /// from: `public androidx.emoji2.text.EmojiCompat$Config create(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config create( - _$jni.JObject context, + EmojiCompat_Config? create( + _$jni.JObject? context, ) { + final _$context = context?.reference ?? _$jni.jNullReference; return _create(reference.pointer, _id_create as _$jni.JMethodIDPtr, - context.reference.pointer) - .object(const $EmojiCompat_Config$Type()); + _$context.pointer) + .object(const $EmojiCompat_Config$NullableType()); + } +} + +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType + extends _$jni + .JObjType { + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;'; + + @_$jni.internal + @_$core.override + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory + .fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType + get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType) + .hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType) && + other + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType; } } @@ -2835,11 +3602,17 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory fromReference( _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( - reference); + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType + get nullableType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); @_$jni.internal @_$core.override @@ -2875,6 +3648,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper'); /// The type which includes information such as the signature of this class. + static const nullableType = + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); static final _id_new$ = _class.constructorId( @@ -2926,16 +3701,20 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper /// from: `public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JObject> getSigningSignatures( - _$jni.JObject packageManager, - _$jni.JString string, + _$jni.JArray<_$jni.JObject?>? getSigningSignatures( + _$jni.JObject? packageManager, + _$jni.JString? string, ) { + final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; return _getSigningSignatures( reference.pointer, _id_getSigningSignatures as _$jni.JMethodIDPtr, - packageManager.reference.pointer, - string.reference.pointer) - .object(const _$jni.JArrayType(_$jni.JObjectType())); + _$packageManager.pointer, + _$string.pointer) + .object<_$jni.JArray<_$jni.JObject?>?>( + const _$jni.JArrayNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_queryIntentContentProviders = _class.instanceMethodId( @@ -2965,18 +3744,22 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JObject> queryIntentContentProviders( - _$jni.JObject packageManager, - _$jni.JObject intent, + _$jni.JList<_$jni.JObject?>? queryIntentContentProviders( + _$jni.JObject? packageManager, + _$jni.JObject? intent, int i, ) { + final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; + final _$intent = intent?.reference ?? _$jni.jNullReference; return _queryIntentContentProviders( reference.pointer, _id_queryIntentContentProviders as _$jni.JMethodIDPtr, - packageManager.reference.pointer, - intent.reference.pointer, + _$packageManager.pointer, + _$intent.pointer, i) - .object(const _$jni.JListType(_$jni.JObjectType())); + .object<_$jni.JList<_$jni.JObject?>?>( + const _$jni.JListNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_getProviderInfo = _class.instanceMethodId( @@ -2997,14 +3780,61 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper /// from: `public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject getProviderInfo( - _$jni.JObject resolveInfo, + _$jni.JObject? getProviderInfo( + _$jni.JObject? resolveInfo, ) { - return _getProviderInfo( - reference.pointer, - _id_getProviderInfo as _$jni.JMethodIDPtr, - resolveInfo.reference.pointer) - .object(const _$jni.JObjectType()); + final _$resolveInfo = resolveInfo?.reference ?? _$jni.jNullReference; + return _getProviderInfo(reference.pointer, + _id_getProviderInfo as _$jni.JMethodIDPtr, _$resolveInfo.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + } +} + +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType + extends _$jni + .JObjType { + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;'; + + @_$jni.internal + @_$core.override + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper + .fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType + get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType) + .hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType) && + other + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType; } } @@ -3024,11 +3854,17 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper fromReference( _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( - reference); + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType + get nullableType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); @_$jni.internal @_$core.override @@ -3065,6 +3901,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19'); /// The type which includes information such as the signature of this class. + static const nullableType = + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); static final _id_new$ = _class.constructorId( @@ -3119,18 +3957,22 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JObject> queryIntentContentProviders( - _$jni.JObject packageManager, - _$jni.JObject intent, + _$jni.JList<_$jni.JObject?>? queryIntentContentProviders( + _$jni.JObject? packageManager, + _$jni.JObject? intent, int i, ) { + final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; + final _$intent = intent?.reference ?? _$jni.jNullReference; return _queryIntentContentProviders( reference.pointer, _id_queryIntentContentProviders as _$jni.JMethodIDPtr, - packageManager.reference.pointer, - intent.reference.pointer, + _$packageManager.pointer, + _$intent.pointer, i) - .object(const _$jni.JListType(_$jni.JObjectType())); + .object<_$jni.JList<_$jni.JObject?>?>( + const _$jni.JListNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_getProviderInfo = _class.instanceMethodId( @@ -3151,14 +3993,62 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 /// from: `public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject getProviderInfo( - _$jni.JObject resolveInfo, + _$jni.JObject? getProviderInfo( + _$jni.JObject? resolveInfo, ) { - return _getProviderInfo( - reference.pointer, - _id_getProviderInfo as _$jni.JMethodIDPtr, - resolveInfo.reference.pointer) - .object(const _$jni.JObjectType()); + final _$resolveInfo = resolveInfo?.reference ?? _$jni.jNullReference; + return _getProviderInfo(reference.pointer, + _id_getProviderInfo as _$jni.JMethodIDPtr, _$resolveInfo.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + } +} + +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType + extends _$jni + .JObjType { + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19;'; + + @_$jni.internal + @_$core.override + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 + .fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType + get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType) + .hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType) && + other + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType; } } @@ -3178,12 +4068,19 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 fromReference( _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 - .fromReference(reference); - + .fromReference( + reference, + ); @_$jni.internal @_$core.override _$jni.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType + get nullableType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); @_$jni.internal @_$core.override @@ -3222,6 +4119,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28'); /// The type which includes information such as the signature of this class. + static const nullableType = + $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type(); static final _id_new$ = _class.constructorId( @@ -3273,16 +4172,69 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 /// from: `public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JObject> getSigningSignatures$1( - _$jni.JObject packageManager, - _$jni.JString string, + _$jni.JArray<_$jni.JObject?>? getSigningSignatures$1( + _$jni.JObject? packageManager, + _$jni.JString? string, ) { + final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; return _getSigningSignatures$1( reference.pointer, _id_getSigningSignatures$1 as _$jni.JMethodIDPtr, - packageManager.reference.pointer, - string.reference.pointer) - .object(const _$jni.JArrayType(_$jni.JObjectType())); + _$packageManager.pointer, + _$string.pointer) + .object<_$jni.JArray<_$jni.JObject?>?>( + const _$jni.JArrayNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); + } +} + +final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType + extends _$jni + .JObjType { + @_$jni.internal + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28;'; + + @_$jni.internal + @_$core.override + DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 + .fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType + get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 3; + + @_$core.override + int get hashCode => + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType) + .hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType) && + other + is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType; } } @@ -3302,12 +4254,19 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 fromReference( _$jni.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 - .fromReference(reference); - + .fromReference( + reference, + ); @_$jni.internal @_$core.override _$jni.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType + get nullableType => + const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); @_$jni.internal @_$core.override @@ -3343,6 +4302,7 @@ class DefaultEmojiCompatConfig extends _$jni.JObject { _$jni.JClass.forName(r'androidx/emoji2/text/DefaultEmojiCompatConfig'); /// The type which includes information such as the signature of this class. + static const nullableType = $DefaultEmojiCompatConfig$NullableType(); static const type = $DefaultEmojiCompatConfig$Type(); static final _id_create = _class.staticMethodId( r'create', @@ -3362,12 +4322,52 @@ class DefaultEmojiCompatConfig extends _$jni.JObject { /// from: `static public androidx.emoji2.text.FontRequestEmojiCompatConfig create(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject create( - _$jni.JObject context, + static _$jni.JObject? create( + _$jni.JObject? context, ) { + final _$context = context?.reference ?? _$jni.jNullReference; return _create(_class.reference.pointer, _id_create as _$jni.JMethodIDPtr, - context.reference.pointer) - .object(const _$jni.JObjectType()); + _$context.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + } +} + +final class $DefaultEmojiCompatConfig$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $DefaultEmojiCompatConfig$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig;'; + + @_$jni.internal + @_$core.override + DefaultEmojiCompatConfig? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : DefaultEmojiCompatConfig.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($DefaultEmojiCompatConfig$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($DefaultEmojiCompatConfig$NullableType) && + other is $DefaultEmojiCompatConfig$NullableType; } } @@ -3383,11 +4383,17 @@ final class $DefaultEmojiCompatConfig$Type @_$jni.internal @_$core.override DefaultEmojiCompatConfig fromReference(_$jni.JReference reference) => - DefaultEmojiCompatConfig.fromReference(reference); + DefaultEmojiCompatConfig.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $DefaultEmojiCompatConfig$NullableType(); @_$jni.internal @_$core.override @@ -3418,6 +4424,7 @@ class Build_Partition extends _$jni.JObject { static final _class = _$jni.JClass.forName(r'android/os/Build$Partition'); /// The type which includes information such as the signature of this class. + static const nullableType = $Build_Partition$NullableType(); static const type = $Build_Partition$Type(); static final _id_PARTITION_NAME_SYSTEM = _class.staticFieldId( r'PARTITION_NAME_SYSTEM', @@ -3426,8 +4433,8 @@ class Build_Partition extends _$jni.JObject { /// from: `static public final java.lang.String PARTITION_NAME_SYSTEM` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get PARTITION_NAME_SYSTEM => - _id_PARTITION_NAME_SYSTEM.get(_class, const _$jni.JStringType()); + static _$jni.JString? get PARTITION_NAME_SYSTEM => + _id_PARTITION_NAME_SYSTEM.get(_class, const _$jni.JStringNullableType()); static final _id_getName = _class.instanceMethodId( r'getName', @@ -3448,9 +4455,9 @@ class Build_Partition extends _$jni.JObject { /// from: `public java.lang.String getName()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getName() { + _$jni.JString? getName() { return _getName(reference.pointer, _id_getName as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getFingerprint = _class.instanceMethodId( @@ -3472,10 +4479,10 @@ class Build_Partition extends _$jni.JObject { /// from: `public java.lang.String getFingerprint()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getFingerprint() { + _$jni.JString? getFingerprint() { return _getFingerprint( reference.pointer, _id_getFingerprint as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getBuildTimeMillis = _class.instanceMethodId( @@ -3520,10 +4527,11 @@ class Build_Partition extends _$jni.JObject { /// from: `public boolean equals(java.lang.Object object)` bool equals( - _$jni.JObject object, + _$jni.JObject? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _equals(reference.pointer, _id_equals as _$jni.JMethodIDPtr, - object.reference.pointer) + _$object.pointer) .boolean; } @@ -3551,6 +4559,44 @@ class Build_Partition extends _$jni.JObject { } } +final class $Build_Partition$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $Build_Partition$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroid/os/Build$Partition;'; + + @_$jni.internal + @_$core.override + Build_Partition? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Build_Partition.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Build_Partition$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Build_Partition$NullableType) && + other is $Build_Partition$NullableType; + } +} + final class $Build_Partition$Type extends _$jni.JObjType { @_$jni.internal const $Build_Partition$Type(); @@ -3562,11 +4608,17 @@ final class $Build_Partition$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Build_Partition fromReference(_$jni.JReference reference) => - Build_Partition.fromReference(reference); + Build_Partition.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Build_Partition$NullableType(); @_$jni.internal @_$core.override @@ -3597,6 +4649,7 @@ class Build_VERSION extends _$jni.JObject { static final _class = _$jni.JClass.forName(r'android/os/Build$VERSION'); /// The type which includes information such as the signature of this class. + static const nullableType = $Build_VERSION$NullableType(); static const type = $Build_VERSION$Type(); static final _id_BASE_OS = _class.staticFieldId( r'BASE_OS', @@ -3605,8 +4658,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String BASE_OS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get BASE_OS => - _id_BASE_OS.get(_class, const _$jni.JStringType()); + static _$jni.JString? get BASE_OS => + _id_BASE_OS.get(_class, const _$jni.JStringNullableType()); static final _id_CODENAME = _class.staticFieldId( r'CODENAME', @@ -3615,8 +4668,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String CODENAME` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get CODENAME => - _id_CODENAME.get(_class, const _$jni.JStringType()); + static _$jni.JString? get CODENAME => + _id_CODENAME.get(_class, const _$jni.JStringNullableType()); static final _id_INCREMENTAL = _class.staticFieldId( r'INCREMENTAL', @@ -3625,8 +4678,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String INCREMENTAL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get INCREMENTAL => - _id_INCREMENTAL.get(_class, const _$jni.JStringType()); + static _$jni.JString? get INCREMENTAL => + _id_INCREMENTAL.get(_class, const _$jni.JStringNullableType()); static final _id_MEDIA_PERFORMANCE_CLASS = _class.staticFieldId( r'MEDIA_PERFORMANCE_CLASS', @@ -3653,8 +4706,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String RELEASE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get RELEASE => - _id_RELEASE.get(_class, const _$jni.JStringType()); + static _$jni.JString? get RELEASE => + _id_RELEASE.get(_class, const _$jni.JStringNullableType()); static final _id_RELEASE_OR_CODENAME = _class.staticFieldId( r'RELEASE_OR_CODENAME', @@ -3663,8 +4716,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String RELEASE_OR_CODENAME` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get RELEASE_OR_CODENAME => - _id_RELEASE_OR_CODENAME.get(_class, const _$jni.JStringType()); + static _$jni.JString? get RELEASE_OR_CODENAME => + _id_RELEASE_OR_CODENAME.get(_class, const _$jni.JStringNullableType()); static final _id_RELEASE_OR_PREVIEW_DISPLAY = _class.staticFieldId( r'RELEASE_OR_PREVIEW_DISPLAY', @@ -3673,8 +4726,9 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String RELEASE_OR_PREVIEW_DISPLAY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get RELEASE_OR_PREVIEW_DISPLAY => - _id_RELEASE_OR_PREVIEW_DISPLAY.get(_class, const _$jni.JStringType()); + static _$jni.JString? get RELEASE_OR_PREVIEW_DISPLAY => + _id_RELEASE_OR_PREVIEW_DISPLAY.get( + _class, const _$jni.JStringNullableType()); static final _id_SDK = _class.staticFieldId( r'SDK', @@ -3683,8 +4737,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String SDK` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SDK => - _id_SDK.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SDK => + _id_SDK.get(_class, const _$jni.JStringNullableType()); static final _id_SDK_INT = _class.staticFieldId( r'SDK_INT', @@ -3701,8 +4755,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String SECURITY_PATCH` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SECURITY_PATCH => - _id_SECURITY_PATCH.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SECURITY_PATCH => + _id_SECURITY_PATCH.get(_class, const _$jni.JStringNullableType()); static final _id_new$ = _class.constructorId( r'()V', @@ -3729,6 +4783,43 @@ class Build_VERSION extends _$jni.JObject { } } +final class $Build_VERSION$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Build_VERSION$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroid/os/Build$VERSION;'; + + @_$jni.internal + @_$core.override + Build_VERSION? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Build_VERSION.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Build_VERSION$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Build_VERSION$NullableType) && + other is $Build_VERSION$NullableType; + } +} + final class $Build_VERSION$Type extends _$jni.JObjType { @_$jni.internal const $Build_VERSION$Type(); @@ -3740,11 +4831,17 @@ final class $Build_VERSION$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Build_VERSION fromReference(_$jni.JReference reference) => - Build_VERSION.fromReference(reference); + Build_VERSION.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Build_VERSION$NullableType(); @_$jni.internal @_$core.override @@ -3775,6 +4872,7 @@ class Build_VERSION_CODES extends _$jni.JObject { static final _class = _$jni.JClass.forName(r'android/os/Build$VERSION_CODES'); /// The type which includes information such as the signature of this class. + static const nullableType = $Build_VERSION_CODES$NullableType(); static const type = $Build_VERSION_CODES$Type(); /// from: `static public final int BASE` @@ -3909,6 +5007,45 @@ class Build_VERSION_CODES extends _$jni.JObject { } } +final class $Build_VERSION_CODES$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $Build_VERSION_CODES$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroid/os/Build$VERSION_CODES;'; + + @_$jni.internal + @_$core.override + Build_VERSION_CODES? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : Build_VERSION_CODES.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Build_VERSION_CODES$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Build_VERSION_CODES$NullableType) && + other is $Build_VERSION_CODES$NullableType; + } +} + final class $Build_VERSION_CODES$Type extends _$jni.JObjType { @_$jni.internal @@ -3921,11 +5058,17 @@ final class $Build_VERSION_CODES$Type @_$jni.internal @_$core.override Build_VERSION_CODES fromReference(_$jni.JReference reference) => - Build_VERSION_CODES.fromReference(reference); + Build_VERSION_CODES.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Build_VERSION_CODES$NullableType(); @_$jni.internal @_$core.override @@ -3956,6 +5099,7 @@ class Build extends _$jni.JObject { static final _class = _$jni.JClass.forName(r'android/os/Build'); /// The type which includes information such as the signature of this class. + static const nullableType = $Build$NullableType(); static const type = $Build$Type(); static final _id_BOARD = _class.staticFieldId( r'BOARD', @@ -3964,8 +5108,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String BOARD` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get BOARD => - _id_BOARD.get(_class, const _$jni.JStringType()); + static _$jni.JString? get BOARD => + _id_BOARD.get(_class, const _$jni.JStringNullableType()); static final _id_BOOTLOADER = _class.staticFieldId( r'BOOTLOADER', @@ -3974,8 +5118,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String BOOTLOADER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get BOOTLOADER => - _id_BOOTLOADER.get(_class, const _$jni.JStringType()); + static _$jni.JString? get BOOTLOADER => + _id_BOOTLOADER.get(_class, const _$jni.JStringNullableType()); static final _id_BRAND = _class.staticFieldId( r'BRAND', @@ -3984,8 +5128,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String BRAND` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get BRAND => - _id_BRAND.get(_class, const _$jni.JStringType()); + static _$jni.JString? get BRAND => + _id_BRAND.get(_class, const _$jni.JStringNullableType()); static final _id_CPU_ABI = _class.staticFieldId( r'CPU_ABI', @@ -3994,8 +5138,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String CPU_ABI` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get CPU_ABI => - _id_CPU_ABI.get(_class, const _$jni.JStringType()); + static _$jni.JString? get CPU_ABI => + _id_CPU_ABI.get(_class, const _$jni.JStringNullableType()); static final _id_CPU_ABI2 = _class.staticFieldId( r'CPU_ABI2', @@ -4004,8 +5148,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String CPU_ABI2` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get CPU_ABI2 => - _id_CPU_ABI2.get(_class, const _$jni.JStringType()); + static _$jni.JString? get CPU_ABI2 => + _id_CPU_ABI2.get(_class, const _$jni.JStringNullableType()); static final _id_DEVICE = _class.staticFieldId( r'DEVICE', @@ -4014,8 +5158,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String DEVICE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get DEVICE => - _id_DEVICE.get(_class, const _$jni.JStringType()); + static _$jni.JString? get DEVICE => + _id_DEVICE.get(_class, const _$jni.JStringNullableType()); static final _id_DISPLAY = _class.staticFieldId( r'DISPLAY', @@ -4024,8 +5168,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String DISPLAY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get DISPLAY => - _id_DISPLAY.get(_class, const _$jni.JStringType()); + static _$jni.JString? get DISPLAY => + _id_DISPLAY.get(_class, const _$jni.JStringNullableType()); static final _id_FINGERPRINT = _class.staticFieldId( r'FINGERPRINT', @@ -4034,8 +5178,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String FINGERPRINT` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get FINGERPRINT => - _id_FINGERPRINT.get(_class, const _$jni.JStringType()); + static _$jni.JString? get FINGERPRINT => + _id_FINGERPRINT.get(_class, const _$jni.JStringNullableType()); static final _id_HARDWARE = _class.staticFieldId( r'HARDWARE', @@ -4044,8 +5188,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String HARDWARE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get HARDWARE => - _id_HARDWARE.get(_class, const _$jni.JStringType()); + static _$jni.JString? get HARDWARE => + _id_HARDWARE.get(_class, const _$jni.JStringNullableType()); static final _id_HOST = _class.staticFieldId( r'HOST', @@ -4054,8 +5198,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String HOST` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get HOST => - _id_HOST.get(_class, const _$jni.JStringType()); + static _$jni.JString? get HOST => + _id_HOST.get(_class, const _$jni.JStringNullableType()); static final _id_ID = _class.staticFieldId( r'ID', @@ -4064,7 +5208,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String ID` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get ID => _id_ID.get(_class, const _$jni.JStringType()); + static _$jni.JString? get ID => + _id_ID.get(_class, const _$jni.JStringNullableType()); static final _id_MANUFACTURER = _class.staticFieldId( r'MANUFACTURER', @@ -4073,8 +5218,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String MANUFACTURER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get MANUFACTURER => - _id_MANUFACTURER.get(_class, const _$jni.JStringType()); + static _$jni.JString? get MANUFACTURER => + _id_MANUFACTURER.get(_class, const _$jni.JStringNullableType()); static final _id_MODEL = _class.staticFieldId( r'MODEL', @@ -4083,8 +5228,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String MODEL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get MODEL => - _id_MODEL.get(_class, const _$jni.JStringType()); + static _$jni.JString? get MODEL => + _id_MODEL.get(_class, const _$jni.JStringNullableType()); static final _id_ODM_SKU = _class.staticFieldId( r'ODM_SKU', @@ -4093,8 +5238,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String ODM_SKU` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get ODM_SKU => - _id_ODM_SKU.get(_class, const _$jni.JStringType()); + static _$jni.JString? get ODM_SKU => + _id_ODM_SKU.get(_class, const _$jni.JStringNullableType()); static final _id_PRODUCT = _class.staticFieldId( r'PRODUCT', @@ -4103,8 +5248,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String PRODUCT` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get PRODUCT => - _id_PRODUCT.get(_class, const _$jni.JStringType()); + static _$jni.JString? get PRODUCT => + _id_PRODUCT.get(_class, const _$jni.JStringNullableType()); static final _id_RADIO = _class.staticFieldId( r'RADIO', @@ -4113,8 +5258,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String RADIO` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get RADIO => - _id_RADIO.get(_class, const _$jni.JStringType()); + static _$jni.JString? get RADIO => + _id_RADIO.get(_class, const _$jni.JStringNullableType()); static final _id_SERIAL = _class.staticFieldId( r'SERIAL', @@ -4123,8 +5268,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SERIAL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SERIAL => - _id_SERIAL.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SERIAL => + _id_SERIAL.get(_class, const _$jni.JStringNullableType()); static final _id_SKU = _class.staticFieldId( r'SKU', @@ -4133,8 +5278,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SKU` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SKU => - _id_SKU.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SKU => + _id_SKU.get(_class, const _$jni.JStringNullableType()); static final _id_SOC_MANUFACTURER = _class.staticFieldId( r'SOC_MANUFACTURER', @@ -4143,8 +5288,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SOC_MANUFACTURER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SOC_MANUFACTURER => - _id_SOC_MANUFACTURER.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SOC_MANUFACTURER => + _id_SOC_MANUFACTURER.get(_class, const _$jni.JStringNullableType()); static final _id_SOC_MODEL = _class.staticFieldId( r'SOC_MODEL', @@ -4153,8 +5298,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SOC_MODEL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SOC_MODEL => - _id_SOC_MODEL.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SOC_MODEL => + _id_SOC_MODEL.get(_class, const _$jni.JStringNullableType()); static final _id_SUPPORTED_32_BIT_ABIS = _class.staticFieldId( r'SUPPORTED_32_BIT_ABIS', @@ -4163,9 +5308,11 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_32_BIT_ABIS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JString> get SUPPORTED_32_BIT_ABIS => + static _$jni.JArray<_$jni.JString?>? get SUPPORTED_32_BIT_ABIS => _id_SUPPORTED_32_BIT_ABIS.get( - _class, const _$jni.JArrayType(_$jni.JStringType())); + _class, + const _$jni.JArrayNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); static final _id_SUPPORTED_64_BIT_ABIS = _class.staticFieldId( r'SUPPORTED_64_BIT_ABIS', @@ -4174,9 +5321,11 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_64_BIT_ABIS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JString> get SUPPORTED_64_BIT_ABIS => + static _$jni.JArray<_$jni.JString?>? get SUPPORTED_64_BIT_ABIS => _id_SUPPORTED_64_BIT_ABIS.get( - _class, const _$jni.JArrayType(_$jni.JStringType())); + _class, + const _$jni.JArrayNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); static final _id_SUPPORTED_ABIS = _class.staticFieldId( r'SUPPORTED_ABIS', @@ -4185,8 +5334,11 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_ABIS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JString> get SUPPORTED_ABIS => _id_SUPPORTED_ABIS - .get(_class, const _$jni.JArrayType(_$jni.JStringType())); + static _$jni.JArray<_$jni.JString?>? get SUPPORTED_ABIS => _id_SUPPORTED_ABIS + .get( + _class, + const _$jni.JArrayNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); static final _id_TAGS = _class.staticFieldId( r'TAGS', @@ -4195,8 +5347,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String TAGS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get TAGS => - _id_TAGS.get(_class, const _$jni.JStringType()); + static _$jni.JString? get TAGS => + _id_TAGS.get(_class, const _$jni.JStringNullableType()); static final _id_TIME = _class.staticFieldId( r'TIME', @@ -4213,8 +5365,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String TYPE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get TYPE => - _id_TYPE.get(_class, const _$jni.JStringType()); + static _$jni.JString? get TYPE => + _id_TYPE.get(_class, const _$jni.JStringNullableType()); static final _id_UNKNOWN = _class.staticFieldId( r'UNKNOWN', @@ -4223,8 +5375,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String UNKNOWN` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get UNKNOWN => - _id_UNKNOWN.get(_class, const _$jni.JStringType()); + static _$jni.JString? get UNKNOWN => + _id_UNKNOWN.get(_class, const _$jni.JStringNullableType()); static final _id_USER = _class.staticFieldId( r'USER', @@ -4233,8 +5385,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String USER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get USER => - _id_USER.get(_class, const _$jni.JStringType()); + static _$jni.JString? get USER => + _id_USER.get(_class, const _$jni.JStringNullableType()); static final _id_new$ = _class.constructorId( r'()V', @@ -4279,10 +5431,10 @@ class Build extends _$jni.JObject { /// from: `static public java.lang.String getSerial()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString getSerial() { + static _$jni.JString? getSerial() { return _getSerial( _class.reference.pointer, _id_getSerial as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getFingerprintedPartitions = _class.staticMethodId( @@ -4305,10 +5457,12 @@ class Build extends _$jni.JObject { /// from: `static public java.util.List getFingerprintedPartitions()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JList getFingerprintedPartitions() { + static _$jni.JList? getFingerprintedPartitions() { return _getFingerprintedPartitions(_class.reference.pointer, _id_getFingerprintedPartitions as _$jni.JMethodIDPtr) - .object(const _$jni.JListType($Build_Partition$Type())); + .object<_$jni.JList?>( + const _$jni.JListNullableType( + $Build_Partition$NullableType())); } static final _id_getRadioVersion = _class.staticMethodId( @@ -4330,10 +5484,47 @@ class Build extends _$jni.JObject { /// from: `static public java.lang.String getRadioVersion()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString getRadioVersion() { + static _$jni.JString? getRadioVersion() { return _getRadioVersion( _class.reference.pointer, _id_getRadioVersion as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); + } +} + +final class $Build$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Build$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Landroid/os/Build;'; + + @_$jni.internal + @_$core.override + Build? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Build.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Build$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Build$NullableType) && + other is $Build$NullableType; } } @@ -4347,12 +5538,16 @@ final class $Build$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - Build fromReference(_$jni.JReference reference) => - Build.fromReference(reference); + Build fromReference(_$jni.JReference reference) => Build.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $Build$NullableType(); @_$jni.internal @_$core.override @@ -4368,7 +5563,7 @@ final class $Build$Type extends _$jni.JObjType { } /// from: `java.util.HashMap` -class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> +class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override @@ -4385,18 +5580,29 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> this.K, this.V, _$jni.JReference reference, - ) : $type = type(K, V), + ) : $type = type<$K, $V>(K, V), super.fromReference(reference); static final _class = _$jni.JClass.forName(r'java/util/HashMap'); /// The type which includes information such as the signature of this class. + static $HashMap$NullableType<$K, $V> + nullableType<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( + _$jni.JObjType<$K> K, + _$jni.JObjType<$V> V, + ) { + return $HashMap$NullableType<$K, $V>( + K, + V, + ); + } + static $HashMap$Type<$K, $V> - type<$K extends _$jni.JObject, $V extends _$jni.JObject>( + type<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( _$jni.JObjType<$K> K, _$jni.JObjType<$V> V, ) { - return $HashMap$Type( + return $HashMap$Type<$K, $V>( K, V, ); @@ -4425,7 +5631,7 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> required _$jni.JObjType<$K> K, required _$jni.JObjType<$V> V, }) { - return HashMap.fromReference( + return HashMap<$K, $V>.fromReference( K, V, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, i, f) @@ -4453,7 +5659,7 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> required _$jni.JObjType<$K> K, required _$jni.JObjType<$V> V, }) { - return HashMap.fromReference( + return HashMap<$K, $V>.fromReference( K, V, _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, i) @@ -4482,7 +5688,7 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> required _$jni.JObjType<$K> K, required _$jni.JObjType<$V> V, }) { - return HashMap.fromReference( + return HashMap<$K, $V>.fromReference( K, V, _new$2(_class.reference.pointer, _id_new$2 as _$jni.JMethodIDPtr) @@ -4507,21 +5713,16 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public void (java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$3( - _$jni.JMap<$K, $V> map, { - _$jni.JObjType<$K>? K, - _$jni.JObjType<$V>? V, + _$jni.JMap<$K?, $V?>? map, { + required _$jni.JObjType<$K> K, + required _$jni.JObjType<$V> V, }) { - K ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).K, - ]) as _$jni.JObjType<$K>; - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; - return HashMap.fromReference( + final _$map = map?.reference ?? _$jni.jNullReference; + return HashMap<$K, $V>.fromReference( K, V, _new$3(_class.reference.pointer, _id_new$3 as _$jni.JMethodIDPtr, - map.reference.pointer) + _$map.pointer) .reference); } @@ -4588,12 +5789,13 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V get(java.lang.Object object)` /// The returned object must be released after use, by calling the [release] method. - $V get( - _$jni.JObject object, + $V? get( + _$jni.JObject? object, ) { - return _get(reference.pointer, _id_get as _$jni.JMethodIDPtr, - object.reference.pointer) - .object(V); + final _$object = object?.reference ?? _$jni.jNullReference; + return _get( + reference.pointer, _id_get as _$jni.JMethodIDPtr, _$object.pointer) + .object<$V?>(V.nullableType); } static final _id_containsKey = _class.instanceMethodId( @@ -4614,10 +5816,11 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public boolean containsKey(java.lang.Object object)` bool containsKey( - _$jni.JObject object, + _$jni.JObject? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _containsKey(reference.pointer, - _id_containsKey as _$jni.JMethodIDPtr, object.reference.pointer) + _id_containsKey as _$jni.JMethodIDPtr, _$object.pointer) .boolean; } @@ -4645,13 +5848,15 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V put(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. - $V put( - $K object, - $V object1, + $V? put( + $K? object, + $V? object1, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _put(reference.pointer, _id_put as _$jni.JMethodIDPtr, - object.reference.pointer, object1.reference.pointer) - .object(V); + _$object.pointer, _$object1.pointer) + .object<$V?>(V.nullableType); } static final _id_putAll = _class.instanceMethodId( @@ -4672,10 +5877,10 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public void putAll(java.util.Map map)` void putAll( - _$jni.JMap<$K, $V> map, + _$jni.JMap<$K?, $V?>? map, ) { - _putAll(reference.pointer, _id_putAll as _$jni.JMethodIDPtr, - map.reference.pointer) + final _$map = map?.reference ?? _$jni.jNullReference; + _putAll(reference.pointer, _id_putAll as _$jni.JMethodIDPtr, _$map.pointer) .check(); } @@ -4697,12 +5902,13 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V remove(java.lang.Object object)` /// The returned object must be released after use, by calling the [release] method. - $V remove( - _$jni.JObject object, + $V? remove( + _$jni.JObject? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _remove(reference.pointer, _id_remove as _$jni.JMethodIDPtr, - object.reference.pointer) - .object(V); + _$object.pointer) + .object<$V?>(V.nullableType); } static final _id_clear = _class.instanceMethodId( @@ -4745,10 +5951,11 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public boolean containsValue(java.lang.Object object)` bool containsValue( - _$jni.JObject object, + _$jni.JObject? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _containsValue(reference.pointer, - _id_containsValue as _$jni.JMethodIDPtr, object.reference.pointer) + _id_containsValue as _$jni.JMethodIDPtr, _$object.pointer) .boolean; } @@ -4771,9 +5978,9 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public java.util.Set keySet()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JSet<$K> keySet() { + _$jni.JSet<$K?>? keySet() { return _keySet(reference.pointer, _id_keySet as _$jni.JMethodIDPtr) - .object(_$jni.JSetType(K)); + .object<_$jni.JSet<$K?>?>(_$jni.JSetNullableType<$K?>(K.nullableType)); } static final _id_values = _class.instanceMethodId( @@ -4795,9 +6002,9 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public java.util.Collection values()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject values() { + _$jni.JObject? values() { return _values(reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_entrySet = _class.instanceMethodId( @@ -4819,9 +6026,11 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public java.util.Set entrySet()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JSet<_$jni.JObject> entrySet() { + _$jni.JSet<_$jni.JObject?>? entrySet() { return _entrySet(reference.pointer, _id_entrySet as _$jni.JMethodIDPtr) - .object(const _$jni.JSetType(_$jni.JObjectType())); + .object<_$jni.JSet<_$jni.JObject?>?>( + const _$jni.JSetNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_getOrDefault = _class.instanceMethodId( @@ -4848,16 +6057,18 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V getOrDefault(java.lang.Object object, V object1)` /// The returned object must be released after use, by calling the [release] method. - $V getOrDefault( - _$jni.JObject object, - $V object1, + $V? getOrDefault( + _$jni.JObject? object, + $V? object1, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _getOrDefault( reference.pointer, _id_getOrDefault as _$jni.JMethodIDPtr, - object.reference.pointer, - object1.reference.pointer) - .object(V); + _$object.pointer, + _$object1.pointer) + .object<$V?>(V.nullableType); } static final _id_putIfAbsent = _class.instanceMethodId( @@ -4884,16 +6095,18 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V putIfAbsent(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. - $V putIfAbsent( - $K object, - $V object1, + $V? putIfAbsent( + $K? object, + $V? object1, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _putIfAbsent( reference.pointer, _id_putIfAbsent as _$jni.JMethodIDPtr, - object.reference.pointer, - object1.reference.pointer) - .object(V); + _$object.pointer, + _$object1.pointer) + .object<$V?>(V.nullableType); } static final _id_remove$1 = _class.instanceMethodId( @@ -4920,11 +6133,13 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public boolean remove(java.lang.Object object, java.lang.Object object1)` bool remove$1( - _$jni.JObject object, - _$jni.JObject object1, + _$jni.JObject? object, + _$jni.JObject? object1, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _remove$1(reference.pointer, _id_remove$1 as _$jni.JMethodIDPtr, - object.reference.pointer, object1.reference.pointer) + _$object.pointer, _$object1.pointer) .boolean; } @@ -4954,16 +6169,15 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public boolean replace(K object, V object1, V object2)` bool replace( - $K object, - $V object1, - $V object2, + $K? object, + $V? object1, + $V? object2, ) { - return _replace( - reference.pointer, - _id_replace as _$jni.JMethodIDPtr, - object.reference.pointer, - object1.reference.pointer, - object2.reference.pointer) + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; + final _$object2 = object2?.reference ?? _$jni.jNullReference; + return _replace(reference.pointer, _id_replace as _$jni.JMethodIDPtr, + _$object.pointer, _$object1.pointer, _$object2.pointer) .boolean; } @@ -4991,13 +6205,15 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V replace(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. - $V replace$1( - $K object, - $V object1, + $V? replace$1( + $K? object, + $V? object1, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _replace$1(reference.pointer, _id_replace$1 as _$jni.JMethodIDPtr, - object.reference.pointer, object1.reference.pointer) - .object(V); + _$object.pointer, _$object1.pointer) + .object<$V?>(V.nullableType); } static final _id_computeIfAbsent = _class.instanceMethodId( @@ -5024,16 +6240,18 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V computeIfAbsent(K object, java.util.function.Function function)` /// The returned object must be released after use, by calling the [release] method. - $V computeIfAbsent( - $K object, - _$jni.JObject function, + $V? computeIfAbsent( + $K? object, + _$jni.JObject? function, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$function = function?.reference ?? _$jni.jNullReference; return _computeIfAbsent( reference.pointer, _id_computeIfAbsent as _$jni.JMethodIDPtr, - object.reference.pointer, - function.reference.pointer) - .object(V); + _$object.pointer, + _$function.pointer) + .object<$V?>(V.nullableType); } static final _id_computeIfPresent = _class.instanceMethodId( @@ -5060,16 +6278,18 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V computeIfPresent(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. - $V computeIfPresent( - $K object, - _$jni.JObject biFunction, + $V? computeIfPresent( + $K? object, + _$jni.JObject? biFunction, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; return _computeIfPresent( reference.pointer, _id_computeIfPresent as _$jni.JMethodIDPtr, - object.reference.pointer, - biFunction.reference.pointer) - .object(V); + _$object.pointer, + _$biFunction.pointer) + .object<$V?>(V.nullableType); } static final _id_compute = _class.instanceMethodId( @@ -5096,13 +6316,15 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V compute(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. - $V compute( - $K object, - _$jni.JObject biFunction, + $V? compute( + $K? object, + _$jni.JObject? biFunction, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; return _compute(reference.pointer, _id_compute as _$jni.JMethodIDPtr, - object.reference.pointer, biFunction.reference.pointer) - .object(V); + _$object.pointer, _$biFunction.pointer) + .object<$V?>(V.nullableType); } static final _id_merge = _class.instanceMethodId( @@ -5131,18 +6353,17 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V merge(K object, V object1, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. - $V merge( - $K object, - $V object1, - _$jni.JObject biFunction, + $V? merge( + $K? object, + $V? object1, + _$jni.JObject? biFunction, ) { - return _merge( - reference.pointer, - _id_merge as _$jni.JMethodIDPtr, - object.reference.pointer, - object1.reference.pointer, - biFunction.reference.pointer) - .object(V); + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; + final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; + return _merge(reference.pointer, _id_merge as _$jni.JMethodIDPtr, + _$object.pointer, _$object1.pointer, _$biFunction.pointer) + .object<$V?>(V.nullableType); } static final _id_forEach = _class.instanceMethodId( @@ -5163,10 +6384,11 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public void forEach(java.util.function.BiConsumer biConsumer)` void forEach( - _$jni.JObject biConsumer, + _$jni.JObject? biConsumer, ) { + final _$biConsumer = biConsumer?.reference ?? _$jni.jNullReference; _forEach(reference.pointer, _id_forEach as _$jni.JMethodIDPtr, - biConsumer.reference.pointer) + _$biConsumer.pointer) .check(); } @@ -5188,10 +6410,11 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public void replaceAll(java.util.function.BiFunction biFunction)` void replaceAll( - _$jni.JObject biFunction, + _$jni.JObject? biFunction, ) { + final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; _replaceAll(reference.pointer, _id_replaceAll as _$jni.JMethodIDPtr, - biFunction.reference.pointer) + _$biFunction.pointer) .check(); } @@ -5214,9 +6437,9 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public java.lang.Object clone()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject clone() { + _$jni.JObject? clone() { return _clone(reference.pointer, _id_clone as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_newHashMap = _class.staticMethodId( @@ -5235,19 +6458,71 @@ class HashMap<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `static public java.util.HashMap newHashMap(int i)` /// The returned object must be released after use, by calling the [release] method. - static HashMap<$K, $V> - newHashMap<$K extends _$jni.JObject, $V extends _$jni.JObject>( + static HashMap<$K?, $V?>? + newHashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( int i, { required _$jni.JObjType<$K> K, required _$jni.JObjType<$V> V, }) { return _newHashMap( _class.reference.pointer, _id_newHashMap as _$jni.JMethodIDPtr, i) - .object($HashMap$Type(K, V)); + .object?>( + $HashMap$NullableType<$K?, $V?>(K.nullableType, V.nullableType)); + } +} + +final class $HashMap$NullableType<$K extends _$jni.JObject?, + $V extends _$jni.JObject?> extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $HashMap$NullableType( + this.K, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => r'Ljava/util/HashMap;'; + + @_$jni.internal + @_$core.override + HashMap<$K, $V>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : HashMap<$K, $V>.fromReference( + K, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($HashMap$NullableType, K, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($HashMap$NullableType<$K, $V>) && + other is $HashMap$NullableType<$K, $V> && + K == other.K && + V == other.V; } } -final class $HashMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> +final class $HashMap$Type<$K extends _$jni.JObject?, $V extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$K> K; @@ -5268,11 +6543,19 @@ final class $HashMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> @_$jni.internal @_$core.override HashMap<$K, $V> fromReference(_$jni.JReference reference) => - HashMap.fromReference(K, V, reference); + HashMap<$K, $V>.fromReference( + K, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $HashMap$NullableType<$K, $V>(K, V); @_$jni.internal @_$core.override @@ -5306,6 +6589,7 @@ class AndroidUtils extends _$jni.JObject { _$jni.JClass.forName(r'com/example/in_app_java/AndroidUtils'); /// The type which includes information such as the signature of this class. + static const nullableType = $AndroidUtils$NullableType(); static const type = $AndroidUtils$Type(); static final _id_showToast = _class.staticMethodId( r'showToast', @@ -5333,16 +6617,55 @@ class AndroidUtils extends _$jni.JObject { /// from: `static public void showToast(android.app.Activity mainActivity, java.lang.CharSequence text, int duration)` static void showToast( - _$jni.JObject mainActivity, - _$jni.JObject text, + _$jni.JObject? mainActivity, + _$jni.JObject? text, int duration, ) { + final _$mainActivity = mainActivity?.reference ?? _$jni.jNullReference; + final _$text = text?.reference ?? _$jni.jNullReference; _showToast(_class.reference.pointer, _id_showToast as _$jni.JMethodIDPtr, - mainActivity.reference.pointer, text.reference.pointer, duration) + _$mainActivity.pointer, _$text.pointer, duration) .check(); } } +final class $AndroidUtils$NullableType extends _$jni.JObjType { + @_$jni.internal + const $AndroidUtils$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/example/in_app_java/AndroidUtils;'; + + @_$jni.internal + @_$core.override + AndroidUtils? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : AndroidUtils.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($AndroidUtils$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($AndroidUtils$NullableType) && + other is $AndroidUtils$NullableType; + } +} + final class $AndroidUtils$Type extends _$jni.JObjType { @_$jni.internal const $AndroidUtils$Type(); @@ -5354,11 +6677,17 @@ final class $AndroidUtils$Type extends _$jni.JObjType { @_$jni.internal @_$core.override AndroidUtils fromReference(_$jni.JReference reference) => - AndroidUtils.fromReference(reference); + AndroidUtils.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $AndroidUtils$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/example/in_app_java/lib/main.dart b/pkgs/jnigen/example/in_app_java/lib/main.dart index 3f3cdcab6..4dbdc84bc 100644 --- a/pkgs/jnigen/example/in_app_java/lib/main.dart +++ b/pkgs/jnigen/example/in_app_java/lib/main.dart @@ -14,7 +14,7 @@ JObject context = JObject.fromReference(Jni.getCachedApplicationContext()); final hashmap = HashMap.new$2(K: JString.type, V: JString.type); -final emojiCompat = EmojiCompat.get(); +final emojiCompat = EmojiCompat.get()!; extension IntX on int { JString toJString() { @@ -29,13 +29,13 @@ const sunglassEmoji = "😎"; void showToast() { final toastCount = hashmap.getOrDefault("toastCount".toJString(), 0.toJString()); - final newToastCount = (int.parse(toastCount.toDartString()) + 1).toJString(); + final newToastCount = (int.parse(toastCount!.toDartString()) + 1).toJString(); hashmap.put("toastCount".toJString(), newToastCount); final emoji = emojiCompat.hasEmojiGlyph(sunglassEmoji.toJString()) ? sunglassEmoji : ':cool:'; final message = - '${newToastCount.toDartString()} - ${Build.MODEL.toDartString()} $emoji'; + '${newToastCount.toDartString()} - ${Build.MODEL!.toDartString()} $emoji'; AndroidUtils.showToast(activity, message.toJString(), 0); } diff --git a/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart b/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart index 84a91337c..a7e671ef8 100644 --- a/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart @@ -62,8 +62,8 @@ class _MyHomePageState extends State { ElevatedButton( onPressed: () { setState(() { - answer = example.thinkBeforeAnswering().then( - (value) => value.toDartString(releaseOriginal: true)); + answer = example.thinkBeforeAnswering().then((value) => + value?.toDartString(releaseOriginal: true) ?? 'null'); }); }, child: const Text('Think...'), diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index f5bfcb56e..60b859b65 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart @@ -20,6 +20,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -49,6 +50,7 @@ class Example extends _$jni.JObject { static final _class = _$jni.JClass.forName(r'Example'); /// The type which includes information such as the signature of this class. + static const nullableType = $Example$NullableType(); static const type = $Example$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -92,22 +94,62 @@ class Example extends _$jni.JObject { /// from: `public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString> thinkBeforeAnswering() async { + _$core.Future<_$jni.JString?> thinkBeforeAnswering() async { final $p = _$jni.ReceivePort(); - final $c = _$jni.JObject.fromReference( - _$jni.ProtectedJniExtensions.newPortContinuation($p)); + final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); + _thinkBeforeAnswering( reference.pointer, _id_thinkBeforeAnswering as _$jni.JMethodIDPtr, - $c.reference.pointer) - .object(const _$jni.JObjectType()); + _$continuation.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _$continuation.release(); final $o = _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringType().jClass.reference.pointer; - if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k)) { + final $k = const _$jni.JStringNullableType().jClass.reference; + if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { + $k.release(); throw 'Failed'; } - return const _$jni.JStringType().fromReference($o); + $k.release(); + return const _$jni.JStringNullableType().fromReference($o); + } +} + +final class $Example$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Example$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'LExample;'; + + @_$jni.internal + @_$core.override + Example? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Example.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Example$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Example$NullableType) && + other is $Example$NullableType; } } @@ -121,12 +163,16 @@ final class $Example$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - Example fromReference(_$jni.JReference reference) => - Example.fromReference(reference); + Example fromReference(_$jni.JReference reference) => Example.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $Example$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/example/notification_plugin/example/lib/main.dart b/pkgs/jnigen/example/notification_plugin/example/lib/main.dart index e5343b0fb..7b978c7ac 100644 --- a/pkgs/jnigen/example/notification_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/notification_plugin/example/lib/main.dart @@ -4,7 +4,6 @@ import 'package:flutter/material.dart'; import 'package:jni/jni.dart'; - // The hierarchy created in generated code will mirror the java package // structure. This is an implementation convenience and we may allow // more customization in future. diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index 2fa53747c..bd8455af5 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart @@ -24,6 +24,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -54,6 +55,7 @@ class Notifications extends _$jni.JObject { _$jni.JClass.forName(r'com/example/notification_plugin/Notifications'); /// The type which includes information such as the signature of this class. + static const nullableType = $Notifications$NullableType(); static const type = $Notifications$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -107,22 +109,62 @@ class Notifications extends _$jni.JObject { /// from: `static public void showNotification(android.content.Context context, int notificationID, java.lang.String title, java.lang.String text)` static void showNotification( - _$jni.JObject context, + _$jni.JObject? context, int notificationID, - _$jni.JString title, - _$jni.JString text, + _$jni.JString? title, + _$jni.JString? text, ) { + final _$context = context?.reference ?? _$jni.jNullReference; + final _$title = title?.reference ?? _$jni.jNullReference; + final _$text = text?.reference ?? _$jni.jNullReference; _showNotification( _class.reference.pointer, _id_showNotification as _$jni.JMethodIDPtr, - context.reference.pointer, + _$context.pointer, notificationID, - title.reference.pointer, - text.reference.pointer) + _$title.pointer, + _$text.pointer) .check(); } } +final class $Notifications$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Notifications$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/example/notification_plugin/Notifications;'; + + @_$jni.internal + @_$core.override + Notifications? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Notifications.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Notifications$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Notifications$NullableType) && + other is $Notifications$NullableType; + } +} + final class $Notifications$Type extends _$jni.JObjType { @_$jni.internal const $Notifications$Type(); @@ -134,11 +176,17 @@ final class $Notifications$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Notifications fromReference(_$jni.JReference reference) => - Notifications.fromReference(reference); + Notifications.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Notifications$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/example/pdfbox_plugin/dart_example/bin/pdf_info.dart b/pkgs/jnigen/example/pdfbox_plugin/dart_example/bin/pdf_info.dart index 0dadbcf24..7b7cd3e10 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/dart_example/bin/pdf_info.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/dart_example/bin/pdf_info.dart @@ -4,9 +4,8 @@ import 'dart:io'; -import 'package:path/path.dart'; import 'package:jni/jni.dart'; - +import 'package:path/path.dart'; import 'package:pdfbox_plugin/pdfbox_plugin.dart'; void writeInfo(String file) { @@ -14,23 +13,23 @@ void writeInfo(String file) { final inputFile = fileInputStreamClass .constructorId("(Ljava/lang/String;)V") .call(fileInputStreamClass, JObject.type, [file.toJString()]); - final pdDoc = PDDocument.load$6(inputFile); + final pdDoc = PDDocument.load$6(inputFile)!; int pages = pdDoc.getNumberOfPages(); - final info = pdDoc.getDocumentInformation(); + final info = pdDoc.getDocumentInformation()!; final title = info.getTitle(); final subject = info.getSubject(); final author = info.getAuthor(); stderr.writeln('Number of pages: $pages'); - if (!title.isNull) { + if (title != null) { stderr.writeln('Title: ${title.toDartString()}'); } - if (!subject.isNull) { + if (subject != null) { stderr.writeln('Subject: ${subject.toDartString()}'); } - if (!author.isNull) { + if (author != null) { stderr.writeln('Author: ${author.toDartString()}'); } diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart index 52fb69d27..a70d514b4 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart @@ -2,13 +2,12 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:flutter/material.dart'; -import 'dart:io'; import 'dart:async'; +import 'dart:io'; +import 'package:flutter/material.dart'; import 'package:jni/jni.dart'; import 'package:path/path.dart'; - import 'package:pdfbox_plugin/pdfbox_plugin.dart'; Stream files(String dir) => Directory(dir).list().map((e) => e.path); @@ -155,15 +154,6 @@ class PDFFileInfo { late String author, subject, title; late int numPages; - /// Converts JString to dart string and deletes the original. - /// Also handles the case where the underlying string is Null. - String _fromJavaStr(JString jstr) { - if (jstr.isNull) { - return '(null)'; - } - return jstr.toDartString(releaseOriginal: true); - } - PDFFileInfo.usingPDFBox(this.filename) { // Since java.io is not directly available, use package:jni API to // create a java.io.File object. @@ -172,17 +162,17 @@ class PDFFileInfo { .constructorId("(Ljava/lang/String;)V") .call(fileClass, JObject.type, [filename]); // Static method call PDDocument.load -> PDDocument - final pdf = PDDocument.load(inputFile); + final pdf = PDDocument.load(inputFile)!; // Instance method call getNumberOfPages() -> int numPages = pdf.getNumberOfPages(); // Instance method that returns an object - final info = pdf.getDocumentInformation(); + final info = pdf.getDocumentInformation()!; /// java.lang.String is a special case and is mapped to JlString which is /// a subclass of JlObject. - author = _fromJavaStr(info.getAuthor()); - title = _fromJavaStr(info.getTitle()); - subject = _fromJavaStr(info.getSubject()); + author = info.getAuthor()?.toDartString(releaseOriginal: true) ?? 'null'; + title = info.getTitle()?.toDartString(releaseOriginal: true) ?? 'null'; + subject = info.getSubject()?.toDartString(releaseOriginal: true) ?? 'null'; pdf.close(); } diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart index 0943be9b2..908e5c0e7 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart @@ -38,6 +38,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -74,6 +75,7 @@ class PDDocument extends _$jni.JObject { _$jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocument'); /// The type which includes information such as the signature of this class. + static const nullableType = $PDDocument$NullableType(); static const type = $PDDocument$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -124,10 +126,12 @@ class PDDocument extends _$jni.JObject { /// You need to add at least one page for the document to be valid. ///@param memUsageSetting defines how memory is used for buffering PDF streams factory PDDocument.new$1( - _$jni.JObject memUsageSetting, + _$jni.JObject? memUsageSetting, ) { + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; return PDDocument.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as _$jni.JMethodIDPtr, memUsageSetting.reference.pointer) + _id_new$1 as _$jni.JMethodIDPtr, _$memUsageSetting.pointer) .reference); } @@ -152,10 +156,11 @@ class PDDocument extends _$jni.JObject { /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. factory PDDocument.new$2( - _$jni.JObject doc, + _$jni.JObject? doc, ) { + final _$doc = doc?.reference ?? _$jni.jNullReference; return PDDocument.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, doc.reference.pointer) + _id_new$2 as _$jni.JMethodIDPtr, _$doc.pointer) .reference); } @@ -187,14 +192,13 @@ class PDDocument extends _$jni.JObject { ///@param doc The COSDocument that this document wraps. ///@param source the parser which is used to read the pdf factory PDDocument.new$3( - _$jni.JObject doc, - _$jni.JObject source, + _$jni.JObject? doc, + _$jni.JObject? source, ) { - return PDDocument.fromReference(_new$3( - _class.reference.pointer, - _id_new$3 as _$jni.JMethodIDPtr, - doc.reference.pointer, - source.reference.pointer) + final _$doc = doc?.reference ?? _$jni.jNullReference; + final _$source = source?.reference ?? _$jni.jNullReference; + return PDDocument.fromReference(_new$3(_class.reference.pointer, + _id_new$3 as _$jni.JMethodIDPtr, _$doc.pointer, _$source.pointer) .reference); } @@ -229,16 +233,19 @@ class PDDocument extends _$jni.JObject { ///@param source the parser which is used to read the pdf ///@param permission he access permissions of the pdf factory PDDocument.new$4( - _$jni.JObject doc, - _$jni.JObject source, - _$jni.JObject permission, + _$jni.JObject? doc, + _$jni.JObject? source, + _$jni.JObject? permission, ) { + final _$doc = doc?.reference ?? _$jni.jNullReference; + final _$source = source?.reference ?? _$jni.jNullReference; + final _$permission = permission?.reference ?? _$jni.jNullReference; return PDDocument.fromReference(_new$4( _class.reference.pointer, _id_new$4 as _$jni.JMethodIDPtr, - doc.reference.pointer, - source.reference.pointer, - permission.reference.pointer) + _$doc.pointer, + _$source.pointer, + _$permission.pointer) .reference); } @@ -264,10 +271,11 @@ class PDDocument extends _$jni.JObject { /// hierarchy and set the parent of the page to the root. ///@param page The page to add to the document. void addPage( - _$jni.JObject page, + _$jni.JObject? page, ) { + final _$page = page?.reference ?? _$jni.jNullReference; _addPage(reference.pointer, _id_addPage as _$jni.JMethodIDPtr, - page.reference.pointer) + _$page.pointer) .check(); } @@ -300,10 +308,11 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature( - _$jni.JObject sigObject, + _$jni.JObject? sigObject, ) { + final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; _addSignature(reference.pointer, _id_addSignature as _$jni.JMethodIDPtr, - sigObject.reference.pointer) + _$sigObject.pointer) .check(); } @@ -343,11 +352,13 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$1( - _$jni.JObject sigObject, - _$jni.JObject options, + _$jni.JObject? sigObject, + _$jni.JObject? options, ) { + final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; + final _$options = options?.reference ?? _$jni.jNullReference; _addSignature$1(reference.pointer, _id_addSignature$1 as _$jni.JMethodIDPtr, - sigObject.reference.pointer, options.reference.pointer) + _$sigObject.pointer, _$options.pointer) .check(); } @@ -386,11 +397,14 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$2( - _$jni.JObject sigObject, - _$jni.JObject signatureInterface, + _$jni.JObject? sigObject, + _$jni.JObject? signatureInterface, ) { + final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; + final _$signatureInterface = + signatureInterface?.reference ?? _$jni.jNullReference; _addSignature$2(reference.pointer, _id_addSignature$2 as _$jni.JMethodIDPtr, - sigObject.reference.pointer, signatureInterface.reference.pointer) + _$sigObject.pointer, _$signatureInterface.pointer) .check(); } @@ -434,16 +448,20 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$3( - _$jni.JObject sigObject, - _$jni.JObject signatureInterface, - _$jni.JObject options, + _$jni.JObject? sigObject, + _$jni.JObject? signatureInterface, + _$jni.JObject? options, ) { + final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; + final _$signatureInterface = + signatureInterface?.reference ?? _$jni.jNullReference; + final _$options = options?.reference ?? _$jni.jNullReference; _addSignature$3( reference.pointer, _id_addSignature$3 as _$jni.JMethodIDPtr, - sigObject.reference.pointer, - signatureInterface.reference.pointer, - options.reference.pointer) + _$sigObject.pointer, + _$signatureInterface.pointer, + _$options.pointer) .check(); } @@ -482,16 +500,20 @@ class PDDocument extends _$jni.JObject { ///@deprecated The method is misleading, because only one signature may be /// added in a document. The method will be removed in the future. void addSignatureField( - _$jni.JList<_$jni.JObject> sigFields, - _$jni.JObject signatureInterface, - _$jni.JObject options, + _$jni.JList<_$jni.JObject?>? sigFields, + _$jni.JObject? signatureInterface, + _$jni.JObject? options, ) { + final _$sigFields = sigFields?.reference ?? _$jni.jNullReference; + final _$signatureInterface = + signatureInterface?.reference ?? _$jni.jNullReference; + final _$options = options?.reference ?? _$jni.jNullReference; _addSignatureField( reference.pointer, _id_addSignatureField as _$jni.JMethodIDPtr, - sigFields.reference.pointer, - signatureInterface.reference.pointer, - options.reference.pointer) + _$sigFields.pointer, + _$signatureInterface.pointer, + _$options.pointer) .check(); } @@ -516,10 +538,11 @@ class PDDocument extends _$jni.JObject { /// Remove the page from the document. ///@param page The page to remove from the document. void removePage( - _$jni.JObject page, + _$jni.JObject? page, ) { + final _$page = page?.reference ?? _$jni.jNullReference; _removePage(reference.pointer, _id_removePage as _$jni.JMethodIDPtr, - page.reference.pointer) + _$page.pointer) .check(); } @@ -590,12 +613,13 @@ class PDDocument extends _$jni.JObject { ///@param page The page to import. ///@return The page that was imported. ///@throws IOException If there is an error copying the page. - _$jni.JObject importPage( - _$jni.JObject page, + _$jni.JObject? importPage( + _$jni.JObject? page, ) { + final _$page = page?.reference ?? _$jni.jNullReference; return _importPage(reference.pointer, _id_importPage as _$jni.JMethodIDPtr, - page.reference.pointer) - .object(const _$jni.JObjectType()); + _$page.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getDocument = _class.instanceMethodId( @@ -620,10 +644,10 @@ class PDDocument extends _$jni.JObject { /// /// This will get the low level document. ///@return The document that this layer sits on top of. - _$jni.JObject getDocument() { + _$jni.JObject? getDocument() { return _getDocument( reference.pointer, _id_getDocument as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getDocumentInformation = _class.instanceMethodId( @@ -653,10 +677,11 @@ class PDDocument extends _$jni.JObject { /// document level metadata, a metadata stream should be used instead, see /// PDDocumentCatalog\#getMetadata(). ///@return The documents /Info dictionary, never null. - pddocumentinformation_.PDDocumentInformation getDocumentInformation() { + pddocumentinformation_.PDDocumentInformation? getDocumentInformation() { return _getDocumentInformation( reference.pointer, _id_getDocumentInformation as _$jni.JMethodIDPtr) - .object(const pddocumentinformation_.$PDDocumentInformation$Type()); + .object( + const pddocumentinformation_.$PDDocumentInformation$NullableType()); } static final _id_setDocumentInformation = _class.instanceMethodId( @@ -684,12 +709,11 @@ class PDDocument extends _$jni.JObject { /// PDDocumentCatalog\#setMetadata(org.apache.pdfbox.pdmodel.common.PDMetadata) PDDocumentCatalog\#setMetadata(PDMetadata). ///@param info The updated document information. void setDocumentInformation( - pddocumentinformation_.PDDocumentInformation info, + pddocumentinformation_.PDDocumentInformation? info, ) { - _setDocumentInformation( - reference.pointer, - _id_setDocumentInformation as _$jni.JMethodIDPtr, - info.reference.pointer) + final _$info = info?.reference ?? _$jni.jNullReference; + _setDocumentInformation(reference.pointer, + _id_setDocumentInformation as _$jni.JMethodIDPtr, _$info.pointer) .check(); } @@ -715,10 +739,10 @@ class PDDocument extends _$jni.JObject { /// /// This will get the document CATALOG. This is guaranteed to not return null. ///@return The documents /Root dictionary - _$jni.JObject getDocumentCatalog() { + _$jni.JObject? getDocumentCatalog() { return _getDocumentCatalog( reference.pointer, _id_getDocumentCatalog as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_isEncrypted = _class.instanceMethodId( @@ -773,10 +797,10 @@ class PDDocument extends _$jni.JObject { /// but the only supported subclass at this time is a /// PDStandardEncryption object. ///@return The encryption dictionary(most likely a PDStandardEncryption object) - _$jni.JObject getEncryption() { + _$jni.JObject? getEncryption() { return _getEncryption( reference.pointer, _id_getEncryption as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setEncryptionDictionary = _class.instanceMethodId( @@ -801,12 +825,13 @@ class PDDocument extends _$jni.JObject { ///@param encryption The encryption dictionary(most likely a PDStandardEncryption object) ///@throws IOException If there is an error determining which security handler to use. void setEncryptionDictionary( - _$jni.JObject encryption, + _$jni.JObject? encryption, ) { + final _$encryption = encryption?.reference ?? _$jni.jNullReference; _setEncryptionDictionary( reference.pointer, _id_setEncryptionDictionary as _$jni.JMethodIDPtr, - encryption.reference.pointer) + _$encryption.pointer) .check(); } @@ -835,10 +860,10 @@ class PDDocument extends _$jni.JObject { /// last in time when empty signature fields are created first but signed after other fields. ///@return the last signature as PDSignatureField. ///@throws IOException if no document catalog can be found. - _$jni.JObject getLastSignatureDictionary() { + _$jni.JObject? getLastSignatureDictionary() { return _getLastSignatureDictionary(reference.pointer, _id_getLastSignatureDictionary as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getSignatureFields = _class.instanceMethodId( @@ -864,10 +889,12 @@ class PDDocument extends _$jni.JObject { /// Retrieve all signature fields from the document. ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. - _$jni.JList<_$jni.JObject> getSignatureFields() { + _$jni.JList<_$jni.JObject?>? getSignatureFields() { return _getSignatureFields( reference.pointer, _id_getSignatureFields as _$jni.JMethodIDPtr) - .object(const _$jni.JListType(_$jni.JObjectType())); + .object<_$jni.JList<_$jni.JObject?>?>( + const _$jni.JListNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_getSignatureDictionaries = _class.instanceMethodId( @@ -893,10 +920,12 @@ class PDDocument extends _$jni.JObject { /// Retrieve all signature dictionaries from the document. ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. - _$jni.JList<_$jni.JObject> getSignatureDictionaries() { + _$jni.JList<_$jni.JObject?>? getSignatureDictionaries() { return _getSignatureDictionaries(reference.pointer, _id_getSignatureDictionaries as _$jni.JMethodIDPtr) - .object(const _$jni.JListType(_$jni.JObjectType())); + .object<_$jni.JList<_$jni.JObject?>?>( + const _$jni.JListNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_registerTrueTypeFontForClosing = _class.instanceMethodId( @@ -923,12 +952,13 @@ class PDDocument extends _$jni.JObject { /// method, it is done by the appropriate PDFont classes. ///@param ttf void registerTrueTypeFontForClosing( - _$jni.JObject ttf, + _$jni.JObject? ttf, ) { + final _$ttf = ttf?.reference ?? _$jni.jNullReference; _registerTrueTypeFontForClosing( reference.pointer, _id_registerTrueTypeFontForClosing as _$jni.JMethodIDPtr, - ttf.reference.pointer) + _$ttf.pointer) .check(); } @@ -956,12 +986,13 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the file required a non-empty password. ///@throws IOException in case of a file reading or parsing error - static PDDocument load( - _$jni.JObject file, + static PDDocument? load( + _$jni.JObject? file, ) { + final _$file = file?.reference ?? _$jni.jNullReference; return _load(_class.reference.pointer, _id_load as _$jni.JMethodIDPtr, - file.reference.pointer) - .object(const $PDDocument$Type()); + _$file.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$1 = _class.staticMethodId( @@ -995,13 +1026,16 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the file required a non-empty password. ///@throws IOException in case of a file reading or parsing error - static PDDocument load$1( - _$jni.JObject file, - _$jni.JObject memUsageSetting, + static PDDocument? load$1( + _$jni.JObject? file, + _$jni.JObject? memUsageSetting, ) { + final _$file = file?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; return _load$1(_class.reference.pointer, _id_load$1 as _$jni.JMethodIDPtr, - file.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + _$file.pointer, _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$2 = _class.staticMethodId( @@ -1035,13 +1069,15 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException in case of a file reading or parsing error - static PDDocument load$2( - _$jni.JObject file, - _$jni.JString password, + static PDDocument? load$2( + _$jni.JObject? file, + _$jni.JString? password, ) { + final _$file = file?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; return _load$2(_class.reference.pointer, _id_load$2 as _$jni.JMethodIDPtr, - file.reference.pointer, password.reference.pointer) - .object(const $PDDocument$Type()); + _$file.pointer, _$password.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$3 = _class.staticMethodId( @@ -1078,18 +1114,18 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException in case of a file reading or parsing error - static PDDocument load$3( - _$jni.JObject file, - _$jni.JString password, - _$jni.JObject memUsageSetting, + static PDDocument? load$3( + _$jni.JObject? file, + _$jni.JString? password, + _$jni.JObject? memUsageSetting, ) { - return _load$3( - _class.reference.pointer, - _id_load$3 as _$jni.JMethodIDPtr, - file.reference.pointer, - password.reference.pointer, - memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + final _$file = file?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; + return _load$3(_class.reference.pointer, _id_load$3 as _$jni.JMethodIDPtr, + _$file.pointer, _$password.pointer, _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$4 = _class.staticMethodId( @@ -1128,20 +1164,24 @@ class PDDocument extends _$jni.JObject { ///@param alias alias to be used for decryption when using public key security ///@return loaded document ///@throws IOException in case of a file reading or parsing error - static PDDocument load$4( - _$jni.JObject file, - _$jni.JString password, - _$jni.JObject keyStore, - _$jni.JString alias, + static PDDocument? load$4( + _$jni.JObject? file, + _$jni.JString? password, + _$jni.JObject? keyStore, + _$jni.JString? alias, ) { + final _$file = file?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; + final _$alias = alias?.reference ?? _$jni.jNullReference; return _load$4( _class.reference.pointer, _id_load$4 as _$jni.JMethodIDPtr, - file.reference.pointer, - password.reference.pointer, - keyStore.reference.pointer, - alias.reference.pointer) - .object(const $PDDocument$Type()); + _$file.pointer, + _$password.pointer, + _$keyStore.pointer, + _$alias.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$5 = _class.staticMethodId( @@ -1183,22 +1223,28 @@ class PDDocument extends _$jni.JObject { ///@param memUsageSetting defines how memory is used for buffering PDF streams ///@return loaded document ///@throws IOException in case of a file reading or parsing error - static PDDocument load$5( - _$jni.JObject file, - _$jni.JString password, - _$jni.JObject keyStore, - _$jni.JString alias, - _$jni.JObject memUsageSetting, + static PDDocument? load$5( + _$jni.JObject? file, + _$jni.JString? password, + _$jni.JObject? keyStore, + _$jni.JString? alias, + _$jni.JObject? memUsageSetting, ) { + final _$file = file?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; + final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; return _load$5( _class.reference.pointer, _id_load$5 as _$jni.JMethodIDPtr, - file.reference.pointer, - password.reference.pointer, - keyStore.reference.pointer, - alias.reference.pointer, - memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + _$file.pointer, + _$password.pointer, + _$keyStore.pointer, + _$alias.pointer, + _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$6 = _class.staticMethodId( @@ -1226,12 +1272,13 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$6( - _$jni.JObject input, + static PDDocument? load$6( + _$jni.JObject? input, ) { + final _$input = input?.reference ?? _$jni.jNullReference; return _load$6(_class.reference.pointer, _id_load$6 as _$jni.JMethodIDPtr, - input.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$7 = _class.staticMethodId( @@ -1266,13 +1313,16 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$7( - _$jni.JObject input, - _$jni.JObject memUsageSetting, + static PDDocument? load$7( + _$jni.JObject? input, + _$jni.JObject? memUsageSetting, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; return _load$7(_class.reference.pointer, _id_load$7 as _$jni.JMethodIDPtr, - input.reference.pointer, memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$8 = _class.staticMethodId( @@ -1307,13 +1357,15 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$8( - _$jni.JObject input, - _$jni.JString password, + static PDDocument? load$8( + _$jni.JObject? input, + _$jni.JString? password, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; return _load$8(_class.reference.pointer, _id_load$8 as _$jni.JMethodIDPtr, - input.reference.pointer, password.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, _$password.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$9 = _class.staticMethodId( @@ -1353,20 +1405,24 @@ class PDDocument extends _$jni.JObject { ///@param alias alias to be used for decryption when using public key security ///@return loaded document ///@throws IOException In case of a reading or parsing error. - static PDDocument load$9( - _$jni.JObject input, - _$jni.JString password, - _$jni.JObject keyStore, - _$jni.JString alias, + static PDDocument? load$9( + _$jni.JObject? input, + _$jni.JString? password, + _$jni.JObject? keyStore, + _$jni.JString? alias, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; + final _$alias = alias?.reference ?? _$jni.jNullReference; return _load$9( _class.reference.pointer, _id_load$9 as _$jni.JMethodIDPtr, - input.reference.pointer, - password.reference.pointer, - keyStore.reference.pointer, - alias.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, + _$password.pointer, + _$keyStore.pointer, + _$alias.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$10 = _class.staticMethodId( @@ -1404,18 +1460,18 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$10( - _$jni.JObject input, - _$jni.JString password, - _$jni.JObject memUsageSetting, + static PDDocument? load$10( + _$jni.JObject? input, + _$jni.JString? password, + _$jni.JObject? memUsageSetting, ) { - return _load$10( - _class.reference.pointer, - _id_load$10 as _$jni.JMethodIDPtr, - input.reference.pointer, - password.reference.pointer, - memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; + return _load$10(_class.reference.pointer, _id_load$10 as _$jni.JMethodIDPtr, + _$input.pointer, _$password.pointer, _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$11 = _class.staticMethodId( @@ -1459,22 +1515,28 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$11( - _$jni.JObject input, - _$jni.JString password, - _$jni.JObject keyStore, - _$jni.JString alias, - _$jni.JObject memUsageSetting, + static PDDocument? load$11( + _$jni.JObject? input, + _$jni.JString? password, + _$jni.JObject? keyStore, + _$jni.JString? alias, + _$jni.JObject? memUsageSetting, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; + final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; return _load$11( _class.reference.pointer, _id_load$11 as _$jni.JMethodIDPtr, - input.reference.pointer, - password.reference.pointer, - keyStore.reference.pointer, - alias.reference.pointer, - memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, + _$password.pointer, + _$keyStore.pointer, + _$alias.pointer, + _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$12 = _class.staticMethodId( @@ -1501,12 +1563,13 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$12( - _$jni.JArray<_$jni.jbyte> input, + static PDDocument? load$12( + _$jni.JArray<_$jni.jbyte>? input, ) { + final _$input = input?.reference ?? _$jni.jNullReference; return _load$12(_class.reference.pointer, _id_load$12 as _$jni.JMethodIDPtr, - input.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$13 = _class.staticMethodId( @@ -1540,13 +1603,15 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$13( - _$jni.JArray<_$jni.jbyte> input, - _$jni.JString password, + static PDDocument? load$13( + _$jni.JArray<_$jni.jbyte>? input, + _$jni.JString? password, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; return _load$13(_class.reference.pointer, _id_load$13 as _$jni.JMethodIDPtr, - input.reference.pointer, password.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, _$password.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$14 = _class.staticMethodId( @@ -1586,20 +1651,24 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$14( - _$jni.JArray<_$jni.jbyte> input, - _$jni.JString password, - _$jni.JObject keyStore, - _$jni.JString alias, + static PDDocument? load$14( + _$jni.JArray<_$jni.jbyte>? input, + _$jni.JString? password, + _$jni.JObject? keyStore, + _$jni.JString? alias, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; + final _$alias = alias?.reference ?? _$jni.jNullReference; return _load$14( _class.reference.pointer, _id_load$14 as _$jni.JMethodIDPtr, - input.reference.pointer, - password.reference.pointer, - keyStore.reference.pointer, - alias.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, + _$password.pointer, + _$keyStore.pointer, + _$alias.pointer) + .object(const $PDDocument$NullableType()); } static final _id_load$15 = _class.staticMethodId( @@ -1642,22 +1711,28 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. - static PDDocument load$15( - _$jni.JArray<_$jni.jbyte> input, - _$jni.JString password, - _$jni.JObject keyStore, - _$jni.JString alias, - _$jni.JObject memUsageSetting, + static PDDocument? load$15( + _$jni.JArray<_$jni.jbyte>? input, + _$jni.JString? password, + _$jni.JObject? keyStore, + _$jni.JString? alias, + _$jni.JObject? memUsageSetting, ) { + final _$input = input?.reference ?? _$jni.jNullReference; + final _$password = password?.reference ?? _$jni.jNullReference; + final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; + final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$memUsageSetting = + memUsageSetting?.reference ?? _$jni.jNullReference; return _load$15( _class.reference.pointer, _id_load$15 as _$jni.JMethodIDPtr, - input.reference.pointer, - password.reference.pointer, - keyStore.reference.pointer, - alias.reference.pointer, - memUsageSetting.reference.pointer) - .object(const $PDDocument$Type()); + _$input.pointer, + _$password.pointer, + _$keyStore.pointer, + _$alias.pointer, + _$memUsageSetting.pointer) + .object(const $PDDocument$NullableType()); } static final _id_save = _class.instanceMethodId( @@ -1686,10 +1761,10 @@ class PDDocument extends _$jni.JObject { ///@param fileName The file to save as. ///@throws IOException if the output could not be written void save( - _$jni.JString fileName, + _$jni.JString? fileName, ) { - _save(reference.pointer, _id_save as _$jni.JMethodIDPtr, - fileName.reference.pointer) + final _$fileName = fileName?.reference ?? _$jni.jNullReference; + _save(reference.pointer, _id_save as _$jni.JMethodIDPtr, _$fileName.pointer) .check(); } @@ -1719,10 +1794,10 @@ class PDDocument extends _$jni.JObject { ///@param file The file to save as. ///@throws IOException if the output could not be written void save$1( - _$jni.JObject file, + _$jni.JObject? file, ) { - _save$1(reference.pointer, _id_save$1 as _$jni.JMethodIDPtr, - file.reference.pointer) + final _$file = file?.reference ?? _$jni.jNullReference; + _save$1(reference.pointer, _id_save$1 as _$jni.JMethodIDPtr, _$file.pointer) .check(); } @@ -1753,10 +1828,11 @@ class PDDocument extends _$jni.JObject { /// it in a java.io.BufferedOutputStream, unless it is already buffered. ///@throws IOException if the output could not be written void save$2( - _$jni.JObject output, + _$jni.JObject? output, ) { + final _$output = output?.reference ?? _$jni.jNullReference; _save$2(reference.pointer, _id_save$2 as _$jni.JMethodIDPtr, - output.reference.pointer) + _$output.pointer) .check(); } @@ -1792,10 +1868,11 @@ class PDDocument extends _$jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream. void saveIncremental( - _$jni.JObject output, + _$jni.JObject? output, ) { + final _$output = output?.reference ?? _$jni.jNullReference; _saveIncremental(reference.pointer, - _id_saveIncremental as _$jni.JMethodIDPtr, output.reference.pointer) + _id_saveIncremental as _$jni.JMethodIDPtr, _$output.pointer) .check(); } @@ -1842,14 +1919,16 @@ class PDDocument extends _$jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream. void saveIncremental$1( - _$jni.JObject output, - _$jni.JSet<_$jni.JObject> objectsToWrite, + _$jni.JObject? output, + _$jni.JSet<_$jni.JObject?>? objectsToWrite, ) { + final _$output = output?.reference ?? _$jni.jNullReference; + final _$objectsToWrite = objectsToWrite?.reference ?? _$jni.jNullReference; _saveIncremental$1( reference.pointer, _id_saveIncremental$1 as _$jni.JMethodIDPtr, - output.reference.pointer, - objectsToWrite.reference.pointer) + _$output.pointer, + _$objectsToWrite.pointer) .check(); } @@ -1910,14 +1989,15 @@ class PDDocument extends _$jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream or /// signature options were not set. - _$jni.JObject saveIncrementalForExternalSigning( - _$jni.JObject output, + _$jni.JObject? saveIncrementalForExternalSigning( + _$jni.JObject? output, ) { + final _$output = output?.reference ?? _$jni.jNullReference; return _saveIncrementalForExternalSigning( reference.pointer, _id_saveIncrementalForExternalSigning as _$jni.JMethodIDPtr, - output.reference.pointer) - .object(const _$jni.JObjectType()); + _$output.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getPage = _class.instanceMethodId( @@ -1945,12 +2025,12 @@ class PDDocument extends _$jni.JObject { /// PDDocument\#getPages() instead. ///@param pageIndex the 0-based page index ///@return the page at the given index. - _$jni.JObject getPage( + _$jni.JObject? getPage( int pageIndex, ) { return _getPage( reference.pointer, _id_getPage as _$jni.JMethodIDPtr, pageIndex) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getPages = _class.instanceMethodId( @@ -1975,9 +2055,9 @@ class PDDocument extends _$jni.JObject { /// /// Returns the page tree. ///@return the page tree - _$jni.JObject getPages() { + _$jni.JObject? getPages() { return _getPages(reference.pointer, _id_getPages as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getNumberOfPages = _class.instanceMethodId( @@ -2061,10 +2141,11 @@ class PDDocument extends _$jni.JObject { ///@param policy The protection policy. ///@throws IOException if there isn't any suitable security handler. void protect( - _$jni.JObject policy, + _$jni.JObject? policy, ) { + final _$policy = policy?.reference ?? _$jni.jNullReference; _protect(reference.pointer, _id_protect as _$jni.JMethodIDPtr, - policy.reference.pointer) + _$policy.pointer) .check(); } @@ -2094,10 +2175,10 @@ class PDDocument extends _$jni.JObject { /// only mode so that permissions cannot be changed. Methods providing access to content should rely on this object /// to verify if the current user is allowed to proceed. ///@return the access permissions for the current user on the document. - _$jni.JObject getCurrentAccessPermission() { + _$jni.JObject? getCurrentAccessPermission() { return _getCurrentAccessPermission(reference.pointer, _id_getCurrentAccessPermission as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_isAllSecurityToBeRemoved = _class.instanceMethodId( @@ -2178,10 +2259,10 @@ class PDDocument extends _$jni.JObject { /// /// Provides the document ID. ///@return the document ID - _$jni.JLong getDocumentId() { + _$jni.JLong? getDocumentId() { return _getDocumentId( reference.pointer, _id_getDocumentId as _$jni.JMethodIDPtr) - .object(const _$jni.JLongType()); + .object<_$jni.JLong?>(const _$jni.JLongNullableType()); } static final _id_setDocumentId = _class.instanceMethodId( @@ -2205,10 +2286,11 @@ class PDDocument extends _$jni.JObject { /// Sets the document ID to the given value. ///@param docId the new document ID void setDocumentId( - _$jni.JLong docId, + _$jni.JLong? docId, ) { + final _$docId = docId?.reference ?? _$jni.jNullReference; _setDocumentId(reference.pointer, _id_setDocumentId as _$jni.JMethodIDPtr, - docId.reference.pointer) + _$docId.pointer) .check(); } @@ -2287,10 +2369,10 @@ class PDDocument extends _$jni.JObject { /// /// Returns the resource cache associated with this document, or null if there is none. ///@return the resource cache or null. - _$jni.JObject getResourceCache() { + _$jni.JObject? getResourceCache() { return _getResourceCache( reference.pointer, _id_getResourceCache as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setResourceCache = _class.instanceMethodId( @@ -2314,16 +2396,52 @@ class PDDocument extends _$jni.JObject { /// Sets the resource cache associated with this document. ///@param resourceCache A resource cache, or null. void setResourceCache( - _$jni.JObject resourceCache, + _$jni.JObject? resourceCache, ) { - _setResourceCache( - reference.pointer, - _id_setResourceCache as _$jni.JMethodIDPtr, - resourceCache.reference.pointer) + final _$resourceCache = resourceCache?.reference ?? _$jni.jNullReference; + _setResourceCache(reference.pointer, + _id_setResourceCache as _$jni.JMethodIDPtr, _$resourceCache.pointer) .check(); } } +final class $PDDocument$NullableType extends _$jni.JObjType { + @_$jni.internal + const $PDDocument$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocument;'; + + @_$jni.internal + @_$core.override + PDDocument? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : PDDocument.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($PDDocument$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($PDDocument$NullableType) && + other is $PDDocument$NullableType; + } +} + final class $PDDocument$Type extends _$jni.JObjType { @_$jni.internal const $PDDocument$Type(); @@ -2335,11 +2453,17 @@ final class $PDDocument$Type extends _$jni.JObjType { @_$jni.internal @_$core.override PDDocument fromReference(_$jni.JReference reference) => - PDDocument.fromReference(reference); + PDDocument.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $PDDocument$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart index ae30379a0..cb1573df3 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart @@ -38,6 +38,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -74,6 +75,7 @@ class PDDocumentInformation extends _$jni.JObject { _$jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocumentInformation'); /// The type which includes information such as the signature of this class. + static const nullableType = $PDDocumentInformation$NullableType(); static const type = $PDDocumentInformation$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -122,10 +124,11 @@ class PDDocumentInformation extends _$jni.JObject { /// Constructor that is used for a preexisting dictionary. ///@param dic The underlying dictionary. factory PDDocumentInformation.new$1( - _$jni.JObject dic, + _$jni.JObject? dic, ) { + final _$dic = dic?.reference ?? _$jni.jNullReference; return PDDocumentInformation.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as _$jni.JMethodIDPtr, dic.reference.pointer) + _id_new$1 as _$jni.JMethodIDPtr, _$dic.pointer) .reference); } @@ -151,10 +154,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the underlying dictionary that this object wraps. ///@return The underlying info dictionary. - _$jni.JObject getCOSObject() { + _$jni.JObject? getCOSObject() { return _getCOSObject( reference.pointer, _id_getCOSObject as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getPropertyStringValue = _class.instanceMethodId( @@ -184,14 +187,15 @@ class PDDocumentInformation extends _$jni.JObject { /// ///@param propertyKey the dictionaries key ///@return the properties value - _$jni.JObject getPropertyStringValue( - _$jni.JString propertyKey, + _$jni.JObject? getPropertyStringValue( + _$jni.JString? propertyKey, ) { + final _$propertyKey = propertyKey?.reference ?? _$jni.jNullReference; return _getPropertyStringValue( reference.pointer, _id_getPropertyStringValue as _$jni.JMethodIDPtr, - propertyKey.reference.pointer) - .object(const _$jni.JObjectType()); + _$propertyKey.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getTitle = _class.instanceMethodId( @@ -216,9 +220,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the title of the document. This will return null if no title exists. ///@return The title of the document. - _$jni.JString getTitle() { + _$jni.JString? getTitle() { return _getTitle(reference.pointer, _id_getTitle as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setTitle = _class.instanceMethodId( @@ -242,10 +246,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the title of the document. ///@param title The new title for the document. void setTitle( - _$jni.JString title, + _$jni.JString? title, ) { + final _$title = title?.reference ?? _$jni.jNullReference; _setTitle(reference.pointer, _id_setTitle as _$jni.JMethodIDPtr, - title.reference.pointer) + _$title.pointer) .check(); } @@ -271,9 +276,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the author of the document. This will return null if no author exists. ///@return The author of the document. - _$jni.JString getAuthor() { + _$jni.JString? getAuthor() { return _getAuthor(reference.pointer, _id_getAuthor as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setAuthor = _class.instanceMethodId( @@ -297,10 +302,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the author of the document. ///@param author The new author for the document. void setAuthor( - _$jni.JString author, + _$jni.JString? author, ) { + final _$author = author?.reference ?? _$jni.jNullReference; _setAuthor(reference.pointer, _id_setAuthor as _$jni.JMethodIDPtr, - author.reference.pointer) + _$author.pointer) .check(); } @@ -326,9 +332,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the subject of the document. This will return null if no subject exists. ///@return The subject of the document. - _$jni.JString getSubject() { + _$jni.JString? getSubject() { return _getSubject(reference.pointer, _id_getSubject as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setSubject = _class.instanceMethodId( @@ -352,10 +358,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the subject of the document. ///@param subject The new subject for the document. void setSubject( - _$jni.JString subject, + _$jni.JString? subject, ) { + final _$subject = subject?.reference ?? _$jni.jNullReference; _setSubject(reference.pointer, _id_setSubject as _$jni.JMethodIDPtr, - subject.reference.pointer) + _$subject.pointer) .check(); } @@ -381,10 +388,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the keywords of the document. This will return null if no keywords exists. ///@return The keywords of the document. - _$jni.JString getKeywords() { + _$jni.JString? getKeywords() { return _getKeywords( reference.pointer, _id_getKeywords as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setKeywords = _class.instanceMethodId( @@ -408,10 +415,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the keywords of the document. ///@param keywords The new keywords for the document. void setKeywords( - _$jni.JString keywords, + _$jni.JString? keywords, ) { + final _$keywords = keywords?.reference ?? _$jni.jNullReference; _setKeywords(reference.pointer, _id_setKeywords as _$jni.JMethodIDPtr, - keywords.reference.pointer) + _$keywords.pointer) .check(); } @@ -437,9 +445,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the creator of the document. This will return null if no creator exists. ///@return The creator of the document. - _$jni.JString getCreator() { + _$jni.JString? getCreator() { return _getCreator(reference.pointer, _id_getCreator as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setCreator = _class.instanceMethodId( @@ -463,10 +471,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the creator of the document. ///@param creator The new creator for the document. void setCreator( - _$jni.JString creator, + _$jni.JString? creator, ) { + final _$creator = creator?.reference ?? _$jni.jNullReference; _setCreator(reference.pointer, _id_setCreator as _$jni.JMethodIDPtr, - creator.reference.pointer) + _$creator.pointer) .check(); } @@ -492,10 +501,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the producer of the document. This will return null if no producer exists. ///@return The producer of the document. - _$jni.JString getProducer() { + _$jni.JString? getProducer() { return _getProducer( reference.pointer, _id_getProducer as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setProducer = _class.instanceMethodId( @@ -519,10 +528,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the producer of the document. ///@param producer The new producer for the document. void setProducer( - _$jni.JString producer, + _$jni.JString? producer, ) { + final _$producer = producer?.reference ?? _$jni.jNullReference; _setProducer(reference.pointer, _id_setProducer as _$jni.JMethodIDPtr, - producer.reference.pointer) + _$producer.pointer) .check(); } @@ -548,10 +558,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the creation date of the document. This will return null if no creation date exists. ///@return The creation date of the document. - _$jni.JObject getCreationDate() { + _$jni.JObject? getCreationDate() { return _getCreationDate( reference.pointer, _id_getCreationDate as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setCreationDate = _class.instanceMethodId( @@ -575,10 +585,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the creation date of the document. ///@param date The new creation date for the document. void setCreationDate( - _$jni.JObject date, + _$jni.JObject? date, ) { + final _$date = date?.reference ?? _$jni.jNullReference; _setCreationDate(reference.pointer, - _id_setCreationDate as _$jni.JMethodIDPtr, date.reference.pointer) + _id_setCreationDate as _$jni.JMethodIDPtr, _$date.pointer) .check(); } @@ -604,10 +615,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the modification date of the document. This will return null if no modification date exists. ///@return The modification date of the document. - _$jni.JObject getModificationDate() { + _$jni.JObject? getModificationDate() { return _getModificationDate( reference.pointer, _id_getModificationDate as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setModificationDate = _class.instanceMethodId( @@ -631,12 +642,11 @@ class PDDocumentInformation extends _$jni.JObject { /// This will set the modification date of the document. ///@param date The new modification date for the document. void setModificationDate( - _$jni.JObject date, + _$jni.JObject? date, ) { - _setModificationDate( - reference.pointer, - _id_setModificationDate as _$jni.JMethodIDPtr, - date.reference.pointer) + final _$date = date?.reference ?? _$jni.jNullReference; + _setModificationDate(reference.pointer, + _id_setModificationDate as _$jni.JMethodIDPtr, _$date.pointer) .check(); } @@ -663,9 +673,9 @@ class PDDocumentInformation extends _$jni.JObject { /// This will get the trapped value for the document. /// This will return null if one is not found. ///@return The trapped value for the document. - _$jni.JString getTrapped() { + _$jni.JString? getTrapped() { return _getTrapped(reference.pointer, _id_getTrapped as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getMetadataKeys = _class.instanceMethodId( @@ -691,10 +701,12 @@ class PDDocumentInformation extends _$jni.JObject { /// This will get the keys of all metadata information fields for the document. ///@return all metadata key strings. ///@since Apache PDFBox 1.3.0 - _$jni.JSet<_$jni.JString> getMetadataKeys() { + _$jni.JSet<_$jni.JString?>? getMetadataKeys() { return _getMetadataKeys( reference.pointer, _id_getMetadataKeys as _$jni.JMethodIDPtr) - .object(const _$jni.JSetType(_$jni.JStringType())); + .object<_$jni.JSet<_$jni.JString?>?>( + const _$jni.JSetNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); } static final _id_getCustomMetadataValue = _class.instanceMethodId( @@ -720,14 +732,15 @@ class PDDocumentInformation extends _$jni.JObject { /// This will return null if one is not found. ///@param fieldName Name of custom metadata field from pdf document. ///@return String Value of metadata field - _$jni.JString getCustomMetadataValue( - _$jni.JString fieldName, + _$jni.JString? getCustomMetadataValue( + _$jni.JString? fieldName, ) { + final _$fieldName = fieldName?.reference ?? _$jni.jNullReference; return _getCustomMetadataValue( reference.pointer, _id_getCustomMetadataValue as _$jni.JMethodIDPtr, - fieldName.reference.pointer) - .object(const _$jni.JStringType()); + _$fieldName.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setCustomMetadataValue = _class.instanceMethodId( @@ -758,14 +771,16 @@ class PDDocumentInformation extends _$jni.JObject { ///@param fieldName The name of the custom metadata field. ///@param fieldValue The value to the custom metadata field. void setCustomMetadataValue( - _$jni.JString fieldName, - _$jni.JString fieldValue, + _$jni.JString? fieldName, + _$jni.JString? fieldValue, ) { + final _$fieldName = fieldName?.reference ?? _$jni.jNullReference; + final _$fieldValue = fieldValue?.reference ?? _$jni.jNullReference; _setCustomMetadataValue( reference.pointer, _id_setCustomMetadataValue as _$jni.JMethodIDPtr, - fieldName.reference.pointer, - fieldValue.reference.pointer) + _$fieldName.pointer, + _$fieldValue.pointer) .check(); } @@ -792,14 +807,54 @@ class PDDocumentInformation extends _$jni.JObject { ///@param value The new trapped value for the document. ///@throws IllegalArgumentException if the parameter is invalid. void setTrapped( - _$jni.JString value, + _$jni.JString? value, ) { + final _$value = value?.reference ?? _$jni.jNullReference; _setTrapped(reference.pointer, _id_setTrapped as _$jni.JMethodIDPtr, - value.reference.pointer) + _$value.pointer) .check(); } } +final class $PDDocumentInformation$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $PDDocumentInformation$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;'; + + @_$jni.internal + @_$core.override + PDDocumentInformation? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : PDDocumentInformation.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($PDDocumentInformation$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($PDDocumentInformation$NullableType) && + other is $PDDocumentInformation$NullableType; + } +} + final class $PDDocumentInformation$Type extends _$jni.JObjType { @_$jni.internal @@ -812,11 +867,17 @@ final class $PDDocumentInformation$Type @_$jni.internal @_$core.override PDDocumentInformation fromReference(_$jni.JReference reference) => - PDDocumentInformation.fromReference(reference); + PDDocumentInformation.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $PDDocumentInformation$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart index 134b0cc16..74bf44b24 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart @@ -38,6 +38,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -78,6 +79,7 @@ class PDFTextStripper extends _$jni.JObject { _$jni.JClass.forName(r'org/apache/pdfbox/text/PDFTextStripper'); /// The type which includes information such as the signature of this class. + static const nullableType = $PDFTextStripper$NullableType(); static const type = $PDFTextStripper$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -135,12 +137,13 @@ class PDFTextStripper extends _$jni.JObject { ///@param doc The document to get the text from. ///@return The text of the PDF document. ///@throws IOException if the doc state is invalid or it is encrypted. - _$jni.JString getText( - pddocument_.PDDocument doc, + _$jni.JString? getText( + pddocument_.PDDocument? doc, ) { - return _getText(reference.pointer, _id_getText as _$jni.JMethodIDPtr, - doc.reference.pointer) - .object(const _$jni.JStringType()); + final _$doc = doc?.reference ?? _$jni.jNullReference; + return _getText( + reference.pointer, _id_getText as _$jni.JMethodIDPtr, _$doc.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_writeText = _class.instanceMethodId( @@ -172,11 +175,13 @@ class PDFTextStripper extends _$jni.JObject { ///@param outputStream The location to put the text. ///@throws IOException If the doc is in an invalid state. void writeText( - pddocument_.PDDocument doc, - _$jni.JObject outputStream, + pddocument_.PDDocument? doc, + _$jni.JObject? outputStream, ) { + final _$doc = doc?.reference ?? _$jni.jNullReference; + final _$outputStream = outputStream?.reference ?? _$jni.jNullReference; _writeText(reference.pointer, _id_writeText as _$jni.JMethodIDPtr, - doc.reference.pointer, outputStream.reference.pointer) + _$doc.pointer, _$outputStream.pointer) .check(); } @@ -202,10 +207,11 @@ class PDFTextStripper extends _$jni.JObject { ///@param page The page to process. ///@throws IOException If there is an error processing the page. void processPage( - _$jni.JObject page, + _$jni.JObject? page, ) { + final _$page = page?.reference ?? _$jni.jNullReference; _processPage(reference.pointer, _id_processPage as _$jni.JMethodIDPtr, - page.reference.pointer) + _$page.pointer) .check(); } @@ -342,12 +348,11 @@ class PDFTextStripper extends _$jni.JObject { /// preference is not set explicitly using this method. ///@param separator The desired line separator string. void setLineSeparator( - _$jni.JString separator, + _$jni.JString? separator, ) { - _setLineSeparator( - reference.pointer, - _id_setLineSeparator as _$jni.JMethodIDPtr, - separator.reference.pointer) + final _$separator = separator?.reference ?? _$jni.jNullReference; + _setLineSeparator(reference.pointer, + _id_setLineSeparator as _$jni.JMethodIDPtr, _$separator.pointer) .check(); } @@ -373,10 +378,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// This will get the line separator. ///@return The desired line separator string. - _$jni.JString getLineSeparator() { + _$jni.JString? getLineSeparator() { return _getLineSeparator( reference.pointer, _id_getLineSeparator as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getWordSeparator = _class.instanceMethodId( @@ -401,10 +406,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// This will get the word separator. ///@return The desired word separator string. - _$jni.JString getWordSeparator() { + _$jni.JString? getWordSeparator() { return _getWordSeparator( reference.pointer, _id_getWordSeparator as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setWordSeparator = _class.instanceMethodId( @@ -431,12 +436,11 @@ class PDFTextStripper extends _$jni.JObject { /// the empty string. ///@param separator The desired page separator string. void setWordSeparator( - _$jni.JString separator, + _$jni.JString? separator, ) { - _setWordSeparator( - reference.pointer, - _id_setWordSeparator as _$jni.JMethodIDPtr, - separator.reference.pointer) + final _$separator = separator?.reference ?? _$jni.jNullReference; + _setWordSeparator(reference.pointer, + _id_setWordSeparator as _$jni.JMethodIDPtr, _$separator.pointer) .check(); } @@ -578,10 +582,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Get the bookmark where text extraction should end, inclusive. Default is null. ///@return The ending bookmark. - _$jni.JObject getEndBookmark() { + _$jni.JObject? getEndBookmark() { return _getEndBookmark( reference.pointer, _id_getEndBookmark as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setEndBookmark = _class.instanceMethodId( @@ -605,10 +609,11 @@ class PDFTextStripper extends _$jni.JObject { /// Set the bookmark where the text extraction should stop. ///@param aEndBookmark The ending bookmark. void setEndBookmark( - _$jni.JObject aEndBookmark, + _$jni.JObject? aEndBookmark, ) { + final _$aEndBookmark = aEndBookmark?.reference ?? _$jni.jNullReference; _setEndBookmark(reference.pointer, _id_setEndBookmark as _$jni.JMethodIDPtr, - aEndBookmark.reference.pointer) + _$aEndBookmark.pointer) .check(); } @@ -634,10 +639,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Get the bookmark where text extraction should start, inclusive. Default is null. ///@return The starting bookmark. - _$jni.JObject getStartBookmark() { + _$jni.JObject? getStartBookmark() { return _getStartBookmark( reference.pointer, _id_getStartBookmark as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setStartBookmark = _class.instanceMethodId( @@ -661,12 +666,13 @@ class PDFTextStripper extends _$jni.JObject { /// Set the bookmark where text extraction should start, inclusive. ///@param aStartBookmark The starting bookmark. void setStartBookmark( - _$jni.JObject aStartBookmark, + _$jni.JObject? aStartBookmark, ) { + final _$aStartBookmark = aStartBookmark?.reference ?? _$jni.jNullReference; _setStartBookmark( reference.pointer, _id_setStartBookmark as _$jni.JMethodIDPtr, - aStartBookmark.reference.pointer) + _$aStartBookmark.pointer) .check(); } @@ -1042,10 +1048,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the beginning of a paragraph. ///@return the paragraph start string - _$jni.JString getParagraphStart() { + _$jni.JString? getParagraphStart() { return _getParagraphStart( reference.pointer, _id_getParagraphStart as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setParagraphStart = _class.instanceMethodId( @@ -1069,10 +1075,11 @@ class PDFTextStripper extends _$jni.JObject { /// Sets the string which will be used at the beginning of a paragraph. ///@param s the paragraph start string void setParagraphStart( - _$jni.JString s, + _$jni.JString? s, ) { + final _$s = s?.reference ?? _$jni.jNullReference; _setParagraphStart(reference.pointer, - _id_setParagraphStart as _$jni.JMethodIDPtr, s.reference.pointer) + _id_setParagraphStart as _$jni.JMethodIDPtr, _$s.pointer) .check(); } @@ -1098,10 +1105,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the end of a paragraph. ///@return the paragraph end string - _$jni.JString getParagraphEnd() { + _$jni.JString? getParagraphEnd() { return _getParagraphEnd( reference.pointer, _id_getParagraphEnd as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setParagraphEnd = _class.instanceMethodId( @@ -1125,10 +1132,11 @@ class PDFTextStripper extends _$jni.JObject { /// Sets the string which will be used at the end of a paragraph. ///@param s the paragraph end string void setParagraphEnd( - _$jni.JString s, + _$jni.JString? s, ) { + final _$s = s?.reference ?? _$jni.jNullReference; _setParagraphEnd(reference.pointer, - _id_setParagraphEnd as _$jni.JMethodIDPtr, s.reference.pointer) + _id_setParagraphEnd as _$jni.JMethodIDPtr, _$s.pointer) .check(); } @@ -1154,10 +1162,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the beginning of a page. ///@return the page start string - _$jni.JString getPageStart() { + _$jni.JString? getPageStart() { return _getPageStart( reference.pointer, _id_getPageStart as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setPageStart = _class.instanceMethodId( @@ -1181,10 +1189,11 @@ class PDFTextStripper extends _$jni.JObject { /// Sets the string which will be used at the beginning of a page. ///@param pageStartValue the page start string void setPageStart( - _$jni.JString pageStartValue, + _$jni.JString? pageStartValue, ) { + final _$pageStartValue = pageStartValue?.reference ?? _$jni.jNullReference; _setPageStart(reference.pointer, _id_setPageStart as _$jni.JMethodIDPtr, - pageStartValue.reference.pointer) + _$pageStartValue.pointer) .check(); } @@ -1210,9 +1219,9 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the end of a page. ///@return the page end string - _$jni.JString getPageEnd() { + _$jni.JString? getPageEnd() { return _getPageEnd(reference.pointer, _id_getPageEnd as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setPageEnd = _class.instanceMethodId( @@ -1236,10 +1245,11 @@ class PDFTextStripper extends _$jni.JObject { /// Sets the string which will be used at the end of a page. ///@param pageEndValue the page end string void setPageEnd( - _$jni.JString pageEndValue, + _$jni.JString? pageEndValue, ) { + final _$pageEndValue = pageEndValue?.reference ?? _$jni.jNullReference; _setPageEnd(reference.pointer, _id_setPageEnd as _$jni.JMethodIDPtr, - pageEndValue.reference.pointer) + _$pageEndValue.pointer) .check(); } @@ -1265,10 +1275,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the beginning of an article. ///@return the article start string - _$jni.JString getArticleStart() { + _$jni.JString? getArticleStart() { return _getArticleStart( reference.pointer, _id_getArticleStart as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setArticleStart = _class.instanceMethodId( @@ -1292,12 +1302,14 @@ class PDFTextStripper extends _$jni.JObject { /// Sets the string which will be used at the beginning of an article. ///@param articleStartValue the article start string void setArticleStart( - _$jni.JString articleStartValue, + _$jni.JString? articleStartValue, ) { + final _$articleStartValue = + articleStartValue?.reference ?? _$jni.jNullReference; _setArticleStart( reference.pointer, _id_setArticleStart as _$jni.JMethodIDPtr, - articleStartValue.reference.pointer) + _$articleStartValue.pointer) .check(); } @@ -1323,10 +1335,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the end of an article. ///@return the article end string - _$jni.JString getArticleEnd() { + _$jni.JString? getArticleEnd() { return _getArticleEnd( reference.pointer, _id_getArticleEnd as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setArticleEnd = _class.instanceMethodId( @@ -1350,14 +1362,54 @@ class PDFTextStripper extends _$jni.JObject { /// Sets the string which will be used at the end of an article. ///@param articleEndValue the article end string void setArticleEnd( - _$jni.JString articleEndValue, + _$jni.JString? articleEndValue, ) { + final _$articleEndValue = + articleEndValue?.reference ?? _$jni.jNullReference; _setArticleEnd(reference.pointer, _id_setArticleEnd as _$jni.JMethodIDPtr, - articleEndValue.reference.pointer) + _$articleEndValue.pointer) .check(); } } +final class $PDFTextStripper$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $PDFTextStripper$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lorg/apache/pdfbox/text/PDFTextStripper;'; + + @_$jni.internal + @_$core.override + PDFTextStripper? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : PDFTextStripper.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($PDFTextStripper$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($PDFTextStripper$NullableType) && + other is $PDFTextStripper$NullableType; + } +} + final class $PDFTextStripper$Type extends _$jni.JObjType { @_$jni.internal const $PDFTextStripper$Type(); @@ -1369,11 +1421,17 @@ final class $PDFTextStripper$Type extends _$jni.JObjType { @_$jni.internal @_$core.override PDFTextStripper fromReference(_$jni.JReference reference) => - PDFTextStripper.fromReference(reference); + PDFTextStripper.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $PDFTextStripper$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmAnnotatedElementVisitor.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmAnnotatedElementVisitor.java deleted file mode 100644 index 0a723b310..000000000 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmAnnotatedElementVisitor.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.github.dart_lang.jnigen.apisummarizer.disasm; - -import com.github.dart_lang.jnigen.apisummarizer.elements.JavaAnnotation; -import org.objectweb.asm.AnnotationVisitor; -import org.objectweb.asm.Type; - -// This interface removes some repetitive code using default methods - -public interface AsmAnnotatedElementVisitor { - void addAnnotation(JavaAnnotation annotation); - - default AnnotationVisitor visitAnnotationDefault(String descriptor, boolean visible) { - var annotation = new JavaAnnotation(); - var aType = Type.getType(descriptor); - annotation.binaryName = aType.getClassName(); - addAnnotation(annotation); - return new AsmAnnotationVisitor(annotation); - } -} diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java index d979b4e32..010c0679d 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmClassVisitor.java @@ -13,12 +13,11 @@ import org.objectweb.asm.*; import org.objectweb.asm.signature.SignatureReader; -public class AsmClassVisitor extends ClassVisitor implements AsmAnnotatedElementVisitor { - private static Param param( - Type type, String name, @SuppressWarnings("SameParameterValue") String signature) { +public class AsmClassVisitor extends ClassVisitor { + private static Param param(Type type, String name) { var param = new Param(); param.name = name; - param.type = TypeUtils.typeUsage(type, signature); + param.type = TypeUtils.typeUsage(type); return param; } @@ -31,6 +30,7 @@ public Map getVisited() { /// Actual access for the inner classes as originally defined. Map actualAccess = new HashMap<>(); + Map outerClass = new HashMap<>(); public AsmClassVisitor() { super(AsmConstants.API); @@ -48,10 +48,11 @@ public void visit( visiting.push(current); current.binaryName = name.replace('/', '.'); current.modifiers = TypeUtils.access(actualAccess.getOrDefault(current.binaryName, access)); + current.outerClassBinaryName = outerClass.getOrDefault(current.binaryName, null); current.declKind = TypeUtils.declKind(access); - current.superclass = TypeUtils.typeUsage(Type.getObjectType(superName), null); + current.superclass = TypeUtils.typeUsage(Type.getObjectType(superName)); current.interfaces = - StreamUtil.map(interfaces, i -> TypeUtils.typeUsage(Type.getObjectType(i), null)); + StreamUtil.map(interfaces, i -> TypeUtils.typeUsage(Type.getObjectType(i))); if (signature != null) { var reader = new SignatureReader(signature); reader.accept(new AsmClassSignatureVisitor(current)); @@ -63,11 +64,15 @@ public void visit( public void visitInnerClass(String name, String outerName, String innerName, int access) { var binaryName = name.replace('/', '.'); actualAccess.put(binaryName, access); - + if (outerName != null) { + var outerClassBinaryName = outerName.replace('/', '.'); + outerClass.put(binaryName, outerClassBinaryName); + } if (visited.containsKey(binaryName)) { // If the order of visit is outerClass-first, innerClass-second then only // correct the modifiers. visited.get(binaryName).modifiers = TypeUtils.access(access); + visited.get(binaryName).outerClassBinaryName = outerClass.get(binaryName); } } @@ -80,7 +85,7 @@ public FieldVisitor visitField( var field = new Field(); field.name = name; - field.type = TypeUtils.typeUsage(Type.getType(descriptor), signature); + field.type = TypeUtils.typeUsage(Type.getType(descriptor)); field.defaultValue = value; field.modifiers = TypeUtils.access(access); if ((access & ACC_ENUM) != 0) { @@ -116,9 +121,9 @@ public MethodVisitor visitMethod( } else { paramNames.put(paramName, 1); } - params.add(param(pt, paramName, null)); + params.add(param(pt, paramName)); } - method.returnType = TypeUtils.typeUsage(type.getReturnType(), signature); + method.returnType = TypeUtils.typeUsage(type.getReturnType()); method.modifiers = TypeUtils.access(access); method.params = params; if (signature != null) { @@ -134,22 +139,45 @@ public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { if (descriptor.equals("Lkotlin/Metadata;")) { return new KotlinMetadataAnnotationVisitor(peekVisiting()); } - return super.visitAnnotation(descriptor, visible); - } - - @Override - public void addAnnotation(JavaAnnotation annotation) { + var annotation = TypeUtils.annotationFromDescriptor(descriptor); peekVisiting().annotations.add(annotation); - } - - @Override - public AnnotationVisitor visitAnnotationDefault(String descriptor, boolean visible) { - return super.visitAnnotation(descriptor, visible); + return new AsmAnnotationVisitor(annotation); } @Override public AnnotationVisitor visitTypeAnnotation( int typeRef, TypePath typePath, String descriptor, boolean visible) { + var typeReference = new TypeReference(typeRef); + var annotation = TypeUtils.annotationFromDescriptor(descriptor); + TypeUsage.ReferredType startingType = null; + switch (typeReference.getSort()) { + case TypeReference.CLASS_TYPE_PARAMETER: + { + var index = typeReference.getTypeParameterIndex(); + peekVisiting().typeParams.get(index).annotations.add(annotation); + break; + } + case TypeReference.CLASS_TYPE_PARAMETER_BOUND: + { + var typeParamIndex = typeReference.getTypeParameterIndex(); + var index = typeReference.getTypeParameterBoundIndex(); + startingType = peekVisiting().typeParams.get(typeParamIndex).bounds.get(index).type; + break; + } + case TypeReference.CLASS_EXTENDS: + { + var index = typeReference.getSuperTypeIndex(); + if (index == -1) { + startingType = peekVisiting().superclass.type; + } else { + startingType = peekVisiting().interfaces.get(index).type; + } + break; + } + } + if (startingType != null) { + TypeUtils.moveToTypePath(startingType, typePath).annotations.add(annotation); + } return super.visitTypeAnnotation(typeRef, typePath, descriptor, visible); } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmFieldVisitor.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmFieldVisitor.java index eb72302ab..1535622fa 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmFieldVisitor.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmFieldVisitor.java @@ -5,11 +5,11 @@ package com.github.dart_lang.jnigen.apisummarizer.disasm; import com.github.dart_lang.jnigen.apisummarizer.elements.Field; -import com.github.dart_lang.jnigen.apisummarizer.elements.JavaAnnotation; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.TypePath; -public class AsmFieldVisitor extends FieldVisitor implements AsmAnnotatedElementVisitor { +public class AsmFieldVisitor extends FieldVisitor { Field field; public AsmFieldVisitor(Field field) { @@ -18,12 +18,17 @@ public AsmFieldVisitor(Field field) { } @Override - public void addAnnotation(JavaAnnotation annotation) { + public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { + var annotation = TypeUtils.annotationFromDescriptor(descriptor); field.annotations.add(annotation); + return new AsmAnnotationVisitor(annotation); } @Override - public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { - return AsmAnnotatedElementVisitor.super.visitAnnotationDefault(descriptor, visible); + public AnnotationVisitor visitTypeAnnotation( + int typeRef, TypePath typePath, String descriptor, boolean visible) { + var annotation = TypeUtils.annotationFromDescriptor(descriptor); + TypeUtils.moveToTypePath(field.type.type, typePath).annotations.add(annotation); + return super.visitTypeAnnotation(typeRef, typePath, descriptor, visible); } } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmMethodVisitor.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmMethodVisitor.java index 6d66fd6d6..9c2679460 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmMethodVisitor.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmMethodVisitor.java @@ -4,15 +4,16 @@ package com.github.dart_lang.jnigen.apisummarizer.disasm; -import com.github.dart_lang.jnigen.apisummarizer.elements.JavaAnnotation; import com.github.dart_lang.jnigen.apisummarizer.elements.Method; +import com.github.dart_lang.jnigen.apisummarizer.elements.TypeUsage; import java.util.ArrayList; import java.util.List; import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.TypePath; +import org.objectweb.asm.TypeReference; -public class AsmMethodVisitor extends MethodVisitor implements AsmAnnotatedElementVisitor { +public class AsmMethodVisitor extends MethodVisitor { Method method; List paramNames = new ArrayList<>(); @@ -27,27 +28,66 @@ public void visitParameter(String name, int access) { } @Override - public void addAnnotation(JavaAnnotation annotation) { + public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { + var annotation = TypeUtils.annotationFromDescriptor(descriptor); method.annotations.add(annotation); - } - - @Override - public AnnotationVisitor visitAnnotationDefault(String descriptor, boolean visible) { - return AsmAnnotatedElementVisitor.super.visitAnnotationDefault(descriptor, visible); + return new AsmAnnotationVisitor(annotation); } @Override public AnnotationVisitor visitTypeAnnotation( int typeRef, TypePath typePath, String descriptor, boolean visible) { - // TODO(#23): Collect annotation on type parameter + var typeReference = new TypeReference(typeRef); + var annotation = TypeUtils.annotationFromDescriptor(descriptor); + TypeUsage.ReferredType startingType = null; + switch (typeReference.getSort()) { + case TypeReference.METHOD_TYPE_PARAMETER: + { + var index = typeReference.getTypeParameterIndex(); + method.typeParams.get(index).annotations.add(annotation); + break; + } + case TypeReference.METHOD_TYPE_PARAMETER_BOUND: + { + var typeParamIndex = typeReference.getTypeParameterIndex(); + var index = typeReference.getTypeParameterBoundIndex(); + startingType = method.typeParams.get(typeParamIndex).bounds.get(index).type; + break; + } + case TypeReference.METHOD_RETURN: + { + startingType = method.returnType.type; + break; + } + case TypeReference.METHOD_RECEIVER: + { + // Not sure what this is. + break; + } + case TypeReference.METHOD_FORMAL_PARAMETER: + { + var index = typeReference.getFormalParameterIndex(); + startingType = method.params.get(index).type.type; + break; + } + case TypeReference.THROWS: + { + // Ignore this as Dart does not have an equivalent to `throws`. + break; + } + } + if (startingType != null) { + TypeUtils.moveToTypePath(startingType, typePath).annotations.add(annotation); + } return super.visitTypeAnnotation(typeRef, typePath, descriptor, visible); } @Override public AnnotationVisitor visitParameterAnnotation( int parameter, String descriptor, boolean visible) { - // TODO(#23): collect and attach it to parameters - return super.visitParameterAnnotation(parameter, descriptor, visible); + var annotation = TypeUtils.annotationFromDescriptor(descriptor); + method.params.get(parameter).annotations.add(annotation); + return new AsmAnnotationVisitor(annotation); } @Override diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmTypeUsageSignatureVisitor.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmTypeUsageSignatureVisitor.java index 6ddda4546..46ccd10ae 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmTypeUsageSignatureVisitor.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/AsmTypeUsageSignatureVisitor.java @@ -81,20 +81,49 @@ public void visitClassType(String name) { typeUsage.type = new TypeUsage.DeclaredType(typeUsage.shorthand, simpleName, new ArrayList<>()); } + @Override + public void visitTypeArgument() { + assert (typeUsage.type instanceof TypeUsage.DeclaredType); + var typeArg = new TypeUsage("?", TypeUsage.Kind.WILDCARD, new TypeUsage.Wildcard(null, null)); + ((TypeUsage.DeclaredType) typeUsage.type).params.add(typeArg); + } + @Override public SignatureVisitor visitTypeArgument(char wildcard) { - // TODO(#141) support wildcards - // TODO(#144) support extend/super clauses assert (typeUsage.type instanceof TypeUsage.DeclaredType); var typeArg = new TypeUsage(); + typeArg.kind = TypeUsage.Kind.DECLARED; ((TypeUsage.DeclaredType) typeUsage.type).params.add(typeArg); + if (wildcard != '=') { + typeArg.kind = TypeUsage.Kind.WILDCARD; + typeArg.type = new TypeUsage.Wildcard(null, null); + typeArg.shorthand = "?"; + switch (wildcard) { + case '+': + { + var extendsBound = new TypeUsage(); + ((TypeUsage.Wildcard) typeArg.type).extendsBound = extendsBound; + typeArg = extendsBound; + break; + } + case '-': + { + var superBound = new TypeUsage(); + ((TypeUsage.Wildcard) typeArg.type).superBound = superBound; + typeArg = superBound; + break; + } + } + } return new AsmTypeUsageSignatureVisitor(typeArg); } @Override public void visitInnerClassType(String name) { typeUsage.shorthand += "." + name; - ((TypeUsage.DeclaredType) typeUsage.type).binaryName += "$" + name; - ((TypeUsage.DeclaredType) typeUsage.type).simpleName = name; + var declaredType = ((TypeUsage.DeclaredType) typeUsage.type); + declaredType.binaryName += "$" + name; + declaredType.simpleName = name; + declaredType.typeParamIndices.add(declaredType.params.size()); } } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/TypeUtils.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/TypeUtils.java index 66c723aa5..09ace8570 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/TypeUtils.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/disasm/TypeUtils.java @@ -9,6 +9,7 @@ import static org.objectweb.asm.Type.OBJECT; import com.github.dart_lang.jnigen.apisummarizer.elements.DeclKind; +import com.github.dart_lang.jnigen.apisummarizer.elements.JavaAnnotation; import com.github.dart_lang.jnigen.apisummarizer.elements.TypeUsage; import com.github.dart_lang.jnigen.apisummarizer.util.SkipException; import java.util.HashMap; @@ -16,6 +17,7 @@ import java.util.Map; import java.util.Set; import org.objectweb.asm.Type; +import org.objectweb.asm.TypePath; class TypeUtils { @@ -31,7 +33,7 @@ public static String simpleName(Type type) { return components[components.length - 1]; } - public static TypeUsage typeUsage(Type type, @SuppressWarnings("unused") String signature) { + public static TypeUsage typeUsage(Type type) { var usage = new TypeUsage(); usage.shorthand = type.getClassName(); switch (type.getSort()) { @@ -43,7 +45,7 @@ public static TypeUsage typeUsage(Type type, @SuppressWarnings("unused") String break; case ARRAY: usage.kind = TypeUsage.Kind.ARRAY; - usage.type = new TypeUsage.Array(TypeUtils.typeUsage(type.getElementType(), null)); + usage.type = new TypeUsage.Array(TypeUtils.typeUsage(type.getElementType())); break; default: usage.kind = TypeUsage.Kind.PRIMITIVE; @@ -78,6 +80,13 @@ public static Set access(int access) { acc.put("synthetic", ACC_SYNTHETIC); } + static JavaAnnotation annotationFromDescriptor(String descriptor) { + var annotation = new JavaAnnotation(); + var aType = Type.getType(descriptor); + annotation.binaryName = aType.getClassName(); + return annotation; + } + static DeclKind declKind(int access) { if ((access & ACC_ENUM) != 0) return DeclKind.ENUM; if ((access & ACC_INTERFACE) != 0) return DeclKind.INTERFACE; @@ -99,6 +108,50 @@ static String defaultParamName(Type type) { } } + static TypeUsage.ReferredType moveToTypePath( + TypeUsage.ReferredType startingType, TypePath typePath) { + if (typePath == null) { + return startingType; + } + var currentType = startingType; + int nestingLevel = 0; + for (int i = 0; i < typePath.getLength(); ++i) { + var step = typePath.getStep(i); + switch (step) { + case TypePath.ARRAY_ELEMENT: + { + currentType = ((TypeUsage.Array) currentType).elementType.type; + nestingLevel = 0; + break; + } + case TypePath.INNER_TYPE: + { + ++nestingLevel; + break; + } + case TypePath.WILDCARD_BOUND: + { + var wildcard = ((TypeUsage.Wildcard) currentType); + var extendsBound = wildcard.extendsBound; + var superBound = wildcard.superBound; + currentType = (extendsBound == null ? superBound : extendsBound).type; + nestingLevel = 0; + break; + } + case TypePath.TYPE_ARGUMENT: + { + var declared = ((TypeUsage.DeclaredType) currentType); + var startingIndex = + nestingLevel == 0 ? 0 : declared.typeParamIndices.get(nestingLevel - 1); + currentType = declared.params.get(startingIndex + typePath.getStepArgument(i)).type; + nestingLevel = 0; + break; + } + } + } + return currentType; + } + private static String unCapitalize(String s) { var first = Character.toLowerCase(s.charAt(0)); if (s.length() == 1) { diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/ElementBuilders.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/ElementBuilders.java index 675da7b8a..4d8a84b52 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/ElementBuilders.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/doclet/ElementBuilders.java @@ -23,6 +23,10 @@ public ElementBuilders(AstEnv env) { private void fillInFromTypeElement(TypeElement e, ClassDecl c) { c.modifiers = e.getModifiers().stream().map(Modifier::toString).collect(Collectors.toSet()); c.binaryName = env.elements.getBinaryName(e).toString(); + if (e.getNestingKind().isNested()) { + c.outerClassBinaryName = + env.elements.getBinaryName((TypeElement) e.getEnclosingElement()).toString(); + } switch (e.getKind()) { case INTERFACE: c.declKind = DeclKind.INTERFACE; @@ -111,6 +115,7 @@ public TypeParam typeParam(TypeParameterElement tpe) { var tp = new TypeParam(); tp.name = tpe.getSimpleName().toString(); tp.bounds = tpe.getBounds().stream().map(this::typeUsage).collect(Collectors.toList()); + tp.annotations = annotations(tpe.getAnnotationMirrors()); return tp; } @@ -129,65 +134,78 @@ public TypeUsage typeUsage(TypeMirror type) { var element = env.types.asElement(type); switch (type.getKind()) { case DECLARED: - // Unique name that's binary name not qualified name - // (It's somewhat confusing but qualified name does not need to be unique, - // because of nesting) - u.kind = TypeUsage.Kind.DECLARED; - var name = - element instanceof TypeElement - ? env.elements.getBinaryName((TypeElement) element).toString() - : element.getSimpleName().toString(); - List params = null; - if (type instanceof DeclaredType) { // it will be - params = + { + // Unique name that's binary name not qualified name + // (It's somewhat confusing but qualified name does not need to be unique, + // because of nesting) + u.kind = TypeUsage.Kind.DECLARED; + var name = + element instanceof TypeElement + ? env.elements.getBinaryName((TypeElement) element).toString() + : element.getSimpleName().toString(); + assert (type instanceof DeclaredType); + List params = ((DeclaredType) type) .getTypeArguments().stream().map(this::typeUsage).collect(Collectors.toList()); + u.type = new TypeUsage.DeclaredType(name, element.getSimpleName().toString(), params); + break; } - u.type = new TypeUsage.DeclaredType(name, element.getSimpleName().toString(), params); - break; case TYPEVAR: - u.kind = TypeUsage.Kind.TYPE_VARIABLE; - // TODO(#23): Encode bounds of type variable. - // A straightforward approach will cause infinite recursion very - // easily. Another approach I can think of is only encoding the - // erasure of the type variable per JLS. - u.type = new TypeUsage.TypeVar(element.getSimpleName().toString()); - break; + { + u.kind = TypeUsage.Kind.TYPE_VARIABLE; + // TODO(#23): Encode bounds of type variable. + // A straightforward approach will cause infinite recursion very + // easily. Another approach I can think of is only encoding the + // erasure of the type variable per JLS. + u.type = new TypeUsage.TypeVar(element.getSimpleName().toString()); + break; + } case ARRAY: - u.kind = TypeUsage.Kind.ARRAY; - var arr = ((ArrayType) type); - u.type = new TypeUsage.Array(typeUsage(arr.getComponentType())); - break; + { + u.kind = TypeUsage.Kind.ARRAY; + var arr = ((ArrayType) type); + u.type = new TypeUsage.Array(typeUsage(arr.getComponentType())); + break; + } case VOID: - u.type = new TypeUsage.PrimitiveType("void"); - u.kind = TypeUsage.Kind.PRIMITIVE; - break; + { + u.type = new TypeUsage.PrimitiveType("void"); + u.kind = TypeUsage.Kind.PRIMITIVE; + break; + } case WILDCARD: - u.kind = TypeUsage.Kind.WILDCARD; - var wildcard = ((WildcardType) type); - var extendsBound = wildcard.getExtendsBound(); - var superBound = wildcard.getSuperBound(); - u.type = - new TypeUsage.Wildcard( - extendsBound != null ? typeUsage(extendsBound) : null, - superBound != null ? typeUsage(superBound) : null); - break; + { + u.kind = TypeUsage.Kind.WILDCARD; + var wildcard = ((WildcardType) type); + var extendsBound = wildcard.getExtendsBound(); + var superBound = wildcard.getSuperBound(); + u.type = + new TypeUsage.Wildcard( + extendsBound != null ? typeUsage(extendsBound) : null, + superBound != null ? typeUsage(superBound) : null); + break; + } case INTERSECTION: - u.kind = TypeUsage.Kind.INTERSECTION; - u.type = - new TypeUsage.Intersection( - ((IntersectionType) type) - .getBounds().stream().map(this::typeUsage).collect(Collectors.toList())); - break; + { + u.kind = TypeUsage.Kind.INTERSECTION; + u.type = + new TypeUsage.Intersection( + ((IntersectionType) type) + .getBounds().stream().map(this::typeUsage).collect(Collectors.toList())); + break; + } default: - u.kind = TypeUsage.Kind.PRIMITIVE; - if (type instanceof PrimitiveType) { - u.type = new TypeUsage.PrimitiveType(type.toString()); - } else { - System.out.println("Unsupported type: " + type); - // throw exception. + { + u.kind = TypeUsage.Kind.PRIMITIVE; + if (type instanceof PrimitiveType) { + u.type = new TypeUsage.PrimitiveType(type.toString()); + } else { + System.err.println("Unsupported type: " + type); + // throw exception. + } } } + u.type.annotations = annotations(type.getAnnotationMirrors()); return u; } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/ClassDecl.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/ClassDecl.java index f50bc7d6d..fd069ad6c 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/ClassDecl.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/ClassDecl.java @@ -31,11 +31,12 @@ public class ClassDecl { public List methods = new ArrayList<>(); public List fields = new ArrayList<>(); public TypeUsage superclass; + public String outerClassBinaryName; public List interfaces = new ArrayList<>(); public boolean hasStaticInit; public boolean hasInstanceInit; public JavaDocComment javadoc; - public List annotations; + public List annotations = new ArrayList<>(); public KotlinClass kotlinClass; public KotlinPackage kotlinPackage; diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeParam.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeParam.java index 8172ee6d8..44856ab42 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeParam.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeParam.java @@ -10,4 +10,5 @@ public class TypeParam { public String name; public List bounds = new ArrayList<>(); + public List annotations = new ArrayList<>(); } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeUsage.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeUsage.java index a60407caf..5b1b0745e 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeUsage.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/TypeUsage.java @@ -4,6 +4,7 @@ package com.github.dart_lang.jnigen.apisummarizer.elements; +import java.util.ArrayList; import java.util.List; public class TypeUsage { @@ -30,7 +31,9 @@ public enum Kind { public Kind kind; public ReferredType type; - public abstract static class ReferredType {} + public abstract static class ReferredType { + public List annotations = new ArrayList<>(); + } public static class PrimitiveType extends ReferredType { public String name; @@ -44,6 +47,7 @@ public static class DeclaredType extends ReferredType { public String binaryName; public String simpleName; public List params; + public List typeParamIndices = new ArrayList<>(); public DeclaredType(String binaryName, String simpleName, List params) { this.binaryName = binaryName; @@ -78,10 +82,10 @@ public Intersection(List types) { } public static class Array extends ReferredType { - public TypeUsage type; + public TypeUsage elementType; public Array(TypeUsage type) { - this.type = type; + this.elementType = type; } } } diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index a2d758966..97f73a861 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart @@ -37,9 +37,6 @@ const _internal = '@$_jni.internal'; // Prefixes and suffixes. const _typeParamPrefix = '\$'; -/// Used for C bindings. -const _selfPointer = 'reference.pointer'; - /// Used for Dart-only bindings. const _self = 'this'; @@ -154,6 +151,7 @@ import 'package:jni/jni.dart' as $_jni; // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -314,7 +312,8 @@ ${modifier}final $classRef = $_jni.JClass.forName(r'$internalName'); // Class definition. final name = node.finalName; - final superName = node.superclass!.accept(_TypeGenerator(resolver)); + final superName = node.superclass! + .accept(_TypeGenerator(resolver, includeNullability: false)); final implClassName = '\$$name'; final typeParamsDef = node.allTypeParams .accept(const _TypeParamDef()) @@ -354,7 +353,7 @@ class $name$typeParamsDef extends $superName { $ctorTypeClassesDef $_jReference reference, ) : - $instanceTypeGetter = $staticTypeGetter$staticTypeGetterCallArgs, + $instanceTypeGetter = $staticTypeGetter$typeParamsCall$staticTypeGetterCallArgs, super.fromReference( $superTypeClassesCall reference @@ -367,28 +366,38 @@ class $name$typeParamsDef extends $superName { // Static TypeClass getter. s.writeln( ' /// The type which includes information such as the signature of this class.'); - final typeClassName = node.typeClassName; - if (typeParams.isEmpty) { - s.writeln('static const $staticTypeGetter = $typeClassName();'); - } else { - final staticTypeGetterTypeClassesDef = typeParams - .map( - (typeParam) => '$_jType<$_typeParamPrefix$typeParam> $typeParam,') - .join(_newLine(depth: 2)); - final typeClassesCall = - typeParams.map((typeParam) => '$typeParam,').join(_newLine(depth: 3)); - s.write(''' - static $typeClassName$typeParamsCall $staticTypeGetter$typeParamsDef( + void generateTypeClassGetter({required bool isNullable}) { + final typeClassName = + isNullable ? node.nullableTypeClassName : node.typeClassName; + final typeClassGetterName = + isNullable ? 'nullableType' : staticTypeGetter; + if (typeParams.isEmpty) { + s.writeln('static const $typeClassGetterName = ' + '$typeClassName$typeParamsCall();'); + } else { + final staticTypeGetterTypeClassesDef = typeParams + .map((typeParam) => + '$_jType<$_typeParamPrefix$typeParam> $typeParam,') + .join(_newLine(depth: 2)); + final typeClassesCall = typeParams + .map((typeParam) => '$typeParam,') + .join(_newLine(depth: 3)); + s.write(''' + static $typeClassName$typeParamsCall $typeClassGetterName$typeParamsDef( $staticTypeGetterTypeClassesDef ) { - return $typeClassName( + return $typeClassName$typeParamsCall( $typeClassesCall ); } '''); + } } + generateTypeClassGetter(isNullable: true); + generateTypeClassGetter(isNullable: false); + // Fields and Methods generateFieldsAndMethods(node, classRef); @@ -484,7 +493,7 @@ class $name$typeParamsDef extends $superName { s.write(''' final \$i = $_jni.JImplementer(); implementIn(\$i, \$impl); - return $name.fromReference( + return $name$typeParamsCall.fromReference( $typeClassesCall \$i.implementReference(), ); @@ -517,7 +526,7 @@ class $name$typeParamsDef extends $superName { abstract base mixin class $implClassName$typeParamsDef { factory $implClassName( $abstractFactoryArgs - ) = _$implClassName; + ) = _$implClassName$typeParamsCall; $typeClassGetters @@ -564,19 +573,41 @@ final class _$implClassName$typeParamsDef with $implClassName$typeParamsCall { s.writeln('}'); } // TypeClass definition. - final typeClassesCall = - typeParams.map((typeParam) => '$typeParam,').join(_newLine(depth: 2)); - final signature = node.signature; - final superTypeClass = superClass.accept(_TypeClassGenerator(resolver)); - final hashCodeTypeClasses = typeParams.join(', '); - final equalityTypeClasses = typeParams - .map((typeParam) => ' &&\n $typeParam == other.$typeParam') - .join(); - final hashCode = typeParams.isEmpty - ? '($typeClassName).hashCode' - : 'Object.hash($typeClassName, $hashCodeTypeClasses)'; - s.write(''' -final class $typeClassName$typeParamsDef extends $_jType<$name$typeParamsCall> { + void generateTypeClass({required bool isNullable}) { + final typeClassName = + isNullable ? node.nullableTypeClassName : node.typeClassName; + final typeClassesCall = + typeParams.map((typeParam) => '$typeParam,').join(_newLine(depth: 2)); + final signature = node.signature; + final superType = superClass.accept(_TypeClassGenerator(resolver)).name; + final hashCodeTypeClasses = typeParams.join(', '); + final equalityTypeClasses = typeParams + .map((typeParam) => ' &&\n $typeParam == other.$typeParam') + .join(); + final hashCode = typeParams.isEmpty + ? '($typeClassName).hashCode' + : 'Object.hash($typeClassName, $hashCodeTypeClasses)'; + final nullableType = isNullable + ? 'this' + : (DeclaredType( + binaryName: node.binaryName, + annotations: [Annotation.nullable], + params: node.allTypeParams + .map((typeParam) => TypeUsage( + shorthand: '', kind: Kind.typeVariable, typeJson: {}) + ..type = (TypeVar(name: typeParam.name) + ..origin = TypeParam( + name: typeParam.name, + annotations: [Annotation.nonNull], + bounds: typeParam.bounds, + ))) + .toList()) + ..classDecl = node) + .accept(_TypeClassGenerator(resolver)) + .name; + final nullable = isNullable ? '?' : ''; + s.write(''' +final class $typeClassName$typeParamsDef extends $_jType<$name$typeParamsCall$nullable> { $typeClassesDef $_internal @@ -590,14 +621,31 @@ final class $typeClassName$typeParamsDef extends $_jType<$name$typeParamsCall> { $_internal $_override - $name$typeParamsCall fromReference($_jReference reference) => $name.fromReference( - $typeClassesCall - reference - ); + $name$typeParamsCall$nullable fromReference($_jReference reference) => + '''); + if (isNullable) { + s.write(''' + reference.isNull ? null : $name$typeParamsCall.fromReference( + $typeClassesCall + reference, + ); +'''); + } else { + s.write(''' + $name$typeParamsCall.fromReference( + $typeClassesCall + reference, + ); +'''); + } + s.write(''' + $_internal + $_override + $_jType get superType => $superType; $_internal $_override - $_jType get superType => ${superTypeClass.name}; + $_jType<$name$typeParamsCall?> get nullableType => $nullableType; $_internal $_override @@ -614,6 +662,11 @@ final class $typeClassName$typeParamsDef extends $_jType<$name$typeParamsCall> { } '''); + } + + generateTypeClass(isNullable: true); + generateTypeClass(isNullable: false); + log.finest('Generated bindings for class ${node.binaryName}'); } } @@ -656,31 +709,39 @@ class _TypeGenerator extends TypeVisitor { /// Whether the generic types should be erased. final bool typeErasure; + final bool includeNullability; + + /// Whether the type is used inside `JArray`. + final bool arrayType; + const _TypeGenerator( this.resolver, { this.forInterfaceImplementation = false, this.typeErasure = false, + this.includeNullability = true, + this.arrayType = false, }); @override String visitArrayType(ArrayType node) { - final innerType = node.type; - if (innerType.kind == Kind.primitive) { - return '$_jArray<$_jni.j${(innerType.type as PrimitiveType).name}>'; - } + final innerType = node.elementType; + final nullable = includeNullability && node.isNullable ? '?' : ''; final typeGenerator = _TypeGenerator( resolver, forInterfaceImplementation: forInterfaceImplementation, typeErasure: forInterfaceImplementation, + includeNullability: true, + arrayType: true, ); - return '$_jArray<${innerType.accept(typeGenerator)}>'; + return '$_jArray<${innerType.accept(typeGenerator)}>$nullable'; } @override String visitDeclaredType(DeclaredType node) { + final nullable = includeNullability && node.isNullable ? '?' : ''; if (node.classDecl.binaryName == 'java.lang.Object' || node.classDecl.binaryName == 'java.lang.String') { - return '$_jni.${node.classDecl.finalName}'; + return '$_jni.${node.classDecl.finalName}$nullable'; } // All type parameters of this type @@ -692,18 +753,21 @@ class _TypeGenerator extends TypeVisitor { resolver, forInterfaceImplementation: forInterfaceImplementation, typeErasure: forInterfaceImplementation, + includeNullability: true, + arrayType: false, ); final definedTypeParams = node.params.accept(typeGenerator).toList(); // Replacing the declared ones. They come at the end. // The rest will be JObject. if (allTypeParams.length >= node.params.length) { + final nullable = includeNullability ? '?' : ''; allTypeParams.replaceRange( 0, allTypeParams.length - node.params.length, List.filled( allTypeParams.length - node.params.length, - _jObject, + '$_jObject$nullable', ), ); allTypeParams.replaceRange( @@ -715,11 +779,14 @@ class _TypeGenerator extends TypeVisitor { final typeParams = allTypeParams.join(', ').encloseIfNotEmpty('<', '>'); final prefix = resolver?.resolvePrefix(node.classDecl) ?? ''; - return '$prefix${node.classDecl.finalName}$typeParams'; + return '$prefix${node.classDecl.finalName}$typeParams$nullable'; } @override String visitPrimitiveType(PrimitiveType node) { + if (arrayType) { + return '$_jni.j${node.name}'; + } return node.dartType; } @@ -727,24 +794,40 @@ class _TypeGenerator extends TypeVisitor { String visitTypeVar(TypeVar node) { // TODO(https://github.com/dart-lang/native/issues/704): Tighten to // typevar bounds instead. - if (typeErasure) { - return _jObject; - } - if (forInterfaceImplementation && node.origin.parent is Method) { - return _jObject; + { + final nullable = includeNullability && node.isNullable ? '?' : ''; + if (typeErasure) { + return '$_jObject$nullable'; + } + if (forInterfaceImplementation && node.origin.parent is Method) { + return '$_jObject$nullable'; + } } - return '$_typeParamPrefix${node.name}'; + final nullable = includeNullability && node.hasQuestionMark ? '?' : ''; + return '$_typeParamPrefix${node.name}$nullable'; } @override String visitWildcard(Wildcard node) { // TODO(https://github.com/dart-lang/native/issues/701): Support wildcards. - return super.visitWildcard(node); + if (node.superBound != null || node.extendsBound == null) { + // Dart does not support `* super T` wildcards. Fall back to Object?. + return super.visitWildcard(node); + } + final typeGenerator = _TypeGenerator( + resolver, + arrayType: arrayType, + forInterfaceImplementation: forInterfaceImplementation, + includeNullability: includeNullability && node.isNullable, + typeErasure: typeErasure, + ); + return node.extendsBound!.accept(typeGenerator); } @override String visitNonPrimitiveType(ReferredType node) { - return _jObject; + final nullable = includeNullability ? '?' : ''; + return '$_jObject$nullable'; } } @@ -770,6 +853,8 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { /// Whether the generic types should be erased. final bool typeErasure; + final bool includeNullability; + final Resolver resolver; _TypeClassGenerator( @@ -777,12 +862,13 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { this.isConst = true, this.boxPrimitives = false, this.forInterfaceImplementation = false, + this.includeNullability = true, this.typeErasure = false, }); @override _TypeClass visitArrayType(ArrayType node) { - final innerTypeClass = node.type.accept(_TypeClassGenerator( + final innerTypeClass = node.elementType.accept(_TypeClassGenerator( resolver, isConst: false, boxPrimitives: false, @@ -790,9 +876,18 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { // Do type erasure for interface implementation. typeErasure: forInterfaceImplementation, )); + final innerType = node.elementType.accept(_TypeGenerator( + resolver, + forInterfaceImplementation: forInterfaceImplementation, + // Do type erasure for interface implementation. + typeErasure: forInterfaceImplementation, + arrayType: true, + )); final ifConst = innerTypeClass.canBeConst && isConst ? 'const ' : ''; + final type = + includeNullability && node.isNullable ? 'NullableType' : 'Type'; return _TypeClass( - '$ifConst${_jArray}Type(${innerTypeClass.name})', + '$ifConst$_jArray$type<$innerType>(${innerTypeClass.name})', innerTypeClass.canBeConst, ); } @@ -818,7 +913,7 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { allTypeParams.isEmpty || definedTypeClasses.every((e) => e.canBeConst); // Replacing the declared ones. They come at the end. - // The rest will be `JObjectType`. + // The rest will be `JObjectNullableType`. if (allTypeParams.length >= node.params.length) { allTypeParams.replaceRange( 0, @@ -827,7 +922,7 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { allTypeParams.length - node.params.length, // Adding const to subexpressions if the entire expression is not // const. - '${canBeConst ? '' : 'const '}${_jObject}Type()', + '${canBeConst ? '' : 'const '}${_jObject}NullableType()', ), ); allTypeParams.replaceRange( @@ -841,9 +936,23 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { final args = allTypeParams.join(', '); final ifConst = isConst && canBeConst ? 'const ' : ''; + final type = includeNullability && node.isNullable + ? node.classDecl.nullableTypeClassName + : node.classDecl.typeClassName; + final typeArgs = node.classDecl.isObject + ? '' + : node.params + .accept(_TypeGenerator( + resolver, + forInterfaceImplementation: forInterfaceImplementation, + // Do type erasure for interface implementation. + typeErasure: forInterfaceImplementation, + )) + .join(', ') + .encloseIfNotEmpty('<', '>'); final prefix = resolver.resolvePrefix(node.classDecl); return _TypeClass( - '$ifConst$prefix${node.classDecl.typeClassName}($args)', + '$ifConst$prefix$type$typeArgs($args)', canBeConst, ); } @@ -859,30 +968,49 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { _TypeClass visitTypeVar(TypeVar node) { // TODO(https://github.com/dart-lang/native/issues/704): Tighten to typevar // bounds instead. + final type = + includeNullability && node.hasQuestionMark ? 'NullableType' : 'Type'; + final convertToNullable = + includeNullability && node.hasQuestionMark ? '.nullableType' : ''; if (typeErasure) { final ifConst = isConst ? 'const ' : ''; - return _TypeClass('$ifConst${_jObject}Type()', true); + return _TypeClass('$ifConst$_jObject$type()', true); } if (forInterfaceImplementation) { if (node.origin.parent is ClassDecl) { - return _TypeClass('_\$impls[\$p]!.${node.name}', false); + return _TypeClass( + '_\$impls[\$p]!.${node.name}$convertToNullable', false); } final ifConst = isConst ? 'const ' : ''; - return _TypeClass('$ifConst${_jObject}Type()', true); + return _TypeClass('$ifConst$_jObject$type()', true); } - return _TypeClass(node.name, false); + return _TypeClass('${node.name}$convertToNullable', false); } @override _TypeClass visitWildcard(Wildcard node) { // TODO(https://github.com/dart-lang/native/issues/701): Support wildcards. - return super.visitWildcard(node); + if (node.superBound != null || node.extendsBound == null) { + // Dart does not support `* super T` wildcards. Fall back to Object?. + return super.visitWildcard(node); + } + final typeClassGenerator = _TypeClassGenerator( + resolver, + boxPrimitives: boxPrimitives, + forInterfaceImplementation: forInterfaceImplementation, + includeNullability: includeNullability && node.isNullable, + isConst: isConst, + typeErasure: typeErasure, + ); + return node.extendsBound!.accept(typeClassGenerator); } @override _TypeClass visitNonPrimitiveType(ReferredType node) { final ifConst = isConst ? 'const ' : ''; - return _TypeClass('$ifConst${_jObject}Type()', true); + final type = + includeNullability && node.isNullable ? 'NullableType' : 'Type'; + return _TypeClass('$ifConst$_jObject$type()', true); } } @@ -893,7 +1021,8 @@ class _TypeParamDef extends Visitor { String visit(TypeParam node) { // TODO(https://github.com/dart-lang/native/issues/704): resolve the actual // type being extended, if any. - return '$_typeParamPrefix${node.name} extends $_jObject'; + final nullable = node.isNullable ? '?' : ''; + return '$_typeParamPrefix${node.name} extends $_jObject$nullable'; } } @@ -912,8 +1041,9 @@ class _JniResultGetter extends TypeVisitor { @override String visitNonPrimitiveType(ReferredType node) { - final type = node.accept(_TypeClassGenerator(resolver)).name; - return 'object($type)'; + final typeClass = node.accept(_TypeClassGenerator(resolver)).name; + final type = node.accept(_TypeGenerator(resolver)); + return 'object<$type>($typeClass)'; } } @@ -953,7 +1083,7 @@ class _ToNativeSuffix extends TypeVisitor { @override String visitNonPrimitiveType(ReferredType node) { - return '.$_selfPointer'; + return '.pointer'; } } @@ -1120,13 +1250,7 @@ ${modifier}final _$name = $_protectedExtension return node.asyncReturnType != null; } - String cCtor(Method node) { - final name = node.finalName; - final params = node.params.accept(const _ParamCall()).join(', '); - return '_$name($params).reference'; - } - - String dartOnlyCtor(Method node) { + String constructor(Method node) { final name = node.finalName; final params = [ '$classRef.reference.pointer', @@ -1136,20 +1260,10 @@ ${modifier}final _$name = $_protectedExtension return '_$name($params).reference'; } - String cMethodCall(Method node) { + String methodCall(Method node) { final name = node.finalName; final params = [ - if (!node.isStatic) _selfPointer, - ...node.params.accept(const _ParamCall()), - ].join(', '); - final resultGetter = node.returnType.accept(_JniResultGetter(resolver)); - return '_$name($params).$resultGetter'; - } - - String dartOnlyMethodCall(Method node) { - final name = node.finalName; - final params = [ - node.isStatic ? '$classRef.reference.pointer' : _selfPointer, + node.isStatic ? '$classRef.reference.pointer' : 'reference.pointer', '_id_$name as $_jni.JMethodIDPtr', ...node.params.accept(const _ParamCall()), ].join(', '); @@ -1192,12 +1306,21 @@ ${modifier}final _$name = $_protectedExtension .map((tp) => '$tp ??= $_jni.lowestCommonSuperType' '(${typeLocators[tp]}) as $_jType<$_typeParamPrefix$tp>;') .join(_newLine(depth: 2)); - + // This is needed to keep the references alive in the scope while waiting + // for the FFI call. + final localReferences = node.params + .accept(const _ParamReference()) + .where((ref) => ref.isNotEmpty) + .toList(); if (node.isConstructor) { final className = node.classDecl.finalName; final name = node.finalName; final ctorName = name == 'new\$' ? className : '$className.$name'; final paramsDef = node.params.accept(_ParamDef(resolver)).delimited(', '); + final typeParamsCall = node.classDecl.allTypeParams + .map((typeParam) => '$_typeParamPrefix${typeParam.name}') + .join(', ') + .encloseIfNotEmpty('<', '>'); final typeClassDef = node.classDecl.allTypeParams .map((typeParam) => typeParam .accept(_CtorTypeClassDef(isRequired: isRequired(typeParam)))) @@ -1207,11 +1330,12 @@ ${modifier}final _$name = $_protectedExtension .map((typeParam) => typeParam.name) .delimited(', '); - final ctorExpr = dartOnlyCtor(node); + final ctorExpr = constructor(node); s.write(''' factory $ctorName($paramsDef$typeClassDef) { $typeInference - return ${node.classDecl.finalName}.fromReference( + ${localReferences.join(_newLine(depth: 2))} + return ${node.classDecl.finalName}$typeParamsCall.fromReference( $typeClassCall $ctorExpr ); @@ -1243,23 +1367,29 @@ ${modifier}final _$name = $_protectedExtension .encloseIfNotEmpty('<', '>'); if (isSuspendFun(node)) { defArgs.removeLast(); + localReferences.removeLast(); } final params = defArgs.delimited(', '); s.write(' $ifStatic$returnType $name$typeParamsDef($params$typeClassDef)'); - final callExpr = dartOnlyMethodCall(node); + final callExpr = methodCall(node); if (isSuspendFun(node)) { final returningType = node.asyncReturnType!.accept(_TypeClassGenerator(resolver)).name; + final continuation = node.params.last.finalName; s.write('''async { $typeInference final \$p = $_jni.ReceivePort(); - final \$c = $_jObject.fromReference($_protectedExtension.newPortContinuation(\$p)); + final _\$$continuation = $_protectedExtension.newPortContinuation(\$p); + ${localReferences.join(_newLine(depth: 2))} $callExpr; + _\$$continuation.release(); final \$o = $_jGlobalReference($_jPointer.fromAddress(await \$p.first)); - final \$k = $returnTypeClass.jClass.reference.pointer; - if (!$_jni.Jni.env.IsInstanceOf(\$o.pointer, \$k)) { + final \$k = $returnTypeClass.jClass.reference; + if (!$_jni.Jni.env.IsInstanceOf(\$o.pointer, \$k.pointer)) { + \$k.release(); throw 'Failed'; } + \$k.release(); return $returningType.fromReference(\$o); } @@ -1268,6 +1398,7 @@ ${modifier}final _$name = $_protectedExtension final returning = returnType == 'void' ? callExpr : 'return $callExpr'; s.writeln('''{ $typeInference + ${localReferences.join(_newLine(depth: 2))} $returning; } '''); @@ -1334,6 +1465,30 @@ class _ParamDef extends Visitor { } } +/// Method parameter reference as a local variable. +/// +/// `JReference`s are finalizable, in order to make sure they will be kept alive +/// in the method's scope they have to be assigned to a local variable. +/// +/// For example: +/// ```dart +/// final _foo = foo.reference; +/// ``` +class _ParamReference extends Visitor { + const _ParamReference(); + + @override + String visit(Param node) { + if (node.type.kind == Kind.primitive) { + return ''; + } + final nullable = node.isNullable ? '?' : ''; + final orDefault = node.isNullable ? ' ?? $_jni.jNullReference' : ''; + return 'final _\$${node.finalName} = ' + '${node.finalName}$nullable.reference$orDefault;'; + } +} + /// Method parameter used in calling the native method. /// /// For example `foo.reference.pointer` in: @@ -1346,7 +1501,8 @@ class _ParamCall extends Visitor { @override String visit(Param node) { final nativeSuffix = node.type.accept(const _ToNativeSuffix()); - final paramCall = '${node.finalName}$nativeSuffix'; + final nonPrimitive = node.type.kind == Kind.primitive ? '' : r'_$'; + final paramCall = '$nonPrimitive${node.finalName}$nativeSuffix'; return paramCall; } } @@ -1408,6 +1564,9 @@ class _ParamTypeLocator extends Visitor>> { @override Map> visit(Param node) { + if (node.isNullable) { + return {}; + } return node.type.accept(_TypeVarLocator(resolver: resolver)).map( (key, value) => MapEntry( key, @@ -1433,7 +1592,11 @@ class _TypeVarLocator extends TypeVisitor>> { @override Map> visitWildcard(Wildcard node) { // TODO(https://github.com/dart-lang/native/issues/701): Support wildcards. - return super.visitWildcard(node); + if (node.superBound != null || node.extendsBound == null) { + // Dart does not support `* super T` wildcards. Fall back to Object?. + return super.visitWildcard(node); + } + return node.extendsBound!.accept(this); } @override @@ -1474,7 +1637,7 @@ class _TypeVarLocator extends TypeVisitor>> { @override Map> visitArrayType(ArrayType node) { - final exprs = node.type.accept(this); + final exprs = node.elementType.accept(this); for (final e in exprs.values.expand((i) => i)) { e.appendLeft('(('); e.prependRight(' as ${_jArray}Type).elementType as $_jType)'); @@ -1671,9 +1834,12 @@ class _InterfaceParamCast extends Visitor { resolver, boxPrimitives: true, forInterfaceImplementation: true, + includeNullability: false, )) .name; - s.write('\$a[$paramIndex].as($typeClass, releaseOriginal: true)'); + final nullable = + node.isNullable && node.type.kind != Kind.primitive ? '?' : '!'; + s.write('\$a![$paramIndex]$nullable.as($typeClass, releaseOriginal: true)'); if (node.type.kind == Kind.primitive) { // Convert to Dart type. final name = (node.type.type as PrimitiveType).name; @@ -1704,8 +1870,8 @@ class _InterfaceReturnBox extends TypeVisitor { // Casting is done to create a new global reference. The user might // use the original reference elsewhere and so the original object // should not be `setAsReleased`. - return '(\$r as $_jObject).as(const ${_jObject}Type())' - '.reference.toPointer()'; + return '(\$r as $_jObject?)?.as(const ${_jObject}Type())' + '.reference.toPointer() ?? $_jni.nullptr'; } @override diff --git a/pkgs/jnigen/lib/src/bindings/descriptor.dart b/pkgs/jnigen/lib/src/bindings/descriptor.dart index e5b0ab3bc..b309a38da 100644 --- a/pkgs/jnigen/lib/src/bindings/descriptor.dart +++ b/pkgs/jnigen/lib/src/bindings/descriptor.dart @@ -74,7 +74,7 @@ class TypeDescriptor extends TypeVisitor { @override String visitArrayType(ArrayType node) { - final inner = node.type.accept(this); + final inner = node.elementType.accept(this); return '[$inner'; } diff --git a/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart b/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart index 4980debf9..53de1ed2d 100644 --- a/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart +++ b/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart @@ -53,10 +53,16 @@ class _KotlinMethodProcessor extends Visitor { assert(node.params.isNotEmpty && node.params.last.type.kind == Kind.declared && node.params.last.type.name == kotlinContinutationType); - final continuationType = node.params.last.type.type as DeclaredType; - node.asyncReturnType = continuationType.params.isEmpty + var continuationType = + (node.params.last.type.type as DeclaredType).params.firstOrNull; + if (continuationType != null && + continuationType.kind == Kind.wildcard && + (continuationType.type as Wildcard).superBound != null) { + continuationType = (continuationType.type as Wildcard).superBound!; + } + node.asyncReturnType = continuationType == null ? TypeUsage.object - : continuationType.params.first.clone(); + : continuationType.clone(); } } } diff --git a/pkgs/jnigen/lib/src/bindings/linker.dart b/pkgs/jnigen/lib/src/bindings/linker.dart index c6b8c097b..5749a28a9 100644 --- a/pkgs/jnigen/lib/src/bindings/linker.dart +++ b/pkgs/jnigen/lib/src/bindings/linker.dart @@ -94,21 +94,23 @@ class _ClassLinker extends Visitor { if (linked.contains(node)) return; log.finest('Linking ${node.binaryName}.'); linked.add(node); - final typeLinker = _TypeLinker(resolve, typeVarOrigin); - node.parent = node.parentName == null ? null : resolve(node.parentName); - node.parent?.accept(this); + node.outerClass = node.outerClassBinaryName == null + ? null + : resolve(node.outerClassBinaryName); + node.outerClass?.accept(this); // Add type params of outer classes to the nested classes. final allTypeParams = []; if (!node.isStatic) { - allTypeParams.addAll(node.parent?.allTypeParams ?? []); + allTypeParams.addAll(node.outerClass?.allTypeParams ?? []); } allTypeParams.addAll(node.typeParams); node.allTypeParams = allTypeParams; for (final typeParam in node.allTypeParams) { typeVarOrigin[typeParam.name] = typeParam; } + final typeLinker = _TypeLinker(resolve, typeVarOrigin); node.superclass ??= TypeUsage.object; node.superclass!.type.accept(typeLinker); @@ -148,39 +150,48 @@ class _MethodLinker extends Visitor { @override void visit(Method node) { - final usedDocklet = node.descriptor == null; - if (usedDocklet && - !node.classDecl.isStatic && + final hasOuterClassArg = !node.classDecl.isStatic && node.classDecl.isNested && - (node.isConstructor || node.isStatic)) { - // For now the nullity of [node.descriptor] identifies if the doclet - // backend was used and the method would potentially need "unnesting". - // Static methods and constructors of non-static nested classes take an - // instance of their outer class as the first parameter. - // - // This is not accounted for by the **doclet** summarizer, so we - // manually add it as the first parameter. - final parentTypeParamCount = node.classDecl.allTypeParams.length - + (node.isConstructor || node.isStatic); + if (hasOuterClassArg) { + final outerClassTypeParamCount = node.classDecl.allTypeParams.length - node.classDecl.typeParams.length; - final parentTypeParams = [ + final outerClassTypeParams = [ for (final typeParam - in node.classDecl.allTypeParams.take(parentTypeParamCount)) ...[ + in node.classDecl.allTypeParams.take(outerClassTypeParamCount)) ...[ TypeUsage( shorthand: typeParam.name, kind: Kind.typeVariable, typeJson: {}) - ..type = TypeVar(name: typeParam.name), + ..type = (TypeVar(name: typeParam.name) + ..annotations = [if (typeParam.hasNonNull) Annotation.nonNull]), ] ]; - final parentType = DeclaredType( - binaryName: node.classDecl.parent!.binaryName, - params: parentTypeParams, + final outerClassType = DeclaredType( + binaryName: node.classDecl.outerClass!.binaryName, + params: outerClassTypeParams, + // `$outerClass` parameter must not be null. + annotations: [Annotation.nonNull], ); - final parentTypeUsage = TypeUsage( - shorthand: parentType.binaryName, kind: Kind.declared, typeJson: {}) - ..type = parentType; - final param = Param(name: '\$parent', type: parentTypeUsage); - // Make the list modifiable. - if (node.params.isEmpty) node.params = []; - node.params.insert(0, param); + final outerClassTypeUsage = TypeUsage( + shorthand: outerClassType.binaryName, + kind: Kind.declared, + typeJson: {}, + )..type = outerClassType; + final param = Param(name: '\$outerClass', type: outerClassTypeUsage); + final usedDoclet = node.descriptor == null; + // For now the nullity of [node.descriptor] identifies if the doclet + // backend was used and the method would potentially need "unnesting". + // Static methods and constructors of non-static nested classes take an + // instance of their outer class as the first parameter. + // + // This is not accounted for by the **doclet** summarizer, so we + // manually add it as the first parameter. + if (usedDoclet) { + // Make the list modifiable. + if (node.params.isEmpty) node.params = []; + node.params.insert(0, param); + } else { + node.params.first = param; + } } for (final typeParam in node.typeParams) { typeVarOrigin[typeParam.name] = typeParam; @@ -222,7 +233,7 @@ class _TypeLinker extends TypeVisitor { @override void visitArrayType(ArrayType node) { - node.type.accept(this); + node.elementType.accept(this); } @override @@ -232,12 +243,12 @@ class _TypeLinker extends TypeVisitor { @override void visitPrimitiveType(PrimitiveType node) { - // Do nothing + // Do nothing. } @override void visitNonPrimitiveType(ReferredType node) { - // Do nothing + // Do nothing. } } diff --git a/pkgs/jnigen/lib/src/bindings/printer.dart b/pkgs/jnigen/lib/src/bindings/printer.dart new file mode 100644 index 000000000..121d3d0f7 --- /dev/null +++ b/pkgs/jnigen/lib/src/bindings/printer.dart @@ -0,0 +1,149 @@ +import '../elements/elements.dart'; +import 'visitor.dart'; + +class Printer extends Visitor { + const Printer(); + @override + void visit(Classes node) { + for (final MapEntry(:key, :value) in node.decls.entries) { + print('<$key>'); + const _ClassPrinter().visit(value); + print(''); + } + } +} + +class _ClassPrinter extends Visitor { + const _ClassPrinter(); + @override + void visit(ClassDecl node) { + print(' '); + for (final method in node.methods) { + method.accept(const _MethodPrinter()); + } + print(' '); + + print(' '); + for (final field in node.fields) { + field.accept(const _FieldPrinter()); + } + print(' '); + } +} + +class _MethodPrinter extends Visitor { + const _MethodPrinter(); + @override + void visit(Method node) { + print(' <${node.finalName}>'); + print(' '); + node.returnType.accept(_TypePrinter(8)); + print(' '); + print(' '); + for (final param in node.params) { + param.accept(const _ParamPrinter()); + } + print(' '); + print(' '); + } +} + +class _FieldPrinter extends Visitor { + const _FieldPrinter(); + @override + void visit(Field node) { + print(' <${node.finalName}>'); + node.type.accept(_TypePrinter(6)); + print(' '); + } +} + +class _ParamPrinter extends Visitor { + const _ParamPrinter(); + + @override + void visit(Param node) { + print(' <${node.finalName}>'); + node.type.type.accept(_TypePrinter(10)); + print(' '); + } +} + +class _TypePrinter extends TypeVisitor { + int depth; + _TypePrinter(this.depth); + + void printAnnotation(ReferredType node) { + if (node.annotations != null) { + print('${' ' * depth}'); + depth += 2; + for (final annotation in node.annotations!) { + annotation.accept(_AnnotationPrinter(depth)); + } + depth -= 2; + print('${' ' * depth}'); + } + } + + @override + void visitArrayType(ArrayType node) { + print('${' ' * depth}'); + depth += 2; + node.elementType.accept(this); + + printAnnotation(node); + + depth -= 2; + print('${' ' * depth}'); + } + + @override + void visitDeclaredType(DeclaredType node) { + print('${' ' * depth}<${node.classDecl.binaryName}>'); + depth += 2; + printAnnotation(node); + for (final param in node.params) { + param.accept(this); + } + depth -= 2; + print('${' ' * depth}'); + } + + @override + void visitTypeVar(TypeVar node) { + print('${' ' * depth}<${node.name}>'); + print('${' ' * (depth + 1)}'); + print('${' ' * (depth + 1)}${node.origin.name}'); + print('${' ' * (depth + 1)}'); + printAnnotation(node); + print('${' ' * depth}'); + } + + @override + void visitPrimitiveType(PrimitiveType node) { + print('${' ' * depth}<${node.name}>'); + printAnnotation(node); + print('${' ' * depth}'); + } + + @override + void visitWildcard(Wildcard node) { + print('${' ' * depth}<*>'); + printAnnotation(node); + print('${' ' * depth}'); + } + + @override + void visitNonPrimitiveType(ReferredType node) {} +} + +class _AnnotationPrinter extends Visitor { + int depth; + + _AnnotationPrinter(this.depth); + + @override + void visit(Annotation node) { + print('${' ' * depth}'); + } +} diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index b5a0b34c2..11fbfec83 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart @@ -189,6 +189,7 @@ class _ClassRenamer implements Visitor { ? _renameConflict(classNameCounts, className, _ElementKind.klass) : className; node.typeClassName = '\$${node.finalName}\$Type'; + node.nullableTypeClassName = '\$${node.finalName}\$NullableType'; log.fine('Class ${node.binaryName} is named ${node.finalName}'); final superClass = (node.superclass!.type as DeclaredType).classDecl; @@ -246,13 +247,6 @@ class _MethodRenamer implements Visitor { for (final param in node.params) { param.accept(paramRenamer); } - - // Kotlin specific - if (node.asyncReturnType != null) { - // It's a suspend fun so the continuation parameter - // should be named $c instead - node.params.last.finalName = '\$c'; - } } } diff --git a/pkgs/jnigen/lib/src/config/config_types.dart b/pkgs/jnigen/lib/src/config/config_types.dart index 1d856e47a..f5bd848fd 100644 --- a/pkgs/jnigen/lib/src/config/config_types.dart +++ b/pkgs/jnigen/lib/src/config/config_types.dart @@ -277,6 +277,8 @@ class Config { this.androidSdkConfig, this.mavenDownloads, this.summarizerOptions, + this.nonNullAnnotations, + this.nullableAnnotations, this.logLevel = Level.INFO, this.dumpJsonTo, this.imports, @@ -335,6 +337,12 @@ class Config { /// Call [importClasses] before using this. late final Map importedClasses; + /// Annotations specifying that this type is nullable. + final List? nullableAnnotations; + + /// Annotations specifying that this type is non-nullable. + final List? nonNullAnnotations; + /// Custom code that is added to the end of the class body with the specified /// binary name. /// @@ -401,9 +409,12 @@ class Config { ..path = '$importPath/$filePath' ..finalName = decl['name'] as String ..typeClassName = decl['type_class'] as String + ..nullableTypeClassName = decl['nullable_type_class'] as String ..superCount = decl['super_count'] as int ..allTypeParams = [] - ..parent = null; + // TODO(https://github.com/dart-lang/native/issues/746): include + // outerClass in the interop information. + ..outerClass = null; for (final typeParamEntry in (decl['type_params'] as YamlMap?)?.entries ?? >[]) { @@ -547,6 +558,12 @@ class Config { ) .toSet(), imports: prov.getPathList(_Props.import), + nonNullAnnotations: prov.hasValue(_Props.nonNullAnnotations) + ? prov.getStringList(_Props.nonNullAnnotations) + : null, + nullableAnnotations: prov.hasValue(_Props.nullableAnnotations) + ? prov.getStringList(_Props.nullableAnnotations) + : null, mavenDownloads: prov.hasValue(_Props.mavenDownloads) ? MavenDownloads( sourceDeps: prov.getStringList(_Props.sourceDeps) ?? const [], @@ -620,6 +637,9 @@ class _Props { static const preamble = 'preamble'; static const logLevel = 'log_level'; + static const nonNullAnnotations = 'non_null_annotations'; + static const nullableAnnotations = 'nullable_annotations'; + static const mavenDownloads = 'maven_downloads'; static const sourceDeps = '$mavenDownloads.source_deps'; static const mavenSourceDir = '$mavenDownloads.source_dir'; diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart index b286576f5..9ab4aa720 100644 --- a/pkgs/jnigen/lib/src/elements/elements.dart +++ b/pkgs/jnigen/lib/src/elements/elements.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'package:json_annotation/json_annotation.dart'; +import 'package:meta/meta.dart'; // Types to describe java API elements @@ -57,9 +58,9 @@ class Classes implements Element { // option in java. @JsonSerializable(createToJson: false) -class ClassDecl extends ClassMember implements Element { +class ClassDecl with ClassMember, Annotated implements Element { ClassDecl({ - this.annotations = const [], + this.annotations, this.javadoc, required this.declKind, this.modifiers = const {}, @@ -68,6 +69,7 @@ class ClassDecl extends ClassMember implements Element { this.methods = const [], this.fields = const [], this.superclass, + this.outerClassBinaryName, this.interfaces = const [], this.hasStaticInit = false, this.hasInstanceInit = false, @@ -79,7 +81,8 @@ class ClassDecl extends ClassMember implements Element { @override final Set modifiers; - final List annotations; + @override + List? annotations; final KotlinClass? kotlinClass; final KotlinPackage? kotlinPackage; final JavaDocComment? javadoc; @@ -95,6 +98,14 @@ class ClassDecl extends ClassMember implements Element { /// Will default to java.lang.Object if null by [Linker]. TypeUsage? superclass; + final String? outerClassBinaryName; + + /// Outer class's [ClassDecl] obtained from [outerClassBinaryName]. + /// + /// Populated by [Linker]. + @JsonKey(includeFromJson: false) + late final ClassDecl? outerClass; + /// Contains enum constant names if class is an enum, /// as obtained by `.values()` method in Java. final List? values; @@ -109,12 +120,6 @@ class ClassDecl extends ClassMember implements Element { @JsonKey(includeFromJson: false) late final int superCount; - /// Parent's [ClassDecl] obtained from [parentName]. - /// - /// Populated by [Linker]. - @JsonKey(includeFromJson: false) - late final ClassDecl? parent; - /// Final name of this class. /// /// Populated by [Renamer]. @@ -128,11 +133,19 @@ class ClassDecl extends ClassMember implements Element { @JsonKey(includeFromJson: false) late final String typeClassName; - /// Type parameters including the ones from its ancestors + /// Name of the nullable type class. + /// + /// Populated by [Renamer]. + @JsonKey(includeFromJson: false) + late final String nullableTypeClassName; + + /// Type parameters including the ones from its outer classes. + /// + /// For `Foo.Bar.Baz` it is [T, U, V, W]. /// /// Populated by [Linker]. @JsonKey(includeFromJson: false) - List allTypeParams = const []; + late final List allTypeParams; /// The path which this class is generated in. /// @@ -169,15 +182,8 @@ class ClassDecl extends ClassMember implements Element { bool get isObject => superCount == 0; - // TODO(https://github.com/dart-lang/native/issues/1544): Use a better - // heuristic. Class names can have dollar signs without being nested. - @JsonKey(includeFromJson: false) - late final String? parentName = binaryName.contains(r'$') - ? binaryName.splitMapJoin(RegExp(r'\$[^$]+$'), onMatch: (_) => '') - : null; - @JsonKey(includeFromJson: false) - late final isNested = parentName != null; + bool get isNested => outerClassBinaryName != null; /// Whether the class is actually only a number of top-level Kotlin Functions. bool get isTopLevel => kotlinPackage != null; @@ -274,20 +280,21 @@ class TypeUsage { clonedType = ArrayType.fromJson(clonedTypeJson); break; } + clonedType.annotations = type.annotations; return TypeUsage(shorthand: shorthand, kind: kind, typeJson: clonedTypeJson) ..type = clonedType; } } -abstract class ReferredType { - const ReferredType(); +abstract class ReferredType with Annotated { + ReferredType(); String get name; R accept(TypeVisitor v); } class PrimitiveType extends ReferredType { - static const _primitives = { + static final _primitives = { 'byte': PrimitiveType._( name: 'byte', signature: 'B', @@ -362,17 +369,19 @@ class PrimitiveType extends ReferredType { ), }; - const PrimitiveType._({ + PrimitiveType._({ required this.name, required this.signature, required this.dartType, required this.boxedName, required this.cType, required this.ffiVarArgType, - }); + }) : annotations = null; @override final String name; + @override + List? annotations; final String signature; final String dartType; @@ -394,11 +403,14 @@ class PrimitiveType extends ReferredType { class DeclaredType extends ReferredType { DeclaredType({ required this.binaryName, + this.annotations, this.params = const [], }); final String binaryName; final List params; + @override + List? annotations; @JsonKey(includeFromJson: false) late ClassDecl classDecl; @@ -421,10 +433,46 @@ class TypeVar extends ReferredType { @JsonKey(includeFromJson: false) late final TypeParam origin; - TypeVar({required this.name}); + TypeVar({ + required this.name, + this.annotations, + }); @override String name; + @override + List? annotations; + + @override + bool get isNullable { + // A type-var is nullable if its origin is nullable. + if (origin.isNullable) { + return true; + } + // If origin is non-null, it has to be explicitly set as nullable. + if (!origin.isNullable && !hasNullable) { + return false; + } + return super.isNullable; + } + + /// Whether this type-variable has a question mark. + /// + /// This is different from [isNullable], a type-variable that extends + /// `JObject?` is nullable, so to get the reference from an object with this + /// type, a null check is needed. However type-variables can have an extra + /// question mark, meaning that even if the original type extends `JObject`, + /// this is nullable. + bool get hasQuestionMark { + // If the origin has any nullability set, this will only be nullable if it + // is explicitly set to be. + if (origin.hasNonNull || origin.hasNullable) { + return hasNullable; + } + // Otherwise it is always nullable unless explicitly set to be + // non-nullable. + return !hasNonNull; + } factory TypeVar.fromJson(Map json) => _$TypeVarFromJson(json); @@ -437,11 +485,23 @@ class TypeVar extends ReferredType { @JsonSerializable(createToJson: false) class Wildcard extends ReferredType { - Wildcard({this.extendsBound, this.superBound}); + Wildcard({ + this.extendsBound, + this.superBound, + this.annotations, + }); TypeUsage? extendsBound, superBound; + @override + bool get isNullable => + super.isNullable && + // If the extends bound is non-null, this is non-null. + !(extendsBound?.type.hasNonNull ?? false); + @override String get name => '?'; + @override + List? annotations; factory Wildcard.fromJson(Map json) => _$WildcardFromJson(json); @@ -454,11 +514,16 @@ class Wildcard extends ReferredType { @JsonSerializable(createToJson: false) class ArrayType extends ReferredType { - ArrayType({required this.type}); - TypeUsage type; + ArrayType({ + required this.elementType, + this.annotations, + }); + TypeUsage elementType; @override - String get name => '[${type.name}'; + String get name => '[${elementType.name}'; + @override + List? annotations; factory ArrayType.fromJson(Map json) => _$ArrayTypeFromJson(json); @@ -469,7 +534,58 @@ class ArrayType extends ReferredType { } } -abstract class ClassMember { +mixin Annotated { + abstract List? annotations; + + static final nullableAnnotations = [ + // Taken from https://kotlinlang.org/docs/java-interop.html#nullability-annotations + 'org.jetbrains.annotations.Nullable', + 'org.jspecify.nullness.Nullable', + 'com.android.annotations.Nullable', + 'androidx.annotation.Nullable', + 'android.support.annotations.Nullable', + 'edu.umd.cs.findbugs.annotations.Nullable', + 'org.eclipse.jdt.annotation.Nullable', + 'lombok.Nullable', + 'io.reactivex.rxjava3.annotations.Nullable', + ]; + late final bool hasNullable = () { + return annotations?.any((annotation) => + nullableAnnotations.contains(annotation.binaryName) || + annotation.binaryName == 'javax.annotation.Nonnull' && + annotation.properties['when'] == 'ALWAYS') ?? + false; + }(); + + static final nonNullAnnotations = [ + // Taken from https://kotlinlang.org/docs/java-interop.html#nullability-annotations + 'org.jetbrains.annotations.NotNull', + 'org.jspecify.nullness.NonNull', + 'com.android.annotations.NonNull', + 'androidx.annotation.NonNull', + 'android.support.annotations.NonNull', + 'edu.umd.cs.findbugs.annotations.NonNull', + 'org.eclipse.jdt.annotation.NonNull', + 'lombok.NonNull', + 'io.reactivex.rxjava3.annotations.NonNull', + ]; + late final hasNonNull = () { + return annotations?.any((annotation) => + nonNullAnnotations.contains(annotation.binaryName) || + annotation.binaryName == 'javax.annotation.Nonnull' && + annotation.properties['when'] == 'ALWAYS') ?? + false; //FIXME + }(); + + late final bool isNullable = () { + if (hasNullable) { + return true; + } + return !hasNonNull; + }(); +} + +mixin ClassMember { String get name; ClassDecl get classDecl; Set get modifiers; @@ -485,9 +601,9 @@ abstract class ClassMember { } @JsonSerializable(createToJson: false) -class Method extends ClassMember implements Element { +class Method with ClassMember, Annotated implements Element { Method({ - this.annotations = const [], + this.annotations, this.javadoc, this.modifiers = const {}, required this.name, @@ -501,8 +617,8 @@ class Method extends ClassMember implements Element { final String name; @override final Set modifiers; - - final List annotations; + @override + List? annotations; final JavaDocComment? javadoc; final List typeParams; List params; @@ -549,17 +665,21 @@ class Method extends ClassMember implements Element { } @JsonSerializable(createToJson: false) -class Param implements Element { +class Param with Annotated implements Element { Param({ - this.annotations = const [], + this.annotations, this.javadoc, required this.name, required this.type, }); - final List annotations; + @override + List? annotations; final JavaDocComment? javadoc; + @override + bool get isNullable => type.type.isNullable || super.hasNullable; + // Synthetic methods might not have parameter names. @JsonKey(defaultValue: 'synthetic') final String name; @@ -583,9 +703,9 @@ class Param implements Element { } @JsonSerializable(createToJson: false) -class Field extends ClassMember implements Element { +class Field with ClassMember, Annotated implements Element { Field({ - this.annotations = const [], + this.annotations, this.javadoc, this.modifiers = const {}, required this.name, @@ -598,7 +718,8 @@ class Field extends ClassMember implements Element { @override final Set modifiers; - final List annotations; + @override + List? annotations; final JavaDocComment? javadoc; final TypeUsage type; final Object? defaultValue; @@ -624,12 +745,24 @@ class Field extends ClassMember implements Element { } @JsonSerializable(createToJson: false) -class TypeParam implements Element { - TypeParam({required this.name, this.bounds = const []}); +class TypeParam with Annotated implements Element { + TypeParam({ + required this.name, + this.bounds = const [], + this.annotations, + }); final String name; final List bounds; + @override + List? annotations; + + @override + bool get hasNonNull => + // A type param with any non-null bound is non-null. + super.hasNonNull || bounds.any((bound) => !bound.type.isNullable); + /// Can either be a [ClassDecl] or a [Method]. /// /// Populated by [Linker]. @@ -663,16 +796,112 @@ class JavaDocComment implements Element { } } +@visibleForTesting +List typePathFromString(String? string) { + if (string == null) return const []; + const innerClass = 46; + assert(innerClass == '.'.codeUnitAt(0)); + const array = 91; + assert(array == '['.codeUnitAt(0)); + const wildcard = 42; + assert(wildcard == '*'.codeUnitAt(0)); + const digit0 = 48; + assert(digit0 == '0'.codeUnitAt(0)); + const digit9 = 57; + assert(digit9 == '9'.codeUnitAt(0)); + const semicolon = 59; + assert(semicolon == ';'.codeUnitAt(0)); + final typePaths = []; + var number = 0; + for (final codeUnit in string.codeUnits) { + switch (codeUnit) { + case array: + typePaths.add(const ToArrayElement()); + case wildcard: + typePaths.add(const ToWildcardBound()); + case innerClass: + typePaths.add(const ToInnerClass()); + case >= digit0 && <= digit9: + number = number * 10 + codeUnit - digit0; + case semicolon: + typePaths.add(ToTypeParam(number)); + number = 0; + default: + throw const FormatException('Invalid type path'); + } + } + return typePaths; +} + +sealed class TypePathStep { + const TypePathStep(); +} + +final class ToArrayElement extends TypePathStep { + const ToArrayElement(); + @override + String toString() { + return '['; + } +} + +final class ToInnerClass extends TypePathStep { + const ToInnerClass(); + @override + String toString() { + return '.'; + } +} + +final class ToWildcardBound extends TypePathStep { + const ToWildcardBound(); + @override + String toString() { + return '*'; + } +} + +final class ToTypeParam extends TypePathStep { + final int index; + const ToTypeParam(this.index); + @override + String toString() { + return '$index;'; + } + + @override + bool operator ==(Object other) { + return other is ToTypeParam && index == other.index; + } + + @override + int get hashCode => (ToTypeParam).hashCode ^ index.hashCode; +} + @JsonSerializable(createToJson: false) class Annotation implements Element { - Annotation({ + /// Specifies that this type can be null. + static const Annotation nullable = + // Any other valid `Nullable` annotation would work. + Annotation(binaryName: 'androidx.annotation.Nullable'); + + /// Specifies that this type cannot be null. + static const Annotation nonNull = + // Any other valid `NonNull` annotation would work. + Annotation(binaryName: 'androidx.annotation.NonNull'); + + const Annotation({ required this.binaryName, this.properties = const {}, + this.typePath = const [], }); final String binaryName; final Map properties; + @JsonKey(fromJson: typePathFromString) + final List typePath; + factory Annotation.fromJson(Map json) => _$AnnotationFromJson(json); diff --git a/pkgs/jnigen/lib/src/elements/elements.g.dart b/pkgs/jnigen/lib/src/elements/elements.g.dart index cb400e729..e981d2054 100644 --- a/pkgs/jnigen/lib/src/elements/elements.g.dart +++ b/pkgs/jnigen/lib/src/elements/elements.g.dart @@ -35,6 +35,7 @@ ClassDecl _$ClassDeclFromJson(Map json) => ClassDecl( superclass: json['superclass'] == null ? null : TypeUsage.fromJson(json['superclass'] as Map), + outerClassBinaryName: json['outerClassBinaryName'] as String?, interfaces: (json['interfaces'] as List?) ?.map((e) => TypeUsage.fromJson(e as Map)) .toList() ?? @@ -74,6 +75,10 @@ const _$KindEnumMap = { DeclaredType _$DeclaredTypeFromJson(Map json) => DeclaredType( binaryName: json['binaryName'] as String, + annotations: (json['annotations'] as List?) + ?.map((e) => Annotation.fromJson(e as Map)) + .toList() ?? + const [], params: (json['params'] as List?) ?.map((e) => TypeUsage.fromJson(e as Map)) .toList() ?? @@ -82,6 +87,10 @@ DeclaredType _$DeclaredTypeFromJson(Map json) => DeclaredType( TypeVar _$TypeVarFromJson(Map json) => TypeVar( name: json['name'] as String, + annotations: (json['annotations'] as List?) + ?.map((e) => Annotation.fromJson(e as Map)) + .toList() ?? + const [], ); Wildcard _$WildcardFromJson(Map json) => Wildcard( @@ -91,10 +100,19 @@ Wildcard _$WildcardFromJson(Map json) => Wildcard( superBound: json['superBound'] == null ? null : TypeUsage.fromJson(json['superBound'] as Map), + annotations: (json['annotations'] as List?) + ?.map((e) => Annotation.fromJson(e as Map)) + .toList() ?? + const [], ); ArrayType _$ArrayTypeFromJson(Map json) => ArrayType( - type: TypeUsage.fromJson(json['type'] as Map), + elementType: + TypeUsage.fromJson(json['elementType'] as Map), + annotations: (json['annotations'] as List?) + ?.map((e) => Annotation.fromJson(e as Map)) + .toList() ?? + const [], ); Method _$MethodFromJson(Map json) => Method( @@ -158,6 +176,10 @@ TypeParam _$TypeParamFromJson(Map json) => TypeParam( ?.map((e) => TypeUsage.fromJson(e as Map)) .toList() ?? const [], + annotations: (json['annotations'] as List?) + ?.map((e) => Annotation.fromJson(e as Map)) + .toList() ?? + const [], ); JavaDocComment _$JavaDocCommentFromJson(Map json) => @@ -171,6 +193,9 @@ Annotation _$AnnotationFromJson(Map json) => Annotation( (k, e) => MapEntry(k, e as Object), ) ?? const {}, + typePath: json['typePath'] == null + ? const [] + : typePathFromString(json['typePath'] as String?), ); KotlinClass _$KotlinClassFromJson(Map json) => KotlinClass( diff --git a/pkgs/jnigen/lib/src/generate_bindings.dart b/pkgs/jnigen/lib/src/generate_bindings.dart index 89231ebab..2e237f211 100644 --- a/pkgs/jnigen/lib/src/generate_bindings.dart +++ b/pkgs/jnigen/lib/src/generate_bindings.dart @@ -20,6 +20,9 @@ import 'tools/tools.dart'; void collectOutputStream(Stream> stream, StringBuffer buffer) => stream.transform(const Utf8Decoder()).forEach(buffer.write); Future generateJniBindings(Config config) async { + Annotated.nonNullAnnotations.addAll(config.nonNullAnnotations ?? []); + Annotated.nullableAnnotations.addAll(config.nullableAnnotations ?? []); + setLoggingLevel(config.logLevel); await buildSummarizerIfNotExists(); @@ -40,6 +43,7 @@ Future generateJniBindings(Config config) async { await classes.accept(Linker(config)); classes.accept(const Descriptor()); classes.accept(Renamer(config)); + // classes.accept(const Printer()); try { await classes.accept(DartGenerator(config)); diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index 8104afd73..4585b5feb 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml @@ -4,7 +4,7 @@ name: jnigen description: A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. -version: 0.12.2 +version: 0.13.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/jnigen issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajnigen diff --git a/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart b/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart index 3920a2da5..df2aad4f5 100644 --- a/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart @@ -17,11 +17,11 @@ void registerTests(String groupName, TestRunnerCallback test) { final json = JString.fromString('[1, true, false, 2, 4]'); JsonFactory factory; factory = JsonFactory(); - final parser = factory.createParser$6(json); + final parser = factory.createParser$6(json)!; final values = []; while (!parser.isClosed()) { final next = parser.nextToken(); - if (next.isNull) continue; + if (next == null) continue; values.add(next.isNumeric()); next.release(); } @@ -34,7 +34,7 @@ void registerTests(String groupName, TestRunnerCallback test) { using((arena) { final factory = JsonFactory()..releasedBy(arena); final erroneous = factory - .createParser$6(''.toJString()..releasedBy(arena)) + .createParser$6(''.toJString()..releasedBy(arena))! ..releasedBy(arena); expect(erroneous.nextToken, throwsA(isA())); }); diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart index 560a32074..dbcb9aeb3 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -37,6 +37,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -72,6 +73,7 @@ class JsonFactory_Feature extends _$jni.JObject { _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory$Feature'); /// The type which includes information such as the signature of this class. + static const nullableType = $JsonFactory_Feature$NullableType(); static const type = $JsonFactory_Feature$Type(); static final _id_values = _class.staticMethodId( r'values', @@ -92,9 +94,11 @@ class JsonFactory_Feature extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { + static _$jni.JArray? values() { return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($JsonFactory_Feature$Type())); + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType( + $JsonFactory_Feature$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -115,12 +119,14 @@ class JsonFactory_Feature extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonFactory_Feature valueOf( - _$jni.JString name, + static JsonFactory_Feature? valueOf( + _$jni.JString? name, ) { + final _$name = name?.reference ?? _$jni.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - name.reference.pointer) - .object(const $JsonFactory_Feature$Type()); + _$name.pointer) + .object( + const $JsonFactory_Feature$NullableType()); } static final _id_collectDefaults = _class.staticMethodId( @@ -224,6 +230,45 @@ class JsonFactory_Feature extends _$jni.JObject { } } +final class $JsonFactory_Feature$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $JsonFactory_Feature$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;'; + + @_$jni.internal + @_$core.override + JsonFactory_Feature? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : JsonFactory_Feature.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonFactory_Feature$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonFactory_Feature$NullableType) && + other is $JsonFactory_Feature$NullableType; + } +} + final class $JsonFactory_Feature$Type extends _$jni.JObjType { @_$jni.internal @@ -236,11 +281,17 @@ final class $JsonFactory_Feature$Type @_$jni.internal @_$core.override JsonFactory_Feature fromReference(_$jni.JReference reference) => - JsonFactory_Feature.fromReference(reference); + JsonFactory_Feature.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $JsonFactory_Feature$NullableType(); @_$jni.internal @_$core.override @@ -290,6 +341,7 @@ class JsonFactory extends _$jni.JObject { _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory'); /// The type which includes information such as the signature of this class. + static const nullableType = $JsonFactory$NullableType(); static const type = $JsonFactory$Type(); static final _id_FORMAT_NAME_JSON = _class.staticFieldId( r'FORMAT_NAME_JSON', @@ -301,8 +353,8 @@ class JsonFactory extends _$jni.JObject { /// /// Name used to identify JSON format /// (and returned by \#getFormatName() - static _$jni.JString get FORMAT_NAME_JSON => - _id_FORMAT_NAME_JSON.get(_class, const _$jni.JStringType()); + static _$jni.JString? get FORMAT_NAME_JSON => + _id_FORMAT_NAME_JSON.get(_class, const _$jni.JStringNullableType()); static final _id_DEFAULT_ROOT_VALUE_SEPARATOR = _class.staticFieldId( r'DEFAULT_ROOT_VALUE_SEPARATOR', @@ -311,8 +363,9 @@ class JsonFactory extends _$jni.JObject { /// from: `static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => - _id_DEFAULT_ROOT_VALUE_SEPARATOR.get(_class, const _$jni.JObjectType()); + static _$jni.JObject? get DEFAULT_ROOT_VALUE_SEPARATOR => + _id_DEFAULT_ROOT_VALUE_SEPARATOR.get( + _class, const _$jni.JObjectNullableType()); /// from: `static public final char DEFAULT_QUOTE_CHAR` /// @@ -369,10 +422,11 @@ class JsonFactory extends _$jni.JObject { /// from: `public void (com.fasterxml.jackson.core.ObjectCodec oc)` /// The returned object must be released after use, by calling the [release] method. factory JsonFactory.new$1( - _$jni.JObject oc, + _$jni.JObject? oc, ) { + final _$oc = oc?.reference ?? _$jni.jNullReference; return JsonFactory.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as _$jni.JMethodIDPtr, oc.reference.pointer) + _id_new$1 as _$jni.JMethodIDPtr, _$oc.pointer) .reference); } @@ -398,10 +452,11 @@ class JsonFactory extends _$jni.JObject { ///@param b Builder that contains settings to use ///@since 2.10 factory JsonFactory.new$2( - _$jni.JObject b, + _$jni.JObject? b, ) { + final _$b = b?.reference ?? _$jni.jNullReference; return JsonFactory.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, b.reference.pointer) + _id_new$2 as _$jni.JMethodIDPtr, _$b.pointer) .reference); } @@ -429,9 +484,9 @@ class JsonFactory extends _$jni.JObject { /// with settings of this factory. ///@return Builder instance to use ///@since 2.10 - _$jni.JObject rebuild() { + _$jni.JObject? rebuild() { return _rebuild(reference.pointer, _id_rebuild as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_builder = _class.staticMethodId( @@ -462,9 +517,9 @@ class JsonFactory extends _$jni.JObject { /// NOTE: signature unfortunately does not expose true implementation type; this /// will be fixed in 3.0. ///@return Builder instance to use - static _$jni.JObject builder() { + static _$jni.JObject? builder() { return _builder(_class.reference.pointer, _id_builder as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_copy = _class.instanceMethodId( @@ -499,9 +554,9 @@ class JsonFactory extends _$jni.JObject { /// set codec after making the copy. ///@return Copy of this factory instance ///@since 2.1 - JsonFactory copy() { + JsonFactory? copy() { return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr) - .object(const $JsonFactory$Type()); + .object(const $JsonFactory$NullableType()); } static final _id_requiresPropertyOrdering = _class.instanceMethodId( @@ -666,10 +721,10 @@ class JsonFactory extends _$jni.JObject { /// from: `public java.lang.Class getFormatReadFeatureType()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject getFormatReadFeatureType() { + _$jni.JObject? getFormatReadFeatureType() { return _getFormatReadFeatureType(reference.pointer, _id_getFormatReadFeatureType as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getFormatWriteFeatureType = _class.instanceMethodId( @@ -691,10 +746,10 @@ class JsonFactory extends _$jni.JObject { /// from: `public java.lang.Class getFormatWriteFeatureType()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject getFormatWriteFeatureType() { + _$jni.JObject? getFormatWriteFeatureType() { return _getFormatWriteFeatureType(reference.pointer, _id_getFormatWriteFeatureType as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_canUseSchema = _class.instanceMethodId( @@ -725,10 +780,11 @@ class JsonFactory extends _$jni.JObject { ///@return Whether parsers and generators constructed by this factory /// can use specified format schema instance bool canUseSchema( - _$jni.JObject schema, + _$jni.JObject? schema, ) { + final _$schema = schema?.reference ?? _$jni.jNullReference; return _canUseSchema(reference.pointer, - _id_canUseSchema as _$jni.JMethodIDPtr, schema.reference.pointer) + _id_canUseSchema as _$jni.JMethodIDPtr, _$schema.pointer) .boolean; } @@ -758,10 +814,10 @@ class JsonFactory extends _$jni.JObject { /// Note: sub-classes should override this method; default /// implementation will return null for all sub-classes ///@return Name of the format handled by parsers, generators this factory creates - _$jni.JString getFormatName() { + _$jni.JString? getFormatName() { return _getFormatName( reference.pointer, _id_getFormatName as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_hasFormat = _class.instanceMethodId( @@ -782,12 +838,13 @@ class JsonFactory extends _$jni.JObject { /// from: `public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject hasFormat( - _$jni.JObject acc, + _$jni.JObject? hasFormat( + _$jni.JObject? acc, ) { + final _$acc = acc?.reference ?? _$jni.jNullReference; return _hasFormat(reference.pointer, _id_hasFormat as _$jni.JMethodIDPtr, - acc.reference.pointer) - .object(const _$jni.JObjectType()); + _$acc.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_requiresCustomCodec = _class.instanceMethodId( @@ -843,9 +900,9 @@ class JsonFactory extends _$jni.JObject { /// from: `public com.fasterxml.jackson.core.Version version()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject version() { + _$jni.JObject? version() { return _version(reference.pointer, _id_version as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_configure = _class.instanceMethodId( @@ -874,13 +931,14 @@ class JsonFactory extends _$jni.JObject { ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead - JsonFactory configure( - JsonFactory_Feature f, + JsonFactory? configure( + JsonFactory_Feature? f, bool state, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _configure(reference.pointer, _id_configure as _$jni.JMethodIDPtr, - f.reference.pointer, state ? 1 : 0) - .object(const $JsonFactory$Type()); + _$f.pointer, state ? 1 : 0) + .object(const $JsonFactory$NullableType()); } static final _id_enable = _class.instanceMethodId( @@ -907,12 +965,13 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to enable ///@return This factory instance (to allow call chaining) ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead - JsonFactory enable( - JsonFactory_Feature f, + JsonFactory? enable( + JsonFactory_Feature? f, ) { - return _enable(reference.pointer, _id_enable as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _enable( + reference.pointer, _id_enable as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_disable = _class.instanceMethodId( @@ -939,12 +998,13 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to disable ///@return This factory instance (to allow call chaining) ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead - JsonFactory disable( - JsonFactory_Feature f, + JsonFactory? disable( + JsonFactory_Feature? f, ) { - return _disable(reference.pointer, _id_disable as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _disable( + reference.pointer, _id_disable as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_isEnabled = _class.instanceMethodId( @@ -969,10 +1029,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to check ///@return True if the specified feature is enabled bool isEnabled( - JsonFactory_Feature f, + JsonFactory_Feature? f, ) { - return _isEnabled(reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, - f.reference.pointer) + final _$f = f?.reference ?? _$jni.jNullReference; + return _isEnabled( + reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1098,16 +1159,14 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to enable/disable ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) - JsonFactory configure$1( - jsonparser_.JsonParser_Feature f, + JsonFactory? configure$1( + jsonparser_.JsonParser_Feature? f, bool state, ) { - return _configure$1( - reference.pointer, - _id_configure$1 as _$jni.JMethodIDPtr, - f.reference.pointer, - state ? 1 : 0) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _configure$1(reference.pointer, + _id_configure$1 as _$jni.JMethodIDPtr, _$f.pointer, state ? 1 : 0) + .object(const $JsonFactory$NullableType()); } static final _id_enable$1 = _class.instanceMethodId( @@ -1133,12 +1192,13 @@ class JsonFactory extends _$jni.JObject { /// (check JsonParser.Feature for list of features) ///@param f Feature to enable ///@return This factory instance (to allow call chaining) - JsonFactory enable$1( - jsonparser_.JsonParser_Feature f, + JsonFactory? enable$1( + jsonparser_.JsonParser_Feature? f, ) { - return _enable$1(reference.pointer, _id_enable$1 as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _enable$1( + reference.pointer, _id_enable$1 as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_disable$1 = _class.instanceMethodId( @@ -1164,12 +1224,13 @@ class JsonFactory extends _$jni.JObject { /// (check JsonParser.Feature for list of features) ///@param f Feature to disable ///@return This factory instance (to allow call chaining) - JsonFactory disable$1( - jsonparser_.JsonParser_Feature f, + JsonFactory? disable$1( + jsonparser_.JsonParser_Feature? f, ) { - return _disable$1(reference.pointer, _id_disable$1 as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _disable$1( + reference.pointer, _id_disable$1 as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_isEnabled$1 = _class.instanceMethodId( @@ -1194,10 +1255,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to check ///@return True if specified feature is enabled bool isEnabled$1( - jsonparser_.JsonParser_Feature f, + jsonparser_.JsonParser_Feature? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _isEnabled$1(reference.pointer, - _id_isEnabled$1 as _$jni.JMethodIDPtr, f.reference.pointer) + _id_isEnabled$1 as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1224,10 +1286,11 @@ class JsonFactory extends _$jni.JObject { ///@return True if specified feature is enabled ///@since 2.10 bool isEnabled$2( - _$jni.JObject f, + _$jni.JObject? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _isEnabled$2(reference.pointer, - _id_isEnabled$2 as _$jni.JMethodIDPtr, f.reference.pointer) + _id_isEnabled$2 as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1254,10 +1317,10 @@ class JsonFactory extends _$jni.JObject { /// Method for getting currently configured input decorator (if any; /// there is no default decorator). ///@return InputDecorator configured, if any - _$jni.JObject getInputDecorator() { + _$jni.JObject? getInputDecorator() { return _getInputDecorator( reference.pointer, _id_getInputDecorator as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setInputDecorator = _class.instanceMethodId( @@ -1283,12 +1346,13 @@ class JsonFactory extends _$jni.JObject { ///@param d Decorator to configure for this factory, if any ({@code null} if none) ///@return This factory instance (to allow call chaining) ///@deprecated Since 2.10 use JsonFactoryBuilder\#inputDecorator(InputDecorator) instead - JsonFactory setInputDecorator( - _$jni.JObject d, + JsonFactory? setInputDecorator( + _$jni.JObject? d, ) { + final _$d = d?.reference ?? _$jni.jNullReference; return _setInputDecorator(reference.pointer, - _id_setInputDecorator as _$jni.JMethodIDPtr, d.reference.pointer) - .object(const $JsonFactory$Type()); + _id_setInputDecorator as _$jni.JMethodIDPtr, _$d.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_configure$2 = _class.instanceMethodId( @@ -1316,16 +1380,14 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to enable/disable ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) - JsonFactory configure$2( - _$jni.JObject f, + JsonFactory? configure$2( + _$jni.JObject? f, bool state, ) { - return _configure$2( - reference.pointer, - _id_configure$2 as _$jni.JMethodIDPtr, - f.reference.pointer, - state ? 1 : 0) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _configure$2(reference.pointer, + _id_configure$2 as _$jni.JMethodIDPtr, _$f.pointer, state ? 1 : 0) + .object(const $JsonFactory$NullableType()); } static final _id_enable$2 = _class.instanceMethodId( @@ -1351,12 +1413,13 @@ class JsonFactory extends _$jni.JObject { /// (check JsonGenerator.Feature for list of features) ///@param f Feature to enable ///@return This factory instance (to allow call chaining) - JsonFactory enable$2( - _$jni.JObject f, + JsonFactory? enable$2( + _$jni.JObject? f, ) { - return _enable$2(reference.pointer, _id_enable$2 as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _enable$2( + reference.pointer, _id_enable$2 as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_disable$2 = _class.instanceMethodId( @@ -1382,12 +1445,13 @@ class JsonFactory extends _$jni.JObject { /// (check JsonGenerator.Feature for list of features) ///@param f Feature to disable ///@return This factory instance (to allow call chaining) - JsonFactory disable$2( - _$jni.JObject f, + JsonFactory? disable$2( + _$jni.JObject? f, ) { - return _disable$2(reference.pointer, _id_disable$2 as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonFactory$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _disable$2( + reference.pointer, _id_disable$2 as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_isEnabled$3 = _class.instanceMethodId( @@ -1412,10 +1476,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to check ///@return Whether specified feature is enabled bool isEnabled$3( - _$jni.JObject f, + _$jni.JObject? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _isEnabled$3(reference.pointer, - _id_isEnabled$3 as _$jni.JMethodIDPtr, f.reference.pointer) + _id_isEnabled$3 as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1442,10 +1507,11 @@ class JsonFactory extends _$jni.JObject { ///@return Whether specified feature is enabled ///@since 2.10 bool isEnabled$4( - _$jni.JObject f, + _$jni.JObject? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _isEnabled$4(reference.pointer, - _id_isEnabled$4 as _$jni.JMethodIDPtr, f.reference.pointer) + _id_isEnabled$4 as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1472,10 +1538,10 @@ class JsonFactory extends _$jni.JObject { /// Method for accessing custom escapes factory uses for JsonGenerators /// it creates. ///@return Configured {@code CharacterEscapes}, if any; {@code null} if none - _$jni.JObject getCharacterEscapes() { + _$jni.JObject? getCharacterEscapes() { return _getCharacterEscapes( reference.pointer, _id_getCharacterEscapes as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setCharacterEscapes = _class.instanceMethodId( @@ -1501,14 +1567,13 @@ class JsonFactory extends _$jni.JObject { /// it creates. ///@param esc CharaterEscapes to set (or {@code null} for "none") ///@return This factory instance (to allow call chaining) - JsonFactory setCharacterEscapes( - _$jni.JObject esc, + JsonFactory? setCharacterEscapes( + _$jni.JObject? esc, ) { - return _setCharacterEscapes( - reference.pointer, - _id_setCharacterEscapes as _$jni.JMethodIDPtr, - esc.reference.pointer) - .object(const $JsonFactory$Type()); + final _$esc = esc?.reference ?? _$jni.jNullReference; + return _setCharacterEscapes(reference.pointer, + _id_setCharacterEscapes as _$jni.JMethodIDPtr, _$esc.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_getOutputDecorator = _class.instanceMethodId( @@ -1535,10 +1600,10 @@ class JsonFactory extends _$jni.JObject { /// there is no default decorator). ///@return OutputDecorator configured for generators factory creates, if any; /// {@code null} if none. - _$jni.JObject getOutputDecorator() { + _$jni.JObject? getOutputDecorator() { return _getOutputDecorator( reference.pointer, _id_getOutputDecorator as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setOutputDecorator = _class.instanceMethodId( @@ -1564,12 +1629,13 @@ class JsonFactory extends _$jni.JObject { ///@return This factory instance (to allow call chaining) ///@param d Output decorator to use, if any ///@deprecated Since 2.10 use JsonFactoryBuilder\#outputDecorator(OutputDecorator) instead - JsonFactory setOutputDecorator( - _$jni.JObject d, + JsonFactory? setOutputDecorator( + _$jni.JObject? d, ) { + final _$d = d?.reference ?? _$jni.jNullReference; return _setOutputDecorator(reference.pointer, - _id_setOutputDecorator as _$jni.JMethodIDPtr, d.reference.pointer) - .object(const $JsonFactory$Type()); + _id_setOutputDecorator as _$jni.JMethodIDPtr, _$d.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_setRootValueSeparator = _class.instanceMethodId( @@ -1596,14 +1662,13 @@ class JsonFactory extends _$jni.JObject { ///@param sep Separator to use, if any; null means that no separator is /// automatically added ///@return This factory instance (to allow call chaining) - JsonFactory setRootValueSeparator( - _$jni.JString sep, + JsonFactory? setRootValueSeparator( + _$jni.JString? sep, ) { - return _setRootValueSeparator( - reference.pointer, - _id_setRootValueSeparator as _$jni.JMethodIDPtr, - sep.reference.pointer) - .object(const $JsonFactory$Type()); + final _$sep = sep?.reference ?? _$jni.jNullReference; + return _setRootValueSeparator(reference.pointer, + _id_setRootValueSeparator as _$jni.JMethodIDPtr, _$sep.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_getRootValueSeparator = _class.instanceMethodId( @@ -1627,10 +1692,10 @@ class JsonFactory extends _$jni.JObject { /// The returned object must be released after use, by calling the [release] method. /// /// @return Root value separator configured, if any - _$jni.JString getRootValueSeparator() { + _$jni.JString? getRootValueSeparator() { return _getRootValueSeparator( reference.pointer, _id_getRootValueSeparator as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setCodec = _class.instanceMethodId( @@ -1659,12 +1724,13 @@ class JsonFactory extends _$jni.JObject { /// of JsonParser and JsonGenerator instances. ///@param oc Codec to use ///@return This factory instance (to allow call chaining) - JsonFactory setCodec( - _$jni.JObject oc, + JsonFactory? setCodec( + _$jni.JObject? oc, ) { - return _setCodec(reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, - oc.reference.pointer) - .object(const $JsonFactory$Type()); + final _$oc = oc?.reference ?? _$jni.jNullReference; + return _setCodec( + reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, _$oc.pointer) + .object(const $JsonFactory$NullableType()); } static final _id_getCodec = _class.instanceMethodId( @@ -1686,9 +1752,9 @@ class JsonFactory extends _$jni.JObject { /// from: `public com.fasterxml.jackson.core.ObjectCodec getCodec()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject getCodec() { + _$jni.JObject? getCodec() { return _getCodec(reference.pointer, _id_getCodec as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createParser = _class.instanceMethodId( @@ -1726,12 +1792,14 @@ class JsonFactory extends _$jni.JObject { /// the parser, since caller has no access to it. ///@param f File that contains JSON content to parse ///@since 2.1 - jsonparser_.JsonParser createParser( - _$jni.JObject f, + jsonparser_.JsonParser? createParser( + _$jni.JObject? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _createParser(reference.pointer, - _id_createParser as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser as _$jni.JMethodIDPtr, _$f.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$1 = _class.instanceMethodId( @@ -1767,12 +1835,14 @@ class JsonFactory extends _$jni.JObject { /// the parser, since caller has no access to it. ///@param url URL pointing to resource that contains JSON content to parse ///@since 2.1 - jsonparser_.JsonParser createParser$1( - _$jni.JObject url, + jsonparser_.JsonParser? createParser$1( + _$jni.JObject? url, ) { + final _$url = url?.reference ?? _$jni.jNullReference; return _createParser$1(reference.pointer, - _id_createParser$1 as _$jni.JMethodIDPtr, url.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$1 as _$jni.JMethodIDPtr, _$url.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$2 = _class.instanceMethodId( @@ -1811,12 +1881,14 @@ class JsonFactory extends _$jni.JObject { /// For other charsets use \#createParser(java.io.Reader). ///@param in InputStream to use for reading JSON content to parse ///@since 2.1 - jsonparser_.JsonParser createParser$2( - _$jni.JObject in$, + jsonparser_.JsonParser? createParser$2( + _$jni.JObject? in$, ) { + final _$in$ = in$?.reference ?? _$jni.jNullReference; return _createParser$2(reference.pointer, - _id_createParser$2 as _$jni.JMethodIDPtr, in$.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$2 as _$jni.JMethodIDPtr, _$in$.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$3 = _class.instanceMethodId( @@ -1848,12 +1920,14 @@ class JsonFactory extends _$jni.JObject { /// is enabled. ///@param r Reader to use for reading JSON content to parse ///@since 2.1 - jsonparser_.JsonParser createParser$3( - _$jni.JObject r, + jsonparser_.JsonParser? createParser$3( + _$jni.JObject? r, ) { + final _$r = r?.reference ?? _$jni.jNullReference; return _createParser$3(reference.pointer, - _id_createParser$3 as _$jni.JMethodIDPtr, r.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$3 as _$jni.JMethodIDPtr, _$r.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$4 = _class.instanceMethodId( @@ -1878,12 +1952,14 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing parser for parsing /// the contents of given byte array. ///@since 2.1 - jsonparser_.JsonParser createParser$4( - _$jni.JArray<_$jni.jbyte> data, + jsonparser_.JsonParser? createParser$4( + _$jni.JArray<_$jni.jbyte>? data, ) { + final _$data = data?.reference ?? _$jni.jNullReference; return _createParser$4(reference.pointer, - _id_createParser$4 as _$jni.JMethodIDPtr, data.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$4 as _$jni.JMethodIDPtr, _$data.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$5 = _class.instanceMethodId( @@ -1915,18 +1991,20 @@ class JsonFactory extends _$jni.JObject { ///@param offset Offset of the first data byte within buffer ///@param len Length of contents to parse within buffer ///@since 2.1 - jsonparser_.JsonParser createParser$5( - _$jni.JArray<_$jni.jbyte> data, + jsonparser_.JsonParser? createParser$5( + _$jni.JArray<_$jni.jbyte>? data, int offset, int len, ) { + final _$data = data?.reference ?? _$jni.jNullReference; return _createParser$5( reference.pointer, _id_createParser$5 as _$jni.JMethodIDPtr, - data.reference.pointer, + _$data.pointer, offset, len) - .object(const jsonparser_.$JsonParser$Type()); + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$6 = _class.instanceMethodId( @@ -1951,12 +2029,14 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing parser for parsing /// contents of given String. ///@since 2.1 - jsonparser_.JsonParser createParser$6( - _$jni.JString content, + jsonparser_.JsonParser? createParser$6( + _$jni.JString? content, ) { + final _$content = content?.reference ?? _$jni.jNullReference; return _createParser$6(reference.pointer, - _id_createParser$6 as _$jni.JMethodIDPtr, content.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$6 as _$jni.JMethodIDPtr, _$content.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$7 = _class.instanceMethodId( @@ -1981,12 +2061,14 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing parser for parsing /// contents of given char array. ///@since 2.4 - jsonparser_.JsonParser createParser$7( - _$jni.JArray<_$jni.jchar> content, + jsonparser_.JsonParser? createParser$7( + _$jni.JArray<_$jni.jchar>? content, ) { + final _$content = content?.reference ?? _$jni.jNullReference; return _createParser$7(reference.pointer, - _id_createParser$7 as _$jni.JMethodIDPtr, content.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$7 as _$jni.JMethodIDPtr, _$content.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$8 = _class.instanceMethodId( @@ -2014,18 +2096,20 @@ class JsonFactory extends _$jni.JObject { /// /// Method for constructing parser for parsing contents of given char array. ///@since 2.4 - jsonparser_.JsonParser createParser$8( - _$jni.JArray<_$jni.jchar> content, + jsonparser_.JsonParser? createParser$8( + _$jni.JArray<_$jni.jchar>? content, int offset, int len, ) { + final _$content = content?.reference ?? _$jni.jNullReference; return _createParser$8( reference.pointer, _id_createParser$8 as _$jni.JMethodIDPtr, - content.reference.pointer, + _$content.pointer, offset, len) - .object(const jsonparser_.$JsonParser$Type()); + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createParser$9 = _class.instanceMethodId( @@ -2053,12 +2137,14 @@ class JsonFactory extends _$jni.JObject { /// If this factory does not support DataInput as source, /// will throw UnsupportedOperationException ///@since 2.8 - jsonparser_.JsonParser createParser$9( - _$jni.JObject in$, + jsonparser_.JsonParser? createParser$9( + _$jni.JObject? in$, ) { + final _$in$ = in$?.reference ?? _$jni.jNullReference; return _createParser$9(reference.pointer, - _id_createParser$9 as _$jni.JMethodIDPtr, in$.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createParser$9 as _$jni.JMethodIDPtr, _$in$.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createNonBlockingByteArrayParser = _class.instanceMethodId( @@ -2095,10 +2181,11 @@ class JsonFactory extends _$jni.JObject { /// (and US-ASCII since it is proper subset); other encodings are not supported /// at this point. ///@since 2.9 - jsonparser_.JsonParser createNonBlockingByteArrayParser() { + jsonparser_.JsonParser? createNonBlockingByteArrayParser() { return _createNonBlockingByteArrayParser(reference.pointer, _id_createNonBlockingByteArrayParser as _$jni.JMethodIDPtr) - .object(const jsonparser_.$JsonParser$Type()); + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createGenerator = _class.instanceMethodId( @@ -2144,16 +2231,18 @@ class JsonFactory extends _$jni.JObject { ///@param out OutputStream to use for writing JSON content ///@param enc Character encoding to use ///@since 2.1 - _$jni.JObject createGenerator( - _$jni.JObject out, - _$jni.JObject enc, + _$jni.JObject? createGenerator( + _$jni.JObject? out, + _$jni.JObject? enc, ) { + final _$out = out?.reference ?? _$jni.jNullReference; + final _$enc = enc?.reference ?? _$jni.jNullReference; return _createGenerator( reference.pointer, _id_createGenerator as _$jni.JMethodIDPtr, - out.reference.pointer, - enc.reference.pointer) - .object(const _$jni.JObjectType()); + _$out.pointer, + _$enc.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createGenerator$1 = _class.instanceMethodId( @@ -2180,12 +2269,13 @@ class JsonFactory extends _$jni.JObject { /// /// Note: there are formats that use fixed encoding (like most binary data formats). ///@since 2.1 - _$jni.JObject createGenerator$1( - _$jni.JObject out, + _$jni.JObject? createGenerator$1( + _$jni.JObject? out, ) { + final _$out = out?.reference ?? _$jni.jNullReference; return _createGenerator$1(reference.pointer, - _id_createGenerator$1 as _$jni.JMethodIDPtr, out.reference.pointer) - .object(const _$jni.JObjectType()); + _id_createGenerator$1 as _$jni.JMethodIDPtr, _$out.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createGenerator$2 = _class.instanceMethodId( @@ -2218,12 +2308,13 @@ class JsonFactory extends _$jni.JObject { /// Using application needs to close it explicitly. ///@since 2.1 ///@param w Writer to use for writing JSON content - _$jni.JObject createGenerator$2( - _$jni.JObject w, + _$jni.JObject? createGenerator$2( + _$jni.JObject? w, ) { + final _$w = w?.reference ?? _$jni.jNullReference; return _createGenerator$2(reference.pointer, - _id_createGenerator$2 as _$jni.JMethodIDPtr, w.reference.pointer) - .object(const _$jni.JObjectType()); + _id_createGenerator$2 as _$jni.JMethodIDPtr, _$w.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createGenerator$3 = _class.instanceMethodId( @@ -2263,16 +2354,18 @@ class JsonFactory extends _$jni.JObject { ///@param f File to write contents to ///@param enc Character encoding to use ///@since 2.1 - _$jni.JObject createGenerator$3( - _$jni.JObject f, - _$jni.JObject enc, + _$jni.JObject? createGenerator$3( + _$jni.JObject? f, + _$jni.JObject? enc, ) { + final _$f = f?.reference ?? _$jni.jNullReference; + final _$enc = enc?.reference ?? _$jni.jNullReference; return _createGenerator$3( reference.pointer, _id_createGenerator$3 as _$jni.JMethodIDPtr, - f.reference.pointer, - enc.reference.pointer) - .object(const _$jni.JObjectType()); + _$f.pointer, + _$enc.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createGenerator$4 = _class.instanceMethodId( @@ -2303,16 +2396,18 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing generator for writing content using specified /// DataOutput instance. ///@since 2.8 - _$jni.JObject createGenerator$4( - _$jni.JObject out, - _$jni.JObject enc, + _$jni.JObject? createGenerator$4( + _$jni.JObject? out, + _$jni.JObject? enc, ) { + final _$out = out?.reference ?? _$jni.jNullReference; + final _$enc = enc?.reference ?? _$jni.jNullReference; return _createGenerator$4( reference.pointer, _id_createGenerator$4 as _$jni.JMethodIDPtr, - out.reference.pointer, - enc.reference.pointer) - .object(const _$jni.JObjectType()); + _$out.pointer, + _$enc.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createGenerator$5 = _class.instanceMethodId( @@ -2339,12 +2434,13 @@ class JsonFactory extends _$jni.JObject { /// /// Note: there are formats that use fixed encoding (like most binary data formats). ///@since 2.8 - _$jni.JObject createGenerator$5( - _$jni.JObject out, + _$jni.JObject? createGenerator$5( + _$jni.JObject? out, ) { + final _$out = out?.reference ?? _$jni.jNullReference; return _createGenerator$5(reference.pointer, - _id_createGenerator$5 as _$jni.JMethodIDPtr, out.reference.pointer) - .object(const _$jni.JObjectType()); + _id_createGenerator$5 as _$jni.JMethodIDPtr, _$out.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createJsonParser = _class.instanceMethodId( @@ -2384,12 +2480,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(File) instead. - jsonparser_.JsonParser createJsonParser( - _$jni.JObject f, + jsonparser_.JsonParser? createJsonParser( + _$jni.JObject? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _createJsonParser(reference.pointer, - _id_createJsonParser as _$jni.JMethodIDPtr, f.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createJsonParser as _$jni.JMethodIDPtr, _$f.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonParser$1 = _class.instanceMethodId( @@ -2428,12 +2526,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(URL) instead. - jsonparser_.JsonParser createJsonParser$1( - _$jni.JObject url, + jsonparser_.JsonParser? createJsonParser$1( + _$jni.JObject? url, ) { + final _$url = url?.reference ?? _$jni.jNullReference; return _createJsonParser$1(reference.pointer, - _id_createJsonParser$1 as _$jni.JMethodIDPtr, url.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createJsonParser$1 as _$jni.JMethodIDPtr, _$url.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonParser$2 = _class.instanceMethodId( @@ -2475,12 +2575,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(InputStream) instead. - jsonparser_.JsonParser createJsonParser$2( - _$jni.JObject in$, + jsonparser_.JsonParser? createJsonParser$2( + _$jni.JObject? in$, ) { + final _$in$ = in$?.reference ?? _$jni.jNullReference; return _createJsonParser$2(reference.pointer, - _id_createJsonParser$2 as _$jni.JMethodIDPtr, in$.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createJsonParser$2 as _$jni.JMethodIDPtr, _$in$.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonParser$3 = _class.instanceMethodId( @@ -2515,12 +2617,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(Reader) instead. - jsonparser_.JsonParser createJsonParser$3( - _$jni.JObject r, + jsonparser_.JsonParser? createJsonParser$3( + _$jni.JObject? r, ) { + final _$r = r?.reference ?? _$jni.jNullReference; return _createJsonParser$3(reference.pointer, - _id_createJsonParser$3 as _$jni.JMethodIDPtr, r.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + _id_createJsonParser$3 as _$jni.JMethodIDPtr, _$r.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonParser$4 = _class.instanceMethodId( @@ -2548,14 +2652,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[]) instead. - jsonparser_.JsonParser createJsonParser$4( - _$jni.JArray<_$jni.jbyte> data, + jsonparser_.JsonParser? createJsonParser$4( + _$jni.JArray<_$jni.jbyte>? data, ) { - return _createJsonParser$4( - reference.pointer, - _id_createJsonParser$4 as _$jni.JMethodIDPtr, - data.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + final _$data = data?.reference ?? _$jni.jNullReference; + return _createJsonParser$4(reference.pointer, + _id_createJsonParser$4 as _$jni.JMethodIDPtr, _$data.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonParser$5 = _class.instanceMethodId( @@ -2590,18 +2694,20 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[],int,int) instead. - jsonparser_.JsonParser createJsonParser$5( - _$jni.JArray<_$jni.jbyte> data, + jsonparser_.JsonParser? createJsonParser$5( + _$jni.JArray<_$jni.jbyte>? data, int offset, int len, ) { + final _$data = data?.reference ?? _$jni.jNullReference; return _createJsonParser$5( reference.pointer, _id_createJsonParser$5 as _$jni.JMethodIDPtr, - data.reference.pointer, + _$data.pointer, offset, len) - .object(const jsonparser_.$JsonParser$Type()); + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonParser$6 = _class.instanceMethodId( @@ -2630,14 +2736,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(String) instead. - jsonparser_.JsonParser createJsonParser$6( - _$jni.JString content, + jsonparser_.JsonParser? createJsonParser$6( + _$jni.JString? content, ) { - return _createJsonParser$6( - reference.pointer, - _id_createJsonParser$6 as _$jni.JMethodIDPtr, - content.reference.pointer) - .object(const jsonparser_.$JsonParser$Type()); + final _$content = content?.reference ?? _$jni.jNullReference; + return _createJsonParser$6(reference.pointer, + _id_createJsonParser$6 as _$jni.JMethodIDPtr, _$content.pointer) + .object( + const jsonparser_.$JsonParser$NullableType()); } static final _id_createJsonGenerator = _class.instanceMethodId( @@ -2685,16 +2791,18 @@ class JsonFactory extends _$jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(OutputStream, JsonEncoding) instead. - _$jni.JObject createJsonGenerator( - _$jni.JObject out, - _$jni.JObject enc, + _$jni.JObject? createJsonGenerator( + _$jni.JObject? out, + _$jni.JObject? enc, ) { + final _$out = out?.reference ?? _$jni.jNullReference; + final _$enc = enc?.reference ?? _$jni.jNullReference; return _createJsonGenerator( reference.pointer, _id_createJsonGenerator as _$jni.JMethodIDPtr, - out.reference.pointer, - enc.reference.pointer) - .object(const _$jni.JObjectType()); + _$out.pointer, + _$enc.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createJsonGenerator$1 = _class.instanceMethodId( @@ -2729,14 +2837,13 @@ class JsonFactory extends _$jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(Writer) instead. - _$jni.JObject createJsonGenerator$1( - _$jni.JObject out, + _$jni.JObject? createJsonGenerator$1( + _$jni.JObject? out, ) { - return _createJsonGenerator$1( - reference.pointer, - _id_createJsonGenerator$1 as _$jni.JMethodIDPtr, - out.reference.pointer) - .object(const _$jni.JObjectType()); + final _$out = out?.reference ?? _$jni.jNullReference; + return _createJsonGenerator$1(reference.pointer, + _id_createJsonGenerator$1 as _$jni.JMethodIDPtr, _$out.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_createJsonGenerator$2 = _class.instanceMethodId( @@ -2766,14 +2873,13 @@ class JsonFactory extends _$jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(OutputStream) instead. - _$jni.JObject createJsonGenerator$2( - _$jni.JObject out, + _$jni.JObject? createJsonGenerator$2( + _$jni.JObject? out, ) { - return _createJsonGenerator$2( - reference.pointer, - _id_createJsonGenerator$2 as _$jni.JMethodIDPtr, - out.reference.pointer) - .object(const _$jni.JObjectType()); + final _$out = out?.reference ?? _$jni.jNullReference; + return _createJsonGenerator$2(reference.pointer, + _id_createJsonGenerator$2 as _$jni.JMethodIDPtr, _$out.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_$_getBufferRecycler = _class.instanceMethodId( @@ -2801,10 +2907,47 @@ class JsonFactory extends _$jni.JObject { /// /// Note: only public to give access for {@code ObjectMapper} ///@return Buffer recycler instance to use - _$jni.JObject $_getBufferRecycler() { + _$jni.JObject? $_getBufferRecycler() { return _$_getBufferRecycler( reference.pointer, _id_$_getBufferRecycler as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + } +} + +final class $JsonFactory$NullableType extends _$jni.JObjType { + @_$jni.internal + const $JsonFactory$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory;'; + + @_$jni.internal + @_$core.override + JsonFactory? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : JsonFactory.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonFactory$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonFactory$NullableType) && + other is $JsonFactory$NullableType; } } @@ -2819,11 +2962,17 @@ final class $JsonFactory$Type extends _$jni.JObjType { @_$jni.internal @_$core.override JsonFactory fromReference(_$jni.JReference reference) => - JsonFactory.fromReference(reference); + JsonFactory.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $JsonFactory$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart index 6062e6c3b..9b6ad37ff 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -37,6 +37,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -71,6 +72,7 @@ class JsonParser_Feature extends _$jni.JObject { _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$Feature'); /// The type which includes information such as the signature of this class. + static const nullableType = $JsonParser_Feature$NullableType(); static const type = $JsonParser_Feature$Type(); static final _id_values = _class.staticMethodId( r'values', @@ -91,9 +93,11 @@ class JsonParser_Feature extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { + static _$jni.JArray? values() { return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($JsonParser_Feature$Type())); + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType( + $JsonParser_Feature$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -114,12 +118,13 @@ class JsonParser_Feature extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonParser_Feature valueOf( - _$jni.JString name, + static JsonParser_Feature? valueOf( + _$jni.JString? name, ) { + final _$name = name?.reference ?? _$jni.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - name.reference.pointer) - .object(const $JsonParser_Feature$Type()); + _$name.pointer) + .object(const $JsonParser_Feature$NullableType()); } static final _id_collectDefaults = _class.staticMethodId( @@ -223,6 +228,45 @@ class JsonParser_Feature extends _$jni.JObject { } } +final class $JsonParser_Feature$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $JsonParser_Feature$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$Feature;'; + + @_$jni.internal + @_$core.override + JsonParser_Feature? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : JsonParser_Feature.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonParser_Feature$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonParser_Feature$NullableType) && + other is $JsonParser_Feature$NullableType; + } +} + final class $JsonParser_Feature$Type extends _$jni.JObjType { @_$jni.internal @@ -235,11 +279,17 @@ final class $JsonParser_Feature$Type @_$jni.internal @_$core.override JsonParser_Feature fromReference(_$jni.JReference reference) => - JsonParser_Feature.fromReference(reference); + JsonParser_Feature.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $JsonParser_Feature$NullableType(); @_$jni.internal @_$core.override @@ -274,6 +324,7 @@ class JsonParser_NumberType extends _$jni.JObject { _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$NumberType'); /// The type which includes information such as the signature of this class. + static const nullableType = $JsonParser_NumberType$NullableType(); static const type = $JsonParser_NumberType$Type(); static final _id_values = _class.staticMethodId( r'values', @@ -294,9 +345,11 @@ class JsonParser_NumberType extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { + static _$jni.JArray? values() { return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($JsonParser_NumberType$Type())); + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType( + $JsonParser_NumberType$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -317,12 +370,53 @@ class JsonParser_NumberType extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonParser_NumberType valueOf( - _$jni.JString name, + static JsonParser_NumberType? valueOf( + _$jni.JString? name, ) { + final _$name = name?.reference ?? _$jni.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - name.reference.pointer) - .object(const $JsonParser_NumberType$Type()); + _$name.pointer) + .object( + const $JsonParser_NumberType$NullableType()); + } +} + +final class $JsonParser_NumberType$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $JsonParser_NumberType$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;'; + + @_$jni.internal + @_$core.override + JsonParser_NumberType? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : JsonParser_NumberType.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonParser_NumberType$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonParser_NumberType$NullableType) && + other is $JsonParser_NumberType$NullableType; } } @@ -338,11 +432,17 @@ final class $JsonParser_NumberType$Type @_$jni.internal @_$core.override JsonParser_NumberType fromReference(_$jni.JReference reference) => - JsonParser_NumberType.fromReference(reference); + JsonParser_NumberType.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $JsonParser_NumberType$NullableType(); @_$jni.internal @_$core.override @@ -379,6 +479,7 @@ class JsonParser extends _$jni.JObject { _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser'); /// The type which includes information such as the signature of this class. + static const nullableType = $JsonParser$NullableType(); static const type = $JsonParser$Type(); static final _id_getCodec = _class.instanceMethodId( r'getCodec', @@ -404,9 +505,9 @@ class JsonParser extends _$jni.JObject { /// parser, if any. Codec is used by \#readValueAs(Class) /// method (and its variants). ///@return Codec assigned to this parser, if any; {@code null} if none - _$jni.JObject getCodec() { + _$jni.JObject? getCodec() { return _getCodec(reference.pointer, _id_getCodec as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setCodec = _class.instanceMethodId( @@ -432,10 +533,11 @@ class JsonParser extends _$jni.JObject { /// method (and its variants). ///@param oc Codec to assign, if any; {@code null} if none void setCodec( - _$jni.JObject oc, + _$jni.JObject? oc, ) { - _setCodec(reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, - oc.reference.pointer) + final _$oc = oc?.reference ?? _$jni.jNullReference; + _setCodec( + reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, _$oc.pointer) .check(); } @@ -473,10 +575,10 @@ class JsonParser extends _$jni.JObject { /// In general use of this accessor should be considered as /// "last effort", i.e. only used if no other mechanism is applicable. ///@return Input source this parser was configured with - _$jni.JObject getInputSource() { + _$jni.JObject? getInputSource() { return _getInputSource( reference.pointer, _id_getInputSource as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setRequestPayloadOnError = _class.instanceMethodId( @@ -501,12 +603,13 @@ class JsonParser extends _$jni.JObject { ///@param payload Payload to pass ///@since 2.8 void setRequestPayloadOnError( - _$jni.JObject payload, + _$jni.JObject? payload, ) { + final _$payload = payload?.reference ?? _$jni.jNullReference; _setRequestPayloadOnError( reference.pointer, _id_setRequestPayloadOnError as _$jni.JMethodIDPtr, - payload.reference.pointer) + _$payload.pointer) .check(); } @@ -540,14 +643,16 @@ class JsonParser extends _$jni.JObject { ///@param charset Character encoding for (lazily) decoding payload ///@since 2.8 void setRequestPayloadOnError$1( - _$jni.JArray<_$jni.jbyte> payload, - _$jni.JString charset, + _$jni.JArray<_$jni.jbyte>? payload, + _$jni.JString? charset, ) { + final _$payload = payload?.reference ?? _$jni.jNullReference; + final _$charset = charset?.reference ?? _$jni.jNullReference; _setRequestPayloadOnError$1( reference.pointer, _id_setRequestPayloadOnError$1 as _$jni.JMethodIDPtr, - payload.reference.pointer, - charset.reference.pointer) + _$payload.pointer, + _$charset.pointer) .check(); } @@ -574,12 +679,13 @@ class JsonParser extends _$jni.JObject { ///@param payload Payload to pass ///@since 2.8 void setRequestPayloadOnError$2( - _$jni.JString payload, + _$jni.JString? payload, ) { + final _$payload = payload?.reference ?? _$jni.jNullReference; _setRequestPayloadOnError$2( reference.pointer, _id_setRequestPayloadOnError$2 as _$jni.JMethodIDPtr, - payload.reference.pointer) + _$payload.pointer) .check(); } @@ -612,10 +718,11 @@ class JsonParser extends _$jni.JObject { ///@param schema Schema to use ///@throws UnsupportedOperationException if parser does not support schema void setSchema( - _$jni.JObject schema, + _$jni.JObject? schema, ) { + final _$schema = schema?.reference ?? _$jni.jNullReference; _setSchema(reference.pointer, _id_setSchema as _$jni.JMethodIDPtr, - schema.reference.pointer) + _$schema.pointer) .check(); } @@ -643,9 +750,9 @@ class JsonParser extends _$jni.JObject { /// Default implementation returns null. ///@return Schema in use by this parser, if any; {@code null} if none ///@since 2.1 - _$jni.JObject getSchema() { + _$jni.JObject? getSchema() { return _getSchema(reference.pointer, _id_getSchema as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_canUseSchema = _class.instanceMethodId( @@ -671,10 +778,11 @@ class JsonParser extends _$jni.JObject { ///@param schema Schema to check ///@return True if this parser can use given schema; false if not bool canUseSchema( - _$jni.JObject schema, + _$jni.JObject? schema, ) { + final _$schema = schema?.reference ?? _$jni.jNullReference; return _canUseSchema(reference.pointer, - _id_canUseSchema as _$jni.JMethodIDPtr, schema.reference.pointer) + _id_canUseSchema as _$jni.JMethodIDPtr, _$schema.pointer) .boolean; } @@ -772,10 +880,10 @@ class JsonParser extends _$jni.JObject { /// parsers that use blocking I/O. ///@return Input feeder to use with non-blocking (async) parsing ///@since 2.9 - _$jni.JObject getNonBlockingInputFeeder() { + _$jni.JObject? getNonBlockingInputFeeder() { return _getNonBlockingInputFeeder(reference.pointer, _id_getNonBlockingInputFeeder as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getReadCapabilities = _class.instanceMethodId( @@ -802,10 +910,10 @@ class JsonParser extends _$jni.JObject { /// underlying data format being read (directly or indirectly). ///@return Set of read capabilities for content to read via this parser ///@since 2.12 - _$jni.JObject getReadCapabilities() { + _$jni.JObject? getReadCapabilities() { return _getReadCapabilities( reference.pointer, _id_getReadCapabilities as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_version = _class.instanceMethodId( @@ -832,9 +940,9 @@ class JsonParser extends _$jni.JObject { /// Left for sub-classes to implement. ///@return Version of this generator (derived from version declared for /// {@code jackson-core} jar that contains the class - _$jni.JObject version() { + _$jni.JObject? version() { return _version(reference.pointer, _id_version as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_close = _class.instanceMethodId( @@ -934,10 +1042,10 @@ class JsonParser extends _$jni.JObject { /// Contexts can also be used for simple xpath-like matching of /// input, if so desired. ///@return Stream input context (JsonStreamContext) associated with this parser - _$jni.JObject getParsingContext() { + _$jni.JObject? getParsingContext() { return _getParsingContext( reference.pointer, _id_getParsingContext as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_currentLocation = _class.instanceMethodId( @@ -972,10 +1080,10 @@ class JsonParser extends _$jni.JObject { /// to other library) ///@return Location of the last processed input unit (byte or character) ///@since 2.13 - _$jni.JObject currentLocation() { + _$jni.JObject? currentLocation() { return _currentLocation( reference.pointer, _id_currentLocation as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_currentTokenLocation = _class.instanceMethodId( @@ -1010,10 +1118,10 @@ class JsonParser extends _$jni.JObject { /// to other library) ///@return Starting location of the token parser currently points to ///@since 2.13 (will eventually replace \#getTokenLocation) - _$jni.JObject currentTokenLocation() { + _$jni.JObject? currentTokenLocation() { return _currentTokenLocation( reference.pointer, _id_currentTokenLocation as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getCurrentLocation = _class.instanceMethodId( @@ -1039,10 +1147,10 @@ class JsonParser extends _$jni.JObject { /// Alias for \#currentLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Location of the last processed input unit (byte or character) - _$jni.JObject getCurrentLocation() { + _$jni.JObject? getCurrentLocation() { return _getCurrentLocation( reference.pointer, _id_getCurrentLocation as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getTokenLocation = _class.instanceMethodId( @@ -1068,10 +1176,10 @@ class JsonParser extends _$jni.JObject { /// Alias for \#currentTokenLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Starting location of the token parser currently points to - _$jni.JObject getTokenLocation() { + _$jni.JObject? getTokenLocation() { return _getTokenLocation( reference.pointer, _id_getTokenLocation as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_currentValue = _class.instanceMethodId( @@ -1105,10 +1213,10 @@ class JsonParser extends _$jni.JObject { /// and gets passed through data-binding. ///@return "Current value" associated with the current input context (state) of this parser ///@since 2.13 (added as replacement for older \#getCurrentValue() - _$jni.JObject currentValue() { + _$jni.JObject? currentValue() { return _currentValue( reference.pointer, _id_currentValue as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_assignCurrentValue = _class.instanceMethodId( @@ -1136,10 +1244,11 @@ class JsonParser extends _$jni.JObject { ///@param v Current value to assign for the current input context of this parser ///@since 2.13 (added as replacement for older \#setCurrentValue void assignCurrentValue( - _$jni.JObject v, + _$jni.JObject? v, ) { + final _$v = v?.reference ?? _$jni.jNullReference; _assignCurrentValue(reference.pointer, - _id_assignCurrentValue as _$jni.JMethodIDPtr, v.reference.pointer) + _id_assignCurrentValue as _$jni.JMethodIDPtr, _$v.pointer) .check(); } @@ -1166,10 +1275,10 @@ class JsonParser extends _$jni.JObject { /// Alias for \#currentValue(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Location of the last processed input unit (byte or character) - _$jni.JObject getCurrentValue() { + _$jni.JObject? getCurrentValue() { return _getCurrentValue( reference.pointer, _id_getCurrentValue as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setCurrentValue = _class.instanceMethodId( @@ -1194,10 +1303,11 @@ class JsonParser extends _$jni.JObject { /// Jackson 2.x versions (and removed from Jackson 3.0). ///@param v Current value to assign for the current input context of this parser void setCurrentValue( - _$jni.JObject v, + _$jni.JObject? v, ) { + final _$v = v?.reference ?? _$jni.jNullReference; _setCurrentValue(reference.pointer, - _id_setCurrentValue as _$jni.JMethodIDPtr, v.reference.pointer) + _id_setCurrentValue as _$jni.JMethodIDPtr, _$v.pointer) .check(); } @@ -1231,10 +1341,11 @@ class JsonParser extends _$jni.JObject { /// otherwise number of bytes released (0 if there was nothing to release) ///@throws IOException if write to stream threw exception int releaseBuffered( - _$jni.JObject out, + _$jni.JObject? out, ) { + final _$out = out?.reference ?? _$jni.jNullReference; return _releaseBuffered(reference.pointer, - _id_releaseBuffered as _$jni.JMethodIDPtr, out.reference.pointer) + _id_releaseBuffered as _$jni.JMethodIDPtr, _$out.pointer) .integer; } @@ -1269,10 +1380,11 @@ class JsonParser extends _$jni.JObject { /// otherwise number of chars released (0 if there was nothing to release) ///@throws IOException if write using Writer threw exception int releaseBuffered$1( - _$jni.JObject w, + _$jni.JObject? w, ) { + final _$w = w?.reference ?? _$jni.jNullReference; return _releaseBuffered$1(reference.pointer, - _id_releaseBuffered$1 as _$jni.JMethodIDPtr, w.reference.pointer) + _id_releaseBuffered$1 as _$jni.JMethodIDPtr, _$w.pointer) .integer; } @@ -1299,12 +1411,13 @@ class JsonParser extends _$jni.JObject { /// (check Feature for list of features) ///@param f Feature to enable ///@return This parser, to allow call chaining - JsonParser enable( - JsonParser_Feature f, + JsonParser? enable( + JsonParser_Feature? f, ) { - return _enable(reference.pointer, _id_enable as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonParser$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _enable( + reference.pointer, _id_enable as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonParser$NullableType()); } static final _id_disable = _class.instanceMethodId( @@ -1330,12 +1443,13 @@ class JsonParser extends _$jni.JObject { /// (check Feature for list of features) ///@param f Feature to disable ///@return This parser, to allow call chaining - JsonParser disable( - JsonParser_Feature f, + JsonParser? disable( + JsonParser_Feature? f, ) { - return _disable(reference.pointer, _id_disable as _$jni.JMethodIDPtr, - f.reference.pointer) - .object(const $JsonParser$Type()); + final _$f = f?.reference ?? _$jni.jNullReference; + return _disable( + reference.pointer, _id_disable as _$jni.JMethodIDPtr, _$f.pointer) + .object(const $JsonParser$NullableType()); } static final _id_configure = _class.instanceMethodId( @@ -1363,13 +1477,14 @@ class JsonParser extends _$jni.JObject { ///@param f Feature to enable or disable ///@param state Whether to enable feature ({@code true}) or disable ({@code false}) ///@return This parser, to allow call chaining - JsonParser configure( - JsonParser_Feature f, + JsonParser? configure( + JsonParser_Feature? f, bool state, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _configure(reference.pointer, _id_configure as _$jni.JMethodIDPtr, - f.reference.pointer, state ? 1 : 0) - .object(const $JsonParser$Type()); + _$f.pointer, state ? 1 : 0) + .object(const $JsonParser$NullableType()); } static final _id_isEnabled = _class.instanceMethodId( @@ -1394,10 +1509,11 @@ class JsonParser extends _$jni.JObject { ///@param f Feature to check ///@return {@code True} if feature is enabled; {@code false} otherwise bool isEnabled( - JsonParser_Feature f, + JsonParser_Feature? f, ) { - return _isEnabled(reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, - f.reference.pointer) + final _$f = f?.reference ?? _$jni.jNullReference; + return _isEnabled( + reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1424,10 +1540,11 @@ class JsonParser extends _$jni.JObject { ///@return {@code True} if feature is enabled; {@code false} otherwise ///@since 2.10 bool isEnabled$1( - _$jni.JObject f, + _$jni.JObject? f, ) { + final _$f = f?.reference ?? _$jni.jNullReference; return _isEnabled$1(reference.pointer, - _id_isEnabled$1 as _$jni.JMethodIDPtr, f.reference.pointer) + _id_isEnabled$1 as _$jni.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1482,12 +1599,12 @@ class JsonParser extends _$jni.JObject { ///@return This parser, to allow call chaining ///@since 2.3 ///@deprecated Since 2.7, use \#overrideStdFeatures(int, int) instead - JsonParser setFeatureMask( + JsonParser? setFeatureMask( int mask, ) { return _setFeatureMask( reference.pointer, _id_setFeatureMask as _$jni.JMethodIDPtr, mask) - .object(const $JsonParser$Type()); + .object(const $JsonParser$NullableType()); } static final _id_overrideStdFeatures = _class.instanceMethodId( @@ -1521,13 +1638,13 @@ class JsonParser extends _$jni.JObject { ///@param mask Bit mask of features to change ///@return This parser, to allow call chaining ///@since 2.6 - JsonParser overrideStdFeatures( + JsonParser? overrideStdFeatures( int values, int mask, ) { return _overrideStdFeatures(reference.pointer, _id_overrideStdFeatures as _$jni.JMethodIDPtr, values, mask) - .object(const $JsonParser$Type()); + .object(const $JsonParser$NullableType()); } static final _id_getFormatFeatures = _class.instanceMethodId( @@ -1588,13 +1705,13 @@ class JsonParser extends _$jni.JObject { ///@param mask Bit mask of features to change ///@return This parser, to allow call chaining ///@since 2.6 - JsonParser overrideFormatFeatures( + JsonParser? overrideFormatFeatures( int values, int mask, ) { return _overrideFormatFeatures(reference.pointer, _id_overrideFormatFeatures as _$jni.JMethodIDPtr, values, mask) - .object(const $JsonParser$Type()); + .object(const $JsonParser$NullableType()); } static final _id_nextToken = _class.instanceMethodId( @@ -1625,9 +1742,10 @@ class JsonParser extends _$jni.JObject { /// to indicate end-of-input ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jsontoken_.JsonToken nextToken() { + jsontoken_.JsonToken? nextToken() { return _nextToken(reference.pointer, _id_nextToken as _$jni.JMethodIDPtr) - .object(const jsontoken_.$JsonToken$Type()); + .object( + const jsontoken_.$JsonToken$NullableType()); } static final _id_nextValue = _class.instanceMethodId( @@ -1666,9 +1784,10 @@ class JsonParser extends _$jni.JObject { /// available yet) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jsontoken_.JsonToken nextValue() { + jsontoken_.JsonToken? nextValue() { return _nextValue(reference.pointer, _id_nextValue as _$jni.JMethodIDPtr) - .object(const jsontoken_.$JsonToken$Type()); + .object( + const jsontoken_.$JsonToken$NullableType()); } static final _id_nextFieldName = _class.instanceMethodId( @@ -1705,10 +1824,11 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems bool nextFieldName( - _$jni.JObject str, + _$jni.JObject? str, ) { + final _$str = str?.reference ?? _$jni.jNullReference; return _nextFieldName(reference.pointer, - _id_nextFieldName as _$jni.JMethodIDPtr, str.reference.pointer) + _id_nextFieldName as _$jni.JMethodIDPtr, _$str.pointer) .boolean; } @@ -1740,10 +1860,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.5 - _$jni.JString nextFieldName$1() { + _$jni.JString? nextFieldName$1() { return _nextFieldName$1( reference.pointer, _id_nextFieldName$1 as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_nextTextValue = _class.instanceMethodId( @@ -1779,10 +1899,10 @@ class JsonParser extends _$jni.JObject { /// to; or {@code null} if next token is of some other type ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JString nextTextValue() { + _$jni.JString? nextTextValue() { return _nextTextValue( reference.pointer, _id_nextTextValue as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_nextIntValue = _class.instanceMethodId( @@ -1905,10 +2025,10 @@ class JsonParser extends _$jni.JObject { /// token parser advanced to; or {@code null} if next token is of some other type ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JBoolean nextBooleanValue() { + _$jni.JBoolean? nextBooleanValue() { return _nextBooleanValue( reference.pointer, _id_nextBooleanValue as _$jni.JMethodIDPtr) - .object(const _$jni.JBooleanType()); + .object<_$jni.JBoolean?>(const _$jni.JBooleanNullableType()); } static final _id_skipChildren = _class.instanceMethodId( @@ -1946,10 +2066,10 @@ class JsonParser extends _$jni.JObject { ///@return This parser, to allow call chaining ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - JsonParser skipChildren() { + JsonParser? skipChildren() { return _skipChildren( reference.pointer, _id_skipChildren as _$jni.JMethodIDPtr) - .object(const $JsonParser$Type()); + .object(const $JsonParser$NullableType()); } static final _id_finishToken = _class.instanceMethodId( @@ -2018,10 +2138,11 @@ class JsonParser extends _$jni.JObject { /// after end-of-input has been encountered, as well as /// if the current token has been explicitly cleared. ///@since 2.8 - jsontoken_.JsonToken currentToken() { + jsontoken_.JsonToken? currentToken() { return _currentToken( reference.pointer, _id_currentToken as _$jni.JMethodIDPtr) - .object(const jsontoken_.$JsonToken$Type()); + .object( + const jsontoken_.$JsonToken$NullableType()); } static final _id_currentTokenId = _class.instanceMethodId( @@ -2082,10 +2203,11 @@ class JsonParser extends _$jni.JObject { /// Jackson 2.13 (will be removed from 3.0). ///@return Type of the token this parser currently points to, /// if any: null before any tokens have been read, and - jsontoken_.JsonToken getCurrentToken() { + jsontoken_.JsonToken? getCurrentToken() { return _getCurrentToken( reference.pointer, _id_getCurrentToken as _$jni.JMethodIDPtr) - .object(const jsontoken_.$JsonToken$Type()); + .object( + const jsontoken_.$JsonToken$NullableType()); } static final _id_getCurrentTokenId = _class.instanceMethodId( @@ -2218,10 +2340,11 @@ class JsonParser extends _$jni.JObject { ///@return {@code True} if the parser current points to specified token ///@since 2.6 bool hasToken( - jsontoken_.JsonToken t, + jsontoken_.JsonToken? t, ) { - return _hasToken(reference.pointer, _id_hasToken as _$jni.JMethodIDPtr, - t.reference.pointer) + final _$t = t?.reference ?? _$jni.jNullReference; + return _hasToken( + reference.pointer, _id_hasToken as _$jni.JMethodIDPtr, _$t.pointer) .boolean; } @@ -2428,10 +2551,11 @@ class JsonParser extends _$jni.JObject { /// Will return null if no tokens have been cleared, /// or if parser has been closed. ///@return Last cleared token, if any; {@code null} otherwise - jsontoken_.JsonToken getLastClearedToken() { + jsontoken_.JsonToken? getLastClearedToken() { return _getLastClearedToken( reference.pointer, _id_getLastClearedToken as _$jni.JMethodIDPtr) - .object(const jsontoken_.$JsonToken$Type()); + .object( + const jsontoken_.$JsonToken$NullableType()); } static final _id_overrideCurrentName = _class.instanceMethodId( @@ -2461,12 +2585,11 @@ class JsonParser extends _$jni.JObject { /// resort, as it is a work-around for regular operation. ///@param name Name to use as the current name; may be null. void overrideCurrentName( - _$jni.JString name, + _$jni.JString? name, ) { - _overrideCurrentName( - reference.pointer, - _id_overrideCurrentName as _$jni.JMethodIDPtr, - name.reference.pointer) + final _$name = name?.reference ?? _$jni.jNullReference; + _overrideCurrentName(reference.pointer, + _id_overrideCurrentName as _$jni.JMethodIDPtr, _$name.pointer) .check(); } @@ -2494,10 +2617,10 @@ class JsonParser extends _$jni.JObject { ///@return Name of the current field in the parsing context ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JString getCurrentName() { + _$jni.JString? getCurrentName() { return _getCurrentName( reference.pointer, _id_getCurrentName as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_currentName = _class.instanceMethodId( @@ -2529,10 +2652,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.10 - _$jni.JString currentName() { + _$jni.JString? currentName() { return _currentName( reference.pointer, _id_currentName as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getText = _class.instanceMethodId( @@ -2563,9 +2686,9 @@ class JsonParser extends _$jni.JObject { /// by \#nextToken() or other iteration methods) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JString getText() { + _$jni.JString? getText() { return _getText(reference.pointer, _id_getText as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getText$1 = _class.instanceMethodId( @@ -2602,10 +2725,11 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.8 int getText$1( - _$jni.JObject writer, + _$jni.JObject? writer, ) { + final _$writer = writer?.reference ?? _$jni.jNullReference; return _getText$1(reference.pointer, _id_getText$1 as _$jni.JMethodIDPtr, - writer.reference.pointer) + _$writer.pointer) .integer; } @@ -2656,10 +2780,11 @@ class JsonParser extends _$jni.JObject { /// at offset 0, and not necessarily until the end of buffer) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JArray<_$jni.jchar> getTextCharacters() { + _$jni.JArray<_$jni.jchar>? getTextCharacters() { return _getTextCharacters( reference.pointer, _id_getTextCharacters as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jcharType())); + .object<_$jni.JArray<_$jni.jchar>?>( + const _$jni.JArrayNullableType<_$jni.jchar>(_$jni.jcharType())); } static final _id_getTextLength = _class.instanceMethodId( @@ -2795,10 +2920,10 @@ class JsonParser extends _$jni.JObject { /// the current token is not numeric, or if decoding of the value fails /// (invalid format for numbers); plain IOException if underlying /// content read fails (possible if values are extracted lazily) - _$jni.JNumber getNumberValue() { + _$jni.JNumber? getNumberValue() { return _getNumberValue( reference.pointer, _id_getNumberValue as _$jni.JMethodIDPtr) - .object(const _$jni.JNumberType()); + .object<_$jni.JNumber?>(const _$jni.JNumberNullableType()); } static final _id_getNumberValueExact = _class.instanceMethodId( @@ -2835,10 +2960,10 @@ class JsonParser extends _$jni.JObject { /// (invalid format for numbers); plain IOException if underlying /// content read fails (possible if values are extracted lazily) ///@since 2.12 - _$jni.JNumber getNumberValueExact() { + _$jni.JNumber? getNumberValueExact() { return _getNumberValueExact( reference.pointer, _id_getNumberValueExact as _$jni.JMethodIDPtr) - .object(const _$jni.JNumberType()); + .object<_$jni.JNumber?>(const _$jni.JNumberNullableType()); } static final _id_getNumberType = _class.instanceMethodId( @@ -2868,10 +2993,11 @@ class JsonParser extends _$jni.JObject { ///@return Type of current number, if parser points to numeric token; {@code null} otherwise ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - JsonParser_NumberType getNumberType() { + JsonParser_NumberType? getNumberType() { return _getNumberType( reference.pointer, _id_getNumberType as _$jni.JMethodIDPtr) - .object(const $JsonParser_NumberType$Type()); + .object( + const $JsonParser_NumberType$NullableType()); } static final _id_getByteValue = _class.instanceMethodId( @@ -3071,10 +3197,10 @@ class JsonParser extends _$jni.JObject { /// otherwise exception thrown ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JObject getBigIntegerValue() { + _$jni.JObject? getBigIntegerValue() { return _getBigIntegerValue( reference.pointer, _id_getBigIntegerValue as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getFloatValue = _class.instanceMethodId( @@ -3185,10 +3311,10 @@ class JsonParser extends _$jni.JObject { /// otherwise exception thrown ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JObject getDecimalValue() { + _$jni.JObject? getDecimalValue() { return _getDecimalValue( reference.pointer, _id_getDecimalValue as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getBooleanValue = _class.instanceMethodId( @@ -3261,10 +3387,10 @@ class JsonParser extends _$jni.JObject { /// for the current token, if any; {@code null otherwise} ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JObject getEmbeddedObject() { + _$jni.JObject? getEmbeddedObject() { return _getEmbeddedObject( reference.pointer, _id_getEmbeddedObject as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getBinaryValue = _class.instanceMethodId( @@ -3306,12 +3432,14 @@ class JsonParser extends _$jni.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JArray<_$jni.jbyte> getBinaryValue( - _$jni.JObject bv, + _$jni.JArray<_$jni.jbyte>? getBinaryValue( + _$jni.JObject? bv, ) { + final _$bv = bv?.reference ?? _$jni.jNullReference; return _getBinaryValue(reference.pointer, - _id_getBinaryValue as _$jni.JMethodIDPtr, bv.reference.pointer) - .object(const _$jni.JArrayType(_$jni.jbyteType())); + _id_getBinaryValue as _$jni.JMethodIDPtr, _$bv.pointer) + .object<_$jni.JArray<_$jni.jbyte>?>( + const _$jni.JArrayNullableType<_$jni.jbyte>(_$jni.jbyteType())); } static final _id_getBinaryValue$1 = _class.instanceMethodId( @@ -3340,10 +3468,11 @@ class JsonParser extends _$jni.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JArray<_$jni.jbyte> getBinaryValue$1() { + _$jni.JArray<_$jni.jbyte>? getBinaryValue$1() { return _getBinaryValue$1( reference.pointer, _id_getBinaryValue$1 as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jbyteType())); + .object<_$jni.JArray<_$jni.jbyte>?>( + const _$jni.JArrayNullableType<_$jni.jbyte>(_$jni.jbyteType())); } static final _id_readBinaryValue = _class.instanceMethodId( @@ -3376,10 +3505,11 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.1 int readBinaryValue( - _$jni.JObject out, + _$jni.JObject? out, ) { + final _$out = out?.reference ?? _$jni.jNullReference; return _readBinaryValue(reference.pointer, - _id_readBinaryValue as _$jni.JMethodIDPtr, out.reference.pointer) + _id_readBinaryValue as _$jni.JMethodIDPtr, _$out.pointer) .integer; } @@ -3416,14 +3546,16 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.1 int readBinaryValue$1( - _$jni.JObject bv, - _$jni.JObject out, + _$jni.JObject? bv, + _$jni.JObject? out, ) { + final _$bv = bv?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? _$jni.jNullReference; return _readBinaryValue$1( reference.pointer, _id_readBinaryValue$1 as _$jni.JMethodIDPtr, - bv.reference.pointer, - out.reference.pointer) + _$bv.pointer, + _$out.pointer) .integer; } @@ -3764,10 +3896,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.1 - _$jni.JString getValueAsString() { + _$jni.JString? getValueAsString() { return _getValueAsString( reference.pointer, _id_getValueAsString as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getValueAsString$1 = _class.instanceMethodId( @@ -3801,12 +3933,13 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.1 - _$jni.JString getValueAsString$1( - _$jni.JString def, + _$jni.JString? getValueAsString$1( + _$jni.JString? def, ) { + final _$def = def?.reference ?? _$jni.jNullReference; return _getValueAsString$1(reference.pointer, - _id_getValueAsString$1 as _$jni.JMethodIDPtr, def.reference.pointer) - .object(const _$jni.JStringType()); + _id_getValueAsString$1 as _$jni.JMethodIDPtr, _$def.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_canReadObjectId = _class.instanceMethodId( @@ -3914,10 +4047,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.3 - _$jni.JObject getObjectId() { + _$jni.JObject? getObjectId() { return _getObjectId( reference.pointer, _id_getObjectId as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_getTypeId = _class.instanceMethodId( @@ -3953,9 +4086,9 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.3 - _$jni.JObject getTypeId() { + _$jni.JObject? getTypeId() { return _getTypeId(reference.pointer, _id_getTypeId as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_readValueAs = _class.instanceMethodId( @@ -4002,13 +4135,14 @@ class JsonParser extends _$jni.JObject { ///@return Java value read from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T readValueAs<$T extends _$jni.JObject>( - _$jni.JObject valueType, { + $T? readValueAs<$T extends _$jni.JObject?>( + _$jni.JObject? valueType, { required _$jni.JObjType<$T> T, }) { + final _$valueType = valueType?.reference ?? _$jni.jNullReference; return _readValueAs(reference.pointer, - _id_readValueAs as _$jni.JMethodIDPtr, valueType.reference.pointer) - .object(T); + _id_readValueAs as _$jni.JMethodIDPtr, _$valueType.pointer) + .object<$T?>(T.nullableType); } static final _id_readValueAs$1 = _class.instanceMethodId( @@ -4052,15 +4186,14 @@ class JsonParser extends _$jni.JObject { ///@return Java value read from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T readValueAs$1<$T extends _$jni.JObject>( - _$jni.JObject valueTypeRef, { + $T? readValueAs$1<$T extends _$jni.JObject?>( + _$jni.JObject? valueTypeRef, { required _$jni.JObjType<$T> T, }) { - return _readValueAs$1( - reference.pointer, - _id_readValueAs$1 as _$jni.JMethodIDPtr, - valueTypeRef.reference.pointer) - .object(T); + final _$valueTypeRef = valueTypeRef?.reference ?? _$jni.jNullReference; + return _readValueAs$1(reference.pointer, + _id_readValueAs$1 as _$jni.JMethodIDPtr, _$valueTypeRef.pointer) + .object<$T?>(T.nullableType); } static final _id_readValuesAs = _class.instanceMethodId( @@ -4090,13 +4223,15 @@ class JsonParser extends _$jni.JObject { ///@return Iterator for reading multiple Java values from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - _$jni.JIterator<$T> readValuesAs<$T extends _$jni.JObject>( - _$jni.JObject valueType, { + _$jni.JIterator<$T?>? readValuesAs<$T extends _$jni.JObject?>( + _$jni.JObject? valueType, { required _$jni.JObjType<$T> T, }) { + final _$valueType = valueType?.reference ?? _$jni.jNullReference; return _readValuesAs(reference.pointer, - _id_readValuesAs as _$jni.JMethodIDPtr, valueType.reference.pointer) - .object(_$jni.JIteratorType(T)); + _id_readValuesAs as _$jni.JMethodIDPtr, _$valueType.pointer) + .object<_$jni.JIterator<$T?>?>( + _$jni.JIteratorNullableType<$T?>(T.nullableType)); } static final _id_readValuesAs$1 = _class.instanceMethodId( @@ -4126,15 +4261,15 @@ class JsonParser extends _$jni.JObject { ///@return Iterator for reading multiple Java values from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - _$jni.JIterator<$T> readValuesAs$1<$T extends _$jni.JObject>( - _$jni.JObject valueTypeRef, { + _$jni.JIterator<$T?>? readValuesAs$1<$T extends _$jni.JObject?>( + _$jni.JObject? valueTypeRef, { required _$jni.JObjType<$T> T, }) { - return _readValuesAs$1( - reference.pointer, - _id_readValuesAs$1 as _$jni.JMethodIDPtr, - valueTypeRef.reference.pointer) - .object(_$jni.JIteratorType(T)); + final _$valueTypeRef = valueTypeRef?.reference ?? _$jni.jNullReference; + return _readValuesAs$1(reference.pointer, + _id_readValuesAs$1 as _$jni.JMethodIDPtr, _$valueTypeRef.pointer) + .object<_$jni.JIterator<$T?>?>( + _$jni.JIteratorNullableType<$T?>(T.nullableType)); } static final _id_readValueAsTree = _class.instanceMethodId( @@ -4166,12 +4301,49 @@ class JsonParser extends _$jni.JObject { ///@return root of the document, or null if empty or whitespace. ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T readValueAsTree<$T extends _$jni.JObject>({ + $T? readValueAsTree<$T extends _$jni.JObject?>({ required _$jni.JObjType<$T> T, }) { return _readValueAsTree( reference.pointer, _id_readValueAsTree as _$jni.JMethodIDPtr) - .object(T); + .object<$T?>(T.nullableType); + } +} + +final class $JsonParser$NullableType extends _$jni.JObjType { + @_$jni.internal + const $JsonParser$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/fasterxml/jackson/core/JsonParser;'; + + @_$jni.internal + @_$core.override + JsonParser? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : JsonParser.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonParser$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonParser$NullableType) && + other is $JsonParser$NullableType; } } @@ -4186,11 +4358,17 @@ final class $JsonParser$Type extends _$jni.JObjType { @_$jni.internal @_$core.override JsonParser fromReference(_$jni.JReference reference) => - JsonParser.fromReference(reference); + JsonParser.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $JsonParser$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart index 9a62b8eb7..cc94a7cc7 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart @@ -37,6 +37,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -70,6 +71,7 @@ class JsonToken extends _$jni.JObject { _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonToken'); /// The type which includes information such as the signature of this class. + static const nullableType = $JsonToken$NullableType(); static const type = $JsonToken$Type(); static final _id_values = _class.staticMethodId( r'values', @@ -90,9 +92,11 @@ class JsonToken extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonToken[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { + static _$jni.JArray? values() { return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($JsonToken$Type())); + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType( + $JsonToken$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -113,12 +117,13 @@ class JsonToken extends _$jni.JObject { /// from: `static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonToken valueOf( - _$jni.JString name, + static JsonToken? valueOf( + _$jni.JString? name, ) { + final _$name = name?.reference ?? _$jni.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - name.reference.pointer) - .object(const $JsonToken$Type()); + _$name.pointer) + .object(const $JsonToken$NullableType()); } static final _id_id = _class.instanceMethodId( @@ -162,9 +167,9 @@ class JsonToken extends _$jni.JObject { /// from: `public final java.lang.String asString()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString asString() { + _$jni.JString? asString() { return _asString(reference.pointer, _id_asString as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_asCharArray = _class.instanceMethodId( @@ -186,10 +191,11 @@ class JsonToken extends _$jni.JObject { /// from: `public final char[] asCharArray()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.jchar> asCharArray() { + _$jni.JArray<_$jni.jchar>? asCharArray() { return _asCharArray( reference.pointer, _id_asCharArray as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jcharType())); + .object<_$jni.JArray<_$jni.jchar>?>( + const _$jni.JArrayNullableType<_$jni.jchar>(_$jni.jcharType())); } static final _id_asByteArray = _class.instanceMethodId( @@ -211,10 +217,11 @@ class JsonToken extends _$jni.JObject { /// from: `public final byte[] asByteArray()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.jbyte> asByteArray() { + _$jni.JArray<_$jni.jbyte>? asByteArray() { return _asByteArray( reference.pointer, _id_asByteArray as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jbyteType())); + .object<_$jni.JArray<_$jni.jbyte>?>( + const _$jni.JArrayNullableType<_$jni.jbyte>(_$jni.jbyteType())); } static final _id_isNumeric = _class.instanceMethodId( @@ -365,6 +372,43 @@ class JsonToken extends _$jni.JObject { } } +final class $JsonToken$NullableType extends _$jni.JObjType { + @_$jni.internal + const $JsonToken$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/fasterxml/jackson/core/JsonToken;'; + + @_$jni.internal + @_$core.override + JsonToken? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : JsonToken.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonToken$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonToken$NullableType) && + other is $JsonToken$NullableType; + } +} + final class $JsonToken$Type extends _$jni.JObjType { @_$jni.internal const $JsonToken$Type(); @@ -376,11 +420,17 @@ final class $JsonToken$Type extends _$jni.JObjType { @_$jni.internal @_$core.override JsonToken fromReference(_$jni.JReference reference) => - JsonToken.fromReference(reference); + JsonToken.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $JsonToken$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index 9209bad65..42b7ca029 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -24,6 +24,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -39,7 +40,7 @@ import 'package:jni/_internal.dart' as _$jni; import 'package:jni/jni.dart' as _$jni; /// from: `com.github.dart_lang.jnigen.Measure` -class Measure<$T extends _$jni.JObject> extends _$jni.JObject { +class Measure<$T extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -51,17 +52,25 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { Measure.fromReference( this.T, _$jni.JReference reference, - ) : $type = type(T), + ) : $type = type<$T>(T), super.fromReference(reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Measure'); /// The type which includes information such as the signature of this class. - static $Measure$Type<$T> type<$T extends _$jni.JObject>( + static $Measure$NullableType<$T> nullableType<$T extends _$jni.JObject?>( _$jni.JObjType<$T> T, ) { - return $Measure$Type( + return $Measure$NullableType<$T>( + T, + ); + } + + static $Measure$Type<$T> type<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $Measure$Type<$T>( T, ); } @@ -108,9 +117,9 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { /// from: `public T getUnit()` /// The returned object must be released after use, by calling the [release] method. - $T getUnit() { + $T? getUnit() { return _getUnit(reference.pointer, _id_getUnit as _$jni.JMethodIDPtr) - .object(T); + .object<$T?>(T.nullableType); } static final _id_convertValue = _class.instanceMethodId( @@ -131,17 +140,61 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { /// from: `public final float convertValue(T measureUnit)` double convertValue( - $T measureUnit, + $T? measureUnit, ) { - return _convertValue( - reference.pointer, - _id_convertValue as _$jni.JMethodIDPtr, - measureUnit.reference.pointer) + final _$measureUnit = measureUnit?.reference ?? _$jni.jNullReference; + return _convertValue(reference.pointer, + _id_convertValue as _$jni.JMethodIDPtr, _$measureUnit.pointer) .float; } } -final class $Measure$Type<$T extends _$jni.JObject> +final class $Measure$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $Measure$NullableType( + this.T, + ); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/Measure;'; + + @_$jni.internal + @_$core.override + Measure<$T>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Measure<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($Measure$NullableType, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Measure$NullableType<$T>) && + other is $Measure$NullableType<$T> && + T == other.T; + } +} + +final class $Measure$Type<$T extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -158,11 +211,17 @@ final class $Measure$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override Measure<$T> fromReference(_$jni.JReference reference) => - Measure.fromReference(T, reference); + Measure<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => $Measure$NullableType<$T>(T); @_$jni.internal @_$core.override @@ -195,6 +254,7 @@ class MeasureUnit extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/MeasureUnit'); /// The type which includes information such as the signature of this class. + static const nullableType = $MeasureUnit$NullableType(); static const type = $MeasureUnit$Type(); static final _id_getSign = _class.instanceMethodId( r'getSign', @@ -215,9 +275,9 @@ class MeasureUnit extends _$jni.JObject { /// from: `public abstract java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getSign() { + _$jni.JString? getSign() { return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -276,10 +336,11 @@ class MeasureUnit extends _$jni.JObject { final $a = $i.args; if ($d == r'getSign()Ljava/lang/String;') { final $r = _$impls[$p]!.getSign(); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'getCoefficient()F') { final $r = _$impls[$p]!.getCoefficient(); @@ -329,25 +390,25 @@ class MeasureUnit extends _$jni.JObject { abstract base mixin class $MeasureUnit { factory $MeasureUnit({ - required _$jni.JString Function() getSign, + required _$jni.JString? Function() getSign, required double Function() getCoefficient, }) = _$MeasureUnit; - _$jni.JString getSign(); + _$jni.JString? getSign(); double getCoefficient(); } final class _$MeasureUnit with $MeasureUnit { _$MeasureUnit({ - required _$jni.JString Function() getSign, + required _$jni.JString? Function() getSign, required double Function() getCoefficient, }) : _getSign = getSign, _getCoefficient = getCoefficient; - final _$jni.JString Function() _getSign; + final _$jni.JString? Function() _getSign; final double Function() _getCoefficient; - _$jni.JString getSign() { + _$jni.JString? getSign() { return _getSign(); } @@ -356,6 +417,43 @@ final class _$MeasureUnit with $MeasureUnit { } } +final class $MeasureUnit$NullableType extends _$jni.JObjType { + @_$jni.internal + const $MeasureUnit$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; + + @_$jni.internal + @_$core.override + MeasureUnit? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MeasureUnit.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MeasureUnit$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MeasureUnit$NullableType) && + other is $MeasureUnit$NullableType; + } +} + final class $MeasureUnit$Type extends _$jni.JObjType { @_$jni.internal const $MeasureUnit$Type(); @@ -367,11 +465,17 @@ final class $MeasureUnit$Type extends _$jni.JObjType { @_$jni.internal @_$core.override MeasureUnit fromReference(_$jni.JReference reference) => - MeasureUnit.fromReference(reference); + MeasureUnit.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $MeasureUnit$NullableType(); @_$jni.internal @_$core.override @@ -388,7 +492,7 @@ final class $MeasureUnit$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.Speed` -class Speed extends Measure { +class Speed extends Measure { @_$jni.internal @_$core.override final _$jni.JObjType $type; @@ -397,12 +501,13 @@ class Speed extends Measure { Speed.fromReference( _$jni.JReference reference, ) : $type = type, - super.fromReference(const $SpeedUnit$Type(), reference); + super.fromReference(const $SpeedUnit$NullableType(), reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Speed'); /// The type which includes information such as the signature of this class. + static const nullableType = $Speed$NullableType(); static const type = $Speed$Type(); static final _id_new$ = _class.constructorId( r'(FLcom/github/dart_lang/jnigen/SpeedUnit;)V', @@ -426,10 +531,11 @@ class Speed extends Measure { /// The returned object must be released after use, by calling the [release] method. factory Speed( double f, - SpeedUnit speedUnit, + SpeedUnit? speedUnit, ) { + final _$speedUnit = speedUnit?.reference ?? _$jni.jNullReference; return Speed.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, f, speedUnit.reference.pointer) + _id_new$ as _$jni.JMethodIDPtr, f, _$speedUnit.pointer) .reference); } @@ -475,9 +581,9 @@ class Speed extends Measure { /// from: `public com.github.dart_lang.jnigen.SpeedUnit getUnit()` /// The returned object must be released after use, by calling the [release] method. - SpeedUnit getUnit$1() { + SpeedUnit? getUnit$1() { return _getUnit$1(reference.pointer, _id_getUnit$1 as _$jni.JMethodIDPtr) - .object(const $SpeedUnit$Type()); + .object(const $SpeedUnit$NullableType()); } static final _id_toString$1 = _class.instanceMethodId( @@ -499,9 +605,9 @@ class Speed extends Measure { /// from: `public java.lang.String toString()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString toString$1() { + _$jni.JString? toString$1() { return _toString$1(reference.pointer, _id_toString$1 as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_component1 = _class.instanceMethodId( @@ -546,9 +652,9 @@ class Speed extends Measure { /// from: `public final com.github.dart_lang.jnigen.SpeedUnit component2()` /// The returned object must be released after use, by calling the [release] method. - SpeedUnit component2() { + SpeedUnit? component2() { return _component2(reference.pointer, _id_component2 as _$jni.JMethodIDPtr) - .object(const $SpeedUnit$Type()); + .object(const $SpeedUnit$NullableType()); } static final _id_copy = _class.instanceMethodId( @@ -572,13 +678,14 @@ class Speed extends Measure { /// from: `public final com.github.dart_lang.jnigen.Speed copy(float f, com.github.dart_lang.jnigen.SpeedUnit speedUnit)` /// The returned object must be released after use, by calling the [release] method. - Speed copy( + Speed? copy( double f, - SpeedUnit speedUnit, + SpeedUnit? speedUnit, ) { + final _$speedUnit = speedUnit?.reference ?? _$jni.jNullReference; return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr, f, - speedUnit.reference.pointer) - .object(const $Speed$Type()); + _$speedUnit.pointer) + .object(const $Speed$NullableType()); } static final _id_hashCode$1 = _class.instanceMethodId( @@ -622,14 +729,53 @@ class Speed extends Measure { /// from: `public boolean equals(java.lang.Object object)` bool equals( - _$jni.JObject object, + _$jni.JObject? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _equals(reference.pointer, _id_equals as _$jni.JMethodIDPtr, - object.reference.pointer) + _$object.pointer) .boolean; } } +final class $Speed$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Speed$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/Speed;'; + + @_$jni.internal + @_$core.override + Speed? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Speed.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $Measure$NullableType($SpeedUnit$NullableType()); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => ($Speed$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Speed$NullableType) && + other is $Speed$NullableType; + } +} + final class $Speed$Type extends _$jni.JObjType { @_$jni.internal const $Speed$Type(); @@ -640,12 +786,17 @@ final class $Speed$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - Speed fromReference(_$jni.JReference reference) => - Speed.fromReference(reference); + Speed fromReference(_$jni.JReference reference) => Speed.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $Measure$NullableType($SpeedUnit$NullableType()); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const $Measure$Type($SpeedUnit$Type()); + _$jni.JObjType get nullableType => const $Speed$NullableType(); @_$jni.internal @_$core.override @@ -676,6 +827,7 @@ class SpeedUnit extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/SpeedUnit'); /// The type which includes information such as the signature of this class. + static const nullableType = $SpeedUnit$NullableType(); static const type = $SpeedUnit$Type(); static final _id_KmPerHour = _class.staticFieldId( r'KmPerHour', @@ -684,8 +836,8 @@ class SpeedUnit extends _$jni.JObject { /// from: `static public final com.github.dart_lang.jnigen.SpeedUnit KmPerHour` /// The returned object must be released after use, by calling the [release] method. - static SpeedUnit get KmPerHour => - _id_KmPerHour.get(_class, const $SpeedUnit$Type()); + static SpeedUnit? get KmPerHour => + _id_KmPerHour.get(_class, const $SpeedUnit$NullableType()); static final _id_MetrePerSec = _class.staticFieldId( r'MetrePerSec', @@ -694,8 +846,8 @@ class SpeedUnit extends _$jni.JObject { /// from: `static public final com.github.dart_lang.jnigen.SpeedUnit MetrePerSec` /// The returned object must be released after use, by calling the [release] method. - static SpeedUnit get MetrePerSec => - _id_MetrePerSec.get(_class, const $SpeedUnit$Type()); + static SpeedUnit? get MetrePerSec => + _id_MetrePerSec.get(_class, const $SpeedUnit$NullableType()); static final _id_getSign = _class.instanceMethodId( r'getSign', @@ -716,9 +868,9 @@ class SpeedUnit extends _$jni.JObject { /// from: `public java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getSign() { + _$jni.JString? getSign() { return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -764,9 +916,11 @@ class SpeedUnit extends _$jni.JObject { /// from: `static public com.github.dart_lang.jnigen.SpeedUnit[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { + static _$jni.JArray? values() { return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($SpeedUnit$Type())); + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType( + $SpeedUnit$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -787,12 +941,50 @@ class SpeedUnit extends _$jni.JObject { /// from: `static public com.github.dart_lang.jnigen.SpeedUnit valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static SpeedUnit valueOf( - _$jni.JString string, + static SpeedUnit? valueOf( + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - string.reference.pointer) - .object(const $SpeedUnit$Type()); + _$string.pointer) + .object(const $SpeedUnit$NullableType()); + } +} + +final class $SpeedUnit$NullableType extends _$jni.JObjType { + @_$jni.internal + const $SpeedUnit$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/SpeedUnit;'; + + @_$jni.internal + @_$core.override + SpeedUnit? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : SpeedUnit.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($SpeedUnit$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($SpeedUnit$NullableType) && + other is $SpeedUnit$NullableType; } } @@ -807,11 +999,17 @@ final class $SpeedUnit$Type extends _$jni.JObjType { @_$jni.internal @_$core.override SpeedUnit fromReference(_$jni.JReference reference) => - SpeedUnit.fromReference(reference); + SpeedUnit.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $SpeedUnit$NullableType(); @_$jni.internal @_$core.override @@ -842,6 +1040,7 @@ class SuspendFun extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/SuspendFun'); /// The type which includes information such as the signature of this class. + static const nullableType = $SuspendFun$NullableType(); static const type = $SuspendFun$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -885,20 +1084,23 @@ class SuspendFun extends _$jni.JObject { /// from: `public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString> sayHello() async { + _$core.Future<_$jni.JString?> sayHello() async { final $p = _$jni.ReceivePort(); - final $c = _$jni.JObject.fromReference( - _$jni.ProtectedJniExtensions.newPortContinuation($p)); + final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); + _sayHello(reference.pointer, _id_sayHello as _$jni.JMethodIDPtr, - $c.reference.pointer) - .object(const _$jni.JObjectType()); + _$continuation.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _$continuation.release(); final $o = _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringType().jClass.reference.pointer; - if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k)) { + final $k = const _$jni.JStringNullableType().jClass.reference; + if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { + $k.release(); throw 'Failed'; } - return const _$jni.JStringType().fromReference($o); + $k.release(); + return const _$jni.JStringNullableType().fromReference($o); } static final _id_sayHello$1 = _class.instanceMethodId( @@ -925,22 +1127,62 @@ class SuspendFun extends _$jni.JObject { /// from: `public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString> sayHello$1( - _$jni.JString string, + _$core.Future<_$jni.JString?> sayHello$1( + _$jni.JString? string, ) async { final $p = _$jni.ReceivePort(); - final $c = _$jni.JObject.fromReference( - _$jni.ProtectedJniExtensions.newPortContinuation($p)); + final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); + final _$string = string?.reference ?? _$jni.jNullReference; _sayHello$1(reference.pointer, _id_sayHello$1 as _$jni.JMethodIDPtr, - string.reference.pointer, $c.reference.pointer) - .object(const _$jni.JObjectType()); + _$string.pointer, _$continuation.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _$continuation.release(); final $o = _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringType().jClass.reference.pointer; - if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k)) { + final $k = const _$jni.JStringNullableType().jClass.reference; + if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { + $k.release(); throw 'Failed'; } - return const _$jni.JStringType().fromReference($o); + $k.release(); + return const _$jni.JStringNullableType().fromReference($o); + } +} + +final class $SuspendFun$NullableType extends _$jni.JObjType { + @_$jni.internal + const $SuspendFun$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/SuspendFun;'; + + @_$jni.internal + @_$core.override + SuspendFun? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : SuspendFun.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($SuspendFun$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($SuspendFun$NullableType) && + other is $SuspendFun$NullableType; } } @@ -955,11 +1197,17 @@ final class $SuspendFun$Type extends _$jni.JObjType { @_$jni.internal @_$core.override SuspendFun fromReference(_$jni.JReference reference) => - SuspendFun.fromReference(reference); + SuspendFun.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $SuspendFun$NullableType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart index 6003f7791..1dca0b082 100644 --- a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart @@ -13,11 +13,11 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Suspend functions', () async { await using((arena) async { final suspendFun = SuspendFun()..releasedBy(arena); - final hello = await suspendFun.sayHello(); + final hello = (await suspendFun.sayHello())!; expect(hello.toDartString(releaseOriginal: true), 'Hello!'); const name = 'Bob'; final helloBob = - await suspendFun.sayHello$1(name.toJString()..releasedBy(arena)); + (await suspendFun.sayHello$1(name.toJString()..releasedBy(arena)))!; expect(helloBob.toDartString(releaseOriginal: true), 'Hello $name!'); }); }); diff --git a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart index debd204f9..25783ec6d 100644 --- a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart @@ -24,6 +24,7 @@ // ignore_for_file: prefer_double_quotes // ignore_for_file: unintended_html_in_doc_comment // ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion // ignore_for_file: unnecessary_parenthesis // ignore_for_file: unused_element // ignore_for_file: unused_field @@ -54,7 +55,63 @@ class Color extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/simple_package/Color'); /// The type which includes information such as the signature of this class. + static const nullableType = $Color$NullableType(); static const type = $Color$Type(); + static final _id_RED = _class.staticFieldId( + r'RED', + r'Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.simple_package.Color RED` + /// The returned object must be released after use, by calling the [release] method. + static Color? get RED => _id_RED.get(_class, const $Color$NullableType()); + + static final _id_BLUE = _class.staticFieldId( + r'BLUE', + r'Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.simple_package.Color BLUE` + /// The returned object must be released after use, by calling the [release] method. + static Color? get BLUE => _id_BLUE.get(_class, const $Color$NullableType()); + + static final _id_BLACK = _class.staticFieldId( + r'BLACK', + r'Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.simple_package.Color BLACK` + /// The returned object must be released after use, by calling the [release] method. + static Color? get BLACK => _id_BLACK.get(_class, const $Color$NullableType()); + + static final _id_GREEN = _class.staticFieldId( + r'GREEN', + r'Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.simple_package.Color GREEN` + /// The returned object must be released after use, by calling the [release] method. + static Color? get GREEN => _id_GREEN.get(_class, const $Color$NullableType()); + + static final _id_YELLOW = _class.staticFieldId( + r'YELLOW', + r'Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.simple_package.Color YELLOW` + /// The returned object must be released after use, by calling the [release] method. + static Color? get YELLOW => + _id_YELLOW.get(_class, const $Color$NullableType()); + + static final _id_LIME = _class.staticFieldId( + r'LIME', + r'Lcom/github/dart_lang/jnigen/simple_package/Color;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.simple_package.Color LIME` + /// The returned object must be released after use, by calling the [release] method. + static Color? get LIME => _id_LIME.get(_class, const $Color$NullableType()); + static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/github/dart_lang/jnigen/simple_package/Color;', @@ -74,9 +131,10 @@ class Color extends _$jni.JObject { /// from: `static public com.github.dart_lang.jnigen.simple_package.Color[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { + static _$jni.JArray? values() { return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($Color$Type())); + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType($Color$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -95,14 +153,52 @@ class Color extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name)` + /// from: `static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static Color valueOf( - _$jni.JString name, + static Color? valueOf( + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - name.reference.pointer) - .object(const $Color$Type()); + _$string.pointer) + .object(const $Color$NullableType()); + } +} + +final class $Color$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Color$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Color;'; + + @_$jni.internal + @_$core.override + Color? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Color.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Color$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Color$NullableType) && + other is $Color$NullableType; } } @@ -116,12 +212,16 @@ final class $Color$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - Color fromReference(_$jni.JReference reference) => - Color.fromReference(reference); + Color fromReference(_$jni.JReference reference) => Color.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $Color$NullableType(); @_$jni.internal @_$core.override @@ -152,6 +252,7 @@ class Example_Nested_NestedTwice extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice'); /// The type which includes information such as the signature of this class. + static const nullableType = $Example_Nested_NestedTwice$NullableType(); static const type = $Example_Nested_NestedTwice$Type(); static final _id_ZERO = _class.staticFieldId( r'ZERO', @@ -190,6 +291,46 @@ class Example_Nested_NestedTwice extends _$jni.JObject { } } +final class $Example_Nested_NestedTwice$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $Example_Nested_NestedTwice$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;'; + + @_$jni.internal + @_$core.override + Example_Nested_NestedTwice? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : Example_Nested_NestedTwice.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Example_Nested_NestedTwice$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Example_Nested_NestedTwice$NullableType) && + other is $Example_Nested_NestedTwice$NullableType; + } +} + final class $Example_Nested_NestedTwice$Type extends _$jni.JObjType { @_$jni.internal @@ -203,11 +344,17 @@ final class $Example_Nested_NestedTwice$Type @_$jni.internal @_$core.override Example_Nested_NestedTwice fromReference(_$jni.JReference reference) => - Example_Nested_NestedTwice.fromReference(reference); + Example_Nested_NestedTwice.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Example_Nested_NestedTwice$NullableType(); @_$jni.internal @_$core.override @@ -239,6 +386,7 @@ class Example_Nested extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Example$Nested'); /// The type which includes information such as the signature of this class. + static const nullableType = $Example_Nested$NullableType(); static const type = $Example_Nested$Type(); static final _id_new$ = _class.constructorId( r'(Z)V', @@ -254,13 +402,13 @@ class Example_Nested extends _$jni.JObject { _$jni.JniResult Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `public void (boolean value)` + /// from: `public void (boolean z)` /// The returned object must be released after use, by calling the [release] method. factory Example_Nested( - bool value, + bool z, ) { - return Example_Nested.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, value ? 1 : 0) + return Example_Nested.fromReference(_new$( + _class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, z ? 1 : 0) .reference); } @@ -326,16 +474,54 @@ class Example_Nested extends _$jni.JObject { _$jni.JThrowablePtr Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `public void setValue(boolean value)` + /// from: `public void setValue(boolean z)` void setValue( - bool value, + bool z, ) { - _setValue(reference.pointer, _id_setValue as _$jni.JMethodIDPtr, - value ? 1 : 0) + _setValue(reference.pointer, _id_setValue as _$jni.JMethodIDPtr, z ? 1 : 0) .check(); } } +final class $Example_Nested$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $Example_Nested$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;'; + + @_$jni.internal + @_$core.override + Example_Nested? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Example_Nested.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Example_Nested$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Example_Nested$NullableType) && + other is $Example_Nested$NullableType; + } +} + final class $Example_Nested$Type extends _$jni.JObjType { @_$jni.internal const $Example_Nested$Type(); @@ -348,11 +534,17 @@ final class $Example_Nested$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Example_Nested fromReference(_$jni.JReference reference) => - Example_Nested.fromReference(reference); + Example_Nested.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Example_Nested$NullableType(); @_$jni.internal @_$core.override @@ -384,6 +576,7 @@ class Example_NonStaticNested extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested'); /// The type which includes information such as the signature of this class. + static const nullableType = $Example_NonStaticNested$NullableType(); static const type = $Example_NonStaticNested$Type(); static final _id_ok = _class.instanceFieldId( r'ok', @@ -411,17 +604,58 @@ class Example_NonStaticNested extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (com.github.dart_lang.jnigen.simple_package.Example $parent)` + /// from: `public void (com.github.dart_lang.jnigen.simple_package.Example $outerClass)` /// The returned object must be released after use, by calling the [release] method. factory Example_NonStaticNested( - Example $parent, + Example $outerClass, ) { + final _$$outerClass = $outerClass.reference; return Example_NonStaticNested.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, $parent.reference.pointer) + _id_new$ as _$jni.JMethodIDPtr, _$$outerClass.pointer) .reference); } } +final class $Example_NonStaticNested$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $Example_NonStaticNested$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;'; + + @_$jni.internal + @_$core.override + Example_NonStaticNested? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : Example_NonStaticNested.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Example_NonStaticNested$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Example_NonStaticNested$NullableType) && + other is $Example_NonStaticNested$NullableType; + } +} + final class $Example_NonStaticNested$Type extends _$jni.JObjType { @_$jni.internal @@ -435,11 +669,17 @@ final class $Example_NonStaticNested$Type @_$jni.internal @_$core.override Example_NonStaticNested fromReference(_$jni.JReference reference) => - Example_NonStaticNested.fromReference(reference); + Example_NonStaticNested.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Example_NonStaticNested$NullableType(); @_$jni.internal @_$core.override @@ -471,6 +711,7 @@ class Example extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Example'); /// The type which includes information such as the signature of this class. + static const nullableType = $Example$NullableType(); static const type = $Example$Type(); /// from: `static public final int ON` @@ -491,8 +732,8 @@ class Example extends _$jni.JObject { /// from: `static public final java.lang.String SEMICOLON_STRING` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get SEMICOLON_STRING => - _id_SEMICOLON_STRING.get(_class, const _$jni.JStringType()); + static _$jni.JString? get SEMICOLON_STRING => + _id_SEMICOLON_STRING.get(_class, const _$jni.JStringNullableType()); static final _id_unusedRandom = _class.staticFieldId( r'unusedRandom', @@ -501,8 +742,8 @@ class Example extends _$jni.JObject { /// from: `static public final java.util.Random unusedRandom` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject get unusedRandom => - _id_unusedRandom.get(_class, const _$jni.JObjectType()); + static _$jni.JObject? get unusedRandom => + _id_unusedRandom.get(_class, const _$jni.JObjectNullableType()); static final _id_getAmount = _class.staticMethodId( r'getAmount', @@ -594,9 +835,9 @@ class Example extends _$jni.JObject { /// from: `static public java.lang.String getName()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString getName() { + static _$jni.JString? getName() { return _getName(_class.reference.pointer, _id_getName as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_getNestedInstance = _class.staticMethodId( @@ -616,12 +857,12 @@ class Example extends _$jni.JObject { _$jni.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.simple_package.Example.Nested getNestedInstance()` + /// from: `static public com.github.dart_lang.jnigen.simple_package.Example$Nested getNestedInstance()` /// The returned object must be released after use, by calling the [release] method. - static Example_Nested getNestedInstance() { + static Example_Nested? getNestedInstance() { return _getNestedInstance(_class.reference.pointer, _id_getNestedInstance as _$jni.JMethodIDPtr) - .object(const $Example_Nested$Type()); + .object(const $Example_Nested$NullableType()); } static final _id_setAmount = _class.staticMethodId( @@ -638,12 +879,11 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `static public void setAmount(int newAmount)` + /// from: `static public void setAmount(int i)` static void setAmount( - int newAmount, + int i, ) { - _setAmount(_class.reference.pointer, _id_setAmount as _$jni.JMethodIDPtr, - newAmount) + _setAmount(_class.reference.pointer, _id_setAmount as _$jni.JMethodIDPtr, i) .check(); } @@ -663,12 +903,13 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public void setName(java.lang.String newName)` + /// from: `static public void setName(java.lang.String string)` static void setName( - _$jni.JString newName, + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; _setName(_class.reference.pointer, _id_setName as _$jni.JMethodIDPtr, - newName.reference.pointer) + _$string.pointer) .check(); } @@ -688,14 +929,13 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public void setNestedInstance(com.github.dart_lang.jnigen.simple_package.Example.Nested newNested)` + /// from: `static public void setNestedInstance(com.github.dart_lang.jnigen.simple_package.Example$Nested nested)` static void setNestedInstance( - Example_Nested newNested, + Example_Nested? nested, ) { - _setNestedInstance( - _class.reference.pointer, - _id_setNestedInstance as _$jni.JMethodIDPtr, - newNested.reference.pointer) + final _$nested = nested?.reference ?? _$jni.jNullReference; + _setNestedInstance(_class.reference.pointer, + _id_setNestedInstance as _$jni.JMethodIDPtr, _$nested.pointer) .check(); } @@ -720,15 +960,15 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, int)>(); - /// from: `static public int max4(int a, int b, int c, int d)` + /// from: `static public int max4(int i, int i1, int i2, int i3)` static int max4( - int a, - int b, - int c, - int d, + int i, + int i1, + int i2, + int i3, ) { - return _max4(_class.reference.pointer, _id_max4 as _$jni.JMethodIDPtr, a, b, - c, d) + return _max4(_class.reference.pointer, _id_max4 as _$jni.JMethodIDPtr, i, + i1, i2, i3) .integer; } @@ -757,19 +997,19 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); - /// from: `static public int max8(int a, int b, int c, int d, int e, int f, int g, int h)` + /// from: `static public int max8(int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7)` static int max8( - int a, - int b, - int c, - int d, - int e, - int f, - int g, - int h, + int i, + int i1, + int i2, + int i3, + int i4, + int i5, + int i6, + int i7, ) { - return _max8(_class.reference.pointer, _id_max8 as _$jni.JMethodIDPtr, a, b, - c, d, e, f, g, h) + return _max8(_class.reference.pointer, _id_max8 as _$jni.JMethodIDPtr, i, + i1, i2, i3, i4, i5, i6, i7) .integer; } @@ -811,11 +1051,11 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `public void setNumber(int number)` + /// from: `public void setNumber(int i)` void setNumber( - int number, + int i, ) { - _setNumber(reference.pointer, _id_setNumber as _$jni.JMethodIDPtr, number) + _setNumber(reference.pointer, _id_setNumber as _$jni.JMethodIDPtr, i) .check(); } @@ -857,11 +1097,11 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `public void setUp(boolean isUp)` + /// from: `public void setUp(boolean z)` void setUp( - bool isUp, + bool z, ) { - _setUp(reference.pointer, _id_setUp as _$jni.JMethodIDPtr, isUp ? 1 : 0) + _setUp(reference.pointer, _id_setUp as _$jni.JMethodIDPtr, z ? 1 : 0) .check(); } @@ -884,10 +1124,10 @@ class Example extends _$jni.JObject { /// from: `public java.lang.String getCodename()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getCodename() { + _$jni.JString? getCodename() { return _getCodename( reference.pointer, _id_getCodename as _$jni.JMethodIDPtr) - .object(const _$jni.JStringType()); + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_setCodename = _class.instanceMethodId( @@ -906,12 +1146,13 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void setCodename(java.lang.String codename)` + /// from: `public void setCodename(java.lang.String string)` void setCodename( - _$jni.JString codename, + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; _setCodename(reference.pointer, _id_setCodename as _$jni.JMethodIDPtr, - codename.reference.pointer) + _$string.pointer) .check(); } @@ -934,9 +1175,9 @@ class Example extends _$jni.JObject { /// from: `public java.util.Random getRandom()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject getRandom() { + _$jni.JObject? getRandom() { return _getRandom(reference.pointer, _id_getRandom as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_setRandom = _class.instanceMethodId( @@ -957,10 +1198,11 @@ class Example extends _$jni.JObject { /// from: `public void setRandom(java.util.Random random)` void setRandom( - _$jni.JObject random, + _$jni.JObject? random, ) { + final _$random = random?.reference ?? _$jni.jNullReference; _setRandom(reference.pointer, _id_setRandom as _$jni.JMethodIDPtr, - random.reference.pointer) + _$random.pointer) .check(); } @@ -1009,15 +1251,15 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, int)>(); - /// from: `public long add4Longs(long a, long b, long c, long d)` + /// from: `public long add4Longs(long j, long j1, long j2, long j3)` int add4Longs( - int a, - int b, - int c, - int d, + int j, + int j1, + int j2, + int j3, ) { - return _add4Longs( - reference.pointer, _id_add4Longs as _$jni.JMethodIDPtr, a, b, c, d) + return _add4Longs(reference.pointer, _id_add4Longs as _$jni.JMethodIDPtr, j, + j1, j2, j3) .long; } @@ -1046,19 +1288,19 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); - /// from: `public long add8Longs(long a, long b, long c, long d, long e, long f, long g, long h)` + /// from: `public long add8Longs(long j, long j1, long j2, long j3, long j4, long j5, long j6, long j7)` int add8Longs( - int a, - int b, - int c, - int d, - int e, - int f, - int g, - int h, + int j, + int j1, + int j2, + int j3, + int j4, + int j5, + int j6, + int j7, ) { - return _add8Longs(reference.pointer, _id_add8Longs as _$jni.JMethodIDPtr, a, - b, c, d, e, f, g, h) + return _add8Longs(reference.pointer, _id_add8Longs as _$jni.JMethodIDPtr, j, + j1, j2, j3, j4, j5, j6, j7) .long; } @@ -1080,14 +1322,13 @@ class Example extends _$jni.JObject { /// from: `public java.lang.String getRandomNumericString(java.util.Random random)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getRandomNumericString( - _$jni.JObject random, + _$jni.JString? getRandomNumericString( + _$jni.JObject? random, ) { - return _getRandomNumericString( - reference.pointer, - _id_getRandomNumericString as _$jni.JMethodIDPtr, - random.reference.pointer) - .object(const _$jni.JStringType()); + final _$random = random?.reference ?? _$jni.jNullReference; + return _getRandomNumericString(reference.pointer, + _id_getRandomNumericString as _$jni.JMethodIDPtr, _$random.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_finalMethod = _class.instanceMethodId( @@ -1130,11 +1371,13 @@ class Example extends _$jni.JObject { _$jni.JMethodIDPtr, )>(); - /// from: `public java.util.List getList()` + /// from: `public java.util.List getList()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString> getList() { + _$jni.JList<_$jni.JString?>? getList() { return _getList(reference.pointer, _id_getList as _$jni.JMethodIDPtr) - .object(const _$jni.JListType(_$jni.JStringType())); + .object<_$jni.JList<_$jni.JString?>?>( + const _$jni.JListNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); } static final _id_joinStrings = _class.instanceMethodId( @@ -1159,20 +1402,20 @@ class Example extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public java.lang.String joinStrings(java.util.List values, java.lang.String delim)` + /// from: `public java.lang.String joinStrings(java.util.List list, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - /// - /// Joins the strings in the list using the given delimiter. - _$jni.JString joinStrings( - _$jni.JList<_$jni.JString> values, - _$jni.JString delim, + _$jni.JString? joinStrings( + _$jni.JList<_$jni.JString?>? list, + _$jni.JString? string, ) { + final _$list = list?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; return _joinStrings( reference.pointer, _id_joinStrings as _$jni.JMethodIDPtr, - values.reference.pointer, - delim.reference.pointer) - .object(const _$jni.JStringType()); + _$list.pointer, + _$string.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_methodWithSeveralParams = _class.instanceMethodId( @@ -1205,29 +1448,30 @@ class Example extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void methodWithSeveralParams(char ch, java.lang.String s, int[] a, T t, java.util.List lt, java.util.Map wm)` - void methodWithSeveralParams<$T extends _$jni.JObject>( - int ch, - _$jni.JString s, - _$jni.JArray<_$jni.jint> a, - $T t, - _$jni.JList<$T> lt, - _$jni.JMap<_$jni.JString, _$jni.JObject> wm, { - _$jni.JObjType<$T>? T, + /// from: `public void methodWithSeveralParams(char c, java.lang.String string, java.lang.Object[] is, T charSequence, java.util.List list, java.util.Map map)` + void methodWithSeveralParams<$T extends _$jni.JObject?>( + int c, + _$jni.JString? string, + _$jni.JArray<_$jni.jint>? is$, + $T? charSequence, + _$jni.JList<$T?>? list, + _$jni.JMap<_$jni.JString?, _$jni.JObject?>? map, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - (lt.$type as _$jni.JListType<_$core.dynamic>).E, - t.$type, - ]) as _$jni.JObjType<$T>; + final _$string = string?.reference ?? _$jni.jNullReference; + final _$is$ = is$?.reference ?? _$jni.jNullReference; + final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? _$jni.jNullReference; + final _$map = map?.reference ?? _$jni.jNullReference; _methodWithSeveralParams( reference.pointer, _id_methodWithSeveralParams as _$jni.JMethodIDPtr, - ch, - s.reference.pointer, - a.reference.pointer, - t.reference.pointer, - lt.reference.pointer, - wm.reference.pointer) + c, + _$string.pointer, + _$is$.pointer, + _$charSequence.pointer, + _$list.pointer, + _$map.pointer) .check(); } @@ -1269,14 +1513,14 @@ class Example extends _$jni.JObject { _$jni.JniResult Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `public void (int number)` + /// from: `public void (int i)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$1( - int number, + int i, ) { - return Example.fromReference(_new$1( - _class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, number) - .reference); + return Example.fromReference( + _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, i) + .reference); } static final _id_new$2 = _class.constructorId( @@ -1294,14 +1538,14 @@ class Example extends _$jni.JObject { _$jni.JniResult Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); - /// from: `public void (int number, boolean isUp)` + /// from: `public void (int i, boolean z)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$2( - int number, - bool isUp, + int i, + bool z, ) { return Example.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, number, isUp ? 1 : 0) + _id_new$2 as _$jni.JMethodIDPtr, i, z ? 1 : 0) .reference); } @@ -1324,19 +1568,16 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (int number, boolean isUp, java.lang.String codename)` + /// from: `public void (int i, boolean z, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$3( - int number, - bool isUp, - _$jni.JString codename, + int i, + bool z, + _$jni.JString? string, ) { - return Example.fromReference(_new$3( - _class.reference.pointer, - _id_new$3 as _$jni.JMethodIDPtr, - number, - isUp ? 1 : 0, - codename.reference.pointer) + final _$string = string?.reference ?? _$jni.jNullReference; + return Example.fromReference(_new$3(_class.reference.pointer, + _id_new$3 as _$jni.JMethodIDPtr, i, z ? 1 : 0, _$string.pointer) .reference); } @@ -1364,20 +1605,20 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); - /// from: `public void (int a, int b, int c, int d, int e, int f, int g, int h)` + /// from: `public void (int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$4( - int a, - int b, - int c, - int d, - int e, - int f, - int g, - int h, + int i, + int i1, + int i2, + int i3, + int i4, + int i5, + int i6, + int i7, ) { return Example.fromReference(_new$4(_class.reference.pointer, - _id_new$4 as _$jni.JMethodIDPtr, a, b, c, d, e, f, g, h) + _id_new$4 as _$jni.JMethodIDPtr, i, i1, i2, i3, i4, i5, i6, i7) .reference); } @@ -1421,13 +1662,13 @@ class Example extends _$jni.JObject { _$jni.JniResult Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); - /// from: `static public int addInts(int a, int b)` + /// from: `static public int addInts(int i, int i1)` static int addInts( - int a, - int b, + int i, + int i1, ) { return _addInts( - _class.reference.pointer, _id_addInts as _$jni.JMethodIDPtr, a, b) + _class.reference.pointer, _id_addInts as _$jni.JMethodIDPtr, i, i1) .integer; } @@ -1450,9 +1691,10 @@ class Example extends _$jni.JObject { /// from: `static public int[] getArr()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.jint> getArr() { + static _$jni.JArray<_$jni.jint>? getArr() { return _getArr(_class.reference.pointer, _id_getArr as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jintType())); + .object<_$jni.JArray<_$jni.jint>?>( + const _$jni.JArrayNullableType<_$jni.jint>(_$jni.jintType())); } static final _id_addAll = _class.staticMethodId( @@ -1471,12 +1713,13 @@ class Example extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public int addAll(int[] arr)` + /// from: `static public int addAll(int[] is)` static int addAll( - _$jni.JArray<_$jni.jint> arr, + _$jni.JArray<_$jni.jint>? is$, ) { + final _$is$ = is$?.reference ?? _$jni.jNullReference; return _addAll(_class.reference.pointer, _id_addAll as _$jni.JMethodIDPtr, - arr.reference.pointer) + _$is$.pointer) .integer; } @@ -1499,9 +1742,9 @@ class Example extends _$jni.JObject { /// from: `public com.github.dart_lang.jnigen.simple_package.Example getSelf()` /// The returned object must be released after use, by calling the [release] method. - Example getSelf() { + Example? getSelf() { return _getSelf(reference.pointer, _id_getSelf as _$jni.JMethodIDPtr) - .object(const $Example$Type()); + .object(const $Example$NullableType()); } static final _id_throwException = _class.staticMethodId( @@ -1568,13 +1811,14 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void overloaded(int a, java.lang.String b)` + /// from: `public void overloaded(int i, java.lang.String string)` void overloaded$1( - int a, - _$jni.JString b, + int i, + _$jni.JString? string, ) { - _overloaded$1(reference.pointer, _id_overloaded$1 as _$jni.JMethodIDPtr, a, - b.reference.pointer) + final _$string = string?.reference ?? _$jni.jNullReference; + _overloaded$1(reference.pointer, _id_overloaded$1 as _$jni.JMethodIDPtr, i, + _$string.pointer) .check(); } @@ -1593,11 +1837,11 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); - /// from: `public void overloaded(int a)` + /// from: `public void overloaded(int i)` void overloaded$2( - int a, + int i, ) { - _overloaded$2(reference.pointer, _id_overloaded$2 as _$jni.JMethodIDPtr, a) + _overloaded$2(reference.pointer, _id_overloaded$2 as _$jni.JMethodIDPtr, i) .check(); } @@ -1623,13 +1867,15 @@ class Example extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void overloaded(java.util.List a, java.lang.String b)` + /// from: `public void overloaded(java.util.List list, java.lang.String string)` void overloaded$3( - _$jni.JList<_$jni.JInteger> a, - _$jni.JString b, + _$jni.JList<_$jni.JInteger?>? list, + _$jni.JString? string, ) { + final _$list = list?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; _overloaded$3(reference.pointer, _id_overloaded$3 as _$jni.JMethodIDPtr, - a.reference.pointer, b.reference.pointer) + _$list.pointer, _$string.pointer) .check(); } @@ -1649,16 +1895,55 @@ class Example extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void overloaded(java.util.List a)` + /// from: `public void overloaded(java.util.List list)` void overloaded$4( - _$jni.JList<_$jni.JInteger> a, + _$jni.JList<_$jni.JInteger?>? list, ) { + final _$list = list?.reference ?? _$jni.jNullReference; _overloaded$4(reference.pointer, _id_overloaded$4 as _$jni.JMethodIDPtr, - a.reference.pointer) + _$list.pointer) .check(); } } +final class $Example$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Example$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Example;'; + + @_$jni.internal + @_$core.override + Example? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Example.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Example$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Example$NullableType) && + other is $Example$NullableType; + } +} + final class $Example$Type extends _$jni.JObjType { @_$jni.internal const $Example$Type(); @@ -1670,12 +1955,16 @@ final class $Example$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - Example fromReference(_$jni.JReference reference) => - Example.fromReference(reference); + Example fromReference(_$jni.JReference reference) => Example.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $Example$NullableType(); @_$jni.internal @_$core.override @@ -1706,6 +1995,7 @@ class Exceptions extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Exceptions'); /// The type which includes information such as the signature of this class. + static const nullableType = $Exceptions$NullableType(); static const type = $Exceptions$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -1745,13 +2035,13 @@ class Exceptions extends _$jni.JObject { _$jni.JniResult Function( _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); - /// from: `public void (float x)` + /// from: `public void (float f)` /// The returned object must be released after use, by calling the [release] method. factory Exceptions.new$1( - double x, + double f, ) { return Exceptions.fromReference( - _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, x) + _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, f) .reference); } @@ -1777,18 +2067,18 @@ class Exceptions extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, int, int, int)>(); - /// from: `public void (int a, int b, int c, int d, int e, int f)` + /// from: `public void (int i, int i1, int i2, int i3, int i4, int i5)` /// The returned object must be released after use, by calling the [release] method. factory Exceptions.new$2( - int a, - int b, - int c, - int d, - int e, - int f, + int i, + int i1, + int i2, + int i3, + int i4, + int i5, ) { return Exceptions.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, a, b, c, d, e, f) + _id_new$2 as _$jni.JMethodIDPtr, i, i1, i2, i3, i4, i5) .reference); } @@ -1811,10 +2101,10 @@ class Exceptions extends _$jni.JObject { /// from: `static public java.lang.Object staticObjectMethod()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject staticObjectMethod() { + static _$jni.JObject? staticObjectMethod() { return _staticObjectMethod(_class.reference.pointer, _id_staticObjectMethod as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_staticIntMethod = _class.staticMethodId( @@ -1860,10 +2150,12 @@ class Exceptions extends _$jni.JObject { /// from: `static public java.lang.Object[] staticObjectArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JObject> staticObjectArrayMethod() { + static _$jni.JArray<_$jni.JObject?>? staticObjectArrayMethod() { return _staticObjectArrayMethod(_class.reference.pointer, _id_staticObjectArrayMethod as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.JObjectType())); + .object<_$jni.JArray<_$jni.JObject?>?>( + const _$jni.JArrayNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_staticIntArrayMethod = _class.staticMethodId( @@ -1885,10 +2177,11 @@ class Exceptions extends _$jni.JObject { /// from: `static public int[] staticIntArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.jint> staticIntArrayMethod() { + static _$jni.JArray<_$jni.jint>? staticIntArrayMethod() { return _staticIntArrayMethod(_class.reference.pointer, _id_staticIntArrayMethod as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jintType())); + .object<_$jni.JArray<_$jni.jint>?>( + const _$jni.JArrayNullableType<_$jni.jint>(_$jni.jintType())); } static final _id_objectMethod = _class.instanceMethodId( @@ -1910,10 +2203,10 @@ class Exceptions extends _$jni.JObject { /// from: `public java.lang.Object objectMethod()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject objectMethod() { + _$jni.JObject? objectMethod() { return _objectMethod( reference.pointer, _id_objectMethod as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_intMethod = _class.instanceMethodId( @@ -1958,10 +2251,12 @@ class Exceptions extends _$jni.JObject { /// from: `public java.lang.Object[] objectArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JObject> objectArrayMethod() { + _$jni.JArray<_$jni.JObject?>? objectArrayMethod() { return _objectArrayMethod( reference.pointer, _id_objectArrayMethod as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.JObjectType())); + .object<_$jni.JArray<_$jni.JObject?>?>( + const _$jni.JArrayNullableType<_$jni.JObject?>( + _$jni.JObjectNullableType())); } static final _id_intArrayMethod = _class.instanceMethodId( @@ -1983,10 +2278,11 @@ class Exceptions extends _$jni.JObject { /// from: `public int[] intArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.jint> intArrayMethod() { + _$jni.JArray<_$jni.jint>? intArrayMethod() { return _intArrayMethod( reference.pointer, _id_intArrayMethod as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType(_$jni.jintType())); + .object<_$jni.JArray<_$jni.jint>?>( + const _$jni.JArrayNullableType<_$jni.jint>(_$jni.jintType())); } static final _id_throwNullPointerException = _class.instanceMethodId( @@ -2033,10 +2329,10 @@ class Exceptions extends _$jni.JObject { /// from: `public java.io.InputStream throwFileNotFoundException()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject throwFileNotFoundException() { + _$jni.JObject? throwFileNotFoundException() { return _throwFileNotFoundException(reference.pointer, _id_throwFileNotFoundException as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_throwClassCastException = _class.instanceMethodId( @@ -2058,10 +2354,10 @@ class Exceptions extends _$jni.JObject { /// from: `public java.io.FileInputStream throwClassCastException()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject throwClassCastException() { + _$jni.JObject? throwClassCastException() { return _throwClassCastException(reference.pointer, _id_throwClassCastException as _$jni.JMethodIDPtr) - .object(const _$jni.JObjectType()); + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } static final _id_throwArrayIndexException = _class.instanceMethodId( @@ -2137,6 +2433,44 @@ class Exceptions extends _$jni.JObject { } } +final class $Exceptions$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Exceptions$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Exceptions;'; + + @_$jni.internal + @_$core.override + Exceptions? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Exceptions.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Exceptions$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Exceptions$NullableType) && + other is $Exceptions$NullableType; + } +} + final class $Exceptions$Type extends _$jni.JObjType { @_$jni.internal const $Exceptions$Type(); @@ -2149,11 +2483,17 @@ final class $Exceptions$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Exceptions fromReference(_$jni.JReference reference) => - Exceptions.fromReference(reference); + Exceptions.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Exceptions$NullableType(); @_$jni.internal @_$core.override @@ -2184,6 +2524,7 @@ class Fields_Nested extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Fields$Nested'); /// The type which includes information such as the signature of this class. + static const nullableType = $Fields_Nested$NullableType(); static const type = $Fields_Nested$Type(); static final _id_hundred = _class.instanceFieldId( r'hundred', @@ -2204,13 +2545,13 @@ class Fields_Nested extends _$jni.JObject { /// from: `static public java.lang.String BEST_GOD` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get BEST_GOD => - _id_BEST_GOD.get(_class, const _$jni.JStringType()); + static _$jni.JString? get BEST_GOD => + _id_BEST_GOD.get(_class, const _$jni.JStringNullableType()); /// from: `static public java.lang.String BEST_GOD` /// The returned object must be released after use, by calling the [release] method. - static set BEST_GOD(_$jni.JString value) => - _id_BEST_GOD.set(_class, const _$jni.JStringType(), value); + static set BEST_GOD(_$jni.JString? value) => + _id_BEST_GOD.set(_class, const _$jni.JStringNullableType(), value); static final _id_new$ = _class.constructorId( r'()V', @@ -2237,6 +2578,44 @@ class Fields_Nested extends _$jni.JObject { } } +final class $Fields_Nested$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Fields_Nested$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;'; + + @_$jni.internal + @_$core.override + Fields_Nested? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Fields_Nested.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Fields_Nested$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Fields_Nested$NullableType) && + other is $Fields_Nested$NullableType; + } +} + final class $Fields_Nested$Type extends _$jni.JObjType { @_$jni.internal const $Fields_Nested$Type(); @@ -2249,11 +2628,17 @@ final class $Fields_Nested$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Fields_Nested fromReference(_$jni.JReference reference) => - Fields_Nested.fromReference(reference); + Fields_Nested.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Fields_Nested$NullableType(); @_$jni.internal @_$core.override @@ -2285,6 +2670,7 @@ class Fields extends _$jni.JObject { r'com/github/dart_lang/jnigen/simple_package/Fields'); /// The type which includes information such as the signature of this class. + static const nullableType = $Fields$NullableType(); static const type = $Fields$Type(); static final _id_amount = _class.staticFieldId( r'amount', @@ -2329,13 +2715,13 @@ class Fields extends _$jni.JObject { /// from: `static public java.lang.String name` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString get name => - _id_name.get(_class, const _$jni.JStringType()); + static _$jni.JString? get name => + _id_name.get(_class, const _$jni.JStringNullableType()); /// from: `static public java.lang.String name` /// The returned object must be released after use, by calling the [release] method. - static set name(_$jni.JString value) => - _id_name.set(_class, const _$jni.JStringType(), value); + static set name(_$jni.JString? value) => + _id_name.set(_class, const _$jni.JStringNullableType(), value); static final _id_i = _class.instanceFieldId( r'i', @@ -2344,12 +2730,12 @@ class Fields extends _$jni.JObject { /// from: `public java.lang.Integer i` /// The returned object must be released after use, by calling the [release] method. - _$jni.JInteger get i => _id_i.get(this, const _$jni.JIntegerType()); + _$jni.JInteger? get i => _id_i.get(this, const _$jni.JIntegerNullableType()); /// from: `public java.lang.Integer i` /// The returned object must be released after use, by calling the [release] method. - set i(_$jni.JInteger value) => - _id_i.set(this, const _$jni.JIntegerType(), value); + set i(_$jni.JInteger? value) => + _id_i.set(this, const _$jni.JIntegerNullableType(), value); static final _id_trillion = _class.instanceFieldId( r'trillion', @@ -2383,13 +2769,13 @@ class Fields extends _$jni.JObject { /// from: `public java.lang.String bestFighterInGreece` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString get bestFighterInGreece => - _id_bestFighterInGreece.get(this, const _$jni.JStringType()); + _$jni.JString? get bestFighterInGreece => + _id_bestFighterInGreece.get(this, const _$jni.JStringNullableType()); /// from: `public java.lang.String bestFighterInGreece` /// The returned object must be released after use, by calling the [release] method. - set bestFighterInGreece(_$jni.JString value) => - _id_bestFighterInGreece.set(this, const _$jni.JStringType(), value); + set bestFighterInGreece(_$jni.JString? value) => _id_bestFighterInGreece.set( + this, const _$jni.JStringNullableType(), value); static final _id_random = _class.instanceFieldId( r'random', @@ -2398,12 +2784,13 @@ class Fields extends _$jni.JObject { /// from: `public java.util.Random random` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject get random => _id_random.get(this, const _$jni.JObjectType()); + _$jni.JObject? get random => + _id_random.get(this, const _$jni.JObjectNullableType()); /// from: `public java.util.Random random` /// The returned object must be released after use, by calling the [release] method. - set random(_$jni.JObject value) => - _id_random.set(this, const _$jni.JObjectType(), value); + set random(_$jni.JObject? value) => + _id_random.set(this, const _$jni.JObjectNullableType(), value); static final _id_euroSymbol = _class.staticFieldId( r'euroSymbol', @@ -2443,9 +2830,9 @@ class Fields extends _$jni.JObject { } } -final class $Fields$Type extends _$jni.JObjType { +final class $Fields$NullableType extends _$jni.JObjType { @_$jni.internal - const $Fields$Type(); + const $Fields$NullableType(); @_$jni.internal @_$core.override @@ -2454,34 +2841,76 @@ final class $Fields$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - Fields fromReference(_$jni.JReference reference) => - Fields.fromReference(reference); + Fields? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Fields.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => this; @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => ($Fields$Type).hashCode; + int get hashCode => ($Fields$NullableType).hashCode; @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($Fields$Type) && other is $Fields$Type; + return other.runtimeType == ($Fields$NullableType) && + other is $Fields$NullableType; } } -/// from: `com.github.dart_lang.jnigen.pkg2.C2` -class C2 extends _$jni.JObject { +final class $Fields$Type extends _$jni.JObjType { @_$jni.internal - @_$core.override - final _$jni.JObjType $type; + const $Fields$Type(); @_$jni.internal - C2.fromReference( + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/simple_package/Fields;'; + + @_$jni.internal + @_$core.override + Fields fromReference(_$jni.JReference reference) => Fields.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => const $Fields$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Fields$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Fields$Type) && other is $Fields$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.pkg2.C2` +class C2 extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + C2.fromReference( _$jni.JReference reference, ) : $type = type, super.fromReference(reference); @@ -2490,6 +2919,7 @@ class C2 extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/C2'); /// The type which includes information such as the signature of this class. + static const nullableType = $C2$NullableType(); static const type = $C2$Type(); static final _id_CONSTANT = _class.staticFieldId( r'CONSTANT', @@ -2528,6 +2958,42 @@ class C2 extends _$jni.JObject { } } +final class $C2$NullableType extends _$jni.JObjType { + @_$jni.internal + const $C2$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/C2;'; + + @_$jni.internal + @_$core.override + C2? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : C2.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($C2$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($C2$NullableType) && other is $C2$NullableType; + } +} + final class $C2$Type extends _$jni.JObjType { @_$jni.internal const $C2$Type(); @@ -2538,11 +3004,16 @@ final class $C2$Type extends _$jni.JObjType { @_$jni.internal @_$core.override - C2 fromReference(_$jni.JReference reference) => C2.fromReference(reference); + C2 fromReference(_$jni.JReference reference) => C2.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $C2$NullableType(); @_$jni.internal @_$core.override @@ -2573,6 +3044,7 @@ class Example$1 extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/Example'); /// The type which includes information such as the signature of this class. + static const nullableType = $Example$1$NullableType(); static const type = $Example$1$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -2623,6 +3095,43 @@ class Example$1 extends _$jni.JObject { } } +final class $Example$1$NullableType extends _$jni.JObjType { + @_$jni.internal + const $Example$1$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/Example;'; + + @_$jni.internal + @_$core.override + Example$1? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Example$1.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Example$1$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Example$1$NullableType) && + other is $Example$1$NullableType; + } +} + final class $Example$1$Type extends _$jni.JObjType { @_$jni.internal const $Example$1$Type(); @@ -2634,11 +3143,17 @@ final class $Example$1$Type extends _$jni.JObjType { @_$jni.internal @_$core.override Example$1 fromReference(_$jni.JReference reference) => - Example$1.fromReference(reference); + Example$1.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $Example$1$NullableType(); @_$jni.internal @_$core.override @@ -2654,7 +3169,7 @@ final class $Example$1$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.generics.GenericTypeParams` -class GenericTypeParams<$S extends _$jni.JObject, $K extends _$jni.JObject> +class GenericTypeParams<$S extends _$jni.JObject?, $K extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override @@ -2671,19 +3186,30 @@ class GenericTypeParams<$S extends _$jni.JObject, $K extends _$jni.JObject> this.S, this.K, _$jni.JReference reference, - ) : $type = type(S, K), + ) : $type = type<$S, $K>(S, K), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/GenericTypeParams'); /// The type which includes information such as the signature of this class. + static $GenericTypeParams$NullableType<$S, $K> + nullableType<$S extends _$jni.JObject?, $K extends _$jni.JObject?>( + _$jni.JObjType<$S> S, + _$jni.JObjType<$K> K, + ) { + return $GenericTypeParams$NullableType<$S, $K>( + S, + K, + ); + } + static $GenericTypeParams$Type<$S, $K> - type<$S extends _$jni.JObject, $K extends _$jni.JObject>( + type<$S extends _$jni.JObject?, $K extends _$jni.JObject?>( _$jni.JObjType<$S> S, _$jni.JObjType<$K> K, ) { - return $GenericTypeParams$Type( + return $GenericTypeParams$Type<$S, $K>( S, K, ); @@ -2711,7 +3237,7 @@ class GenericTypeParams<$S extends _$jni.JObject, $K extends _$jni.JObject> required _$jni.JObjType<$S> S, required _$jni.JObjType<$K> K, }) { - return GenericTypeParams.fromReference( + return GenericTypeParams<$S, $K>.fromReference( S, K, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) @@ -2719,8 +3245,62 @@ class GenericTypeParams<$S extends _$jni.JObject, $K extends _$jni.JObject> } } -final class $GenericTypeParams$Type<$S extends _$jni.JObject, - $K extends _$jni.JObject> +final class $GenericTypeParams$NullableType<$S extends _$jni.JObject?, + $K extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + const $GenericTypeParams$NullableType( + this.S, + this.K, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;'; + + @_$jni.internal + @_$core.override + GenericTypeParams<$S, $K>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : GenericTypeParams<$S, $K>.fromReference( + S, + K, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($GenericTypeParams$NullableType, S, K); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GenericTypeParams$NullableType<$S, $K>) && + other is $GenericTypeParams$NullableType<$S, $K> && + S == other.S && + K == other.K; + } +} + +final class $GenericTypeParams$Type<$S extends _$jni.JObject?, + $K extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$S> S; @@ -2742,11 +3322,19 @@ final class $GenericTypeParams$Type<$S extends _$jni.JObject, @_$jni.internal @_$core.override GenericTypeParams<$S, $K> fromReference(_$jni.JReference reference) => - GenericTypeParams.fromReference(S, K, reference); + GenericTypeParams<$S, $K>.fromReference( + S, + K, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $GenericTypeParams$NullableType<$S, $K>(S, K); @_$jni.internal @_$core.override @@ -2765,8 +3353,10 @@ final class $GenericTypeParams$Type<$S extends _$jni.JObject, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child` -class GrandParent_Parent_Child<$T extends _$jni.JObject, - $S extends _$jni.JObject, $U extends _$jni.JObject> extends _$jni.JObject { +class GrandParent_Parent_Child< + $T extends _$jni.JObject?, + $S extends _$jni.JObject?, + $U extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -2786,22 +3376,37 @@ class GrandParent_Parent_Child<$T extends _$jni.JObject, this.S, this.U, _$jni.JReference reference, - ) : $type = type(T, S, U), + ) : $type = type<$T, $S, $U>(T, S, U), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child'); /// The type which includes information such as the signature of this class. + static $GrandParent_Parent_Child$NullableType<$T, $S, $U> nullableType< + $T extends _$jni.JObject?, + $S extends _$jni.JObject?, + $U extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$S> S, + _$jni.JObjType<$U> U, + ) { + return $GrandParent_Parent_Child$NullableType<$T, $S, $U>( + T, + S, + U, + ); + } + static $GrandParent_Parent_Child$Type<$T, $S, $U> type< - $T extends _$jni.JObject, - $S extends _$jni.JObject, - $U extends _$jni.JObject>( + $T extends _$jni.JObject?, + $S extends _$jni.JObject?, + $U extends _$jni.JObject?>( _$jni.JObjType<$T> T, _$jni.JObjType<$S> S, _$jni.JObjType<$U> U, ) { - return $GrandParent_Parent_Child$Type( + return $GrandParent_Parent_Child$Type<$T, $S, $U>( T, S, U, @@ -2815,11 +3420,12 @@ class GrandParent_Parent_Child<$T extends _$jni.JObject, /// from: `public T grandParentValue` /// The returned object must be released after use, by calling the [release] method. - $T get grandParentValue => _id_grandParentValue.get(this, T); + $T? get grandParentValue => _id_grandParentValue.get(this, T.nullableType); /// from: `public T grandParentValue` /// The returned object must be released after use, by calling the [release] method. - set grandParentValue($T value) => _id_grandParentValue.set(this, T, value); + set grandParentValue($T? value) => + _id_grandParentValue.set(this, T.nullableType, value); static final _id_parentValue = _class.instanceFieldId( r'parentValue', @@ -2828,11 +3434,12 @@ class GrandParent_Parent_Child<$T extends _$jni.JObject, /// from: `public S parentValue` /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => _id_parentValue.get(this, S); + $S? get parentValue => _id_parentValue.get(this, S.nullableType); /// from: `public S parentValue` /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => _id_parentValue.set(this, S, value); + set parentValue($S? value) => + _id_parentValue.set(this, S.nullableType, value); static final _id_value = _class.instanceFieldId( r'value', @@ -2841,11 +3448,11 @@ class GrandParent_Parent_Child<$T extends _$jni.JObject, /// from: `public U value` /// The returned object must be released after use, by calling the [release] method. - $U get value => _id_value.get(this, U); + $U? get value => _id_value.get(this, U.nullableType); /// from: `public U value` /// The returned object must be released after use, by calling the [release] method. - set value($U value) => _id_value.set(this, U, value); + set value($U? value) => _id_value.set(this, U.nullableType, value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V', @@ -2868,40 +3475,103 @@ class GrandParent_Parent_Child<$T extends _$jni.JObject, _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $parent, U newValue)` + /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $outerClass, U object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent_Child( - GrandParent_Parent<$T, $S> $parent, - $U newValue, { + GrandParent_Parent<$T?, $S?> $outerClass, + $U? object, { _$jni.JObjType<$T>? T, _$jni.JObjType<$S>? S, - _$jni.JObjType<$U>? U, + required _$jni.JObjType<$U> U, }) { T ??= _$jni.lowestCommonSuperType([ - ($parent.$type + ($outerClass.$type as $GrandParent_Parent$Type<_$core.dynamic, _$core.dynamic>) .T, ]) as _$jni.JObjType<$T>; S ??= _$jni.lowestCommonSuperType([ - ($parent.$type + ($outerClass.$type as $GrandParent_Parent$Type<_$core.dynamic, _$core.dynamic>) .S, ]) as _$jni.JObjType<$S>; - U ??= _$jni.lowestCommonSuperType([ - newValue.$type, - ]) as _$jni.JObjType<$U>; - return GrandParent_Parent_Child.fromReference( + final _$$outerClass = $outerClass.reference; + final _$object = object?.reference ?? _$jni.jNullReference; + return GrandParent_Parent_Child<$T, $S, $U>.fromReference( T, S, U, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, - $parent.reference.pointer, newValue.reference.pointer) + _$$outerClass.pointer, _$object.pointer) .reference); } } -final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject, - $S extends _$jni.JObject, $U extends _$jni.JObject> +final class $GrandParent_Parent_Child$NullableType<$T extends _$jni.JObject?, + $S extends _$jni.JObject?, $U extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + const $GrandParent_Parent_Child$NullableType( + this.T, + this.S, + this.U, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;'; + + @_$jni.internal + @_$core.override + GrandParent_Parent_Child<$T, $S, $U>? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : GrandParent_Parent_Child<$T, $S, $U>.fromReference( + T, + S, + U, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => + this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + Object.hash($GrandParent_Parent_Child$NullableType, T, S, U); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($GrandParent_Parent_Child$NullableType<$T, $S, $U>) && + other is $GrandParent_Parent_Child$NullableType<$T, $S, $U> && + T == other.T && + S == other.S && + U == other.U; + } +} + +final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject?, + $S extends _$jni.JObject?, $U extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -2928,11 +3598,20 @@ final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject, @_$core.override GrandParent_Parent_Child<$T, $S, $U> fromReference( _$jni.JReference reference) => - GrandParent_Parent_Child.fromReference(T, S, U, reference); + GrandParent_Parent_Child<$T, $S, $U>.fromReference( + T, + S, + U, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $GrandParent_Parent_Child$NullableType<$T, $S, $U>(T, S, U); @_$jni.internal @_$core.override @@ -2952,7 +3631,7 @@ final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent` -class GrandParent_Parent<$T extends _$jni.JObject, $S extends _$jni.JObject> +class GrandParent_Parent<$T extends _$jni.JObject?, $S extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override @@ -2969,19 +3648,30 @@ class GrandParent_Parent<$T extends _$jni.JObject, $S extends _$jni.JObject> this.T, this.S, _$jni.JReference reference, - ) : $type = type(T, S), + ) : $type = type<$T, $S>(T, S), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$Parent'); /// The type which includes information such as the signature of this class. + static $GrandParent_Parent$NullableType<$T, $S> + nullableType<$T extends _$jni.JObject?, $S extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$S> S, + ) { + return $GrandParent_Parent$NullableType<$T, $S>( + T, + S, + ); + } + static $GrandParent_Parent$Type<$T, $S> - type<$T extends _$jni.JObject, $S extends _$jni.JObject>( + type<$T extends _$jni.JObject?, $S extends _$jni.JObject?>( _$jni.JObjType<$T> T, _$jni.JObjType<$S> S, ) { - return $GrandParent_Parent$Type( + return $GrandParent_Parent$Type<$T, $S>( T, S, ); @@ -2994,11 +3684,12 @@ class GrandParent_Parent<$T extends _$jni.JObject, $S extends _$jni.JObject> /// from: `public T parentValue` /// The returned object must be released after use, by calling the [release] method. - $T get parentValue => _id_parentValue.get(this, T); + $T? get parentValue => _id_parentValue.get(this, T.nullableType); /// from: `public T parentValue` /// The returned object must be released after use, by calling the [release] method. - set parentValue($T value) => _id_parentValue.set(this, T, value); + set parentValue($T? value) => + _id_parentValue.set(this, T.nullableType, value); static final _id_value = _class.instanceFieldId( r'value', @@ -3007,11 +3698,11 @@ class GrandParent_Parent<$T extends _$jni.JObject, $S extends _$jni.JObject> /// from: `public S value` /// The returned object must be released after use, by calling the [release] method. - $S get value => _id_value.get(this, S); + $S? get value => _id_value.get(this, S.nullableType); /// from: `public S value` /// The returned object must be released after use, by calling the [release] method. - set value($S value) => _id_value.set(this, S, value); + set value($S? value) => _id_value.set(this, S.nullableType, value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V', @@ -3034,31 +3725,84 @@ class GrandParent_Parent<$T extends _$jni.JObject, $S extends _$jni.JObject> _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue)` + /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $outerClass, S object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent( - GrandParent<$T> $parent, - $S newValue, { + GrandParent<$T?> $outerClass, + $S? object, { _$jni.JObjType<$T>? T, - _$jni.JObjType<$S>? S, + required _$jni.JObjType<$S> S, }) { T ??= _$jni.lowestCommonSuperType([ - ($parent.$type as $GrandParent$Type<_$core.dynamic>).T, + ($outerClass.$type as $GrandParent$Type<_$core.dynamic>).T, ]) as _$jni.JObjType<$T>; - S ??= _$jni.lowestCommonSuperType([ - newValue.$type, - ]) as _$jni.JObjType<$S>; - return GrandParent_Parent.fromReference( + final _$$outerClass = $outerClass.reference; + final _$object = object?.reference ?? _$jni.jNullReference; + return GrandParent_Parent<$T, $S>.fromReference( T, S, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, - $parent.reference.pointer, newValue.reference.pointer) + _$$outerClass.pointer, _$object.pointer) .reference); } } -final class $GrandParent_Parent$Type<$T extends _$jni.JObject, - $S extends _$jni.JObject> +final class $GrandParent_Parent$NullableType<$T extends _$jni.JObject?, + $S extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + const $GrandParent_Parent$NullableType( + this.T, + this.S, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;'; + + @_$jni.internal + @_$core.override + GrandParent_Parent<$T, $S>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : GrandParent_Parent<$T, $S>.fromReference( + T, + S, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($GrandParent_Parent$NullableType, T, S); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GrandParent_Parent$NullableType<$T, $S>) && + other is $GrandParent_Parent$NullableType<$T, $S> && + T == other.T && + S == other.S; + } +} + +final class $GrandParent_Parent$Type<$T extends _$jni.JObject?, + $S extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -3080,11 +3824,19 @@ final class $GrandParent_Parent$Type<$T extends _$jni.JObject, @_$jni.internal @_$core.override GrandParent_Parent<$T, $S> fromReference(_$jni.JReference reference) => - GrandParent_Parent.fromReference(T, S, reference); + GrandParent_Parent<$T, $S>.fromReference( + T, + S, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $GrandParent_Parent$NullableType<$T, $S>(T, S); @_$jni.internal @_$core.override @@ -3103,8 +3855,8 @@ final class $GrandParent_Parent$Type<$T extends _$jni.JObject, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child` -class GrandParent_StaticParent_Child<$S extends _$jni.JObject, - $U extends _$jni.JObject> extends _$jni.JObject { +class GrandParent_StaticParent_Child<$S extends _$jni.JObject?, + $U extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -3120,36 +3872,48 @@ class GrandParent_StaticParent_Child<$S extends _$jni.JObject, this.S, this.U, _$jni.JReference reference, - ) : $type = type(S, U), + ) : $type = type<$S, $U>(S, U), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child'); /// The type which includes information such as the signature of this class. - static $GrandParent_StaticParent_Child$Type<$S, $U> - type<$S extends _$jni.JObject, $U extends _$jni.JObject>( + static $GrandParent_StaticParent_Child$NullableType<$S, $U> + nullableType<$S extends _$jni.JObject?, $U extends _$jni.JObject?>( _$jni.JObjType<$S> S, _$jni.JObjType<$U> U, ) { - return $GrandParent_StaticParent_Child$Type( + return $GrandParent_StaticParent_Child$NullableType<$S, $U>( S, U, ); } - static final _id_parentValue = _class.instanceFieldId( - r'parentValue', + static $GrandParent_StaticParent_Child$Type<$S, $U> + type<$S extends _$jni.JObject?, $U extends _$jni.JObject?>( + _$jni.JObjType<$S> S, + _$jni.JObjType<$U> U, + ) { + return $GrandParent_StaticParent_Child$Type<$S, $U>( + S, + U, + ); + } + + static final _id_parentValue = _class.instanceFieldId( + r'parentValue', r'Ljava/lang/Object;', ); /// from: `public S parentValue` /// The returned object must be released after use, by calling the [release] method. - $S get parentValue => _id_parentValue.get(this, S); + $S? get parentValue => _id_parentValue.get(this, S.nullableType); /// from: `public S parentValue` /// The returned object must be released after use, by calling the [release] method. - set parentValue($S value) => _id_parentValue.set(this, S, value); + set parentValue($S? value) => + _id_parentValue.set(this, S.nullableType, value); static final _id_value = _class.instanceFieldId( r'value', @@ -3158,11 +3922,11 @@ class GrandParent_StaticParent_Child<$S extends _$jni.JObject, /// from: `public U value` /// The returned object must be released after use, by calling the [release] method. - $U get value => _id_value.get(this, U); + $U? get value => _id_value.get(this, U.nullableType); /// from: `public U value` /// The returned object must be released after use, by calling the [release] method. - set value($U value) => _id_value.set(this, U, value); + set value($U? value) => _id_value.set(this, U.nullableType, value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V', @@ -3187,37 +3951,90 @@ class GrandParent_StaticParent_Child<$S extends _$jni.JObject, _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $parent, S parentValue, U value)` + /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $outerClass, S object, U object1)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent_Child( - GrandParent_StaticParent<$S> $parent, - $S parentValue, - $U value, { + GrandParent_StaticParent<$S?> $outerClass, + $S? object, + $U? object1, { _$jni.JObjType<$S>? S, - _$jni.JObjType<$U>? U, + required _$jni.JObjType<$U> U, }) { S ??= _$jni.lowestCommonSuperType([ - parentValue.$type, - ($parent.$type as $GrandParent_StaticParent$Type<_$core.dynamic>).S, + ($outerClass.$type as $GrandParent_StaticParent$Type<_$core.dynamic>).S, ]) as _$jni.JObjType<$S>; - U ??= _$jni.lowestCommonSuperType([ - value.$type, - ]) as _$jni.JObjType<$U>; - return GrandParent_StaticParent_Child.fromReference( + final _$$outerClass = $outerClass.reference; + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; + return GrandParent_StaticParent_Child<$S, $U>.fromReference( S, U, - _new$( - _class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, - $parent.reference.pointer, - parentValue.reference.pointer, - value.reference.pointer) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _$$outerClass.pointer, _$object.pointer, _$object1.pointer) .reference); } } -final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject, - $U extends _$jni.JObject> +final class $GrandParent_StaticParent_Child$NullableType< + $S extends _$jni.JObject?, $U extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + const $GrandParent_StaticParent_Child$NullableType( + this.S, + this.U, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;'; + + @_$jni.internal + @_$core.override + GrandParent_StaticParent_Child<$S, $U>? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : GrandParent_StaticParent_Child<$S, $U>.fromReference( + S, + U, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => + this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + Object.hash($GrandParent_StaticParent_Child$NullableType, S, U); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($GrandParent_StaticParent_Child$NullableType<$S, $U>) && + other is $GrandParent_StaticParent_Child$NullableType<$S, $U> && + S == other.S && + U == other.U; + } +} + +final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject?, + $U extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$S> S; @@ -3240,11 +4057,19 @@ final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject, @_$core.override GrandParent_StaticParent_Child<$S, $U> fromReference( _$jni.JReference reference) => - GrandParent_StaticParent_Child.fromReference(S, U, reference); + GrandParent_StaticParent_Child<$S, $U>.fromReference( + S, + U, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $GrandParent_StaticParent_Child$NullableType<$S, $U>(S, U); @_$jni.internal @_$core.override @@ -3264,7 +4089,8 @@ final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent` -class GrandParent_StaticParent<$S extends _$jni.JObject> extends _$jni.JObject { +class GrandParent_StaticParent<$S extends _$jni.JObject?> + extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -3276,17 +4102,26 @@ class GrandParent_StaticParent<$S extends _$jni.JObject> extends _$jni.JObject { GrandParent_StaticParent.fromReference( this.S, _$jni.JReference reference, - ) : $type = type(S), + ) : $type = type<$S>(S), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent'); /// The type which includes information such as the signature of this class. - static $GrandParent_StaticParent$Type<$S> type<$S extends _$jni.JObject>( + static $GrandParent_StaticParent$NullableType<$S> + nullableType<$S extends _$jni.JObject?>( + _$jni.JObjType<$S> S, + ) { + return $GrandParent_StaticParent$NullableType<$S>( + S, + ); + } + + static $GrandParent_StaticParent$Type<$S> type<$S extends _$jni.JObject?>( _$jni.JObjType<$S> S, ) { - return $GrandParent_StaticParent$Type( + return $GrandParent_StaticParent$Type<$S>( S, ); } @@ -3298,11 +4133,11 @@ class GrandParent_StaticParent<$S extends _$jni.JObject> extends _$jni.JObject { /// from: `public S value` /// The returned object must be released after use, by calling the [release] method. - $S get value => _id_value.get(this, S); + $S? get value => _id_value.get(this, S.nullableType); /// from: `public S value` /// The returned object must be released after use, by calling the [release] method. - set value($S value) => _id_value.set(this, S, value); + set value($S? value) => _id_value.set(this, S.nullableType, value); static final _id_new$ = _class.constructorId( r'(Ljava/lang/Object;)V', @@ -3319,24 +4154,69 @@ class GrandParent_StaticParent<$S extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (S value)` + /// from: `public void (S object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent( - $S value, { - _$jni.JObjType<$S>? S, + $S? object, { + required _$jni.JObjType<$S> S, }) { - S ??= _$jni.lowestCommonSuperType([ - value.$type, - ]) as _$jni.JObjType<$S>; - return GrandParent_StaticParent.fromReference( + final _$object = object?.reference ?? _$jni.jNullReference; + return GrandParent_StaticParent<$S>.fromReference( S, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, - value.reference.pointer) + _$object.pointer) .reference); } } -final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject> +final class $GrandParent_StaticParent$NullableType<$S extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$S> S; + + @_$jni.internal + const $GrandParent_StaticParent$NullableType( + this.S, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;'; + + @_$jni.internal + @_$core.override + GrandParent_StaticParent<$S>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : GrandParent_StaticParent<$S>.fromReference( + S, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($GrandParent_StaticParent$NullableType, S); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GrandParent_StaticParent$NullableType<$S>) && + other is $GrandParent_StaticParent$NullableType<$S> && + S == other.S; + } +} + +final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$S> S; @@ -3354,11 +4234,18 @@ final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject> @_$jni.internal @_$core.override GrandParent_StaticParent<$S> fromReference(_$jni.JReference reference) => - GrandParent_StaticParent.fromReference(S, reference); + GrandParent_StaticParent<$S>.fromReference( + S, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $GrandParent_StaticParent$NullableType<$S>(S); @_$jni.internal @_$core.override @@ -3376,7 +4263,7 @@ final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.generics.GrandParent` -class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { +class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -3388,17 +4275,25 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { GrandParent.fromReference( this.T, _$jni.JReference reference, - ) : $type = type(T), + ) : $type = type<$T>(T), super.fromReference(reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/GrandParent'); /// The type which includes information such as the signature of this class. - static $GrandParent$Type<$T> type<$T extends _$jni.JObject>( + static $GrandParent$NullableType<$T> nullableType<$T extends _$jni.JObject?>( _$jni.JObjType<$T> T, ) { - return $GrandParent$Type( + return $GrandParent$NullableType<$T>( + T, + ); + } + + static $GrandParent$Type<$T> type<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $GrandParent$Type<$T>( T, ); } @@ -3410,11 +4305,11 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { /// from: `public T value` /// The returned object must be released after use, by calling the [release] method. - $T get value => _id_value.get(this, T); + $T? get value => _id_value.get(this, T.nullableType); /// from: `public T value` /// The returned object must be released after use, by calling the [release] method. - set value($T value) => _id_value.set(this, T, value); + set value($T? value) => _id_value.set(this, T.nullableType, value); static final _id_new$ = _class.constructorId( r'(Ljava/lang/Object;)V', @@ -3431,19 +4326,17 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (T value)` + /// from: `public void (T object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent( - $T value, { - _$jni.JObjType<$T>? T, + $T? object, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - value.$type, - ]) as _$jni.JObjType<$T>; - return GrandParent.fromReference( + final _$object = object?.reference ?? _$jni.jNullReference; + return GrandParent<$T>.fromReference( T, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, - value.reference.pointer) + _$object.pointer) .reference); } @@ -3464,13 +4357,14 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent<_$jni.JObject, _$jni.JString> stringParent() { + GrandParent_Parent<$T?, _$jni.JString?>? stringParent() { return _stringParent( reference.pointer, _id_stringParent as _$jni.JMethodIDPtr) - .object(const $GrandParent_Parent$Type( - _$jni.JObjectType(), _$jni.JStringType())); + .object?>( + $GrandParent_Parent$NullableType<$T?, _$jni.JString?>( + T.nullableType, const _$jni.JStringNullableType())); } static final _id_varParent = _class.instanceMethodId( @@ -3489,18 +4383,18 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S nestedValue)` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S object)` /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent<_$jni.JObject, $S> varParent<$S extends _$jni.JObject>( - $S nestedValue, { - _$jni.JObjType<$S>? S, + GrandParent_Parent<$T?, $S?>? varParent<$S extends _$jni.JObject?>( + $S? object, { + required _$jni.JObjType<$S> S, }) { - S ??= _$jni.lowestCommonSuperType([ - nestedValue.$type, - ]) as _$jni.JObjType<$S>; + final _$object = object?.reference ?? _$jni.jNullReference; return _varParent(reference.pointer, _id_varParent as _$jni.JMethodIDPtr, - nestedValue.reference.pointer) - .object($GrandParent_Parent$Type(const _$jni.JObjectType(), S)); + _$object.pointer) + .object?>( + $GrandParent_Parent$NullableType<$T?, $S?>( + T.nullableType, S.nullableType)); } static final _id_stringStaticParent = _class.staticMethodId( @@ -3520,12 +4414,14 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent stringStaticParent()` + /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent stringStaticParent()` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent<_$jni.JString> stringStaticParent() { + static GrandParent_StaticParent<_$jni.JString?>? stringStaticParent() { return _stringStaticParent(_class.reference.pointer, _id_stringStaticParent as _$jni.JMethodIDPtr) - .object(const $GrandParent_StaticParent$Type(_$jni.JStringType())); + .object?>( + const $GrandParent_StaticParent$NullableType<_$jni.JString?>( + _$jni.JStringNullableType())); } static final _id_varStaticParent = _class.staticMethodId( @@ -3544,18 +4440,18 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent varStaticParent(S value)` + /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent varStaticParent(S object)` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent<$S> varStaticParent<$S extends _$jni.JObject>( - $S value, { - _$jni.JObjType<$S>? S, + static GrandParent_StaticParent<$S?>? + varStaticParent<$S extends _$jni.JObject?>( + $S? object, { + required _$jni.JObjType<$S> S, }) { - S ??= _$jni.lowestCommonSuperType([ - value.$type, - ]) as _$jni.JObjType<$S>; + final _$object = object?.reference ?? _$jni.jNullReference; return _varStaticParent(_class.reference.pointer, - _id_varStaticParent as _$jni.JMethodIDPtr, value.reference.pointer) - .object($GrandParent_StaticParent$Type(S)); + _id_varStaticParent as _$jni.JMethodIDPtr, _$object.pointer) + .object?>( + $GrandParent_StaticParent$NullableType<$S?>(S.nullableType)); } static final _id_staticParentWithSameType = _class.instanceMethodId( @@ -3575,16 +4471,62 @@ class GrandParent<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent staticParentWithSameType()` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent staticParentWithSameType()` /// The returned object must be released after use, by calling the [release] method. - GrandParent_StaticParent<$T> staticParentWithSameType() { + GrandParent_StaticParent<$T?>? staticParentWithSameType() { return _staticParentWithSameType(reference.pointer, _id_staticParentWithSameType as _$jni.JMethodIDPtr) - .object($GrandParent_StaticParent$Type(T)); + .object?>( + $GrandParent_StaticParent$NullableType<$T?>(T.nullableType)); + } +} + +final class $GrandParent$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $GrandParent$NullableType( + this.T, + ); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent;'; + + @_$jni.internal + @_$core.override + GrandParent<$T>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : GrandParent<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($GrandParent$NullableType, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GrandParent$NullableType<$T>) && + other is $GrandParent$NullableType<$T> && + T == other.T; } } -final class $GrandParent$Type<$T extends _$jni.JObject> +final class $GrandParent$Type<$T extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -3601,11 +4543,18 @@ final class $GrandParent$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override GrandParent<$T> fromReference(_$jni.JReference reference) => - GrandParent.fromReference(T, reference); + GrandParent<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $GrandParent$NullableType<$T>(T); @_$jni.internal @_$core.override @@ -3623,7 +4572,7 @@ final class $GrandParent$Type<$T extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.generics.MyMap$MyEntry` -class MyMap_MyEntry<$K extends _$jni.JObject, $V extends _$jni.JObject> +class MyMap_MyEntry<$K extends _$jni.JObject?, $V extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override @@ -3640,19 +4589,30 @@ class MyMap_MyEntry<$K extends _$jni.JObject, $V extends _$jni.JObject> this.K, this.V, _$jni.JReference reference, - ) : $type = type(K, V), + ) : $type = type<$K, $V>(K, V), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/MyMap$MyEntry'); /// The type which includes information such as the signature of this class. + static $MyMap_MyEntry$NullableType<$K, $V> + nullableType<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( + _$jni.JObjType<$K> K, + _$jni.JObjType<$V> V, + ) { + return $MyMap_MyEntry$NullableType<$K, $V>( + K, + V, + ); + } + static $MyMap_MyEntry$Type<$K, $V> - type<$K extends _$jni.JObject, $V extends _$jni.JObject>( + type<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( _$jni.JObjType<$K> K, _$jni.JObjType<$V> V, ) { - return $MyMap_MyEntry$Type( + return $MyMap_MyEntry$Type<$K, $V>( K, V, ); @@ -3665,11 +4625,11 @@ class MyMap_MyEntry<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public K key` /// The returned object must be released after use, by calling the [release] method. - $K get key => _id_key.get(this, K); + $K? get key => _id_key.get(this, K.nullableType); /// from: `public K key` /// The returned object must be released after use, by calling the [release] method. - set key($K value) => _id_key.set(this, K, value); + set key($K? value) => _id_key.set(this, K.nullableType, value); static final _id_value = _class.instanceFieldId( r'value', @@ -3678,11 +4638,11 @@ class MyMap_MyEntry<$K extends _$jni.JObject, $V extends _$jni.JObject> /// from: `public V value` /// The returned object must be released after use, by calling the [release] method. - $V get value => _id_value.get(this, V); + $V? get value => _id_value.get(this, V.nullableType); /// from: `public V value` /// The returned object must be released after use, by calling the [release] method. - set value($V value) => _id_value.set(this, V, value); + set value($V? value) => _id_value.set(this, V.nullableType, value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V', @@ -3707,38 +4667,88 @@ class MyMap_MyEntry<$K extends _$jni.JObject, $V extends _$jni.JObject> _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $parent, K key, V value)` + /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $outerClass, K object, V object1)` /// The returned object must be released after use, by calling the [release] method. factory MyMap_MyEntry( - MyMap<$K, $V> $parent, - $K key, - $V value, { + MyMap<$K?, $V?> $outerClass, + $K? object, + $V? object1, { _$jni.JObjType<$K>? K, _$jni.JObjType<$V>? V, }) { K ??= _$jni.lowestCommonSuperType([ - key.$type, - ($parent.$type as $MyMap$Type<_$core.dynamic, _$core.dynamic>).K, + ($outerClass.$type as $MyMap$Type<_$core.dynamic, _$core.dynamic>).K, ]) as _$jni.JObjType<$K>; V ??= _$jni.lowestCommonSuperType([ - value.$type, - ($parent.$type as $MyMap$Type<_$core.dynamic, _$core.dynamic>).V, + ($outerClass.$type as $MyMap$Type<_$core.dynamic, _$core.dynamic>).V, ]) as _$jni.JObjType<$V>; - return MyMap_MyEntry.fromReference( + final _$$outerClass = $outerClass.reference; + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; + return MyMap_MyEntry<$K, $V>.fromReference( K, V, - _new$( - _class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, - $parent.reference.pointer, - key.reference.pointer, - value.reference.pointer) + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _$$outerClass.pointer, _$object.pointer, _$object1.pointer) .reference); } } -final class $MyMap_MyEntry$Type<$K extends _$jni.JObject, - $V extends _$jni.JObject> extends _$jni.JObjType> { +final class $MyMap_MyEntry$NullableType<$K extends _$jni.JObject?, + $V extends _$jni.JObject?> extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $MyMap_MyEntry$NullableType( + this.K, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;'; + + @_$jni.internal + @_$core.override + MyMap_MyEntry<$K, $V>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : MyMap_MyEntry<$K, $V>.fromReference( + K, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($MyMap_MyEntry$NullableType, K, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyMap_MyEntry$NullableType<$K, $V>) && + other is $MyMap_MyEntry$NullableType<$K, $V> && + K == other.K && + V == other.V; + } +} + +final class $MyMap_MyEntry$Type<$K extends _$jni.JObject?, + $V extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$K> K; @@ -3759,11 +4769,19 @@ final class $MyMap_MyEntry$Type<$K extends _$jni.JObject, @_$jni.internal @_$core.override MyMap_MyEntry<$K, $V> fromReference(_$jni.JReference reference) => - MyMap_MyEntry.fromReference(K, V, reference); + MyMap_MyEntry<$K, $V>.fromReference( + K, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $MyMap_MyEntry$NullableType<$K, $V>(K, V); @_$jni.internal @_$core.override @@ -3782,7 +4800,7 @@ final class $MyMap_MyEntry$Type<$K extends _$jni.JObject, } /// from: `com.github.dart_lang.jnigen.generics.MyMap` -class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> +class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override @@ -3799,19 +4817,30 @@ class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> this.K, this.V, _$jni.JReference reference, - ) : $type = type(K, V), + ) : $type = type<$K, $V>(K, V), super.fromReference(reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyMap'); /// The type which includes information such as the signature of this class. + static $MyMap$NullableType<$K, $V> + nullableType<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( + _$jni.JObjType<$K> K, + _$jni.JObjType<$V> V, + ) { + return $MyMap$NullableType<$K, $V>( + K, + V, + ); + } + static $MyMap$Type<$K, $V> - type<$K extends _$jni.JObject, $V extends _$jni.JObject>( + type<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( _$jni.JObjType<$K> K, _$jni.JObjType<$V> V, ) { - return $MyMap$Type( + return $MyMap$Type<$K, $V>( K, V, ); @@ -3839,7 +4868,7 @@ class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> required _$jni.JObjType<$K> K, required _$jni.JObjType<$V> V, }) { - return MyMap.fromReference( + return MyMap<$K, $V>.fromReference( K, V, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) @@ -3862,14 +4891,15 @@ class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public V get(K key)` + /// from: `public V get(K object)` /// The returned object must be released after use, by calling the [release] method. - $V get( - $K key, + $V? get( + $K? object, ) { - return _get(reference.pointer, _id_get as _$jni.JMethodIDPtr, - key.reference.pointer) - .object(V); + final _$object = object?.reference ?? _$jni.jNullReference; + return _get( + reference.pointer, _id_get as _$jni.JMethodIDPtr, _$object.pointer) + .object<$V?>(V.nullableType); } static final _id_put = _class.instanceMethodId( @@ -3894,15 +4924,17 @@ class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public V put(K key, V value)` + /// from: `public V put(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. - $V put( - $K key, - $V value, + $V? put( + $K? object, + $V? object1, ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _put(reference.pointer, _id_put as _$jni.JMethodIDPtr, - key.reference.pointer, value.reference.pointer) - .object(V); + _$object.pointer, _$object1.pointer) + .object<$V?>(V.nullableType); } static final _id_entryStack = _class.instanceMethodId( @@ -3922,16 +4954,69 @@ class MyMap<$K extends _$jni.JObject, $V extends _$jni.JObject> _$jni.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.MyStack.MyEntry> entryStack()` + /// from: `public com.github.dart_lang.jnigen.generics.MyStack entryStack()` /// The returned object must be released after use, by calling the [release] method. - MyStack> entryStack() { + MyStack?>? entryStack() { return _entryStack(reference.pointer, _id_entryStack as _$jni.JMethodIDPtr) - .object(const $MyStack$Type( - $MyMap_MyEntry$Type(_$jni.JObjectType(), _$jni.JObjectType()))); + .object?>?>( + $MyStack$NullableType?>( + $MyMap_MyEntry$NullableType<$K?, $V?>( + K.nullableType, V.nullableType))); + } +} + +final class $MyMap$NullableType<$K extends _$jni.JObject?, + $V extends _$jni.JObject?> extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $MyMap$NullableType( + this.K, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap;'; + + @_$jni.internal + @_$core.override + MyMap<$K, $V>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MyMap<$K, $V>.fromReference( + K, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($MyMap$NullableType, K, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyMap$NullableType<$K, $V>) && + other is $MyMap$NullableType<$K, $V> && + K == other.K && + V == other.V; } } -final class $MyMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> +final class $MyMap$Type<$K extends _$jni.JObject?, $V extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$K> K; @@ -3952,11 +5037,19 @@ final class $MyMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> @_$jni.internal @_$core.override MyMap<$K, $V> fromReference(_$jni.JReference reference) => - MyMap.fromReference(K, V, reference); + MyMap<$K, $V>.fromReference( + K, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $MyMap$NullableType<$K, $V>(K, V); @_$jni.internal @_$core.override @@ -3975,7 +5068,7 @@ final class $MyMap$Type<$K extends _$jni.JObject, $V extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.generics.MyStack` -class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { +class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -3987,17 +5080,25 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { MyStack.fromReference( this.T, _$jni.JReference reference, - ) : $type = type(T), + ) : $type = type<$T>(T), super.fromReference(reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyStack'); /// The type which includes information such as the signature of this class. - static $MyStack$Type<$T> type<$T extends _$jni.JObject>( + static $MyStack$NullableType<$T> nullableType<$T extends _$jni.JObject?>( _$jni.JObjType<$T> T, ) { - return $MyStack$Type( + return $MyStack$NullableType<$T>( + T, + ); + } + + static $MyStack$Type<$T> type<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $MyStack$Type<$T>( T, ); } @@ -4023,7 +5124,7 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { factory MyStack({ required _$jni.JObjType<$T> T, }) { - return MyStack.fromReference( + return MyStack<$T>.fromReference( T, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); @@ -4045,18 +5146,16 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(T[] arr)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(java.lang.Object[] objects)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> fromArray<$T extends _$jni.JObject>( - _$jni.JArray<$T> arr, { - _$jni.JObjType<$T>? T, + static MyStack<$T?>? fromArray<$T extends _$jni.JObject?>( + _$jni.JArray<$T?>? objects, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - ((arr.$type as _$jni.JArrayType).elementType as _$jni.JObjType), - ]) as _$jni.JObjType<$T>; + final _$objects = objects?.reference ?? _$jni.jNullReference; return _fromArray(_class.reference.pointer, - _id_fromArray as _$jni.JMethodIDPtr, arr.reference.pointer) - .object($MyStack$Type(T)); + _id_fromArray as _$jni.JMethodIDPtr, _$objects.pointer) + .object?>($MyStack$NullableType<$T?>(T.nullableType)); } static final _id_fromArrayOfArrayOfGrandParents = _class.staticMethodId( @@ -4076,24 +5175,19 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(com.github.dart_lang.jnigen.generics.GrandParent[][] arr)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(java.lang.Object[] grandParents)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$S> fromArrayOfArrayOfGrandParents<$S extends _$jni.JObject>( - _$jni.JArray<_$jni.JArray>> arr, { - _$jni.JObjType<$S>? S, + static MyStack<$S?>? + fromArrayOfArrayOfGrandParents<$S extends _$jni.JObject?>( + _$jni.JArray<_$jni.JArray?>?>? grandParents, { + required _$jni.JObjType<$S> S, }) { - S ??= _$jni.lowestCommonSuperType([ - (((((arr.$type as _$jni.JArrayType).elementType as _$jni.JObjType) - as _$jni.JArrayType) - .elementType as _$jni.JObjType) - as $GrandParent$Type<_$core.dynamic>) - .T, - ]) as _$jni.JObjType<$S>; + final _$grandParents = grandParents?.reference ?? _$jni.jNullReference; return _fromArrayOfArrayOfGrandParents( _class.reference.pointer, _id_fromArrayOfArrayOfGrandParents as _$jni.JMethodIDPtr, - arr.reference.pointer) - .object($MyStack$Type(S)); + _$grandParents.pointer) + .object?>($MyStack$NullableType<$S?>(S.nullableType)); } static final _id_of = _class.staticMethodId( @@ -4113,13 +5207,13 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of<$T extends _$jni.JObject>({ + static MyStack<$T?>? of<$T extends _$jni.JObject?>({ required _$jni.JObjType<$T> T, }) { return _of(_class.reference.pointer, _id_of as _$jni.JMethodIDPtr) - .object($MyStack$Type(T)); + .object?>($MyStack$NullableType<$T?>(T.nullableType)); } static final _id_of$1 = _class.staticMethodId( @@ -4138,18 +5232,16 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T obj)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of$1<$T extends _$jni.JObject>( - $T obj, { - _$jni.JObjType<$T>? T, + static MyStack<$T?>? of$1<$T extends _$jni.JObject?>( + $T? object, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - obj.$type, - ]) as _$jni.JObjType<$T>; + final _$object = object?.reference ?? _$jni.jNullReference; return _of$1(_class.reference.pointer, _id_of$1 as _$jni.JMethodIDPtr, - obj.reference.pointer) - .object($MyStack$Type(T)); + _$object.pointer) + .object?>($MyStack$NullableType<$T?>(T.nullableType)); } static final _id_of$2 = _class.staticMethodId( @@ -4174,20 +5266,18 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T obj, T obj2)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object, T object1)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T> of$2<$T extends _$jni.JObject>( - $T obj, - $T obj2, { - _$jni.JObjType<$T>? T, + static MyStack<$T?>? of$2<$T extends _$jni.JObject?>( + $T? object, + $T? object1, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - obj2.$type, - obj.$type, - ]) as _$jni.JObjType<$T>; + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _of$2(_class.reference.pointer, _id_of$2 as _$jni.JMethodIDPtr, - obj.reference.pointer, obj2.reference.pointer) - .object($MyStack$Type(T)); + _$object.pointer, _$object1.pointer) + .object?>($MyStack$NullableType<$T?>(T.nullableType)); } static final _id_push = _class.instanceMethodId( @@ -4206,12 +5296,12 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void push(T item)` + /// from: `public void push(T object)` void push( - $T item, + $T? object, ) { - _push(reference.pointer, _id_push as _$jni.JMethodIDPtr, - item.reference.pointer) + final _$object = object?.reference ?? _$jni.jNullReference; + _push(reference.pointer, _id_push as _$jni.JMethodIDPtr, _$object.pointer) .check(); } @@ -4234,8 +5324,9 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { /// from: `public T pop()` /// The returned object must be released after use, by calling the [release] method. - $T pop() { - return _pop(reference.pointer, _id_pop as _$jni.JMethodIDPtr).object(T); + $T? pop() { + return _pop(reference.pointer, _id_pop as _$jni.JMethodIDPtr) + .object<$T?>(T.nullableType); } static final _id_size = _class.instanceMethodId( @@ -4261,7 +5352,52 @@ class MyStack<$T extends _$jni.JObject> extends _$jni.JObject { } } -final class $MyStack$Type<$T extends _$jni.JObject> +final class $MyStack$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $MyStack$NullableType( + this.T, + ); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyStack;'; + + @_$jni.internal + @_$core.override + MyStack<$T>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MyStack<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($MyStack$NullableType, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyStack$NullableType<$T>) && + other is $MyStack$NullableType<$T> && + T == other.T; + } +} + +final class $MyStack$Type<$T extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -4278,11 +5414,17 @@ final class $MyStack$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override MyStack<$T> fromReference(_$jni.JReference reference) => - MyStack.fromReference(T, reference); + MyStack<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => $MyStack$NullableType<$T>(T); @_$jni.internal @_$core.override @@ -4300,8 +5442,8 @@ final class $MyStack$Type<$T extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.generics.StringKeyedMap` -class StringKeyedMap<$V extends _$jni.JObject> - extends MyMap<_$jni.JString, $V> { +class StringKeyedMap<$V extends _$jni.JObject?> + extends MyMap<_$jni.JString?, $V?> { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -4313,17 +5455,27 @@ class StringKeyedMap<$V extends _$jni.JObject> StringKeyedMap.fromReference( this.V, _$jni.JReference reference, - ) : $type = type(V), - super.fromReference(const _$jni.JStringType(), V, reference); + ) : $type = type<$V>(V), + super.fromReference( + const _$jni.JStringNullableType(), V.nullableType, reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/StringKeyedMap'); /// The type which includes information such as the signature of this class. - static $StringKeyedMap$Type<$V> type<$V extends _$jni.JObject>( + static $StringKeyedMap$NullableType<$V> + nullableType<$V extends _$jni.JObject?>( + _$jni.JObjType<$V> V, + ) { + return $StringKeyedMap$NullableType<$V>( + V, + ); + } + + static $StringKeyedMap$Type<$V> type<$V extends _$jni.JObject?>( _$jni.JObjType<$V> V, ) { - return $StringKeyedMap$Type( + return $StringKeyedMap$Type<$V>( V, ); } @@ -4349,14 +5501,62 @@ class StringKeyedMap<$V extends _$jni.JObject> factory StringKeyedMap({ required _$jni.JObjType<$V> V, }) { - return StringKeyedMap.fromReference( + return StringKeyedMap<$V>.fromReference( V, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $StringKeyedMap$Type<$V extends _$jni.JObject> +final class $StringKeyedMap$NullableType<$V extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $StringKeyedMap$NullableType( + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;'; + + @_$jni.internal + @_$core.override + StringKeyedMap<$V>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : StringKeyedMap<$V>.fromReference( + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $MyMap$NullableType<_$jni.JString?, $V?>( + const _$jni.JStringNullableType(), V.nullableType); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => Object.hash($StringKeyedMap$NullableType, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringKeyedMap$NullableType<$V>) && + other is $StringKeyedMap$NullableType<$V> && + V == other.V; + } +} + +final class $StringKeyedMap$Type<$V extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$V> V; @@ -4374,11 +5574,19 @@ final class $StringKeyedMap$Type<$V extends _$jni.JObject> @_$jni.internal @_$core.override StringKeyedMap<$V> fromReference(_$jni.JReference reference) => - StringKeyedMap.fromReference(V, reference); + StringKeyedMap<$V>.fromReference( + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $MyMap$NullableType<_$jni.JString?, $V?>( + const _$jni.JStringNullableType(), V.nullableType); @_$jni.internal @_$core.override - _$jni.JObjType get superType => $MyMap$Type(const _$jni.JStringType(), V); + _$jni.JObjType?> get nullableType => + $StringKeyedMap$NullableType<$V>(V); @_$jni.internal @_$core.override @@ -4396,7 +5604,7 @@ final class $StringKeyedMap$Type<$V extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.generics.StringMap` -class StringMap extends StringKeyedMap<_$jni.JString> { +class StringMap extends StringKeyedMap<_$jni.JString?> { @_$jni.internal @_$core.override final _$jni.JObjType $type; @@ -4405,12 +5613,13 @@ class StringMap extends StringKeyedMap<_$jni.JString> { StringMap.fromReference( _$jni.JReference reference, ) : $type = type, - super.fromReference(const _$jni.JStringType(), reference); + super.fromReference(const _$jni.JStringNullableType(), reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringMap'); /// The type which includes information such as the signature of this class. + static const nullableType = $StringMap$NullableType(); static const type = $StringMap$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -4437,6 +5646,45 @@ class StringMap extends StringKeyedMap<_$jni.JString> { } } +final class $StringMap$NullableType extends _$jni.JObjType { + @_$jni.internal + const $StringMap$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringMap;'; + + @_$jni.internal + @_$core.override + StringMap? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : StringMap.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $StringKeyedMap$NullableType<_$jni.JString?>( + _$jni.JStringNullableType()); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 3; + + @_$core.override + int get hashCode => ($StringMap$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringMap$NullableType) && + other is $StringMap$NullableType; + } +} + final class $StringMap$Type extends _$jni.JObjType { @_$jni.internal const $StringMap$Type(); @@ -4448,12 +5696,19 @@ final class $StringMap$Type extends _$jni.JObjType { @_$jni.internal @_$core.override StringMap fromReference(_$jni.JReference reference) => - StringMap.fromReference(reference); - + StringMap.fromReference( + reference, + ); @_$jni.internal @_$core.override _$jni.JObjType get superType => - const $StringKeyedMap$Type(_$jni.JStringType()); + const $StringKeyedMap$NullableType<_$jni.JString?>( + _$jni.JStringNullableType()); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + const $StringMap$NullableType(); @_$jni.internal @_$core.override @@ -4469,7 +5724,7 @@ final class $StringMap$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.generics.StringStack` -class StringStack extends MyStack<_$jni.JString> { +class StringStack extends MyStack<_$jni.JString?> { @_$jni.internal @_$core.override final _$jni.JObjType $type; @@ -4478,12 +5733,13 @@ class StringStack extends MyStack<_$jni.JString> { StringStack.fromReference( _$jni.JReference reference, ) : $type = type, - super.fromReference(const _$jni.JStringType(), reference); + super.fromReference(const _$jni.JStringNullableType(), reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringStack'); /// The type which includes information such as the signature of this class. + static const nullableType = $StringStack$NullableType(); static const type = $StringStack$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -4510,6 +5766,44 @@ class StringStack extends MyStack<_$jni.JString> { } } +final class $StringStack$NullableType extends _$jni.JObjType { + @_$jni.internal + const $StringStack$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringStack;'; + + @_$jni.internal + @_$core.override + StringStack? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : StringStack.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $MyStack$NullableType<_$jni.JString?>(_$jni.JStringNullableType()); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => ($StringStack$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringStack$NullableType) && + other is $StringStack$NullableType; + } +} + final class $StringStack$Type extends _$jni.JObjType { @_$jni.internal const $StringStack$Type(); @@ -4521,11 +5815,18 @@ final class $StringStack$Type extends _$jni.JObjType { @_$jni.internal @_$core.override StringStack fromReference(_$jni.JReference reference) => - StringStack.fromReference(reference); + StringStack.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => + const $MyStack$NullableType<_$jni.JString?>(_$jni.JStringNullableType()); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const $MyStack$Type(_$jni.JStringType()); + _$jni.JObjType get nullableType => + const $StringStack$NullableType(); @_$jni.internal @_$core.override @@ -4542,8 +5843,8 @@ final class $StringStack$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.generics.StringValuedMap` -class StringValuedMap<$K extends _$jni.JObject> - extends MyMap<$K, _$jni.JString> { +class StringValuedMap<$K extends _$jni.JObject?> + extends MyMap<$K?, _$jni.JString?> { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -4555,17 +5856,27 @@ class StringValuedMap<$K extends _$jni.JObject> StringValuedMap.fromReference( this.K, _$jni.JReference reference, - ) : $type = type(K), - super.fromReference(K, const _$jni.JStringType(), reference); + ) : $type = type<$K>(K), + super.fromReference( + K.nullableType, const _$jni.JStringNullableType(), reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/generics/StringValuedMap'); /// The type which includes information such as the signature of this class. - static $StringValuedMap$Type<$K> type<$K extends _$jni.JObject>( + static $StringValuedMap$NullableType<$K> + nullableType<$K extends _$jni.JObject?>( _$jni.JObjType<$K> K, ) { - return $StringValuedMap$Type( + return $StringValuedMap$NullableType<$K>( + K, + ); + } + + static $StringValuedMap$Type<$K> type<$K extends _$jni.JObject?>( + _$jni.JObjType<$K> K, + ) { + return $StringValuedMap$Type<$K>( K, ); } @@ -4591,14 +5902,62 @@ class StringValuedMap<$K extends _$jni.JObject> factory StringValuedMap({ required _$jni.JObjType<$K> K, }) { - return StringValuedMap.fromReference( + return StringValuedMap<$K>.fromReference( K, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $StringValuedMap$Type<$K extends _$jni.JObject> +final class $StringValuedMap$NullableType<$K extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$K> K; + + @_$jni.internal + const $StringValuedMap$NullableType( + this.K, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/generics/StringValuedMap;'; + + @_$jni.internal + @_$core.override + StringValuedMap<$K>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : StringValuedMap<$K>.fromReference( + K, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $MyMap$NullableType<$K?, _$jni.JString?>( + K.nullableType, const _$jni.JStringNullableType()); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => Object.hash($StringValuedMap$NullableType, K); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringValuedMap$NullableType<$K>) && + other is $StringValuedMap$NullableType<$K> && + K == other.K; + } +} + +final class $StringValuedMap$Type<$K extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$K> K; @@ -4616,11 +5975,19 @@ final class $StringValuedMap$Type<$K extends _$jni.JObject> @_$jni.internal @_$core.override StringValuedMap<$K> fromReference(_$jni.JReference reference) => - StringValuedMap.fromReference(K, reference); + StringValuedMap<$K>.fromReference( + K, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $MyMap$NullableType<$K?, _$jni.JString?>( + K.nullableType, const _$jni.JStringNullableType()); @_$jni.internal @_$core.override - _$jni.JObjType get superType => $MyMap$Type(K, const _$jni.JStringType()); + _$jni.JObjType?> get nullableType => + $StringValuedMap$NullableType<$K>(K); @_$jni.internal @_$core.override @@ -4638,7 +6005,7 @@ final class $StringValuedMap$Type<$K extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.interfaces.GenericInterface` -class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { +class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -4650,17 +6017,26 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { GenericInterface.fromReference( this.T, _$jni.JReference reference, - ) : $type = type(T), + ) : $type = type<$T>(T), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/GenericInterface'); /// The type which includes information such as the signature of this class. - static $GenericInterface$Type<$T> type<$T extends _$jni.JObject>( + static $GenericInterface$NullableType<$T> + nullableType<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $GenericInterface$NullableType<$T>( + T, + ); + } + + static $GenericInterface$Type<$T> type<$T extends _$jni.JObject?>( _$jni.JObjType<$T> T, ) { - return $GenericInterface$Type( + return $GenericInterface$Type<$T>( T, ); } @@ -4681,18 +6057,17 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract U[] genericArrayOf(U element)` + /// from: `public abstract java.lang.Object[] genericArrayOf(U object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<$U> genericArrayOf<$U extends _$jni.JObject>( - $U element, { - _$jni.JObjType<$U>? U, + _$jni.JArray<$U?>? genericArrayOf<$U extends _$jni.JObject?>( + $U? object, { + required _$jni.JObjType<$U> U, }) { - U ??= _$jni.lowestCommonSuperType([ - element.$type, - ]) as _$jni.JObjType<$U>; + final _$object = object?.reference ?? _$jni.jNullReference; return _genericArrayOf(reference.pointer, - _id_genericArrayOf as _$jni.JMethodIDPtr, element.reference.pointer) - .object(_$jni.JArrayType(U)); + _id_genericArrayOf as _$jni.JMethodIDPtr, _$object.pointer) + .object<_$jni.JArray<$U?>?>( + _$jni.JArrayNullableType<$U?>(U.nullableType)); } static final _id_arrayOf = _class.instanceMethodId( @@ -4711,14 +6086,16 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract T[] arrayOf(T element)` + /// from: `public abstract java.lang.Object[] arrayOf(T object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<$T> arrayOf( - $T element, + _$jni.JArray<$T?>? arrayOf( + $T? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _arrayOf(reference.pointer, _id_arrayOf as _$jni.JMethodIDPtr, - element.reference.pointer) - .object(_$jni.JArrayType(T)); + _$object.pointer) + .object<_$jni.JArray<$T?>?>( + _$jni.JArrayNullableType<$T?>(T.nullableType)); } static final _id_mapOf = _class.instanceMethodId( @@ -4743,19 +6120,19 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract java.util.Map mapOf(T key, U value)` + /// from: `public abstract java.util.Map mapOf(T object, U object1)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JMap<$T, $U> mapOf<$U extends _$jni.JObject>( - $T key, - $U value, { - _$jni.JObjType<$U>? U, + _$jni.JMap<$T?, $U?>? mapOf<$U extends _$jni.JObject?>( + $T? object, + $U? object1, { + required _$jni.JObjType<$U> U, }) { - U ??= _$jni.lowestCommonSuperType([ - value.$type, - ]) as _$jni.JObjType<$U>; + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1?.reference ?? _$jni.jNullReference; return _mapOf(reference.pointer, _id_mapOf as _$jni.JMethodIDPtr, - key.reference.pointer, value.reference.pointer) - .object(_$jni.JMapType(T, U)); + _$object.pointer, _$object1.pointer) + .object<_$jni.JMap<$T?, $U?>?>( + _$jni.JMapNullableType<$T?, $U?>(T.nullableType, U.nullableType)); } static final _id_firstOfGenericArray = _class.instanceMethodId( @@ -4774,20 +6151,16 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract U firstOfGenericArray(U[] array)` + /// from: `public abstract U firstOfGenericArray(java.lang.Object[] objects)` /// The returned object must be released after use, by calling the [release] method. - $U firstOfGenericArray<$U extends _$jni.JObject>( - _$jni.JArray<$U> array, { - _$jni.JObjType<$U>? U, + $U? firstOfGenericArray<$U extends _$jni.JObject?>( + _$jni.JArray<$U?>? objects, { + required _$jni.JObjType<$U> U, }) { - U ??= _$jni.lowestCommonSuperType([ - ((array.$type as _$jni.JArrayType).elementType as _$jni.JObjType), - ]) as _$jni.JObjType<$U>; - return _firstOfGenericArray( - reference.pointer, - _id_firstOfGenericArray as _$jni.JMethodIDPtr, - array.reference.pointer) - .object(U); + final _$objects = objects?.reference ?? _$jni.jNullReference; + return _firstOfGenericArray(reference.pointer, + _id_firstOfGenericArray as _$jni.JMethodIDPtr, _$objects.pointer) + .object<$U?>(U.nullableType); } static final _id_firstOfArray = _class.instanceMethodId( @@ -4806,14 +6179,15 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract T firstOfArray(T[] array)` + /// from: `public abstract T firstOfArray(java.lang.Object[] objects)` /// The returned object must be released after use, by calling the [release] method. - $T firstOfArray( - _$jni.JArray<$T> array, + $T? firstOfArray( + _$jni.JArray<$T?>? objects, ) { + final _$objects = objects?.reference ?? _$jni.jNullReference; return _firstOfArray(reference.pointer, - _id_firstOfArray as _$jni.JMethodIDPtr, array.reference.pointer) - .object(T); + _id_firstOfArray as _$jni.JMethodIDPtr, _$objects.pointer) + .object<$T?>(T.nullableType); } static final _id_firstKeyOf = _class.instanceMethodId( @@ -4832,18 +6206,16 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract T firstKeyOf(java.util.Map map)` + /// from: `public abstract T firstKeyOf(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $T firstKeyOf<$U extends _$jni.JObject>( - _$jni.JMap<$T, $U> map, { - _$jni.JObjType<$U>? U, + $T? firstKeyOf<$U extends _$jni.JObject?>( + _$jni.JMap<$T?, $U?>? map, { + required _$jni.JObjType<$U> U, }) { - U ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$U>; + final _$map = map?.reference ?? _$jni.jNullReference; return _firstKeyOf(reference.pointer, _id_firstKeyOf as _$jni.JMethodIDPtr, - map.reference.pointer) - .object(T); + _$map.pointer) + .object<$T?>(T.nullableType); } static final _id_firstValueOf = _class.instanceMethodId( @@ -4862,18 +6234,16 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract U firstValueOf(java.util.Map map)` + /// from: `public abstract U firstValueOf(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $U firstValueOf<$U extends _$jni.JObject>( - _$jni.JMap<$T, $U> map, { - _$jni.JObjType<$U>? U, + $U? firstValueOf<$U extends _$jni.JObject?>( + _$jni.JMap<$T?, $U?>? map, { + required _$jni.JObjType<$U> U, }) { - U ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$U>; + final _$map = map?.reference ?? _$jni.jNullReference; return _firstValueOf(reference.pointer, - _id_firstValueOf as _$jni.JMethodIDPtr, map.reference.pointer) - .object(U); + _id_firstValueOf as _$jni.JMethodIDPtr, _$map.pointer) + .object<$U?>(U.nullableType); } /// Maps a specific port to the implemented interface. @@ -4908,73 +6278,86 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { final $a = $i.args; if ($d == r'genericArrayOf(Ljava/lang/Object;)[Ljava/lang/Object;') { final $r = _$impls[$p]!.genericArrayOf( - $a[0].as(const _$jni.JObjectType(), releaseOriginal: true), + $a![0]?.as(const _$jni.JObjectType(), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'arrayOf(Ljava/lang/Object;)[Ljava/lang/Object;') { final $r = _$impls[$p]!.arrayOf( - $a[0].as(_$impls[$p]!.T, releaseOriginal: true), + $a![0]?.as(_$impls[$p]!.T, releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'mapOf(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;') { final $r = _$impls[$p]!.mapOf( - $a[0].as(_$impls[$p]!.T, releaseOriginal: true), - $a[1].as(const _$jni.JObjectType(), releaseOriginal: true), + $a![0]?.as(_$impls[$p]!.T, releaseOriginal: true), + $a![1]?.as(const _$jni.JObjectType(), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'firstOfGenericArray([Ljava/lang/Object;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstOfGenericArray( - $a[0].as(const _$jni.JArrayType(_$jni.JObjectType()), + $a![0]?.as( + const _$jni.JArrayType<_$jni.JObject?>( + _$jni.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'firstOfArray([Ljava/lang/Object;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstOfArray( - $a[0].as(const _$jni.JArrayType(_$jni.JObjectType()), + $a![0]?.as( + const _$jni.JArrayType<_$jni.JObject?>( + _$jni.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'firstKeyOf(Ljava/util/Map;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstKeyOf( - $a[0].as( - const _$jni.JMapType(_$jni.JObjectType(), _$jni.JObjectType()), + $a![0]?.as( + const _$jni.JMapType<_$jni.JObject?, _$jni.JObject?>( + _$jni.JObjectNullableType(), _$jni.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'firstValueOf(Ljava/util/Map;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstValueOf( - $a[0].as( - const _$jni.JMapType(_$jni.JObjectType(), _$jni.JObjectType()), + $a![0]?.as( + const _$jni.JMapType<_$jni.JObject?, _$jni.JObject?>( + _$jni.JObjectNullableType(), _$jni.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } } catch (e) { return _$jni.ProtectedJniExtensions.newDartException(e); @@ -4982,7 +6365,7 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { return _$jni.nullptr; } - static void implementIn<$T extends _$jni.JObject>( + static void implementIn<$T extends _$jni.JObject?>( _$jni.JImplementer implementer, $GenericInterface<$T> $impl, ) { @@ -5012,60 +6395,61 @@ class GenericInterface<$T extends _$jni.JObject> extends _$jni.JObject { ) { final $i = _$jni.JImplementer(); implementIn($i, $impl); - return GenericInterface.fromReference( + return GenericInterface<$T>.fromReference( $impl.T, $i.implementReference(), ); } } -abstract base mixin class $GenericInterface<$T extends _$jni.JObject> { +abstract base mixin class $GenericInterface<$T extends _$jni.JObject?> { factory $GenericInterface({ required _$jni.JObjType<$T> T, - required _$jni.JArray<_$jni.JObject> Function(_$jni.JObject element) + required _$jni.JArray<_$jni.JObject?>? Function(_$jni.JObject? object) genericArrayOf, - required _$jni.JArray<_$jni.JObject> Function($T element) arrayOf, - required _$jni.JMap<_$jni.JObject, _$jni.JObject> Function( - $T key, _$jni.JObject value) + required _$jni.JArray<_$jni.JObject?>? Function($T? object) arrayOf, + required _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? Function( + $T? object, _$jni.JObject? object1) mapOf, - required _$jni.JObject Function(_$jni.JArray<_$jni.JObject> array) + required _$jni.JObject? Function(_$jni.JArray<_$jni.JObject?>? objects) firstOfGenericArray, - required $T Function(_$jni.JArray<_$jni.JObject> array) firstOfArray, - required $T Function(_$jni.JMap<_$jni.JObject, _$jni.JObject> map) + required $T? Function(_$jni.JArray<_$jni.JObject?>? objects) firstOfArray, + required $T? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) firstKeyOf, - required _$jni.JObject Function( - _$jni.JMap<_$jni.JObject, _$jni.JObject> map) + required _$jni.JObject? Function( + _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) firstValueOf, - }) = _$GenericInterface; + }) = _$GenericInterface<$T>; _$jni.JObjType<$T> get T; - _$jni.JArray<_$jni.JObject> genericArrayOf(_$jni.JObject element); - _$jni.JArray<_$jni.JObject> arrayOf($T element); - _$jni.JMap<_$jni.JObject, _$jni.JObject> mapOf($T key, _$jni.JObject value); - _$jni.JObject firstOfGenericArray(_$jni.JArray<_$jni.JObject> array); - $T firstOfArray(_$jni.JArray<_$jni.JObject> array); - $T firstKeyOf(_$jni.JMap<_$jni.JObject, _$jni.JObject> map); - _$jni.JObject firstValueOf(_$jni.JMap<_$jni.JObject, _$jni.JObject> map); + _$jni.JArray<_$jni.JObject?>? genericArrayOf(_$jni.JObject? object); + _$jni.JArray<_$jni.JObject?>? arrayOf($T? object); + _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? mapOf( + $T? object, _$jni.JObject? object1); + _$jni.JObject? firstOfGenericArray(_$jni.JArray<_$jni.JObject?>? objects); + $T? firstOfArray(_$jni.JArray<_$jni.JObject?>? objects); + $T? firstKeyOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map); + _$jni.JObject? firstValueOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map); } -final class _$GenericInterface<$T extends _$jni.JObject> +final class _$GenericInterface<$T extends _$jni.JObject?> with $GenericInterface<$T> { _$GenericInterface({ required this.T, - required _$jni.JArray<_$jni.JObject> Function(_$jni.JObject element) + required _$jni.JArray<_$jni.JObject?>? Function(_$jni.JObject? object) genericArrayOf, - required _$jni.JArray<_$jni.JObject> Function($T element) arrayOf, - required _$jni.JMap<_$jni.JObject, _$jni.JObject> Function( - $T key, _$jni.JObject value) + required _$jni.JArray<_$jni.JObject?>? Function($T? object) arrayOf, + required _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? Function( + $T? object, _$jni.JObject? object1) mapOf, - required _$jni.JObject Function(_$jni.JArray<_$jni.JObject> array) + required _$jni.JObject? Function(_$jni.JArray<_$jni.JObject?>? objects) firstOfGenericArray, - required $T Function(_$jni.JArray<_$jni.JObject> array) firstOfArray, - required $T Function(_$jni.JMap<_$jni.JObject, _$jni.JObject> map) + required $T? Function(_$jni.JArray<_$jni.JObject?>? objects) firstOfArray, + required $T? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) firstKeyOf, - required _$jni.JObject Function( - _$jni.JMap<_$jni.JObject, _$jni.JObject> map) + required _$jni.JObject? Function( + _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) firstValueOf, }) : _genericArrayOf = genericArrayOf, _arrayOf = arrayOf, @@ -5078,54 +6462,56 @@ final class _$GenericInterface<$T extends _$jni.JObject> @_$core.override final _$jni.JObjType<$T> T; - final _$jni.JArray<_$jni.JObject> Function(_$jni.JObject element) + final _$jni.JArray<_$jni.JObject?>? Function(_$jni.JObject? object) _genericArrayOf; - final _$jni.JArray<_$jni.JObject> Function($T element) _arrayOf; - final _$jni.JMap<_$jni.JObject, _$jni.JObject> Function( - $T key, _$jni.JObject value) _mapOf; - final _$jni.JObject Function(_$jni.JArray<_$jni.JObject> array) + final _$jni.JArray<_$jni.JObject?>? Function($T? object) _arrayOf; + final _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? Function( + $T? object, _$jni.JObject? object1) _mapOf; + final _$jni.JObject? Function(_$jni.JArray<_$jni.JObject?>? objects) _firstOfGenericArray; - final $T Function(_$jni.JArray<_$jni.JObject> array) _firstOfArray; - final $T Function(_$jni.JMap<_$jni.JObject, _$jni.JObject> map) _firstKeyOf; - final _$jni.JObject Function(_$jni.JMap<_$jni.JObject, _$jni.JObject> map) + final $T? Function(_$jni.JArray<_$jni.JObject?>? objects) _firstOfArray; + final $T? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + _firstKeyOf; + final _$jni.JObject? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) _firstValueOf; - _$jni.JArray<_$jni.JObject> genericArrayOf(_$jni.JObject element) { - return _genericArrayOf(element); + _$jni.JArray<_$jni.JObject?>? genericArrayOf(_$jni.JObject? object) { + return _genericArrayOf(object); } - _$jni.JArray<_$jni.JObject> arrayOf($T element) { - return _arrayOf(element); + _$jni.JArray<_$jni.JObject?>? arrayOf($T? object) { + return _arrayOf(object); } - _$jni.JMap<_$jni.JObject, _$jni.JObject> mapOf($T key, _$jni.JObject value) { - return _mapOf(key, value); + _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? mapOf( + $T? object, _$jni.JObject? object1) { + return _mapOf(object, object1); } - _$jni.JObject firstOfGenericArray(_$jni.JArray<_$jni.JObject> array) { - return _firstOfGenericArray(array); + _$jni.JObject? firstOfGenericArray(_$jni.JArray<_$jni.JObject?>? objects) { + return _firstOfGenericArray(objects); } - $T firstOfArray(_$jni.JArray<_$jni.JObject> array) { - return _firstOfArray(array); + $T? firstOfArray(_$jni.JArray<_$jni.JObject?>? objects) { + return _firstOfArray(objects); } - $T firstKeyOf(_$jni.JMap<_$jni.JObject, _$jni.JObject> map) { + $T? firstKeyOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) { return _firstKeyOf(map); } - _$jni.JObject firstValueOf(_$jni.JMap<_$jni.JObject, _$jni.JObject> map) { + _$jni.JObject? firstValueOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) { return _firstValueOf(map); } } -final class $GenericInterface$Type<$T extends _$jni.JObject> - extends _$jni.JObjType> { +final class $GenericInterface$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { @_$jni.internal final _$jni.JObjType<$T> T; @_$jni.internal - const $GenericInterface$Type( + const $GenericInterface$NullableType( this.T, ); @@ -5136,55 +6522,117 @@ final class $GenericInterface$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override - GenericInterface<$T> fromReference(_$jni.JReference reference) => - GenericInterface.fromReference(T, reference); + GenericInterface<$T>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : GenericInterface<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => this; @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => Object.hash($GenericInterface$Type, T); + int get hashCode => Object.hash($GenericInterface$NullableType, T); @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($GenericInterface$Type<$T>) && - other is $GenericInterface$Type<$T> && + return other.runtimeType == ($GenericInterface$NullableType<$T>) && + other is $GenericInterface$NullableType<$T> && T == other.T; } } -/// from: `com.github.dart_lang.jnigen.interfaces.MyInterface` -class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; - +final class $GenericInterface$Type<$T extends _$jni.JObject?> + extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @_$jni.internal - MyInterface.fromReference( + const $GenericInterface$Type( this.T, - _$jni.JReference reference, - ) : $type = type(T), - super.fromReference(reference); + ); - static final _class = _$jni.JClass.forName( - r'com/github/dart_lang/jnigen/interfaces/MyInterface'); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/GenericInterface;'; - /// The type which includes information such as the signature of this class. - static $MyInterface$Type<$T> type<$T extends _$jni.JObject>( - _$jni.JObjType<$T> T, - ) { - return $MyInterface$Type( - T, - ); - } + @_$jni.internal + @_$core.override + GenericInterface<$T> fromReference(_$jni.JReference reference) => + GenericInterface<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => + $GenericInterface$NullableType<$T>(T); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($GenericInterface$Type, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GenericInterface$Type<$T>) && + other is $GenericInterface$Type<$T> && + T == other.T; + } +} + +/// from: `com.github.dart_lang.jnigen.interfaces.MyInterface` +class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + MyInterface.fromReference( + this.T, + _$jni.JReference reference, + ) : $type = type<$T>(T), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/interfaces/MyInterface'); + + /// The type which includes information such as the signature of this class. + static $MyInterface$NullableType<$T> nullableType<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $MyInterface$NullableType<$T>( + T, + ); + } + + static $MyInterface$Type<$T> type<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $MyInterface$Type<$T>( + T, + ); + } static final _id_voidCallback = _class.instanceMethodId( r'voidCallback', @@ -5202,12 +6650,13 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract void voidCallback(java.lang.String s)` + /// from: `public abstract void voidCallback(java.lang.String string)` void voidCallback( - _$jni.JString s, + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; _voidCallback(reference.pointer, _id_voidCallback as _$jni.JMethodIDPtr, - s.reference.pointer) + _$string.pointer) .check(); } @@ -5227,14 +6676,15 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract java.lang.String stringCallback(java.lang.String s)` + /// from: `public abstract java.lang.String stringCallback(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString stringCallback( - _$jni.JString s, + _$jni.JString? stringCallback( + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; return _stringCallback(reference.pointer, - _id_stringCallback as _$jni.JMethodIDPtr, s.reference.pointer) - .object(const _$jni.JStringType()); + _id_stringCallback as _$jni.JMethodIDPtr, _$string.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); } static final _id_varCallback = _class.instanceMethodId( @@ -5253,14 +6703,15 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract T varCallback(T t)` + /// from: `public abstract T varCallback(T object)` /// The returned object must be released after use, by calling the [release] method. - $T varCallback( - $T t, + $T? varCallback( + $T? object, ) { + final _$object = object?.reference ?? _$jni.jNullReference; return _varCallback(reference.pointer, - _id_varCallback as _$jni.JMethodIDPtr, t.reference.pointer) - .object(T); + _id_varCallback as _$jni.JMethodIDPtr, _$object.pointer) + .object<$T?>(T.nullableType); } static final _id_manyPrimitives = _class.instanceMethodId( @@ -5284,15 +6735,15 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int, int, double)>(); - /// from: `public abstract long manyPrimitives(int a, boolean b, char c, double d)` + /// from: `public abstract long manyPrimitives(int i, boolean z, char c, double d)` int manyPrimitives( - int a, - bool b, + int i, + bool z, int c, double d, ) { return _manyPrimitives(reference.pointer, - _id_manyPrimitives as _$jni.JMethodIDPtr, a, b ? 1 : 0, c, d) + _id_manyPrimitives as _$jni.JMethodIDPtr, i, z ? 1 : 0, c, d) .long; } @@ -5328,40 +6779,42 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { final $a = $i.args; if ($d == r'voidCallback(Ljava/lang/String;)V') { _$impls[$p]!.voidCallback( - $a[0].as(const _$jni.JStringType(), releaseOriginal: true), + $a![0]?.as(const _$jni.JStringType(), releaseOriginal: true), ); return _$jni.nullptr; } if ($d == r'stringCallback(Ljava/lang/String;)Ljava/lang/String;') { final $r = _$impls[$p]!.stringCallback( - $a[0].as(const _$jni.JStringType(), releaseOriginal: true), + $a![0]?.as(const _$jni.JStringType(), releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'varCallback(Ljava/lang/Object;)Ljava/lang/Object;') { final $r = _$impls[$p]!.varCallback( - $a[0].as(_$impls[$p]!.T, releaseOriginal: true), + $a![0]?.as(_$impls[$p]!.T, releaseOriginal: true), ); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; } if ($d == r'manyPrimitives(IZCD)J') { final $r = _$impls[$p]!.manyPrimitives( - $a[0] + $a![0]! .as(const _$jni.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), - $a[1] + $a![1]! .as(const _$jni.JBooleanType(), releaseOriginal: true) .booleanValue(releaseOriginal: true), - $a[2] + $a![2]! .as(const _$jni.JCharacterType(), releaseOriginal: true) .charValue(releaseOriginal: true), - $a[3] + $a![3]! .as(const _$jni.JDoubleType(), releaseOriginal: true) .doubleValue(releaseOriginal: true), ); @@ -5373,7 +6826,7 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { return _$jni.nullptr; } - static void implementIn<$T extends _$jni.JObject>( + static void implementIn<$T extends _$jni.JObject?>( _$jni.JImplementer implementer, $MyInterface<$T> $impl, ) { @@ -5405,7 +6858,7 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { ) { final $i = _$jni.JImplementer(); implementIn($i, $impl); - return MyInterface.fromReference( + return MyInterface<$T>.fromReference( $impl.T, $i.implementReference(), ); @@ -5413,33 +6866,33 @@ class MyInterface<$T extends _$jni.JObject> extends _$jni.JObject { static _$core.Map get $impls => _$impls; } -abstract base mixin class $MyInterface<$T extends _$jni.JObject> { +abstract base mixin class $MyInterface<$T extends _$jni.JObject?> { factory $MyInterface({ required _$jni.JObjType<$T> T, - required void Function(_$jni.JString s) voidCallback, + required void Function(_$jni.JString? string) voidCallback, bool voidCallback$async, - required _$jni.JString Function(_$jni.JString s) stringCallback, - required $T Function($T t) varCallback, - required int Function(int a, bool b, int c, double d) manyPrimitives, - }) = _$MyInterface; + required _$jni.JString? Function(_$jni.JString? string) stringCallback, + required $T? Function($T? object) varCallback, + required int Function(int i, bool z, int c, double d) manyPrimitives, + }) = _$MyInterface<$T>; _$jni.JObjType<$T> get T; - void voidCallback(_$jni.JString s); + void voidCallback(_$jni.JString? string); bool get voidCallback$async => false; - _$jni.JString stringCallback(_$jni.JString s); - $T varCallback($T t); - int manyPrimitives(int a, bool b, int c, double d); + _$jni.JString? stringCallback(_$jni.JString? string); + $T? varCallback($T? object); + int manyPrimitives(int i, bool z, int c, double d); } -final class _$MyInterface<$T extends _$jni.JObject> with $MyInterface<$T> { +final class _$MyInterface<$T extends _$jni.JObject?> with $MyInterface<$T> { _$MyInterface({ required this.T, - required void Function(_$jni.JString s) voidCallback, + required void Function(_$jni.JString? string) voidCallback, this.voidCallback$async = false, - required _$jni.JString Function(_$jni.JString s) stringCallback, - required $T Function($T t) varCallback, - required int Function(int a, bool b, int c, double d) manyPrimitives, + required _$jni.JString? Function(_$jni.JString? string) stringCallback, + required $T? Function($T? object) varCallback, + required int Function(int i, bool z, int c, double d) manyPrimitives, }) : _voidCallback = voidCallback, _stringCallback = stringCallback, _varCallback = varCallback, @@ -5448,30 +6901,76 @@ final class _$MyInterface<$T extends _$jni.JObject> with $MyInterface<$T> { @_$core.override final _$jni.JObjType<$T> T; - final void Function(_$jni.JString s) _voidCallback; + final void Function(_$jni.JString? string) _voidCallback; final bool voidCallback$async; - final _$jni.JString Function(_$jni.JString s) _stringCallback; - final $T Function($T t) _varCallback; - final int Function(int a, bool b, int c, double d) _manyPrimitives; + final _$jni.JString? Function(_$jni.JString? string) _stringCallback; + final $T? Function($T? object) _varCallback; + final int Function(int i, bool z, int c, double d) _manyPrimitives; + + void voidCallback(_$jni.JString? string) { + return _voidCallback(string); + } - void voidCallback(_$jni.JString s) { - return _voidCallback(s); + _$jni.JString? stringCallback(_$jni.JString? string) { + return _stringCallback(string); } - _$jni.JString stringCallback(_$jni.JString s) { - return _stringCallback(s); + $T? varCallback($T? object) { + return _varCallback(object); } - $T varCallback($T t) { - return _varCallback(t); + int manyPrimitives(int i, bool z, int c, double d) { + return _manyPrimitives(i, z, c, d); } +} + +final class $MyInterface$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $MyInterface$NullableType( + this.T, + ); - int manyPrimitives(int a, bool b, int c, double d) { - return _manyPrimitives(a, b, c, d); + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/MyInterface;'; + + @_$jni.internal + @_$core.override + MyInterface<$T>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MyInterface<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($MyInterface$NullableType, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyInterface$NullableType<$T>) && + other is $MyInterface$NullableType<$T> && + T == other.T; } } -final class $MyInterface$Type<$T extends _$jni.JObject> +final class $MyInterface$Type<$T extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -5489,11 +6988,18 @@ final class $MyInterface$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override MyInterface<$T> fromReference(_$jni.JReference reference) => - MyInterface.fromReference(T, reference); + MyInterface<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $MyInterface$NullableType<$T>(T); @_$jni.internal @_$core.override @@ -5526,6 +7032,7 @@ class MyInterfaceConsumer extends _$jni.JObject { r'com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer'); /// The type which includes information such as the signature of this class. + static const nullableType = $MyInterfaceConsumer$NullableType(); static const type = $MyInterfaceConsumer$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -5583,31 +7090,30 @@ class MyInterfaceConsumer extends _$jni.JObject { double, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public void consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String s, int a, boolean b, char c, double d, T t)` - static void consumeOnAnotherThread<$T extends _$jni.JObject>( - MyInterface<$T> myInterface, - _$jni.JString s, - int a, - bool b, + /// from: `static public void consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` + static void consumeOnAnotherThread<$T extends _$jni.JObject?>( + MyInterface<$T?>? myInterface, + _$jni.JString? string, + int i, + bool z, int c, double d, - $T t, { - _$jni.JObjType<$T>? T, + $T? object, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - t.$type, - (myInterface.$type as $MyInterface$Type<_$core.dynamic>).T, - ]) as _$jni.JObjType<$T>; + final _$myInterface = myInterface?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? _$jni.jNullReference; _consumeOnAnotherThread( _class.reference.pointer, _id_consumeOnAnotherThread as _$jni.JMethodIDPtr, - myInterface.reference.pointer, - s.reference.pointer, - a, - b ? 1 : 0, + _$myInterface.pointer, + _$string.pointer, + i, + z ? 1 : 0, c, d, - t.reference.pointer) + _$object.pointer) .check(); } @@ -5643,35 +7149,74 @@ class MyInterfaceConsumer extends _$jni.JObject { double, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public void consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String s, int a, boolean b, char c, double d, T t)` - static void consumeOnSameThread<$T extends _$jni.JObject>( - MyInterface<$T> myInterface, - _$jni.JString s, - int a, - bool b, + /// from: `static public void consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` + static void consumeOnSameThread<$T extends _$jni.JObject?>( + MyInterface<$T?>? myInterface, + _$jni.JString? string, + int i, + bool z, int c, double d, - $T t, { - _$jni.JObjType<$T>? T, + $T? object, { + required _$jni.JObjType<$T> T, }) { - T ??= _$jni.lowestCommonSuperType([ - t.$type, - (myInterface.$type as $MyInterface$Type<_$core.dynamic>).T, - ]) as _$jni.JObjType<$T>; + final _$myInterface = myInterface?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? _$jni.jNullReference; _consumeOnSameThread( _class.reference.pointer, _id_consumeOnSameThread as _$jni.JMethodIDPtr, - myInterface.reference.pointer, - s.reference.pointer, - a, - b ? 1 : 0, + _$myInterface.pointer, + _$string.pointer, + i, + z ? 1 : 0, c, d, - t.reference.pointer) + _$object.pointer) .check(); } } +final class $MyInterfaceConsumer$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $MyInterfaceConsumer$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;'; + + @_$jni.internal + @_$core.override + MyInterfaceConsumer? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : MyInterfaceConsumer.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MyInterfaceConsumer$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyInterfaceConsumer$NullableType) && + other is $MyInterfaceConsumer$NullableType; + } +} + final class $MyInterfaceConsumer$Type extends _$jni.JObjType { @_$jni.internal @@ -5685,11 +7230,17 @@ final class $MyInterfaceConsumer$Type @_$jni.internal @_$core.override MyInterfaceConsumer fromReference(_$jni.JReference reference) => - MyInterfaceConsumer.fromReference(reference); + MyInterfaceConsumer.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $MyInterfaceConsumer$NullableType(); @_$jni.internal @_$core.override @@ -5721,6 +7272,7 @@ class MyRunnable extends _$jni.JObject { r'com/github/dart_lang/jnigen/interfaces/MyRunnable'); /// The type which includes information such as the signature of this class. + static const nullableType = $MyRunnable$NullableType(); static const type = $MyRunnable$Type(); static final _id_run = _class.instanceMethodId( r'run', @@ -5847,6 +7399,44 @@ final class _$MyRunnable with $MyRunnable { } } +final class $MyRunnable$NullableType extends _$jni.JObjType { + @_$jni.internal + const $MyRunnable$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;'; + + @_$jni.internal + @_$core.override + MyRunnable? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MyRunnable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MyRunnable$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyRunnable$NullableType) && + other is $MyRunnable$NullableType; + } +} + final class $MyRunnable$Type extends _$jni.JObjType { @_$jni.internal const $MyRunnable$Type(); @@ -5859,11 +7449,17 @@ final class $MyRunnable$Type extends _$jni.JObjType { @_$jni.internal @_$core.override MyRunnable fromReference(_$jni.JReference reference) => - MyRunnable.fromReference(reference); + MyRunnable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $MyRunnable$NullableType(); @_$jni.internal @_$core.override @@ -5894,6 +7490,7 @@ class MyRunnableRunner extends _$jni.JObject { r'com/github/dart_lang/jnigen/interfaces/MyRunnableRunner'); /// The type which includes information such as the signature of this class. + static const nullableType = $MyRunnableRunner$NullableType(); static const type = $MyRunnableRunner$Type(); static final _id_error = _class.instanceFieldId( r'error', @@ -5902,12 +7499,13 @@ class MyRunnableRunner extends _$jni.JObject { /// from: `public java.lang.Throwable error` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject get error => _id_error.get(this, const _$jni.JObjectType()); + _$jni.JObject? get error => + _id_error.get(this, const _$jni.JObjectNullableType()); /// from: `public java.lang.Throwable error` /// The returned object must be released after use, by calling the [release] method. - set error(_$jni.JObject value) => - _id_error.set(this, const _$jni.JObjectType(), value); + set error(_$jni.JObject? value) => + _id_error.set(this, const _$jni.JObjectNullableType(), value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V', @@ -5924,13 +7522,14 @@ class MyRunnableRunner extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (com.github.dart_lang.jnigen.interfaces.MyRunnable runnable)` + /// from: `public void (com.github.dart_lang.jnigen.interfaces.MyRunnable myRunnable)` /// The returned object must be released after use, by calling the [release] method. factory MyRunnableRunner( - MyRunnable runnable, + MyRunnable? myRunnable, ) { + final _$myRunnable = myRunnable?.reference ?? _$jni.jNullReference; return MyRunnableRunner.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, runnable.reference.pointer) + _id_new$ as _$jni.JMethodIDPtr, _$myRunnable.pointer) .reference); } @@ -6007,6 +7606,46 @@ class MyRunnableRunner extends _$jni.JObject { } } +final class $MyRunnableRunner$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $MyRunnableRunner$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;'; + + @_$jni.internal + @_$core.override + MyRunnableRunner? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : MyRunnableRunner.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MyRunnableRunner$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyRunnableRunner$NullableType) && + other is $MyRunnableRunner$NullableType; + } +} + final class $MyRunnableRunner$Type extends _$jni.JObjType { @_$jni.internal const $MyRunnableRunner$Type(); @@ -6019,11 +7658,17 @@ final class $MyRunnableRunner$Type extends _$jni.JObjType { @_$jni.internal @_$core.override MyRunnableRunner fromReference(_$jni.JReference reference) => - MyRunnableRunner.fromReference(reference); + MyRunnableRunner.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $MyRunnableRunner$NullableType(); @_$jni.internal @_$core.override @@ -6055,6 +7700,7 @@ class StringConversionException extends _$jni.JObject { r'com/github/dart_lang/jnigen/interfaces/StringConversionException'); /// The type which includes information such as the signature of this class. + static const nullableType = $StringConversionException$NullableType(); static const type = $StringConversionException$Type(); static final _id_new$ = _class.constructorId( r'(Ljava/lang/String;)V', @@ -6071,19 +7717,60 @@ class StringConversionException extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public void (java.lang.String message)` + /// from: `public void (java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. factory StringConversionException( - _$jni.JString message, + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; return StringConversionException.fromReference(_new$( _class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, - message.reference.pointer) + _$string.pointer) .reference); } } +final class $StringConversionException$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $StringConversionException$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/StringConversionException;'; + + @_$jni.internal + @_$core.override + StringConversionException? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : StringConversionException.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($StringConversionException$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringConversionException$NullableType) && + other is $StringConversionException$NullableType; + } +} + final class $StringConversionException$Type extends _$jni.JObjType { @_$jni.internal @@ -6097,11 +7784,17 @@ final class $StringConversionException$Type @_$jni.internal @_$core.override StringConversionException fromReference(_$jni.JReference reference) => - StringConversionException.fromReference(reference); + StringConversionException.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $StringConversionException$NullableType(); @_$jni.internal @_$core.override @@ -6133,6 +7826,7 @@ class StringConverter extends _$jni.JObject { r'com/github/dart_lang/jnigen/interfaces/StringConverter'); /// The type which includes information such as the signature of this class. + static const nullableType = $StringConverter$NullableType(); static const type = $StringConverter$Type(); static final _id_parseToInt = _class.instanceMethodId( r'parseToInt', @@ -6150,12 +7844,13 @@ class StringConverter extends _$jni.JObject { _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract int parseToInt(java.lang.String s)` + /// from: `public abstract int parseToInt(java.lang.String string)` int parseToInt( - _$jni.JString s, + _$jni.JString? string, ) { + final _$string = string?.reference ?? _$jni.jNullReference; return _parseToInt(reference.pointer, _id_parseToInt as _$jni.JMethodIDPtr, - s.reference.pointer) + _$string.pointer) .integer; } @@ -6191,7 +7886,7 @@ class StringConverter extends _$jni.JObject { final $a = $i.args; if ($d == r'parseToInt(Ljava/lang/String;)I') { final $r = _$impls[$p]!.parseToInt( - $a[0].as(const _$jni.JStringType(), releaseOriginal: true), + $a![0]?.as(const _$jni.JStringType(), releaseOriginal: true), ); return _$jni.JInteger($r).reference.toPointer(); } @@ -6239,21 +7934,60 @@ class StringConverter extends _$jni.JObject { abstract base mixin class $StringConverter { factory $StringConverter({ - required int Function(_$jni.JString s) parseToInt, + required int Function(_$jni.JString? string) parseToInt, }) = _$StringConverter; - int parseToInt(_$jni.JString s); + int parseToInt(_$jni.JString? string); } final class _$StringConverter with $StringConverter { _$StringConverter({ - required int Function(_$jni.JString s) parseToInt, + required int Function(_$jni.JString? string) parseToInt, }) : _parseToInt = parseToInt; - final int Function(_$jni.JString s) _parseToInt; + final int Function(_$jni.JString? string) _parseToInt; + + int parseToInt(_$jni.JString? string) { + return _parseToInt(string); + } +} + +final class $StringConverter$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $StringConverter$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/StringConverter;'; + + @_$jni.internal + @_$core.override + StringConverter? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : StringConverter.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($StringConverter$NullableType).hashCode; - int parseToInt(_$jni.JString s) { - return _parseToInt(s); + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringConverter$NullableType) && + other is $StringConverter$NullableType; } } @@ -6269,11 +8003,17 @@ final class $StringConverter$Type extends _$jni.JObjType { @_$jni.internal @_$core.override StringConverter fromReference(_$jni.JReference reference) => - StringConverter.fromReference(reference); + StringConverter.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $StringConverter$NullableType(); @_$jni.internal @_$core.override @@ -6305,6 +8045,7 @@ class StringConverterConsumer extends _$jni.JObject { r'com/github/dart_lang/jnigen/interfaces/StringConverterConsumer'); /// The type which includes information such as the signature of this class. + static const nullableType = $StringConverterConsumer$NullableType(); static const type = $StringConverterConsumer$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -6352,18 +8093,21 @@ class StringConverterConsumer extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public java.lang.Integer consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String s)` + /// from: `static public java.lang.Integer consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JInteger consumeOnSameThread( - StringConverter stringConverter, - _$jni.JString s, + static _$jni.JInteger? consumeOnSameThread( + StringConverter? stringConverter, + _$jni.JString? string, ) { + final _$stringConverter = + stringConverter?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; return _consumeOnSameThread( _class.reference.pointer, _id_consumeOnSameThread as _$jni.JMethodIDPtr, - stringConverter.reference.pointer, - s.reference.pointer) - .object(const _$jni.JIntegerType()); + _$stringConverter.pointer, + _$string.pointer) + .object<_$jni.JInteger?>(const _$jni.JIntegerNullableType()); } static final _id_consumeOnAnotherThread = _class.staticMethodId( @@ -6388,25 +8132,28 @@ class StringConverterConsumer extends _$jni.JObject { _$jni.Pointer<_$jni.Void>, _$jni.Pointer<_$jni.Void>)>(); - /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String s)` + /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject consumeOnAnotherThread( - StringConverter stringConverter, - _$jni.JString s, + static _$jni.JObject? consumeOnAnotherThread( + StringConverter? stringConverter, + _$jni.JString? string, ) { + final _$stringConverter = + stringConverter?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? _$jni.jNullReference; return _consumeOnAnotherThread( _class.reference.pointer, _id_consumeOnAnotherThread as _$jni.JMethodIDPtr, - stringConverter.reference.pointer, - s.reference.pointer) - .object(const _$jni.JObjectType()); + _$stringConverter.pointer, + _$string.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); } } -final class $StringConverterConsumer$Type - extends _$jni.JObjType { +final class $StringConverterConsumer$NullableType + extends _$jni.JObjType { @_$jni.internal - const $StringConverterConsumer$Type(); + const $StringConverterConsumer$NullableType(); @_$jni.internal @_$core.override @@ -6415,51 +8162,105 @@ final class $StringConverterConsumer$Type @_$jni.internal @_$core.override - StringConverterConsumer fromReference(_$jni.JReference reference) => - StringConverterConsumer.fromReference(reference); + StringConverterConsumer? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : StringConverterConsumer.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => this; @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => ($StringConverterConsumer$Type).hashCode; + int get hashCode => ($StringConverterConsumer$NullableType).hashCode; @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($StringConverterConsumer$Type) && - other is $StringConverterConsumer$Type; + return other.runtimeType == ($StringConverterConsumer$NullableType) && + other is $StringConverterConsumer$NullableType; } } -/// from: `com.github.dart_lang.jnigen.inheritance.BaseClass` -class BaseClass<$T extends _$jni.JObject> extends _$jni.JObject { +final class $StringConverterConsumer$Type + extends _$jni.JObjType { @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; + const $StringConverterConsumer$Type(); @_$jni.internal - final _$jni.JObjType<$T> T; + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/interfaces/StringConverterConsumer;'; + + @_$jni.internal + @_$core.override + StringConverterConsumer fromReference(_$jni.JReference reference) => + StringConverterConsumer.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + const $StringConverterConsumer$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($StringConverterConsumer$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($StringConverterConsumer$Type) && + other is $StringConverterConsumer$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.inheritance.BaseClass` +class BaseClass<$T extends _$jni.JObject?> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$T> T; @_$jni.internal BaseClass.fromReference( this.T, _$jni.JReference reference, - ) : $type = type(T), + ) : $type = type<$T>(T), super.fromReference(reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/inheritance/BaseClass'); /// The type which includes information such as the signature of this class. - static $BaseClass$Type<$T> type<$T extends _$jni.JObject>( + static $BaseClass$NullableType<$T> nullableType<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $BaseClass$NullableType<$T>( + T, + ); + } + + static $BaseClass$Type<$T> type<$T extends _$jni.JObject?>( _$jni.JObjType<$T> T, ) { - return $BaseClass$Type( + return $BaseClass$Type<$T>( T, ); } @@ -6485,14 +8286,60 @@ class BaseClass<$T extends _$jni.JObject> extends _$jni.JObject { factory BaseClass({ required _$jni.JObjType<$T> T, }) { - return BaseClass.fromReference( + return BaseClass<$T>.fromReference( T, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $BaseClass$Type<$T extends _$jni.JObject> +final class $BaseClass$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $BaseClass$NullableType( + this.T, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/inheritance/BaseClass;'; + + @_$jni.internal + @_$core.override + BaseClass<$T>? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : BaseClass<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($BaseClass$NullableType, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($BaseClass$NullableType<$T>) && + other is $BaseClass$NullableType<$T> && + T == other.T; + } +} + +final class $BaseClass$Type<$T extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -6510,11 +8357,18 @@ final class $BaseClass$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override BaseClass<$T> fromReference(_$jni.JReference reference) => - BaseClass.fromReference(T, reference); + BaseClass<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType?> get nullableType => + $BaseClass$NullableType<$T>(T); @_$jni.internal @_$core.override @@ -6532,7 +8386,7 @@ final class $BaseClass$Type<$T extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.inheritance.GenericDerivedClass` -class GenericDerivedClass<$T extends _$jni.JObject> extends BaseClass<$T> { +class GenericDerivedClass<$T extends _$jni.JObject?> extends BaseClass<$T?> { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -6544,17 +8398,26 @@ class GenericDerivedClass<$T extends _$jni.JObject> extends BaseClass<$T> { GenericDerivedClass.fromReference( this.T, _$jni.JReference reference, - ) : $type = type(T), - super.fromReference(T, reference); + ) : $type = type<$T>(T), + super.fromReference(T.nullableType, reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/inheritance/GenericDerivedClass'); /// The type which includes information such as the signature of this class. - static $GenericDerivedClass$Type<$T> type<$T extends _$jni.JObject>( + static $GenericDerivedClass$NullableType<$T> + nullableType<$T extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + ) { + return $GenericDerivedClass$NullableType<$T>( + T, + ); + } + + static $GenericDerivedClass$Type<$T> type<$T extends _$jni.JObject?>( _$jni.JObjType<$T> T, ) { - return $GenericDerivedClass$Type( + return $GenericDerivedClass$Type<$T>( T, ); } @@ -6580,14 +8443,61 @@ class GenericDerivedClass<$T extends _$jni.JObject> extends BaseClass<$T> { factory GenericDerivedClass({ required _$jni.JObjType<$T> T, }) { - return GenericDerivedClass.fromReference( + return GenericDerivedClass<$T>.fromReference( T, _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) .reference); } } -final class $GenericDerivedClass$Type<$T extends _$jni.JObject> +final class $GenericDerivedClass$NullableType<$T extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + const $GenericDerivedClass$NullableType( + this.T, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/inheritance/GenericDerivedClass;'; + + @_$jni.internal + @_$core.override + GenericDerivedClass<$T>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : GenericDerivedClass<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $BaseClass$NullableType<$T?>(T.nullableType); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 2; + + @_$core.override + int get hashCode => Object.hash($GenericDerivedClass$NullableType, T); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($GenericDerivedClass$NullableType<$T>) && + other is $GenericDerivedClass$NullableType<$T> && + T == other.T; + } +} + +final class $GenericDerivedClass$Type<$T extends _$jni.JObject?> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -6605,11 +8515,18 @@ final class $GenericDerivedClass$Type<$T extends _$jni.JObject> @_$jni.internal @_$core.override GenericDerivedClass<$T> fromReference(_$jni.JReference reference) => - GenericDerivedClass.fromReference(T, reference); + GenericDerivedClass<$T>.fromReference( + T, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => $BaseClass$NullableType<$T?>(T.nullableType); @_$jni.internal @_$core.override - _$jni.JObjType get superType => $BaseClass$Type(T); + _$jni.JObjType?> get nullableType => + $GenericDerivedClass$NullableType<$T>(T); @_$jni.internal @_$core.override @@ -6627,7 +8544,7 @@ final class $GenericDerivedClass$Type<$T extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.inheritance.SpecificDerivedClass` -class SpecificDerivedClass extends BaseClass<_$jni.JString> { +class SpecificDerivedClass extends BaseClass<_$jni.JString?> { @_$jni.internal @_$core.override final _$jni.JObjType $type; @@ -6636,12 +8553,13 @@ class SpecificDerivedClass extends BaseClass<_$jni.JString> { SpecificDerivedClass.fromReference( _$jni.JReference reference, ) : $type = type, - super.fromReference(const _$jni.JStringType(), reference); + super.fromReference(const _$jni.JStringNullableType(), reference); static final _class = _$jni.JClass.forName( r'com/github/dart_lang/jnigen/inheritance/SpecificDerivedClass'); /// The type which includes information such as the signature of this class. + static const nullableType = $SpecificDerivedClass$NullableType(); static const type = $SpecificDerivedClass$Type(); static final _id_new$ = _class.constructorId( r'()V', @@ -6668,10 +8586,10 @@ class SpecificDerivedClass extends BaseClass<_$jni.JString> { } } -final class $SpecificDerivedClass$Type - extends _$jni.JObjType { +final class $SpecificDerivedClass$NullableType + extends _$jni.JObjType { @_$jni.internal - const $SpecificDerivedClass$Type(); + const $SpecificDerivedClass$NullableType(); @_$jni.internal @_$core.override @@ -6680,170 +8598,2490 @@ final class $SpecificDerivedClass$Type @_$jni.internal @_$core.override - SpecificDerivedClass fromReference(_$jni.JReference reference) => - SpecificDerivedClass.fromReference(reference); + SpecificDerivedClass? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : SpecificDerivedClass.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const $BaseClass$NullableType<_$jni.JString?>( + _$jni.JStringNullableType()); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const $BaseClass$Type(_$jni.JStringType()); + _$jni.JObjType get nullableType => this; @_$jni.internal @_$core.override final superCount = 2; @_$core.override - int get hashCode => ($SpecificDerivedClass$Type).hashCode; + int get hashCode => ($SpecificDerivedClass$NullableType).hashCode; @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($SpecificDerivedClass$Type) && - other is $SpecificDerivedClass$Type; - } -} - -/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable$Case` -class JsonSerializable_Case extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; - - @_$jni.internal - JsonSerializable_Case.fromReference( - _$jni.JReference reference, - ) : $type = type, - super.fromReference(reference); - - static final _class = _$jni.JClass.forName( - r'com/github/dart_lang/jnigen/annotations/JsonSerializable$Case'); - - /// The type which includes information such as the signature of this class. - static const type = $JsonSerializable_Case$Type(); - static final _id_values = _class.staticMethodId( - r'values', - r'()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', - ); - - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>(); - - /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case[] values()` - /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object(const _$jni.JArrayType($JsonSerializable_Case$Type())); - } - - static final _id_valueOf = _class.staticMethodId( - r'valueOf', - r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', - ); - - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( - 'globalEnv_CallStaticObjectMethod') - .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - - /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case valueOf(java.lang.String name)` - /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case valueOf( - _$jni.JString name, - ) { - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, - name.reference.pointer) - .object(const $JsonSerializable_Case$Type()); + return other.runtimeType == ($SpecificDerivedClass$NullableType) && + other is $SpecificDerivedClass$NullableType; } } -final class $JsonSerializable_Case$Type - extends _$jni.JObjType { +final class $SpecificDerivedClass$Type + extends _$jni.JObjType { @_$jni.internal - const $JsonSerializable_Case$Type(); + const $SpecificDerivedClass$Type(); @_$jni.internal @_$core.override String get signature => - r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; + r'Lcom/github/dart_lang/jnigen/inheritance/SpecificDerivedClass;'; @_$jni.internal @_$core.override - JsonSerializable_Case fromReference(_$jni.JReference reference) => - JsonSerializable_Case.fromReference(reference); + SpecificDerivedClass fromReference(_$jni.JReference reference) => + SpecificDerivedClass.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const $BaseClass$NullableType<_$jni.JString?>( + _$jni.JStringNullableType()); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => + const $SpecificDerivedClass$NullableType(); @_$jni.internal @_$core.override - final superCount = 1; + final superCount = 2; @_$core.override - int get hashCode => ($JsonSerializable_Case$Type).hashCode; + int get hashCode => ($SpecificDerivedClass$Type).hashCode; @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_Case$Type) && - other is $JsonSerializable_Case$Type; + return other.runtimeType == ($SpecificDerivedClass$Type) && + other is $SpecificDerivedClass$Type; } } -/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable` -class JsonSerializable extends _$jni.JObject { +/// from: `com.github.dart_lang.jnigen.annotations.Annotated$Nested` +class Annotated_Nested<$T extends _$jni.JObject?, $U extends _$jni.JObject, + $W extends _$jni.JObject, $V extends _$jni.JObject?> extends _$jni.JObject { @_$jni.internal @_$core.override - final _$jni.JObjType $type; + final _$jni.JObjType> $type; @_$jni.internal - JsonSerializable.fromReference( + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$W> W; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + Annotated_Nested.fromReference( + this.T, + this.U, + this.W, + this.V, _$jni.JReference reference, - ) : $type = type, + ) : $type = type<$T, $U, $W, $V>(T, U, W, V), super.fromReference(reference); static final _class = _$jni.JClass.forName( - r'com/github/dart_lang/jnigen/annotations/JsonSerializable'); + r'com/github/dart_lang/jnigen/annotations/Annotated$Nested'); /// The type which includes information such as the signature of this class. - static const type = $JsonSerializable$Type(); - static final _id_value = _class.instanceMethodId( - r'value', - r'()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', - ); - - static final _value = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>(); - - /// from: `public abstract com.github.dart_lang.jnigen.annotations.JsonSerializable$Case value()` - /// The returned object must be released after use, by calling the [release] method. - JsonSerializable_Case value() { - return _value(reference.pointer, _id_value as _$jni.JMethodIDPtr) - .object(const $JsonSerializable_Case$Type()); + static $Annotated_Nested$NullableType<$T, $U, $W, $V> nullableType< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $W extends _$jni.JObject, + $V extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + _$jni.JObjType<$W> W, + _$jni.JObjType<$V> V, + ) { + return $Annotated_Nested$NullableType<$T, $U, $W, $V>( + T, + U, + W, + V, + ); } - /// Maps a specific port to the implemented interface. + static $Annotated_Nested$Type<$T, $U, $W, $V> type< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $W extends _$jni.JObject, + $V extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + _$jni.JObjType<$W> W, + _$jni.JObjType<$V> V, + ) { + return $Annotated_Nested$Type<$T, $U, $W, $V>( + T, + U, + W, + V, + ); + } + + static final _id_v = _class.instanceFieldId( + r'v', + r'Ljava/lang/Object;', + ); + + /// from: `public V v` + /// The returned object must be released after use, by calling the [release] method. + $V? get v => _id_v.get(this, V.nullableType); + + /// from: `public V v` + /// The returned object must be released after use, by calling the [release] method. + set v($V? value) => _id_v.set(this, V.nullableType, value); + + static final _id_u = _class.instanceFieldId( + r'u', + r'Ljava/lang/Object;', + ); + + /// from: `public U u` + /// The returned object must be released after use, by calling the [release] method. + $U get u => _id_u.get(this, U); + + /// from: `public U u` + /// The returned object must be released after use, by calling the [release] method. + set u($U value) => _id_u.set(this, U, value); + + static final _id_new$ = _class.constructorId( + r'(Lcom/github/dart_lang/jnigen/annotations/Annotated;Ljava/lang/Object;)V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public void (com.github.dart_lang.jnigen.annotations.Annotated $outerClass, V object)` + /// The returned object must be released after use, by calling the [release] method. + factory Annotated_Nested( + Annotated<$T?, $U, $W> $outerClass, + $V? object, { + _$jni.JObjType<$T>? T, + _$jni.JObjType<$U>? U, + _$jni.JObjType<$W>? W, + required _$jni.JObjType<$V> V, + }) { + T ??= _$jni.lowestCommonSuperType([ + ($outerClass.$type as $Annotated$Type<_$core.dynamic, _$core.dynamic, + _$core.dynamic>) + .T, + ]) as _$jni.JObjType<$T>; + U ??= _$jni.lowestCommonSuperType([ + ($outerClass.$type as $Annotated$Type<_$core.dynamic, _$core.dynamic, + _$core.dynamic>) + .U, + ]) as _$jni.JObjType<$U>; + W ??= _$jni.lowestCommonSuperType([ + ($outerClass.$type as $Annotated$Type<_$core.dynamic, _$core.dynamic, + _$core.dynamic>) + .W, + ]) as _$jni.JObjType<$W>; + final _$$outerClass = $outerClass.reference; + final _$object = object?.reference ?? _$jni.jNullReference; + return Annotated_Nested<$T, $U, $W, $V>.fromReference( + T, + U, + W, + V, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _$$outerClass.pointer, _$object.pointer) + .reference); + } +} + +final class $Annotated_Nested$NullableType< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $W extends _$jni.JObject, + $V extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$W> W; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $Annotated_Nested$NullableType( + this.T, + this.U, + this.W, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/Annotated$Nested;'; + + @_$jni.internal + @_$core.override + Annotated_Nested<$T, $U, $W, $V>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : Annotated_Nested<$T, $U, $W, $V>.fromReference( + T, + U, + W, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($Annotated_Nested$NullableType, T, U, W, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($Annotated_Nested$NullableType<$T, $U, $W, $V>) && + other is $Annotated_Nested$NullableType<$T, $U, $W, $V> && + T == other.T && + U == other.U && + W == other.W && + V == other.V; + } +} + +final class $Annotated_Nested$Type< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $W extends _$jni.JObject, + $V extends _$jni.JObject?> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$W> W; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $Annotated_Nested$Type( + this.T, + this.U, + this.W, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/Annotated$Nested;'; + + @_$jni.internal + @_$core.override + Annotated_Nested<$T, $U, $W, $V> fromReference(_$jni.JReference reference) => + Annotated_Nested<$T, $U, $W, $V>.fromReference( + T, + U, + W, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => + $Annotated_Nested$NullableType<$T, $U, $W, $V>(T, U, W, V); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($Annotated_Nested$Type, T, U, W, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Annotated_Nested$Type<$T, $U, $W, $V>) && + other is $Annotated_Nested$Type<$T, $U, $W, $V> && + T == other.T && + U == other.U && + W == other.W && + V == other.V; + } +} + +/// from: `com.github.dart_lang.jnigen.annotations.Annotated` +class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, + $W extends _$jni.JObject> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$W> W; + + @_$jni.internal + Annotated.fromReference( + this.T, + this.U, + this.W, + _$jni.JReference reference, + ) : $type = type<$T, $U, $W>(T, U, W), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/Annotated'); + + /// The type which includes information such as the signature of this class. + static $Annotated$NullableType<$T, $U, $W> nullableType< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $W extends _$jni.JObject>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + _$jni.JObjType<$W> W, + ) { + return $Annotated$NullableType<$T, $U, $W>( + T, + U, + W, + ); + } + + static $Annotated$Type<$T, $U, $W> type<$T extends _$jni.JObject?, + $U extends _$jni.JObject, $W extends _$jni.JObject>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + _$jni.JObjType<$W> W, + ) { + return $Annotated$Type<$T, $U, $W>( + T, + U, + W, + ); + } + + static final _id_t = _class.instanceFieldId( + r't', + r'Ljava/lang/Object;', + ); + + /// from: `public T t` + /// The returned object must be released after use, by calling the [release] method. + $T? get t => _id_t.get(this, T.nullableType); + + /// from: `public T t` + /// The returned object must be released after use, by calling the [release] method. + set t($T? value) => _id_t.set(this, T.nullableType, value); + + static final _id_u = _class.instanceFieldId( + r'u', + r'Ljava/lang/Object;', + ); + + /// from: `public U u` + /// The returned object must be released after use, by calling the [release] method. + $U get u => _id_u.get(this, U); + + /// from: `public U u` + /// The returned object must be released after use, by calling the [release] method. + set u($U value) => _id_u.set(this, U, value); + + static final _id_w = _class.instanceFieldId( + r'w', + r'Ljava/lang/Object;', + ); + + /// from: `public W w` + /// The returned object must be released after use, by calling the [release] method. + $W get w => _id_w.get(this, W); + + /// from: `public W w` + /// The returned object must be released after use, by calling the [release] method. + set w($W value) => _id_w.set(this, W, value); + + static final _id_new$ = _class.constructorId( + r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public void (T object, U object1, W object2)` + /// The returned object must be released after use, by calling the [release] method. + factory Annotated( + $T? object, + $U object1, + $W object2, { + required _$jni.JObjType<$T> T, + _$jni.JObjType<$U>? U, + _$jni.JObjType<$W>? W, + }) { + U ??= _$jni.lowestCommonSuperType([ + object1.$type, + ]) as _$jni.JObjType<$U>; + W ??= _$jni.lowestCommonSuperType([ + object2.$type, + ]) as _$jni.JObjType<$W>; + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1.reference; + final _$object2 = object2.reference; + return Annotated<$T, $U, $W>.fromReference( + T, + U, + W, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _$object.pointer, _$object1.pointer, _$object2.pointer) + .reference); + } + + static final _id_hello = _class.instanceMethodId( + r'hello', + r'()Ljava/lang/String;', + ); + + static final _hello = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.lang.String hello()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString hello() { + return _hello(reference.pointer, _id_hello as _$jni.JMethodIDPtr) + .object<_$jni.JString>(const _$jni.JStringType()); + } + + static final _id_nullableHello = _class.instanceMethodId( + r'nullableHello', + r'(Z)Ljava/lang/String;', + ); + + static final _nullableHello = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.lang.String nullableHello(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString? nullableHello( + bool z, + ) { + return _nullableHello(reference.pointer, + _id_nullableHello as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); + } + + static final _id_echo = _class.instanceMethodId( + r'echo', + r'(Ljava/lang/String;)Ljava/lang/String;', + ); + + static final _echo = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public java.lang.String echo(java.lang.String string)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString echo( + _$jni.JString string, + ) { + final _$string = string.reference; + return _echo( + reference.pointer, _id_echo as _$jni.JMethodIDPtr, _$string.pointer) + .object<_$jni.JString>(const _$jni.JStringType()); + } + + static final _id_nullableEcho = _class.instanceMethodId( + r'nullableEcho', + r'(Ljava/lang/String;)Ljava/lang/String;', + ); + + static final _nullableEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public java.lang.String nullableEcho(java.lang.String string)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString? nullableEcho( + _$jni.JString? string, + ) { + final _$string = string?.reference ?? _$jni.jNullReference; + return _nullableEcho(reference.pointer, + _id_nullableEcho as _$jni.JMethodIDPtr, _$string.pointer) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); + } + + static final _id_array = _class.instanceMethodId( + r'array', + r'()[Ljava/lang/String;', + ); + + static final _array = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.lang.String[] array()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JArray<_$jni.JString> array() { + return _array(reference.pointer, _id_array as _$jni.JMethodIDPtr) + .object<_$jni.JArray<_$jni.JString>>( + const _$jni.JArrayType<_$jni.JString>(_$jni.JStringType())); + } + + static final _id_arrayOfNullable = _class.instanceMethodId( + r'arrayOfNullable', + r'()[Ljava/lang/String;', + ); + + static final _arrayOfNullable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.lang.String[] arrayOfNullable()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JArray<_$jni.JString?> arrayOfNullable() { + return _arrayOfNullable( + reference.pointer, _id_arrayOfNullable as _$jni.JMethodIDPtr) + .object<_$jni.JArray<_$jni.JString?>>( + const _$jni.JArrayType<_$jni.JString?>( + _$jni.JStringNullableType())); + } + + static final _id_nullableArray = _class.instanceMethodId( + r'nullableArray', + r'(Z)[Ljava/lang/String;', + ); + + static final _nullableArray = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.lang.String[] nullableArray(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JArray<_$jni.JString>? nullableArray( + bool z, + ) { + return _nullableArray(reference.pointer, + _id_nullableArray as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JArray<_$jni.JString>?>( + const _$jni.JArrayNullableType<_$jni.JString>(_$jni.JStringType())); + } + + static final _id_nullableArrayOfNullable = _class.instanceMethodId( + r'nullableArrayOfNullable', + r'(Z)[Ljava/lang/String;', + ); + + static final _nullableArrayOfNullable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.lang.String[] nullableArrayOfNullable(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JArray<_$jni.JString?>? nullableArrayOfNullable( + bool z, + ) { + return _nullableArrayOfNullable(reference.pointer, + _id_nullableArrayOfNullable as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JArray<_$jni.JString?>?>( + const _$jni.JArrayNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); + } + + static final _id_list = _class.instanceMethodId( + r'list', + r'()Ljava/util/List;', + ); + + static final _list = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List list()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JString> list() { + return _list(reference.pointer, _id_list as _$jni.JMethodIDPtr) + .object<_$jni.JList<_$jni.JString>>( + const _$jni.JListType<_$jni.JString>(_$jni.JStringType())); + } + + static final _id_listOfNullable = _class.instanceMethodId( + r'listOfNullable', + r'()Ljava/util/List;', + ); + + static final _listOfNullable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List listOfNullable()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JString?> listOfNullable() { + return _listOfNullable( + reference.pointer, _id_listOfNullable as _$jni.JMethodIDPtr) + .object<_$jni.JList<_$jni.JString?>>( + const _$jni.JListType<_$jni.JString?>(_$jni.JStringNullableType())); + } + + static final _id_nullableList = _class.instanceMethodId( + r'nullableList', + r'(Z)Ljava/util/List;', + ); + + static final _nullableList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List nullableList(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JString>? nullableList( + bool z, + ) { + return _nullableList(reference.pointer, + _id_nullableList as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JList<_$jni.JString>?>( + const _$jni.JListNullableType<_$jni.JString>(_$jni.JStringType())); + } + + static final _id_nullableListOfNullable = _class.instanceMethodId( + r'nullableListOfNullable', + r'(Z)Ljava/util/List;', + ); + + static final _nullableListOfNullable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List nullableListOfNullable(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JString?>? nullableListOfNullable( + bool z, + ) { + return _nullableListOfNullable(reference.pointer, + _id_nullableListOfNullable as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JList<_$jni.JString?>?>( + const _$jni.JListNullableType<_$jni.JString?>( + _$jni.JStringNullableType())); + } + + static final _id_classGenericEcho = _class.instanceMethodId( + r'classGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _classGenericEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T classGenericEcho(T object)` + /// The returned object must be released after use, by calling the [release] method. + $T classGenericEcho( + $T object, + ) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _classGenericEcho(reference.pointer, + _id_classGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + .object<$T>(T); + } + + static final _id_nullableClassGenericEcho = _class.instanceMethodId( + r'nullableClassGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _nullableClassGenericEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T nullableClassGenericEcho(T object)` + /// The returned object must be released after use, by calling the [release] method. + $T? nullableClassGenericEcho( + $T? object, + ) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _nullableClassGenericEcho( + reference.pointer, + _id_nullableClassGenericEcho as _$jni.JMethodIDPtr, + _$object.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_methodGenericEcho = _class.instanceMethodId( + r'methodGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _methodGenericEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V methodGenericEcho(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericEcho<$V extends _$jni.JObject?>( + $V object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _methodGenericEcho(reference.pointer, + _id_methodGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + .object<$V>(V); + } + + static final _id_methodGenericEcho2 = _class.instanceMethodId( + r'methodGenericEcho2', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _methodGenericEcho2 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V methodGenericEcho2(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericEcho2<$V extends _$jni.JObject>( + $V object, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + object.$type, + ]) as _$jni.JObjType<$V>; + final _$object = object.reference; + return _methodGenericEcho2(reference.pointer, + _id_methodGenericEcho2 as _$jni.JMethodIDPtr, _$object.pointer) + .object<$V>(V); + } + + static final _id_methodGenericEcho3 = _class.instanceMethodId( + r'methodGenericEcho3', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _methodGenericEcho3 = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V methodGenericEcho3(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericEcho3<$V extends _$jni.JObject>( + $V object, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + object.$type, + ]) as _$jni.JObjType<$V>; + final _$object = object.reference; + return _methodGenericEcho3(reference.pointer, + _id_methodGenericEcho3 as _$jni.JMethodIDPtr, _$object.pointer) + .object<$V>(V); + } + + static final _id_nullableReturnMethodGenericEcho = _class.instanceMethodId( + r'nullableReturnMethodGenericEcho', + r'(Ljava/lang/Object;Z)Ljava/lang/Object;', + ); + + static final _nullableReturnMethodGenericEcho = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + + /// from: `public V nullableReturnMethodGenericEcho(V object, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + $V? nullableReturnMethodGenericEcho<$V extends _$jni.JObject?>( + $V object, + bool z, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _nullableReturnMethodGenericEcho( + reference.pointer, + _id_nullableReturnMethodGenericEcho as _$jni.JMethodIDPtr, + _$object.pointer, + z ? 1 : 0) + .object<$V?>(V.nullableType); + } + + static final _id_nullableReturnMethodGenericEcho2 = _class.instanceMethodId( + r'nullableReturnMethodGenericEcho2', + r'(Ljava/lang/Object;Z)Ljava/lang/Object;', + ); + + static final _nullableReturnMethodGenericEcho2 = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Int32 + )>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + + /// from: `public V nullableReturnMethodGenericEcho2(V object, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + $V? nullableReturnMethodGenericEcho2<$V extends _$jni.JObject>( + $V object, + bool z, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + object.$type, + ]) as _$jni.JObjType<$V>; + final _$object = object.reference; + return _nullableReturnMethodGenericEcho2( + reference.pointer, + _id_nullableReturnMethodGenericEcho2 as _$jni.JMethodIDPtr, + _$object.pointer, + z ? 1 : 0) + .object<$V?>(V.nullableType); + } + + static final _id_nullableMethodGenericEcho = _class.instanceMethodId( + r'nullableMethodGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _nullableMethodGenericEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V nullableMethodGenericEcho(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V nullableMethodGenericEcho<$V extends _$jni.JObject?>( + $V object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _nullableMethodGenericEcho( + reference.pointer, + _id_nullableMethodGenericEcho as _$jni.JMethodIDPtr, + _$object.pointer) + .object<$V>(V); + } + + static final _id_noAnnotationMethodGenericEcho = _class.instanceMethodId( + r'noAnnotationMethodGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _noAnnotationMethodGenericEcho = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V noAnnotationMethodGenericEcho(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V? noAnnotationMethodGenericEcho<$V extends _$jni.JObject?>( + $V? object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _noAnnotationMethodGenericEcho( + reference.pointer, + _id_noAnnotationMethodGenericEcho as _$jni.JMethodIDPtr, + _$object.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_nullableArgMethodGenericEcho = _class.instanceMethodId( + r'nullableArgMethodGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _nullableArgMethodGenericEcho = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V nullableArgMethodGenericEcho(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V nullableArgMethodGenericEcho<$V extends _$jni.JObject>( + $V? object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _nullableArgMethodGenericEcho( + reference.pointer, + _id_nullableArgMethodGenericEcho as _$jni.JMethodIDPtr, + _$object.pointer) + .object<$V>(V); + } + + static final _id_classGenericList = _class.instanceMethodId( + r'classGenericList', + r'()Ljava/util/List;', + ); + + static final _classGenericList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List classGenericList()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$T> classGenericList() { + return _classGenericList( + reference.pointer, _id_classGenericList as _$jni.JMethodIDPtr) + .object<_$jni.JList<$T>>(_$jni.JListType<$T>(T)); + } + + static final _id_classGenericListOfNullable = _class.instanceMethodId( + r'classGenericListOfNullable', + r'()Ljava/util/List;', + ); + + static final _classGenericListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List classGenericListOfNullable()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$T?> classGenericListOfNullable() { + return _classGenericListOfNullable(reference.pointer, + _id_classGenericListOfNullable as _$jni.JMethodIDPtr) + .object<_$jni.JList<$T?>>(_$jni.JListType<$T?>(T.nullableType)); + } + + static final _id_nullableClassGenericList = _class.instanceMethodId( + r'nullableClassGenericList', + r'(Z)Ljava/util/List;', + ); + + static final _nullableClassGenericList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List nullableClassGenericList(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$T>? nullableClassGenericList( + bool z, + ) { + return _nullableClassGenericList(reference.pointer, + _id_nullableClassGenericList as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JList<$T>?>(_$jni.JListNullableType<$T>(T)); + } + + static final _id_nullableClassGenericListOfNullable = _class.instanceMethodId( + r'nullableClassGenericListOfNullable', + r'(Z)Ljava/util/List;', + ); + + static final _nullableClassGenericListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List nullableClassGenericListOfNullable(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$T?>? nullableClassGenericListOfNullable( + bool z, + ) { + return _nullableClassGenericListOfNullable( + reference.pointer, + _id_nullableClassGenericListOfNullable as _$jni.JMethodIDPtr, + z ? 1 : 0) + .object<_$jni.JList<$T?>?>( + _$jni.JListNullableType<$T?>(T.nullableType)); + } + + static final _id_methodGenericList = _class.instanceMethodId( + r'methodGenericList', + r'(Ljava/lang/Object;)Ljava/util/List;', + ); + + static final _methodGenericList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public java.util.List methodGenericList(V object)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$V> methodGenericList<$V extends _$jni.JObject?>( + $V object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _methodGenericList(reference.pointer, + _id_methodGenericList as _$jni.JMethodIDPtr, _$object.pointer) + .object<_$jni.JList<$V>>(_$jni.JListType<$V>(V)); + } + + static final _id_methodGenericListOfNullable = _class.instanceMethodId( + r'methodGenericListOfNullable', + r'()Ljava/util/List;', + ); + + static final _methodGenericListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List methodGenericListOfNullable()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$V?> methodGenericListOfNullable<$V extends _$jni.JObject?>({ + required _$jni.JObjType<$V> V, + }) { + return _methodGenericListOfNullable(reference.pointer, + _id_methodGenericListOfNullable as _$jni.JMethodIDPtr) + .object<_$jni.JList<$V?>>(_$jni.JListType<$V?>(V.nullableType)); + } + + static final _id_nullableMethodGenericList = _class.instanceMethodId( + r'nullableMethodGenericList', + r'(Ljava/lang/Object;Z)Ljava/util/List;', + ); + + static final _nullableMethodGenericList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni + .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + + /// from: `public java.util.List nullableMethodGenericList(V object, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$V>? nullableMethodGenericList<$V extends _$jni.JObject?>( + $V object, + bool z, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _nullableMethodGenericList( + reference.pointer, + _id_nullableMethodGenericList as _$jni.JMethodIDPtr, + _$object.pointer, + z ? 1 : 0) + .object<_$jni.JList<$V>?>(_$jni.JListNullableType<$V>(V)); + } + + static final _id_nullableMethodGenericListOfNullable = + _class.instanceMethodId( + r'nullableMethodGenericListOfNullable', + r'(Z)Ljava/util/List;', + ); + + static final _nullableMethodGenericListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List nullableMethodGenericListOfNullable(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$V?>? + nullableMethodGenericListOfNullable<$V extends _$jni.JObject?>( + bool z, { + required _$jni.JObjType<$V> V, + }) { + return _nullableMethodGenericListOfNullable( + reference.pointer, + _id_nullableMethodGenericListOfNullable as _$jni.JMethodIDPtr, + z ? 1 : 0) + .object<_$jni.JList<$V?>?>( + _$jni.JListNullableType<$V?>(V.nullableType)); + } + + static final _id_firstOfClassGenericList = _class.instanceMethodId( + r'firstOfClassGenericList', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfClassGenericList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstOfClassGenericList(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstOfClassGenericList( + _$jni.JList<$T> list, + ) { + final _$list = list.reference; + return _firstOfClassGenericList(reference.pointer, + _id_firstOfClassGenericList as _$jni.JMethodIDPtr, _$list.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstOfClassGenericNullableList = _class.instanceMethodId( + r'firstOfClassGenericNullableList', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfClassGenericNullableList = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstOfClassGenericNullableList(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstOfClassGenericNullableList( + _$jni.JList<$T>? list, + ) { + final _$list = list?.reference ?? _$jni.jNullReference; + return _firstOfClassGenericNullableList( + reference.pointer, + _id_firstOfClassGenericNullableList as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstOfClassGenericListOfNullable = _class.instanceMethodId( + r'firstOfClassGenericListOfNullable', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfClassGenericListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstOfClassGenericListOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstOfClassGenericListOfNullable( + _$jni.JList<$T?> list, + ) { + final _$list = list.reference; + return _firstOfClassGenericListOfNullable( + reference.pointer, + _id_firstOfClassGenericListOfNullable as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstOfClassGenericNullableListOfNullable = + _class.instanceMethodId( + r'firstOfClassGenericNullableListOfNullable', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfClassGenericNullableListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstOfClassGenericNullableListOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstOfClassGenericNullableListOfNullable( + _$jni.JList<$T?>? list, + ) { + final _$list = list?.reference ?? _$jni.jNullReference; + return _firstOfClassGenericNullableListOfNullable( + reference.pointer, + _id_firstOfClassGenericNullableListOfNullable as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstOfMethodGenericList = _class.instanceMethodId( + r'firstOfMethodGenericList', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfMethodGenericList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstOfMethodGenericList(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstOfMethodGenericList<$V extends _$jni.JObject?>( + _$jni.JList<$V> list, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (list.$type as _$jni.JListType<_$core.dynamic>).E, + ]) as _$jni.JObjType<$V>; + final _$list = list.reference; + return _firstOfMethodGenericList(reference.pointer, + _id_firstOfMethodGenericList as _$jni.JMethodIDPtr, _$list.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstOfMethodGenericNullableList = _class.instanceMethodId( + r'firstOfMethodGenericNullableList', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfMethodGenericNullableList = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstOfMethodGenericNullableList(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstOfMethodGenericNullableList<$V extends _$jni.JObject?>( + _$jni.JList<$V>? list, { + required _$jni.JObjType<$V> V, + }) { + final _$list = list?.reference ?? _$jni.jNullReference; + return _firstOfMethodGenericNullableList( + reference.pointer, + _id_firstOfMethodGenericNullableList as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstOfMethodGenericListOfNullable = _class.instanceMethodId( + r'firstOfMethodGenericListOfNullable', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfMethodGenericListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstOfMethodGenericListOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstOfMethodGenericListOfNullable<$V extends _$jni.JObject?>( + _$jni.JList<$V?> list, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (list.$type as _$jni.JListType<_$core.dynamic>).E, + ]) as _$jni.JObjType<$V>; + final _$list = list.reference; + return _firstOfMethodGenericListOfNullable( + reference.pointer, + _id_firstOfMethodGenericListOfNullable as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstOfMethodGenericNullableListOfNullable = + _class.instanceMethodId( + r'firstOfMethodGenericNullableListOfNullable', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _firstOfMethodGenericNullableListOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstOfMethodGenericNullableListOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstOfMethodGenericNullableListOfNullable<$V extends _$jni.JObject?>( + _$jni.JList<$V?>? list, { + required _$jni.JObjType<$V> V, + }) { + final _$list = list?.reference ?? _$jni.jNullReference; + return _firstOfMethodGenericNullableListOfNullable( + reference.pointer, + _id_firstOfMethodGenericNullableListOfNullable + as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstKeyOfComboMap = _class.instanceMethodId( + r'firstKeyOfComboMap', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstKeyOfComboMap = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstKeyOfComboMap(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstKeyOfComboMap<$V extends _$jni.JObject?>( + _$jni.JMap<$T, $V> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstKeyOfComboMap(reference.pointer, + _id_firstKeyOfComboMap as _$jni.JMethodIDPtr, _$map.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstValueOfComboMap = _class.instanceMethodId( + r'firstValueOfComboMap', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstValueOfComboMap = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstValueOfComboMap(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstValueOfComboMap<$V extends _$jni.JObject?>( + _$jni.JMap<$T, $V> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstValueOfComboMap(reference.pointer, + _id_firstValueOfComboMap as _$jni.JMethodIDPtr, _$map.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstKeyOfComboMapNullableKey = _class.instanceMethodId( + r'firstKeyOfComboMapNullableKey', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstKeyOfComboMapNullableKey = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstKeyOfComboMapNullableKey(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstKeyOfComboMapNullableKey<$V extends _$jni.JObject?>( + _$jni.JMap<$T?, $V> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstKeyOfComboMapNullableKey( + reference.pointer, + _id_firstKeyOfComboMapNullableKey as _$jni.JMethodIDPtr, + _$map.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstValueOfComboMapNullableKey = _class.instanceMethodId( + r'firstValueOfComboMapNullableKey', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstValueOfComboMapNullableKey = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstValueOfComboMapNullableKey(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstValueOfComboMapNullableKey<$V extends _$jni.JObject?>( + _$jni.JMap<$T?, $V> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstValueOfComboMapNullableKey( + reference.pointer, + _id_firstValueOfComboMapNullableKey as _$jni.JMethodIDPtr, + _$map.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstKeyOfComboMapNullableValue = _class.instanceMethodId( + r'firstKeyOfComboMapNullableValue', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstKeyOfComboMapNullableValue = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstKeyOfComboMapNullableValue(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstKeyOfComboMapNullableValue<$V extends _$jni.JObject?>( + _$jni.JMap<$T, $V?> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstKeyOfComboMapNullableValue( + reference.pointer, + _id_firstKeyOfComboMapNullableValue as _$jni.JMethodIDPtr, + _$map.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstValueOfComboMapNullableValue = _class.instanceMethodId( + r'firstValueOfComboMapNullableValue', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstValueOfComboMapNullableValue = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstValueOfComboMapNullableValue(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstValueOfComboMapNullableValue<$V extends _$jni.JObject?>( + _$jni.JMap<$T, $V?> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstValueOfComboMapNullableValue( + reference.pointer, + _id_firstValueOfComboMapNullableValue as _$jni.JMethodIDPtr, + _$map.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstKeyOfComboMapNullableKeyAndValue = + _class.instanceMethodId( + r'firstKeyOfComboMapNullableKeyAndValue', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstKeyOfComboMapNullableKeyAndValue = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public T firstKeyOfComboMapNullableKeyAndValue(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $T? firstKeyOfComboMapNullableKeyAndValue<$V extends _$jni.JObject?>( + _$jni.JMap<$T?, $V?> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstKeyOfComboMapNullableKeyAndValue( + reference.pointer, + _id_firstKeyOfComboMapNullableKeyAndValue as _$jni.JMethodIDPtr, + _$map.pointer) + .object<$T?>(T.nullableType); + } + + static final _id_firstValueOfComboMapNullableKeyAndValue = + _class.instanceMethodId( + r'firstValueOfComboMapNullableKeyAndValue', + r'(Ljava/util/Map;)Ljava/lang/Object;', + ); + + static final _firstValueOfComboMapNullableKeyAndValue = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public V firstValueOfComboMapNullableKeyAndValue(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + $V? firstValueOfComboMapNullableKeyAndValue<$V extends _$jni.JObject?>( + _$jni.JMap<$T?, $V?> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstValueOfComboMapNullableKeyAndValue( + reference.pointer, + _id_firstValueOfComboMapNullableKeyAndValue as _$jni.JMethodIDPtr, + _$map.pointer) + .object<$V?>(V.nullableType); + } + + static final _id_firstEntryOfComboMap = _class.instanceMethodId( + r'firstEntryOfComboMap', + r'(Ljava/util/Map;)Ljava/util/Map$Entry;', + ); + + static final _firstEntryOfComboMap = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public java.util.Map$Entry firstEntryOfComboMap(java.util.Map map)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JObject? firstEntryOfComboMap<$V extends _$jni.JObject?>( + _$jni.JMap<$T, $V> map, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, + ]) as _$jni.JObjType<$V>; + final _$map = map.reference; + return _firstEntryOfComboMap(reference.pointer, + _id_firstEntryOfComboMap as _$jni.JMethodIDPtr, _$map.pointer) + .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + } + + static final _id_getW = _class.instanceMethodId( + r'getW', + r'()Ljava/lang/Object;', + ); + + static final _getW = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public W getW()` + /// The returned object must be released after use, by calling the [release] method. + $W getW() { + return _getW(reference.pointer, _id_getW as _$jni.JMethodIDPtr) + .object<$W>(W); + } + + static final _id_nullableGetW = _class.instanceMethodId( + r'nullableGetW', + r'(Z)Ljava/lang/Object;', + ); + + static final _nullableGetW = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public W nullableGetW(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + $W? nullableGetW( + bool z, + ) { + return _nullableGetW(reference.pointer, + _id_nullableGetW as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<$W?>(W.nullableType); + } + + static final _id_list3dOfT = _class.instanceMethodId( + r'list3dOfT', + r'()Ljava/util/List;', + ); + + static final _list3dOfT = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List list3dOfT()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JList<_$jni.JList<$T?>>> list3dOfT() { + return _list3dOfT(reference.pointer, _id_list3dOfT as _$jni.JMethodIDPtr) + .object<_$jni.JList<_$jni.JList<_$jni.JList<$T?>>>>( + _$jni.JListType<_$jni.JList<_$jni.JList<$T?>>>( + _$jni.JListType<_$jni.JList<$T?>>( + _$jni.JListType<$T?>(T.nullableType)))); + } + + static final _id_list3dOfU = _class.instanceMethodId( + r'list3dOfU', + r'()Ljava/util/List;', + ); + + static final _list3dOfU = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List list3dOfU()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JList<_$jni.JList<$U>>> list3dOfU() { + return _list3dOfU(reference.pointer, _id_list3dOfU as _$jni.JMethodIDPtr) + .object<_$jni.JList<_$jni.JList<_$jni.JList<$U>>>>( + _$jni.JListType<_$jni.JList<_$jni.JList<$U>>>( + _$jni.JListType<_$jni.JList<$U>>(_$jni.JListType<$U>(U)))); + } + + static final _id_list3dOfW = _class.instanceMethodId( + r'list3dOfW', + r'()Ljava/util/List;', + ); + + static final _list3dOfW = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List list3dOfW()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JList<_$jni.JList<$W>>> list3dOfW() { + return _list3dOfW(reference.pointer, _id_list3dOfW as _$jni.JMethodIDPtr) + .object<_$jni.JList<_$jni.JList<_$jni.JList<$W>>>>( + _$jni.JListType<_$jni.JList<_$jni.JList<$W>>>( + _$jni.JListType<_$jni.JList<$W>>(_$jni.JListType<$W>(W)))); + } + + static final _id_list3dOfNullableU = _class.instanceMethodId( + r'list3dOfNullableU', + r'(Z)Ljava/util/List;', + ); + + static final _list3dOfNullableU = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List list3dOfNullableU(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JList<_$jni.JList<$U?>>> list3dOfNullableU( + bool z, + ) { + return _list3dOfNullableU(reference.pointer, + _id_list3dOfNullableU as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JList<_$jni.JList<_$jni.JList<$U?>>>>( + _$jni.JListType<_$jni.JList<_$jni.JList<$U?>>>( + _$jni.JListType<_$jni.JList<$U?>>( + _$jni.JListType<$U?>(U.nullableType)))); + } + + static final _id_list3dOfNullableW = _class.instanceMethodId( + r'list3dOfNullableW', + r'(Z)Ljava/util/List;', + ); + + static final _list3dOfNullableW = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public java.util.List list3dOfNullableW(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JList<_$jni.JList<$W?>>> list3dOfNullableW( + bool z, + ) { + return _list3dOfNullableW(reference.pointer, + _id_list3dOfNullableW as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JList<_$jni.JList<_$jni.JList<$W?>>>>( + _$jni.JListType<_$jni.JList<_$jni.JList<$W?>>>( + _$jni.JListType<_$jni.JList<$W?>>( + _$jni.JListType<$W?>(W.nullableType)))); + } + + static final _id_nested = _class.instanceMethodId( + r'nested', + r'()Lcom/github/dart_lang/jnigen/annotations/Annotated$Nested;', + ); + + static final _nested = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public com.github.dart_lang.jnigen.annotations.Annotated.Nested nested()` + /// The returned object must be released after use, by calling the [release] method. + Annotated_Nested<$T?, $U, $W, _$jni.JInteger>? nested() { + return _nested(reference.pointer, _id_nested as _$jni.JMethodIDPtr) + .object?>( + $Annotated_Nested$NullableType<$T?, $U, $W, _$jni.JInteger>( + T.nullableType, U, W, const _$jni.JIntegerType())); + } + + static final _id_intList = _class.instanceMethodId( + r'intList', + r'()Ljava/util/List;', + ); + + static final _intList = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public java.util.List intList()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JInteger> intList() { + return _intList(reference.pointer, _id_intList as _$jni.JMethodIDPtr) + .object<_$jni.JList<_$jni.JInteger>>( + const _$jni.JListType<_$jni.JInteger>(_$jni.JIntegerType())); + } +} + +final class $Annotated$NullableType< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $W extends _$jni.JObject> extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$W> W; + + @_$jni.internal + const $Annotated$NullableType( + this.T, + this.U, + this.W, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/Annotated;'; + + @_$jni.internal + @_$core.override + Annotated<$T, $U, $W>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : Annotated<$T, $U, $W>.fromReference( + T, + U, + W, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($Annotated$NullableType, T, U, W); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Annotated$NullableType<$T, $U, $W>) && + other is $Annotated$NullableType<$T, $U, $W> && + T == other.T && + U == other.U && + W == other.W; + } +} + +final class $Annotated$Type<$T extends _$jni.JObject?, $U extends _$jni.JObject, + $W extends _$jni.JObject> extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$W> W; + + @_$jni.internal + const $Annotated$Type( + this.T, + this.U, + this.W, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/Annotated;'; + + @_$jni.internal + @_$core.override + Annotated<$T, $U, $W> fromReference(_$jni.JReference reference) => + Annotated<$T, $U, $W>.fromReference( + T, + U, + W, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => + $Annotated$NullableType<$T, $U, $W>(T, U, W); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($Annotated$Type, T, U, W); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Annotated$Type<$T, $U, $W>) && + other is $Annotated$Type<$T, $U, $W> && + T == other.T && + U == other.U && + W == other.W; + } +} + +/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable$Case` +class JsonSerializable_Case extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + JsonSerializable_Case.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/JsonSerializable$Case'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $JsonSerializable_Case$NullableType(); + static const type = $JsonSerializable_Case$Type(); + static final _id_SNAKE_CASE = _class.staticFieldId( + r'SNAKE_CASE', + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.annotations.JsonSerializable$Case SNAKE_CASE` + /// The returned object must be released after use, by calling the [release] method. + static JsonSerializable_Case? get SNAKE_CASE => + _id_SNAKE_CASE.get(_class, const $JsonSerializable_Case$NullableType()); + + static final _id_KEBAB_CASE = _class.staticFieldId( + r'KEBAB_CASE', + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.annotations.JsonSerializable$Case KEBAB_CASE` + /// The returned object must be released after use, by calling the [release] method. + static JsonSerializable_Case? get KEBAB_CASE => + _id_KEBAB_CASE.get(_class, const $JsonSerializable_Case$NullableType()); + + static final _id_CAMEL_CASE = _class.staticFieldId( + r'CAMEL_CASE', + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + ); + + /// from: `static public final com.github.dart_lang.jnigen.annotations.JsonSerializable$Case CAMEL_CASE` + /// The returned object must be released after use, by calling the [release] method. + static JsonSerializable_Case? get CAMEL_CASE => + _id_CAMEL_CASE.get(_class, const $JsonSerializable_Case$NullableType()); + + static final _id_values = _class.staticMethodId( + r'values', + r'()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + ); + + static final _values = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable$Case[] values()` + /// The returned object must be released after use, by calling the [release] method. + static _$jni.JArray? values() { + return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) + .object<_$jni.JArray?>( + const _$jni.JArrayNullableType( + $JsonSerializable_Case$NullableType())); + } + + static final _id_valueOf = _class.staticMethodId( + r'valueOf', + r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + ); + + static final _valueOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable$Case valueOf(java.lang.String string)` + /// The returned object must be released after use, by calling the [release] method. + static JsonSerializable_Case? valueOf( + _$jni.JString? string, + ) { + final _$string = string?.reference ?? _$jni.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + _$string.pointer) + .object( + const $JsonSerializable_Case$NullableType()); + } +} + +final class $JsonSerializable_Case$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $JsonSerializable_Case$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; + + @_$jni.internal + @_$core.override + JsonSerializable_Case? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : JsonSerializable_Case.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonSerializable_Case$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonSerializable_Case$NullableType) && + other is $JsonSerializable_Case$NullableType; + } +} + +final class $JsonSerializable_Case$Type + extends _$jni.JObjType { + @_$jni.internal + const $JsonSerializable_Case$Type(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; + + @_$jni.internal + @_$core.override + JsonSerializable_Case fromReference(_$jni.JReference reference) => + JsonSerializable_Case.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + const $JsonSerializable_Case$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonSerializable_Case$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonSerializable_Case$Type) && + other is $JsonSerializable_Case$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable` +class JsonSerializable extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + JsonSerializable.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/JsonSerializable'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $JsonSerializable$NullableType(); + static const type = $JsonSerializable$Type(); + static final _id_value = _class.instanceMethodId( + r'value', + r'()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', + ); + + static final _value = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public abstract com.github.dart_lang.jnigen.annotations.JsonSerializable$Case value()` + /// The returned object must be released after use, by calling the [release] method. + JsonSerializable_Case? value() { + return _value(reference.pointer, _id_value as _$jni.JMethodIDPtr) + .object( + const $JsonSerializable_Case$NullableType()); + } + + /// Maps a specific port to the implemented interface. static final _$core.Map _$impls = {}; static _$jni.JObjectPtr _$invoke( int port, @@ -6873,14 +11111,323 @@ class JsonSerializable extends _$jni.JObject { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; - if ($d == - r'value()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;') { - final $r = _$impls[$p]!.value(); - return ($r as _$jni.JObject) - .as(const _$jni.JObjectType()) - .reference - .toPointer(); - } + if ($d == + r'value()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;') { + final $r = _$impls[$p]!.value(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; + } + } catch (e) { + return _$jni.ProtectedJniExtensions.newDartException(e); + } + return _$jni.nullptr; + } + + static void implementIn( + _$jni.JImplementer implementer, + $JsonSerializable $impl, + ) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = _$jni.MethodInvocation.fromMessage($m); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + }); + implementer.add( + r'com.github.dart_lang.jnigen.annotations.JsonSerializable', + $p, + _$invokePointer, + [], + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } + + factory JsonSerializable.implement( + $JsonSerializable $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return JsonSerializable.fromReference( + $i.implementReference(), + ); + } +} + +abstract base mixin class $JsonSerializable { + factory $JsonSerializable({ + required JsonSerializable_Case? Function() value, + }) = _$JsonSerializable; + + JsonSerializable_Case? value(); +} + +final class _$JsonSerializable with $JsonSerializable { + _$JsonSerializable({ + required JsonSerializable_Case? Function() value, + }) : _value = value; + + final JsonSerializable_Case? Function() _value; + + JsonSerializable_Case? value() { + return _value(); + } +} + +final class $JsonSerializable$NullableType + extends _$jni.JObjType { + @_$jni.internal + const $JsonSerializable$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; + + @_$jni.internal + @_$core.override + JsonSerializable? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : JsonSerializable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonSerializable$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonSerializable$NullableType) && + other is $JsonSerializable$NullableType; + } +} + +final class $JsonSerializable$Type extends _$jni.JObjType { + @_$jni.internal + const $JsonSerializable$Type(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; + + @_$jni.internal + @_$core.override + JsonSerializable fromReference(_$jni.JReference reference) => + JsonSerializable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + const $JsonSerializable$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($JsonSerializable$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($JsonSerializable$Type) && + other is $JsonSerializable$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.annotations.MyDataClass` +class MyDataClass extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + MyDataClass.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/annotations/MyDataClass'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $MyDataClass$NullableType(); + static const type = $MyDataClass$Type(); + static final _id_new$ = _class.constructorId( + r'()V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory MyDataClass() { + return MyDataClass.fromReference( + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + .reference); + } +} + +final class $MyDataClass$NullableType extends _$jni.JObjType { + @_$jni.internal + const $MyDataClass$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; + + @_$jni.internal + @_$core.override + MyDataClass? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MyDataClass.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MyDataClass$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyDataClass$NullableType) && + other is $MyDataClass$NullableType; + } +} + +final class $MyDataClass$Type extends _$jni.JObjType { + @_$jni.internal + const $MyDataClass$Type(); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; + + @_$jni.internal + @_$core.override + MyDataClass fromReference(_$jni.JReference reference) => + MyDataClass.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + const $MyDataClass$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MyDataClass$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MyDataClass$Type) && + other is $MyDataClass$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.annotations.NotNull` +class NotNull extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType $type; + + @_$jni.internal + NotNull.fromReference( + _$jni.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/annotations/NotNull'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $NotNull$NullableType(); + static const type = $NotNull$Type(); + + /// Maps a specific port to the implemented interface. + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( + int port, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + _$jni.MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final _$jni.Pointer< + _$jni.NativeFunction< + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + + static _$jni.Pointer<_$jni.Void> _$invokeMethod( + int $p, + _$jni.MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; } catch (e) { return _$jni.ProtectedJniExtensions.newDartException(e); } @@ -6889,7 +11436,7 @@ class JsonSerializable extends _$jni.JObject { static void implementIn( _$jni.JImplementer implementer, - $JsonSerializable $impl, + $NotNull $impl, ) { late final _$jni.RawReceivePort $p; $p = _$jni.RawReceivePort(($m) { @@ -6903,7 +11450,7 @@ class JsonSerializable extends _$jni.JObject { _$jni.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( - r'com.github.dart_lang.jnigen.annotations.JsonSerializable', + r'com.github.dart_lang.jnigen.annotations.NotNull', $p, _$invokePointer, [], @@ -6912,139 +11459,262 @@ class JsonSerializable extends _$jni.JObject { _$impls[$a] = $impl; } - factory JsonSerializable.implement( - $JsonSerializable $impl, + factory NotNull.implement( + $NotNull $impl, ) { final $i = _$jni.JImplementer(); implementIn($i, $impl); - return JsonSerializable.fromReference( + return NotNull.fromReference( $i.implementReference(), ); } } -abstract base mixin class $JsonSerializable { - factory $JsonSerializable({ - required JsonSerializable_Case Function() value, - }) = _$JsonSerializable; +abstract base mixin class $NotNull { + factory $NotNull() = _$NotNull; +} - JsonSerializable_Case value(); +final class _$NotNull with $NotNull { + _$NotNull(); } -final class _$JsonSerializable with $JsonSerializable { - _$JsonSerializable({ - required JsonSerializable_Case Function() value, - }) : _value = value; +final class $NotNull$NullableType extends _$jni.JObjType { + @_$jni.internal + const $NotNull$NullableType(); - final JsonSerializable_Case Function() _value; + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/annotations/NotNull;'; - JsonSerializable_Case value() { - return _value(); + @_$jni.internal + @_$core.override + NotNull? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : NotNull.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($NotNull$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($NotNull$NullableType) && + other is $NotNull$NullableType; } } -final class $JsonSerializable$Type extends _$jni.JObjType { +final class $NotNull$Type extends _$jni.JObjType { @_$jni.internal - const $JsonSerializable$Type(); + const $NotNull$Type(); @_$jni.internal @_$core.override - String get signature => - r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; + String get signature => r'Lcom/github/dart_lang/jnigen/annotations/NotNull;'; @_$jni.internal @_$core.override - JsonSerializable fromReference(_$jni.JReference reference) => - JsonSerializable.fromReference(reference); + NotNull fromReference(_$jni.JReference reference) => NotNull.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => const $NotNull$NullableType(); @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => ($JsonSerializable$Type).hashCode; + int get hashCode => ($NotNull$Type).hashCode; @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable$Type) && - other is $JsonSerializable$Type; + return other.runtimeType == ($NotNull$Type) && other is $NotNull$Type; } } -/// from: `com.github.dart_lang.jnigen.annotations.MyDataClass` -class MyDataClass extends _$jni.JObject { +/// from: `com.github.dart_lang.jnigen.annotations.Nullable` +class Nullable extends _$jni.JObject { @_$jni.internal @_$core.override - final _$jni.JObjType $type; + final _$jni.JObjType $type; @_$jni.internal - MyDataClass.fromReference( + Nullable.fromReference( _$jni.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( - r'com/github/dart_lang/jnigen/annotations/MyDataClass'); + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/annotations/Nullable'); /// The type which includes information such as the signature of this class. - static const type = $MyDataClass$Type(); - static final _id_new$ = _class.constructorId( - r'()V', - ); + static const nullableType = $Nullable$NullableType(); + static const type = $Nullable$Type(); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< + /// Maps a specific port to the implemented interface. + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( + int port, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + _$jni.MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final _$jni.Pointer< _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>>('globalEnv_NewObject') - .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>(); + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); - /// from: `public void ()` - /// The returned object must be released after use, by calling the [release] method. - factory MyDataClass() { - return MyDataClass.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) - .reference); + static _$jni.Pointer<_$jni.Void> _$invokeMethod( + int $p, + _$jni.MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + } catch (e) { + return _$jni.ProtectedJniExtensions.newDartException(e); + } + return _$jni.nullptr; + } + + static void implementIn( + _$jni.JImplementer implementer, + $Nullable $impl, + ) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = _$jni.MethodInvocation.fromMessage($m); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + }); + implementer.add( + r'com.github.dart_lang.jnigen.annotations.Nullable', + $p, + _$invokePointer, + [], + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } + + factory Nullable.implement( + $Nullable $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return Nullable.fromReference( + $i.implementReference(), + ); } } -final class $MyDataClass$Type extends _$jni.JObjType { +abstract base mixin class $Nullable { + factory $Nullable() = _$Nullable; +} + +final class _$Nullable with $Nullable { + _$Nullable(); +} + +final class $Nullable$NullableType extends _$jni.JObjType { @_$jni.internal - const $MyDataClass$Type(); + const $Nullable$NullableType(); @_$jni.internal @_$core.override - String get signature => - r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; + String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Nullable;'; @_$jni.internal @_$core.override - MyDataClass fromReference(_$jni.JReference reference) => - MyDataClass.fromReference(reference); + Nullable? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : Nullable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + _$jni.JObjType get nullableType => this; @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => ($MyDataClass$Type).hashCode; + int get hashCode => ($Nullable$NullableType).hashCode; @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MyDataClass$Type) && - other is $MyDataClass$Type; + return other.runtimeType == ($Nullable$NullableType) && + other is $Nullable$NullableType; + } +} + +final class $Nullable$Type extends _$jni.JObjType { + @_$jni.internal + const $Nullable$Type(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Nullable;'; + + @_$jni.internal + @_$core.override + Nullable fromReference(_$jni.JReference reference) => Nullable.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => const $Nullable$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($Nullable$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Nullable$Type) && other is $Nullable$Type; } } diff --git a/pkgs/jnigen/test/simple_package_test/generate.dart b/pkgs/jnigen/test/simple_package_test/generate.dart index 78fdbbe8d..05595f7b9 100644 --- a/pkgs/jnigen/test/simple_package_test/generate.dart +++ b/pkgs/jnigen/test/simple_package_test/generate.dart @@ -23,8 +23,11 @@ const preamble = ''' final javaPrefix = join('com', 'github', 'dart_lang', 'jnigen'); final javaFiles = [ + join(javaPrefix, 'annotations', 'Annotated.java'), join(javaPrefix, 'annotations', 'JsonSerializable.java'), join(javaPrefix, 'annotations', 'MyDataClass.java'), + join(javaPrefix, 'annotations', 'NotNull.java'), + join(javaPrefix, 'annotations', 'Nullable.java'), join(javaPrefix, 'simple_package', 'Color.java'), join(javaPrefix, 'simple_package', 'Example.java'), join(javaPrefix, 'simple_package', 'Exceptions.java'), @@ -68,6 +71,7 @@ Config getConfig() { final config = Config( sourcePath: [Uri.directory(javaPath)], classPath: [Uri.directory(javaPath)], + summarizerOptions: SummarizerOptions(backend: SummarizerBackend.asm), classes: [ 'com.github.dart_lang.jnigen.simple_package', 'com.github.dart_lang.jnigen.pkg2', @@ -77,6 +81,8 @@ Config getConfig() { 'com.github.dart_lang.jnigen.annotations', ], logLevel: Level.INFO, + nonNullAnnotations: ['com.github.dart_lang.jnigen.annotations.NotNull'], + nullableAnnotations: ['com.github.dart_lang.jnigen.annotations.Nullable'], customClassBody: { 'com.github.dart_lang.jnigen.interfaces.MyInterface': r''' static _$core.Map get $impls => _$impls; diff --git a/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Annotated.java b/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Annotated.java new file mode 100644 index 000000000..75acfc351 --- /dev/null +++ b/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Annotated.java @@ -0,0 +1,297 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.github.dart_lang.jnigen.annotations; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class Annotated { + public T t; + public U u; + public W w; + + public Annotated(T t, U u, W w) { + this.t = t; + this.u = u; + this.w = w; + } + + public @NotNull String hello() { + return "hello"; + } + + public String nullableHello(boolean returnNull) { + return returnNull ? null : hello(); + } + + public @NotNull String echo(@NotNull String string) { + return string; + } + + public String nullableEcho(String string) { + return string; + } + + public @NotNull String @NotNull [] array() { + return new String[] {"hello"}; + } + + public String @NotNull [] arrayOfNullable() { + return new String[] {null}; + } + + public @NotNull String[] nullableArray(boolean returnNull) { + return returnNull ? null : array(); + } + + public String[] nullableArrayOfNullable(boolean returnNull) { + return returnNull ? null : arrayOfNullable(); + } + + public @NotNull List<@NotNull String> list() { + return List.of("hello"); + } + + public @NotNull List listOfNullable() { + var list = new ArrayList(); + list.add(null); + return list; + } + + public List<@NotNull String> nullableList(boolean returnNull) { + return returnNull ? null : list(); + } + + public List nullableListOfNullable(boolean returnNull) { + return returnNull ? null : listOfNullable(); + } + + public @NotNull T classGenericEcho(@NotNull T value) { + return value; + } + + public T nullableClassGenericEcho(T value) { + return value; + } + + public @NotNull V methodGenericEcho(@NotNull V value) { + return value; + } + + public <@NotNull V> V methodGenericEcho2(V value) { + return value; + } + + public V methodGenericEcho3(V value) { + return value; + } + + public V nullableReturnMethodGenericEcho(@NotNull V value, boolean returnNull) { + return returnNull ? null : value; + } + + public <@NotNull V> @Nullable V nullableReturnMethodGenericEcho2(V value, boolean returnNull) { + return returnNull ? null : value; + } + + public <@Nullable V> V nullableMethodGenericEcho(V value) { + return value; + } + + public V noAnnotationMethodGenericEcho(V value) { + return value; + } + + public <@NotNull V> V nullableArgMethodGenericEcho(@Nullable V value) { + if (value == null) { + throw new NullPointerException(); + } + return value; + } + + public @NotNull List<@NotNull T> classGenericList() { + return List.of(t); + } + + public @NotNull List classGenericListOfNullable() { + var list = new ArrayList(); + list.add(null); + return list; + } + + public List<@NotNull T> nullableClassGenericList(boolean returnNull) { + return returnNull ? null : classGenericList(); + } + + public List nullableClassGenericListOfNullable(boolean returnNull) { + return returnNull ? null : classGenericListOfNullable(); + } + + public @NotNull List<@NotNull V> methodGenericList(@NotNull V value) { + return List.of(value); + } + + public @NotNull List methodGenericListOfNullable() { + var list = new ArrayList(); + list.add(null); + return list; + } + + public List<@NotNull V> nullableMethodGenericList(@NotNull V value, boolean returnNull) { + return returnNull ? null : methodGenericList(value); + } + + public List nullableMethodGenericListOfNullable(boolean returnNull) { + return returnNull ? null : methodGenericListOfNullable(); + } + + public T firstOfClassGenericList(@NotNull List<@NotNull T> list) { + if (list.isEmpty()) { + return null; + } + return list.get(0); + } + + public T firstOfClassGenericNullableList(List<@NotNull T> list) { + if (list == null || list.isEmpty()) { + return null; + } + return list.get(0); + } + + public T firstOfClassGenericListOfNullable(@NotNull List list) { + if (list.isEmpty()) { + return null; + } + return list.get(0); + } + + public T firstOfClassGenericNullableListOfNullable(List list) { + if (list == null || list.isEmpty()) { + return null; + } + return list.get(0); + } + + public V firstOfMethodGenericList(@NotNull List<@NotNull V> list) { + if (list.isEmpty()) { + return null; + } + return list.get(0); + } + + public V firstOfMethodGenericNullableList(List<@NotNull V> list) { + if (list == null || list.isEmpty()) { + return null; + } + return list.get(0); + } + + public V firstOfMethodGenericListOfNullable(@NotNull List list) { + if (list.isEmpty()) { + return null; + } + return list.get(0); + } + + public V firstOfMethodGenericNullableListOfNullable(List list) { + if (list == null || list.isEmpty()) { + return null; + } + return list.get(0); + } + + public T firstKeyOfComboMap(@NotNull Map<@NotNull T, @NotNull V> map) { + return map.keySet().stream().findFirst().orElse(null); + } + + public V firstValueOfComboMap(@NotNull Map<@NotNull T, @NotNull V> map) { + return map.values().stream().findFirst().orElse(null); + } + + public T firstKeyOfComboMapNullableKey(@NotNull Map map) { + return map.keySet().stream().findFirst().orElse(null); + } + + public V firstValueOfComboMapNullableKey(@NotNull Map map) { + return map.values().stream().findFirst().orElse(null); + } + + public T firstKeyOfComboMapNullableValue(@NotNull Map<@NotNull T, V> map) { + return map.keySet().stream().findFirst().orElse(null); + } + + public V firstValueOfComboMapNullableValue(@NotNull Map<@NotNull T, V> map) { + return map.values().stream().findFirst().orElse(null); + } + + public T firstKeyOfComboMapNullableKeyAndValue(@NotNull Map map) { + return map.keySet().stream().findFirst().orElse(null); + } + + public V firstValueOfComboMapNullableKeyAndValue(@NotNull Map map) { + return map.values().stream().findFirst().orElse(null); + } + + public Map.Entry<@NotNull T, @NotNull V> firstEntryOfComboMap( + @NotNull Map<@NotNull T, @NotNull V> map) { + return map.entrySet().stream().findFirst().orElse(null); + } + + public W getW() { + return w; + } + + public @Nullable W nullableGetW(boolean returnNull) { + return returnNull ? null : w; + } + + public @NotNull List<@NotNull List<@NotNull List>> list3dOfT() { + List list = new ArrayList<>(); + list.add(t); + return List.of(List.of(list)); + } + + public @NotNull List<@NotNull List<@NotNull List>> list3dOfU() { + return List.of(List.of(List.of(u))); + } + + public @NotNull List<@NotNull List<@NotNull List>> list3dOfW() { + return List.of(List.of(List.of(w))); + } + + public @NotNull List<@NotNull List<@NotNull List<@Nullable U>>> list3dOfNullableU( + boolean returnNull) { + List<@Nullable U> list = new ArrayList<>(); + list.add(returnNull ? null : u); + return List.of(List.of(list)); + } + + public @NotNull List<@NotNull List<@NotNull List<@Nullable W>>> list3dOfNullableW( + boolean returnNull) { + List<@Nullable W> list = new ArrayList<>(); + list.add(returnNull ? null : w); + return List.of(List.of(list)); + } + + public class Nested { + public V v; + public @NotNull U u; + + public Nested(V v) { + this.v = v; + this.u = Annotated.this.u; + } + } + + public Annotated.Nested<@NotNull Integer> nested() { + return new Nested<>(42); + } + + public @NotNull List intList() { + return List.of(42); + } +} diff --git a/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/NotNull.java b/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/NotNull.java new file mode 100644 index 000000000..2ce438d22 --- /dev/null +++ b/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/NotNull.java @@ -0,0 +1,17 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.github.dart_lang.jnigen.annotations; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.CLASS) +@Target({ + ElementType.METHOD, + ElementType.FIELD, + ElementType.PARAMETER, + ElementType.LOCAL_VARIABLE, + ElementType.TYPE_USE +}) +public @interface NotNull {} diff --git a/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Nullable.java b/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Nullable.java new file mode 100644 index 000000000..bee4fd60d --- /dev/null +++ b/pkgs/jnigen/test/simple_package_test/java/com/github/dart_lang/jnigen/annotations/Nullable.java @@ -0,0 +1,17 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package com.github.dart_lang.jnigen.annotations; + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.CLASS) +@Target({ + ElementType.METHOD, + ElementType.FIELD, + ElementType.PARAMETER, + ElementType.LOCAL_VARIABLE, + ElementType.TYPE_USE +}) +public @interface Nullable {} diff --git a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart index fdabd98d5..9ad8a39b6 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart @@ -40,7 +40,7 @@ void registerTests(String groupName, TestRunnerCallback test) { expect(Example.OFF, equals(0)); expect(Example.PI, closeTo(pi, fpDelta)); expect(Example.SEMICOLON, equals(';'.codeUnitAt(0))); - expect(Example.SEMICOLON_STRING.toDartString(releaseOriginal: true), + expect(Example.SEMICOLON_STRING!.toDartString(releaseOriginal: true), equals(';')); }); @@ -56,18 +56,18 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Static fields & methods - string', () { expect( - Example.getName().toDartString(releaseOriginal: true), + Example.getName()!.toDartString(releaseOriginal: true), isIn(['Ragnar Lothbrok', 'Theseus']), ); Example.setName('Theseus'.toJString()); expect( - Example.getName().toDartString(releaseOriginal: true), + Example.getName()!.toDartString(releaseOriginal: true), equals('Theseus'), ); }); test('Static fields and methods - Object', () { - final nested = Example.getNestedInstance(); + final nested = Example.getNestedInstance()!; expect(nested.getValue(), isIn([true, false])); nested.setValue(false); expect(nested.getValue(), isFalse); @@ -83,13 +83,13 @@ void registerTests(String groupName, TestRunnerCallback test) { final e = Example(); expect(e.getNumber(), equals(0)); expect(e.getIsUp(), true); - expect(e.getCodename().toDartString(), equals('achilles')); + expect(e.getCodename()!.toDartString(), equals('achilles')); e.setNumber(1); e.setUp(false); e.setCodename('spartan'.toJString()); expect(e.getIsUp(), false); expect(e.getNumber(), 1); - expect(e.getCodename().toDartString(), equals('spartan')); + expect(e.getCodename()!.toDartString(), equals('spartan')); e.release(); }); @@ -112,14 +112,14 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Misc. instance methods', () { final e = Example(); final rand = e.getRandom(); - expect(rand.isNull, isFalse); + expect(rand, isNotNull); final _ = e.getRandomLong(); final id = - e.getRandomNumericString(rand).toDartString(releaseOriginal: true); + e.getRandomNumericString(rand)!.toDartString(releaseOriginal: true); expect(int.parse(id), lessThan(10000)); e.setNumber(145); expect( - e.getSelf().getSelf().getSelf().getSelf().getNumber(), + e.getSelf()!.getSelf()!.getSelf()!.getSelf()!.getNumber(), equals(145), ); e.release(); @@ -129,19 +129,19 @@ void registerTests(String groupName, TestRunnerCallback test) { final e0 = Example(); expect(e0.getNumber(), 0); expect(e0.getIsUp(), true); - expect(e0.getCodename().toDartString(), equals('achilles')); + expect(e0.getCodename()!.toDartString(), equals('achilles')); final e1 = Example.new$1(111); expect(e1.getNumber(), equals(111)); expect(e1.getIsUp(), true); - expect(e1.getCodename().toDartString(), 'achilles'); + expect(e1.getCodename()!.toDartString(), 'achilles'); final e2 = Example.new$2(122, false); expect(e2.getNumber(), equals(122)); expect(e2.getIsUp(), false); - expect(e2.getCodename().toDartString(), 'achilles'); + expect(e2.getCodename()!.toDartString(), 'achilles'); final e3 = Example.new$3(133, false, 'spartan'.toJString()); expect(e3.getNumber(), equals(133)); expect(e3.getIsUp(), false); - expect(e3.getCodename().toDartString(), 'spartan'); + expect(e3.getCodename()!.toDartString(), 'spartan'); }); test('Static (non-final) fields', () { @@ -154,12 +154,12 @@ void registerTests(String groupName, TestRunnerCallback test) { expect(Fields.asterisk, equals('*'.codeUnitAt(0))); expect( - Fields.name.toDartString(), + Fields.name!.toDartString(), isIn(['Earl Haraldson', 'Ragnar Lothbrok']), ); Fields.name = 'Ragnar Lothbrok'.toJString(); - expect(Fields.name.toDartString(), equals('Ragnar Lothbrok')); + expect(Fields.name!.toDartString(), equals('Ragnar Lothbrok')); expect(Fields.pi, closeTo(pi, fpDelta)); }); @@ -169,24 +169,24 @@ void registerTests(String groupName, TestRunnerCallback test) { expect(f.trillion, equals(trillion)); expect(f.isAchillesDead, isFalse); - expect(f.bestFighterInGreece.toDartString(), equals('Achilles')); + expect(f.bestFighterInGreece!.toDartString(), equals('Achilles')); // "For your glory walks hand-in-hand with your doom." - Thetis. f.isAchillesDead = true; // I don't know much Greek mythology. But Troy was released in 2004, // and 300 was released in 2006, so it's Leonidas I. f.bestFighterInGreece = 'Leonidas I'.toJString(); expect(f.isAchillesDead, isTrue); - expect(f.bestFighterInGreece.toDartString(), 'Leonidas I'); + expect(f.bestFighterInGreece!.toDartString(), 'Leonidas I'); }); test('Fields from nested class', () { expect(Fields_Nested().hundred, equals(100)); // Hector of Troy may disagree. - expect(Fields_Nested.BEST_GOD.toDartString(), equals('Pallas Athena')); + expect(Fields_Nested.BEST_GOD!.toDartString(), equals('Pallas Athena')); }); test('static methods arrays', () { - final array = Example.getArr(); + final array = Example.getArr()!; expect(array[0], 1); expect(array[1], 2); expect(array[2], 3); @@ -200,11 +200,11 @@ void registerTests(String groupName, TestRunnerCallback test) { final ex2 = Example(); ex1.setNumber(1); ex2.setNumber(2); - final array = JArray(Example.type, 2); + final array = JArray(Example.nullableType, 2); array[0] = ex1; array[1] = ex2; - expect(array[0].getNumber(), 1); - expect(array[1].getNumber(), 2); + expect(array[0]!.getNumber(), 1); + expect(array[1]!.getNumber(), 2); array.release(); ex1.release(); ex2.release(); @@ -267,13 +267,14 @@ void registerTests(String groupName, TestRunnerCallback test) { group('generics', () { test('GrandParent constructor', () { using((arena) { - final grandParent = - GrandParent('Hello'.toJString()..releasedBy(arena)) - ..releasedBy(arena); + final grandParent = GrandParent( + 'Hello'.toJString()..releasedBy(arena), + T: JString.type) + ..releasedBy(arena); expect(grandParent, isA>()); expect(grandParent.$type, isA<$GrandParent$Type>()); expect( - grandParent.value.toDartString(releaseOriginal: true), 'Hello'); + grandParent.value!.toDartString(releaseOriginal: true), 'Hello'); }); }); test('MyStack', () { @@ -281,8 +282,8 @@ void registerTests(String groupName, TestRunnerCallback test) { final stack = MyStack(T: JString.type)..releasedBy(arena); stack.push('Hello'.toJString()..releasedBy(arena)); stack.push('World'.toJString()..releasedBy(arena)); - expect(stack.pop().toDartString(releaseOriginal: true), 'World'); - expect(stack.pop().toDartString(releaseOriginal: true), 'Hello'); + expect(stack.pop()!.toDartString(releaseOriginal: true), 'World'); + expect(stack.pop()!.toDartString(releaseOriginal: true), 'Hello'); }); }); test('Different stacks have different types, same stacks have same types', @@ -313,18 +314,20 @@ void registerTests(String groupName, TestRunnerCallback test) { map.put('Hello'.toJString()..releasedBy(arena), helloExample); map.put('World'.toJString()..releasedBy(arena), worldExample); expect( - (map.get('Hello'.toJString()..releasedBy(arena))..releasedBy(arena)) + (map.get('Hello'.toJString()..releasedBy(arena))! + ..releasedBy(arena)) .getNumber(), 1, ); expect( - (map.get('World'.toJString()..releasedBy(arena))..releasedBy(arena)) + (map.get('World'.toJString()..releasedBy(arena))! + ..releasedBy(arena)) .getNumber(), 2, ); expect( - ((map.entryStack()..releasedBy(arena)).pop()..releasedBy(arena)) - .key + ((map.entryStack()!..releasedBy(arena)).pop()!..releasedBy(arena)) + .key! .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), anyOf('Hello', 'World'), @@ -336,8 +339,8 @@ void registerTests(String groupName, TestRunnerCallback test) { using((arena) { final stringStack = StringStack()..releasedBy(arena); stringStack.push('Hello'.toJString()..releasedBy(arena)); - expect( - stringStack.pop().toDartString(releaseOriginal: true), 'Hello'); + expect(stringStack.pop()!.toDartString(releaseOriginal: true), + 'Hello'); }); }); test('StringKeyedMap', () { @@ -346,7 +349,7 @@ void registerTests(String groupName, TestRunnerCallback test) { final example = Example()..releasedBy(arena); map.put('Hello'.toJString()..releasedBy(arena), example); expect( - (map.get('Hello'.toJString()..releasedBy(arena)) + (map.get('Hello'.toJString()..releasedBy(arena))! ..releasedBy(arena)) .getNumber(), 0, @@ -359,7 +362,7 @@ void registerTests(String groupName, TestRunnerCallback test) { final example = Example()..releasedBy(arena); map.put(example, 'Hello'.toJString()..releasedBy(arena)); expect( - map.get(example).toDartString(releaseOriginal: true), + map.get(example)!.toDartString(releaseOriginal: true), 'Hello', ); }); @@ -371,7 +374,7 @@ void registerTests(String groupName, TestRunnerCallback test) { 'world'.toJString()..releasedBy(arena)); expect( map - .get('hello'.toJString()..releasedBy(arena)) + .get('hello'.toJString()..releasedBy(arena))! .toDartString(releaseOriginal: true), 'world', ); @@ -391,48 +394,48 @@ void registerTests(String groupName, TestRunnerCallback test) { GrandParent(T: JString.type, '!'.toJString()..releasedBy(arena)) ..releasedBy(arena); expect( - grandParent.value.toDartString(releaseOriginal: true), + grandParent.value!.toDartString(releaseOriginal: true), '!', ); - final strStaticParent = GrandParent.stringStaticParent() + final strStaticParent = GrandParent.stringStaticParent()! ..releasedBy(arena); expect( - strStaticParent.value.toDartString(releaseOriginal: true), + strStaticParent.value!.toDartString(releaseOriginal: true), 'Hello', ); final exampleStaticParent = GrandParent.varStaticParent( - S: Example.type, Example()..releasedBy(arena)) + S: Example.type, Example()..releasedBy(arena))! ..releasedBy(arena); expect( - (exampleStaticParent.value..releasedBy(arena)).getNumber(), + (exampleStaticParent.value!..releasedBy(arena)).getNumber(), 0, ); - final strParent = grandParent.stringParent()..releasedBy(arena); + final strParent = grandParent.stringParent()!..releasedBy(arena); expect( - strParent.parentValue + strParent.parentValue! .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), '!', ); expect( - strParent.value.toDartString(releaseOriginal: true), + strParent.value!.toDartString(releaseOriginal: true), 'Hello', ); final exampleParent = grandParent.varParent( - S: Example.type, Example()..releasedBy(arena)) + S: Example.type, Example()..releasedBy(arena))! ..releasedBy(arena); expect( - exampleParent.parentValue + exampleParent.parentValue! .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), '!', ); expect( - (exampleParent.value..releasedBy(arena)).getNumber(), + (exampleParent.value!..releasedBy(arena)).getNumber(), 0, ); // TODO(#139): test constructing Child, currently does not work due @@ -442,17 +445,20 @@ void registerTests(String groupName, TestRunnerCallback test) { }); test('Constructing non-static nested classes', () { using((arena) { - final grandParent = GrandParent(1.toJInteger())..releasedBy(arena); - final parent = GrandParent_Parent(grandParent, 2.toJInteger()) - ..releasedBy(arena); - final child = GrandParent_Parent_Child(parent, 3.toJInteger()) + final grandParent = GrandParent(1.toJInteger(), T: JInteger.type) ..releasedBy(arena); - expect(grandParent.value.intValue(releaseOriginal: true), 1); - expect(parent.parentValue.intValue(releaseOriginal: true), 1); - expect(parent.value.intValue(releaseOriginal: true), 2); - expect(child.grandParentValue.intValue(releaseOriginal: true), 1); - expect(child.parentValue.intValue(releaseOriginal: true), 2); - expect(child.value.intValue(releaseOriginal: true), 3); + final parent = + GrandParent_Parent(grandParent, 2.toJInteger(), S: JInteger.type) + ..releasedBy(arena); + final child = + GrandParent_Parent_Child(parent, 3.toJInteger(), U: JInteger.type) + ..releasedBy(arena); + expect(grandParent.value!.intValue(releaseOriginal: true), 1); + expect(parent.parentValue!.intValue(releaseOriginal: true), 1); + expect(parent.value!.intValue(releaseOriginal: true), 2); + expect(child.grandParentValue!.intValue(releaseOriginal: true), 1); + expect(child.parentValue!.intValue(releaseOriginal: true), 2); + expect(child.value!.intValue(releaseOriginal: true), 3); }); }); @@ -463,11 +469,13 @@ void registerTests(String groupName, TestRunnerCallback test) { expect(emptyStack.size(), 0); final stack = MyStack.of$1( 'Hello'.toJString()..releasedBy(arena), - )..releasedBy(arena); - expect(stack, isA>()); - expect(stack.$type, isA<$MyStack$Type>()); + T: JString.type, + )! + ..releasedBy(arena); + expect(stack, isA>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( - stack.pop().toDartString(releaseOriginal: true), + stack.pop()!.toDartString(releaseOriginal: true), 'Hello', ); }); @@ -477,15 +485,17 @@ void registerTests(String groupName, TestRunnerCallback test) { final stack = MyStack.of$2( 'Hello'.toJString()..releasedBy(arena), 'World'.toJString()..releasedBy(arena), - )..releasedBy(arena); - expect(stack, isA>()); - expect(stack.$type, isA<$MyStack$Type>()); + T: JString.type, + )! + ..releasedBy(arena); + expect(stack, isA>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( - stack.pop().toDartString(releaseOriginal: true), + stack.pop()!.toDartString(releaseOriginal: true), 'World', ); expect( - stack.pop().toDartString(releaseOriginal: true), + stack.pop()!.toDartString(releaseOriginal: true), 'Hello', ); }); @@ -495,21 +505,23 @@ void registerTests(String groupName, TestRunnerCallback test) { final array = JArray.filled(1, 'World'.toJString()..releasedBy(arena)) ..releasedBy(arena); final stack = MyStack.of$2( + T: JObject.type, 'Hello'.toJString()..releasedBy(arena), array, - )..releasedBy(arena); - expect(stack, isA>()); - expect(stack.$type, isA<$MyStack$Type>()); + )! + ..releasedBy(arena); + expect(stack, isA>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( stack - .pop() + .pop()! .as(JArray.type(JString.type), releaseOriginal: true)[0] .toDartString(releaseOriginal: true), 'World', ); expect( stack - .pop() + .pop()! .as(JString.type, releaseOriginal: true) .toDartString(releaseOriginal: true), 'Hello', @@ -520,11 +532,12 @@ void registerTests(String groupName, TestRunnerCallback test) { using((arena) { final array = JArray.filled(1, 'Hello'.toJString()..releasedBy(arena)) ..releasedBy(arena); - final stack = MyStack.fromArray(array)..releasedBy(arena); - expect(stack, isA>()); - expect(stack.$type, isA<$MyStack$Type>()); + final stack = MyStack.fromArray(T: JString.type, array)! + ..releasedBy(arena); + expect(stack, isA>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( - stack.pop().toDartString(releaseOriginal: true), + stack.pop()!.toDartString(releaseOriginal: true), 'Hello', ); }); @@ -533,18 +546,18 @@ void registerTests(String groupName, TestRunnerCallback test) { using((arena) { final firstDimention = JArray.filled( 1, - GrandParent('Hello'.toJString()..releasedBy(arena)) + GrandParent(T: JString.type, 'Hello'.toJString()..releasedBy(arena)) ..releasedBy(arena), )..releasedBy(arena); final twoDimentionalArray = JArray.filled(1, firstDimention) ..releasedBy(arena); - final stack = - MyStack.fromArrayOfArrayOfGrandParents(twoDimentionalArray) - ..releasedBy(arena); - expect(stack, isA>()); - expect(stack.$type, isA<$MyStack$Type>()); + final stack = MyStack.fromArrayOfArrayOfGrandParents( + S: JString.type, twoDimentionalArray)! + ..releasedBy(arena); + expect(stack, isA>()); + expect(stack.$type, isA<$MyStack$Type>()); expect( - stack.pop().toDartString(releaseOriginal: true), + stack.pop()!.toDartString(releaseOriginal: true), 'Hello', ); }); @@ -568,11 +581,11 @@ void registerTests(String groupName, TestRunnerCallback test) { $MyInterface( voidCallback: voidCallbackResult.complete, stringCallback: (s) { - return (s.toDartString(releaseOriginal: true) * 2).toJString(); + return (s!.toDartString(releaseOriginal: true) * 2).toJString(); }, - varCallback: (JInteger t) { + varCallback: (JInteger? t) { final result = - (t.intValue(releaseOriginal: true) * 2).toJInteger(); + (t!.intValue(releaseOriginal: true) * 2).toJInteger(); varCallbackResult.complete(result); return result; }, @@ -595,6 +608,7 @@ void registerTests(String groupName, TestRunnerCallback test) { // The other two methods will be called individually using the passed // arguments afterwards. consume( + T: JInteger.type, myInterface, // For stringCallback: 'hello'.toJString(), @@ -695,10 +709,10 @@ void registerTests(String groupName, TestRunnerCallback test) { StringConverter.implement(DartStringToIntParser(radix: 10)) ..releasedBy(arena); final fifteen = StringConverterConsumer.consumeOnSameThread( - hexParser, 'F'.toJString()..releasedBy(arena)); + hexParser, 'F'.toJString()..releasedBy(arena))!; expect(fifteen.intValue(releaseOriginal: true), 15); final fortyTwo = StringConverterConsumer.consumeOnSameThread( - decimalParser, '42'.toJString()..releasedBy(arena)); + decimalParser, '42'.toJString()..releasedBy(arena))!; expect(fortyTwo.intValue(releaseOriginal: true), 42); }); }); @@ -762,13 +776,13 @@ void registerTests(String groupName, TestRunnerCallback test) { } else { runner.runOnAnotherThread(); } - while (runner.error.isNull) { + while (runner.error == null) { await Future.delayed(const Duration(milliseconds: 100)); } expect( Jni.env.IsInstanceOf( // ignore: invalid_use_of_internal_member - runner.error.reference.pointer, + runner.error!.reference.pointer, JClass.forName( 'java/lang/reflect/UndeclaredThrowableException') // ignore: invalid_use_of_internal_member @@ -777,10 +791,10 @@ void registerTests(String groupName, TestRunnerCallback test) { ), isTrue, ); - final throwableClass = runner.error.jClass; + final throwableClass = runner.error!.jClass; final cause = throwableClass .instanceMethodId('getCause', '()Ljava/lang/Throwable;') - .call(runner.error, JObject.type, []); + .call(runner.error!, JObject.type, []); expect( Jni.env.IsInstanceOf( // ignore: invalid_use_of_internal_member @@ -811,7 +825,7 @@ void registerTests(String groupName, TestRunnerCallback test) { test('StringConverter.implement on $threading ', () async { final stringConverter = StringConverter.implement($StringConverter( parseToInt: (s) { - final value = int.tryParse(s.toDartString()); + final value = int.tryParse(s!.toDartString()); if (value == null) { // ignore: only_throw_errors throw StringConversionException( @@ -844,7 +858,8 @@ void registerTests(String groupName, TestRunnerCallback test) { return (await receivePort.first) as $T; } - final sevenHundredBoxed = consume(stringConverter, '700'.toJString()); + final sevenHundredBoxed = + consume(stringConverter, '700'.toJString())!; final int sevenHundred; if (sevenHundredBoxed is JInteger) { sevenHundred = sevenHundredBoxed.intValue(); @@ -855,7 +870,7 @@ void registerTests(String groupName, TestRunnerCallback test) { } expect(sevenHundred, 700); - final fooBoxed = consume(stringConverter, 'foo'.toJString()); + final fooBoxed = consume(stringConverter, 'foo'.toJString())!; final int foo; if (fooBoxed is JInteger) { foo = fooBoxed.intValue(); @@ -873,42 +888,46 @@ void registerTests(String groupName, TestRunnerCallback test) { final genericInterface = GenericInterface.implement( $GenericInterface( T: JString.type, - arrayOf: (element) => JArray(JString.type, 1)..[0] = element, - firstKeyOf: (map) => map.keys.first.as(JString.type), - firstValueOf: (map) => map.values.first, - firstOfArray: (array) => array[0].as(JString.type), - firstOfGenericArray: (array) => array[0], - genericArrayOf: (element) => JArray(JObject.type, 1)..[0] = element, + arrayOf: (element) => + JArray(JString.nullableType, 1)..[0] = element!, + firstKeyOf: (map) => map!.keys.first!.as(JString.type), + firstValueOf: (map) => map!.values.first, + firstOfArray: (array) => array![0]!.as(JString.type), + firstOfGenericArray: (array) => array![0], + genericArrayOf: (element) => + JArray(JObject.nullableType, 1)..[0] = element, mapOf: (key, value) => - JMap.hash(JString.type, JObject.type)..[key] = value, + JMap.hash(JString.type, JObject.type)..[key!] = value, ), )..releasedBy(arena); final stringArray = genericInterface - .arrayOf('hello'.toJString()..releasedBy(arena)) + .arrayOf('hello'.toJString()..releasedBy(arena))! ..releasedBy(arena); expect(stringArray, hasLength(1)); - expect(stringArray[0].toDartString(releaseOriginal: true), 'hello'); + expect(stringArray[0]!.toDartString(releaseOriginal: true), 'hello'); expect( genericInterface - .firstOfArray(stringArray) + .firstOfArray(stringArray)! .toDartString(releaseOriginal: true), 'hello', ); - final intArray = genericInterface - .genericArrayOf(42.toJInteger()..releasedBy(arena)) + final intArray = genericInterface.genericArrayOf( + U: JInteger.type, 42.toJInteger()..releasedBy(arena))! ..releasedBy(arena); expect( genericInterface - .firstOfGenericArray(intArray) + .firstOfGenericArray(U: JInteger.type, intArray)! .intValue(releaseOriginal: true), 42, ); final jmap = genericInterface.mapOf( + U: JInteger.type, 'hello'.toJString()..releasedBy(arena), 42.toJInteger()..releasedBy(arena), - )..releasedBy(arena); + )! + ..releasedBy(arena); expect( jmap['hello'.toJString()..releasedBy(arena)]! .intValue(releaseOriginal: true), @@ -916,19 +935,332 @@ void registerTests(String groupName, TestRunnerCallback test) { ); expect( genericInterface - .firstKeyOf(jmap) + .firstKeyOf(U: JInteger.type, jmap)! .as(JString.type) .toDartString(releaseOriginal: true), 'hello', ); expect( - genericInterface.firstValueOf(jmap).intValue(releaseOriginal: true), + genericInterface + .firstValueOf(U: JInteger.type, jmap)! + .intValue(releaseOriginal: true), 42, ); }); }); }); + group('Nullablity annotations', () { + Annotated newTestObject(Arena arena) { + return Annotated( + null, + 'hello'.toJString()..releasedBy(arena), + 'world'.toJString()..releasedBy(arena), + T: JString.nullableType, + )..releasedBy(arena); + } + + Annotated newNonNullTestObject(Arena arena) { + return Annotated( + 'hello'.toJString()..releasedBy(arena), + 'hello'.toJString()..releasedBy(arena), + 'world'.toJString()..releasedBy(arena), + T: JString.type, + )..releasedBy(arena); + } + + test('Field access', () { + using((arena) { + final annotated = newTestObject(arena); + expect(annotated.t, isNull); + expect(annotated.u.toDartString(releaseOriginal: true), 'hello'); + expect(annotated.w.toDartString(releaseOriginal: true), 'world'); + }); + }); + + test('Field setting', () { + using((arena) { + final annotated = newTestObject(arena); + annotated.t = 'hello'.toJString()..releasedBy(arena); + expect( + annotated.t! + .as(JString.type, releaseOriginal: true) + .toDartString(releaseOriginal: true), + 'hello', + ); + }); + }); + + test('Methods with no object args', () { + using((arena) { + final annotated = newTestObject(arena); + expect(annotated.hello().toDartString(releaseOriginal: true), 'hello'); + expect(annotated.nullableHello(true), isNull); + expect( + annotated.nullableHello(false)!.toDartString(releaseOriginal: true), + 'hello', + ); + }); + }); + + test('Methods returning arrays', () { + using((arena) { + final annotated = newTestObject(arena); + expect( + (annotated.array()..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect((annotated.arrayOfNullable()..releasedBy(arena))[0], isNull); + expect(annotated.nullableArray(true), isNull); + expect( + (annotated.nullableArray(false)!..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect(annotated.nullableArrayOfNullable(true), isNull); + expect( + (annotated.nullableArrayOfNullable(false)!..releasedBy(arena))[0], + isNull, + ); + }); + }); + + test('Methods returning lists', () { + using((arena) { + final annotated = newTestObject(arena); + expect( + (annotated.list()..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect((annotated.listOfNullable()..releasedBy(arena))[0], isNull); + expect(annotated.nullableList(true), isNull); + expect( + (annotated.nullableList(false)!..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect(annotated.nullableListOfNullable(true), isNull); + expect( + (annotated.nullableListOfNullable(false)!..releasedBy(arena))[0], + isNull, + ); + }); + }); + + test('Methods with one object arg', () { + using((arena) { + final annotated = newTestObject(arena); + final object = 'hello'.toJString()..releasedBy(arena); + expect( + annotated.echo(object).toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated.nullableEcho(object)!.toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated.nullableEcho(null), + isNull, + ); + }); + }); + + test('Class generic methods with one object arg', () { + using((arena) { + final annotatedNullableT = newTestObject(arena); + final object = 'hello'.toJString()..releasedBy(arena); + expect( + annotatedNullableT + .classGenericEcho(object)! // Cannot make it non-nullable. + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotatedNullableT + .nullableClassGenericEcho(object)! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotatedNullableT.nullableClassGenericEcho(null), + isNull, + ); + + final annotatedNonNullableT = newNonNullTestObject(arena); + expect( + annotatedNonNullableT + .classGenericEcho(object) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotatedNonNullableT + .nullableClassGenericEcho(object)! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotatedNonNullableT.nullableClassGenericEcho(null), + isNull, + ); + }); + }); + + test('Method generic methods with one object arg', () { + using((arena) { + final annotated = newTestObject(arena); + final object = 'hello'.toJString()..releasedBy(arena); + expect( + annotated + .methodGenericEcho(object, V: JString.nullableType)! + // Cannot make it non-nullable. + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + .methodGenericEcho(object, V: JString.type) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + .methodGenericEcho2(object) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + .methodGenericEcho3(object) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + // Requires `V`. + .nullableReturnMethodGenericEcho(object, false, V: JString.type)! + // Cannot make it non-nullable. + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + // Requires `V`. + .nullableReturnMethodGenericEcho(object, true, V: JString.type), + isNull, + ); + expect( + annotated + // `V` is optional. + .nullableReturnMethodGenericEcho2(object, false)! + // Cannot make it non-nullable. + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + // `V` is optional. + .nullableReturnMethodGenericEcho2(object, true), + isNull, + ); + expect( + annotated.nullableMethodGenericEcho(null, V: JString.nullableType), + isNull, + ); + expect( + annotated + .nullableMethodGenericEcho(object, V: JString.nullableType)! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + .nullableMethodGenericEcho(object, V: JString.type) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated.noAnnotationMethodGenericEcho(null, + V: JString.nullableType), + isNull, + ); + expect( + annotated + .noAnnotationMethodGenericEcho(object, V: JString.nullableType)! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + // With no annotations, specifying a non-nullable type still + // requires `!`. + .noAnnotationMethodGenericEcho(object, V: JString.type)! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated + .nullableArgMethodGenericEcho(object, V: JString.type) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + () => annotated.nullableArgMethodGenericEcho(null, + V: JString.type), + throwsA(isA()), + ); + expect( + annotated + .nullableArgMethodGenericEcho( + object, + V: JString.type, + ) + .toDartString(releaseOriginal: true), + 'hello', + ); + }); + }); + + test('Class generic list methods', () { + using((arena) { + final annotated = newNonNullTestObject(arena); + expect( + (annotated.classGenericList()..releasedBy(arena)) + .first + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + (annotated.classGenericListOfNullable()..releasedBy(arena)).first, + isNull, + ); + expect( + annotated.nullableClassGenericList(true), + isNull, + ); + expect( + (annotated.nullableClassGenericList(false)!..releasedBy(arena)) + .first + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + annotated.nullableClassGenericListOfNullable(true), + isNull, + ); + expect( + (annotated.nullableClassGenericListOfNullable(false)! + ..releasedBy(arena)) + .first, + isNull, + ); + }); + }); + }); + group('$groupName (load tests)', () { const k4 = 4 * 1024; // This is a round number, unlike say 4000 const k256 = 256 * 1024; @@ -999,8 +1331,8 @@ final class DartStringToIntParser with $StringConverter { DartStringToIntParser({required this.radix}); @override - int parseToInt(JString s) { - return int.parse(s.toDartString(releaseOriginal: true), radix: radix); + int parseToInt(JString? s) { + return int.parse(s!.toDartString(releaseOriginal: true), radix: radix); } } diff --git a/pkgs/jnigen/test/summary_test.dart b/pkgs/jnigen/test/summary_test.dart index d8d608196..93922f6ed 100644 --- a/pkgs/jnigen/test/summary_test.dart +++ b/pkgs/jnigen/test/summary_test.dart @@ -127,7 +127,7 @@ void registerCommonTests(Classes classes) { final arrayParam = method.params[2]; expect(arrayParam.type.kind, equals(Kind.array)); - expect((arrayParam.type.type as ArrayType).type.name, equals('int')); + expect((arrayParam.type.type as ArrayType).elementType.name, equals('int')); final typeVarParam = method.params[3]; expect(typeVarParam.type.kind, equals(Kind.typeVariable)); diff --git a/pkgs/jnigen/test/type_path_test.dart b/pkgs/jnigen/test/type_path_test.dart new file mode 100644 index 000000000..19ea448cf --- /dev/null +++ b/pkgs/jnigen/test/type_path_test.dart @@ -0,0 +1,18 @@ +import 'package:jnigen/jnigen.dart'; +import 'package:test/test.dart'; + +void main() { + test('Type path parsing', () { + const string = '0;.3;[14;*'; + final typePath = typePathFromString(string); + expect(typePath, const [ + ToTypeParam(0), + ToInnerClass(), + ToTypeParam(3), + ToArrayElement(), + ToTypeParam(14), + ToWildcardBound(), + ]); + expect(typePath.join(), string); + }); +} From 028f89d4a59448f9ecda5bd3d4519e2d7c742072 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 25 Nov 2024 15:56:09 +0100 Subject: [PATCH 10/50] [native_toolchain_c] Compile with `-O3` by default (#1747) [Not all linkers support `-Os`](https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket/8730301908709004769/+/u/test_results/new_test_failures__logs_), so defaulting to `-O3` is more portable. Issue: * https://github.com/dart-lang/native/issues/1267 --- pkgs/native_toolchain_c/CHANGELOG.md | 2 +- pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart | 4 ++-- pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/native_toolchain_c/CHANGELOG.md b/pkgs/native_toolchain_c/CHANGELOG.md index c3c04d05c..d0edf147c 100644 --- a/pkgs/native_toolchain_c/CHANGELOG.md +++ b/pkgs/native_toolchain_c/CHANGELOG.md @@ -2,7 +2,7 @@ - For Android, produce dylibs with page-size set to 16kb by default. https://github.com/dart-lang/native/issues/1611 -- Make optimization level configurable. Defaults to `-Os` and `/Os`. +- Make optimization level configurable. Defaults to `-3s` and `/O3`. https://github.com/dart-lang/native/issues/1267 ## 0.6.0 diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart index c3a97f8b7..62ec22015 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart @@ -68,7 +68,7 @@ class CBuilder extends CTool implements Builder { super.language = Language.c, super.cppLinkStdLib, super.linkModePreference, - super.optimizationLevel = OptimizationLevel.oS, + super.optimizationLevel = OptimizationLevel.o3, }) : super(type: OutputType.library); CBuilder.executable({ @@ -89,7 +89,7 @@ class CBuilder extends CTool implements Builder { super.std, super.language = Language.c, super.cppLinkStdLib, - super.optimizationLevel = OptimizationLevel.oS, + super.optimizationLevel = OptimizationLevel.o3, }) : super( type: OutputType.executable, assetName: null, diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart index 9a10f504a..b79174967 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart @@ -37,7 +37,7 @@ class CLinker extends CTool implements Linker { super.language = Language.c, super.cppLinkStdLib, super.linkModePreference, - super.optimizationLevel = OptimizationLevel.oS, + super.optimizationLevel = OptimizationLevel.o3, }) : super(type: OutputType.library); /// Runs the C Linker with on this C build spec. From 4ce481621c224dc5b7d86e2589c612f0624f0e44 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Tue, 26 Nov 2024 11:05:40 +1300 Subject: [PATCH 11/50] [swift2objc] Support optionals (#1742) --- .../src/ast/_core/interfaces/declaration.dart | 2 +- .../interfaces/function_declaration.dart | 2 +- .../src/ast/_core/shared/referred_type.dart | 47 +++++- .../built_in/built_in_declaration.dart | 7 + .../compounds/members/method_declaration.dart | 2 +- .../src/ast/declarations/globals/globals.dart | 2 +- .../lib/src/generator/_core/utils.dart | 2 +- .../generator/generators/class_generator.dart | 13 +- .../lib/src/parser/_core/token_list.dart | 63 ++++++++ .../lib/src/parser/_core/utils.dart | 43 ++--- ...n.dart => parse_function_declaration.dart} | 47 ++---- .../parse_initializer_declaration.dart | 89 +++++------ .../parse_variable_declaration.dart | 32 +--- .../parser/parsers/parse_declarations.dart | 2 +- .../lib/src/parser/parsers/parse_type.dart | 108 +++++++++++++ .../lib/src/transformer/_core/utils.dart | 71 ++++++--- .../transformers/transform_function.dart | 30 ++-- .../transformers/transform_initializer.dart | 5 +- .../transformers/transform_referred_type.dart | 34 ++-- .../transformers/transform_variable.dart | 7 +- .../classes_and_methods_output.swift | 4 +- .../classes_and_static_methods_output.swift | 4 +- ...lobal_variables_and_functions_output.swift | 4 +- .../test/integration/optional_input.swift | 36 +++++ .../test/integration/optional_output.swift | 97 ++++++++++++ .../structs_and_methods_output.swift | 4 +- .../structs_and_static_methods_output.swift | 4 +- .../unit/parse_initializer_param_input.json | 73 --------- .../unit/parse_initializer_param_test.dart | 75 ++++++++- .../swift2objc/test/unit/parse_type_test.dart | 149 ++++++++++++++++++ .../swift2objc/test/unit/token_list_test.dart | 75 +++++++++ 31 files changed, 833 insertions(+), 300 deletions(-) create mode 100644 pkgs/swift2objc/lib/src/parser/_core/token_list.dart rename pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/{pase_function_declaration.dart => parse_function_declaration.dart} (66%) create mode 100644 pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart create mode 100644 pkgs/swift2objc/test/integration/optional_input.swift create mode 100644 pkgs/swift2objc/test/integration/optional_output.swift delete mode 100644 pkgs/swift2objc/test/unit/parse_initializer_param_input.json create mode 100644 pkgs/swift2objc/test/unit/parse_type_test.dart create mode 100644 pkgs/swift2objc/test/unit/token_list_test.dart diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/declaration.dart index a0c8f5efa..4c237c8ba 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/declaration.dart @@ -10,6 +10,6 @@ abstract interface class Declaration { abstract final String name; } -extension AstDeclaredType on T { +extension AsDeclaredType on T { DeclaredType get asDeclaredType => DeclaredType(id: id, declaration: this); } diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart index 140ed9695..a354941a8 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart @@ -11,5 +11,5 @@ import 'type_parameterizable.dart'; /// Describes a function-like entity. abstract interface class FunctionDeclaration implements Declaration, Parameterizable, Executable, TypeParameterizable { - abstract final ReferredType? returnType; + abstract final ReferredType returnType; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart index 268be6eb1..e3c1c8a98 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart @@ -10,19 +10,19 @@ import '../interfaces/objc_annotatable.dart'; /// entities (e.g a method return type). /// See `DeclaredType` and `GenericType` for concrete implementation. sealed class ReferredType { - final String id; - final String name; abstract final bool isObjCRepresentable; - const ReferredType(this.name, {required this.id}); + abstract final String swiftType; + + bool sameAs(ReferredType other); + + const ReferredType(); } /// Describes a reference of a declared type (user-defined or built-in). class DeclaredType implements ReferredType { - @override final String id; - @override String get name { final decl = declaration; if (decl is CompoundDeclaration && decl.pathComponents.isNotEmpty) { @@ -40,6 +40,12 @@ class DeclaredType implements ReferredType { declaration is ObjCAnnotatable && (declaration as ObjCAnnotatable).hasObjCAnnotation; + @override + String get swiftType => name; + + @override + bool sameAs(ReferredType other) => other is DeclaredType && other.id == id; + const DeclaredType({ required this.id, required this.declaration, @@ -53,17 +59,44 @@ class DeclaredType implements ReferredType { /// Describes a reference of a generic type /// (e.g a method return type `T` within a generic class). class GenericType implements ReferredType { - @override final String id; - @override final String name; @override bool get isObjCRepresentable => false; + @override + String get swiftType => name; + + @override + bool sameAs(ReferredType other) => other is GenericType && other.id == id; + const GenericType({ required this.id, required this.name, }); + + @override + String toString() => name; +} + +/// An optional type, like Dart's nullable types. Eg `String?`. +class OptionalType implements ReferredType { + final ReferredType child; + + @override + bool get isObjCRepresentable => child.isObjCRepresentable; + + @override + String get swiftType => '$child?'; + + @override + bool sameAs(ReferredType other) => + other is OptionalType && child.sameAs(other.child); + + OptionalType(this.child); + + @override + String toString() => swiftType; } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart index 6131549df..f3d2f319b 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart @@ -28,3 +28,10 @@ enum BuiltInDeclaration implements Declaration, ObjCAnnotatable { required this.name, }); } + +final objectType = BuiltInDeclaration.swiftNSObject.asDeclaredType; +final stringType = BuiltInDeclaration.swiftString.asDeclaredType; +final intType = BuiltInDeclaration.swiftInt.asDeclaredType; +final doubleType = BuiltInDeclaration.swiftDouble.asDeclaredType; +final boolType = BuiltInDeclaration.swiftBool.asDeclaredType; +final voidType = BuiltInDeclaration.swiftVoid.asDeclaredType; diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart index 1a312ac82..849dac94e 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart @@ -34,7 +34,7 @@ class MethodDeclaration List statements; @override - ReferredType? returnType; + ReferredType returnType; bool isStatic; diff --git a/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart b/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart index 774e35ffb..73c55ffa1 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart @@ -34,7 +34,7 @@ class GlobalFunctionDeclaration implements FunctionDeclaration { List typeParams; @override - ReferredType? returnType; + ReferredType returnType; @override List statements; diff --git a/pkgs/swift2objc/lib/src/generator/_core/utils.dart b/pkgs/swift2objc/lib/src/generator/_core/utils.dart index 63c9450d7..571c70835 100644 --- a/pkgs/swift2objc/lib/src/generator/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/generator/_core/utils.dart @@ -11,7 +11,7 @@ String generateParameters(List params) { labels = param.name; } - return '$labels: ${param.type.name}'; + return '$labels: ${param.type.swiftType}'; }).join(', '); } diff --git a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart index 9f335e26f..6be8971e9 100644 --- a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart @@ -1,4 +1,9 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + import '../../ast/_core/shared/referred_type.dart'; +import '../../ast/declarations/built_in/built_in_declaration.dart'; import '../../ast/declarations/compounds/class_declaration.dart'; import '../_core/utils.dart'; @@ -47,7 +52,7 @@ String? _generateClassWrappedInstance(ClassDeclaration declaration) { "Wrapped instance can't have a generic type", ); - return 'var ${property.name}: ${property.type.name}'; + return 'var ${property.name}: ${property.type.swiftType}'; } List _generateInitializers(ClassDeclaration declaration) { @@ -102,8 +107,8 @@ List _generateClassMethods(ClassDeclaration declaration) { 'public func ${method.name}(${generateParameters(method.params)})', ); - if (method.returnType != null) { - header.write(' -> ${method.returnType!.name}'); + if (!method.returnType.sameAs(voidType)) { + header.write(' -> ${method.returnType.swiftType}'); } return [ @@ -127,7 +132,7 @@ List _generateClassProperties(ClassDeclaration declaration) { header.write('static '); } - header.write('public var ${property.name}: ${property.type.name} {'); + header.write('public var ${property.name}: ${property.type.swiftType} {'); final getterLines = [ 'get {', diff --git a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart new file mode 100644 index 000000000..c2e38fdc4 --- /dev/null +++ b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart @@ -0,0 +1,63 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'json.dart'; +import 'utils.dart'; + +/// A slicable list of json tokens from the symbolgraph. +/// +/// These token lists appear in the symbolgraph json under keys like +/// 'declarationFragments'. They represent things like argument lists, or +/// variable declarations. +/// +/// We have to do a little bit of preprocessing on the raw json list before we +/// can pass it to parseType, because certain tokens get concatenated by the +/// swift compiler. This class performs that preprocessing, as well as providing +/// convenience methods for parsing, like slicing. +class TokenList { + final List _list; + final int _start; + final int _end; + + TokenList._(this._list, this._start, this._end) + : assert(0 <= _start && _start <= _end && _end <= _list.length); + + factory TokenList(Json fragments) { + const splits = { + '?(': ['?', '('], + '?)': ['?', ')'], + '?, ': ['?', ', '], + }; + + final list = []; + for (final token in fragments) { + final split = splits[getSpellingForKind(token, 'text')]; + if (split != null) { + for (final sub in split) { + list.add(Json({'kind': 'text', 'spelling': sub})); + } + } else { + list.add(token); + } + } + return TokenList._(list, 0, list.length); + } + + int get length => _end - _start; + bool get isEmpty => length == 0; + Json operator [](int index) => _list[index + _start]; + + int indexWhere(bool Function(Json element) test) { + for (var i = _start; i < _end; ++i) { + if (test(_list[i])) return i - _start; + } + return -1; + } + + TokenList slice(int startIndex, [int? endIndex]) => TokenList._( + _list, startIndex + _start, endIndex != null ? endIndex + _start : _end); + + @override + String toString() => _list.getRange(_start, _end).toString(); +} diff --git a/pkgs/swift2objc/lib/src/parser/_core/utils.dart b/pkgs/swift2objc/lib/src/parser/_core/utils.dart index 9bb0ba3d7..6c680ab27 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/utils.dart @@ -10,9 +10,10 @@ import '../../ast/_core/interfaces/declaration.dart'; import '../../ast/_core/interfaces/enum_declaration.dart'; import '../../ast/_core/shared/referred_type.dart'; import '../../ast/declarations/globals/globals.dart'; -import '../parsers/parse_declarations.dart'; +import '../parsers/parse_type.dart'; import 'json.dart'; import 'parsed_symbolgraph.dart'; +import 'token_list.dart'; typedef ParsedSymbolsMap = Map; typedef ParsedRelationsMap = Map>; @@ -22,6 +23,7 @@ Json readJsonFile(String jsonFilePath) { return Json(jsonDecode(jsonStr)); } +// Valid ID characters seen in symbolgraphs: 0-9A-Za-z_():@ const idDelim = '-'; extension AddIdSuffix on String { @@ -38,10 +40,16 @@ extension TopLevelOnly on List { ).toList(); } -/// Matches fragments, which look like {"kind": "foo", "spelling": "bar"}. +/// If `fragment['kind'] == kind`, returns `fragment['spelling']`. Otherwise +/// returns null. +String? getSpellingForKind(Json fragment, String kind) => + fragment['kind'].get() == kind + ? fragment['spelling'].get() + : null; + +/// Matches fragments, which look like `{"kind": "foo", "spelling": "bar"}`. bool matchFragment(Json fragment, String kind, String spelling) => - fragment['kind'].get() == kind && - fragment['spelling'].get() == spelling; + getSpellingForKind(fragment, kind) == spelling; String parseSymbolId(Json symbolJson) { final idJson = symbolJson['identifier']['precise']; @@ -70,20 +78,6 @@ bool parseIsOverriding(Json symbolJson) { .any((json) => matchFragment(json, 'keyword', 'override')); } -ReferredType parseTypeFromId(String typeId, ParsedSymbolgraph symbolgraph) { - final paramTypeSymbol = symbolgraph.symbols[typeId]; - - if (paramTypeSymbol == null) { - throw Exception( - 'Type with id "$typeId" does not exist among parsed symbols.', - ); - } - - final paramTypeDeclaration = parseDeclaration(paramTypeSymbol, symbolgraph); - - return paramTypeDeclaration.asDeclaredType; -} - final class ObsoleteException implements Exception { final String symbol; ObsoleteException(this.symbol); @@ -107,3 +101,16 @@ extension Deduper on Iterable { Iterable dedupeBy(K Function(T) id) => {for (final t in this) id(t): t}.values; } + +ReferredType parseTypeAfterSeparator( + TokenList fragments, + ParsedSymbolgraph symbolgraph, +) { + // fragments = [..., ': ', type tokens...] + final separatorIndex = + fragments.indexWhere((token) => matchFragment(token, 'text', ': ')); + final (type, suffix) = + parseType(symbolgraph, fragments.slice(separatorIndex + 1)); + assert(suffix.isEmpty, '$suffix'); + return type; +} diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/pase_function_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart similarity index 66% rename from pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/pase_function_declaration.dart rename to pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart index bdff14992..8764189bf 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/pase_function_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart @@ -2,15 +2,15 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../../../ast/_core/interfaces/declaration.dart'; import '../../../ast/_core/shared/parameter.dart'; import '../../../ast/_core/shared/referred_type.dart'; import '../../../ast/declarations/compounds/members/method_declaration.dart'; import '../../../ast/declarations/globals/globals.dart'; import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; +import '../../_core/token_list.dart'; import '../../_core/utils.dart'; -import '../parse_declarations.dart'; +import '../parse_type.dart'; GlobalFunctionDeclaration parseGlobalFunctionDeclaration( Json globalFunctionSymbolJson, @@ -39,34 +39,15 @@ MethodDeclaration parseMethodDeclaration( ); } -ReferredType? _parseFunctionReturnType( +ReferredType _parseFunctionReturnType( Json methodSymbolJson, ParsedSymbolgraph symbolgraph, ) { - final returnJson = methodSymbolJson['functionSignature']['returns'][0]; - - // This means there's no return type - if (returnJson['spelling'].get() == '()') { - return null; - } - - final returnTypeId = returnJson['preciseIdentifier'].get(); - - final returnTypeSymbol = symbolgraph.symbols[returnTypeId]; - - if (returnTypeSymbol == null) { - throw Exception( - 'The method at path "${methodSymbolJson.path}" has a return type that ' - 'does not exist among parsed symbols.', - ); - } - - final returnTypeDeclaration = parseDeclaration( - returnTypeSymbol, - symbolgraph, - ); - - return returnTypeDeclaration.asDeclaredType; + final returnJson = + TokenList(methodSymbolJson['functionSignature']['returns']); + final (returnType, unparsed) = parseType(symbolgraph, returnJson); + assert(unparsed.isEmpty); + return returnType; } List _parseFunctionParams( @@ -91,12 +72,6 @@ List _parseFunctionParams( ReferredType _parseParamType( Json paramSymbolJson, ParsedSymbolgraph symbolgraph, -) { - final fragments = paramSymbolJson['declarationFragments']; - - final paramTypeId = fragments - .firstJsonWhereKey('kind', 'typeIdentifier')['preciseIdentifier'] - .get(); - - return parseTypeFromId(paramTypeId, symbolgraph); -} +) => + parseTypeAfterSeparator( + TokenList(paramSymbolJson['declarationFragments']), symbolgraph); diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index d5cb9192f..7f7dabb33 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -2,7 +2,9 @@ import '../../../ast/_core/shared/parameter.dart'; import '../../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; +import '../../_core/token_list.dart'; import '../../_core/utils.dart'; +import '../parse_type.dart'; InitializerDeclaration parseInitializerDeclaration( Json initializerSymbolJson, @@ -39,74 +41,59 @@ List parseInitializerParams( // things like `init` keyword, brackets, spaces, etc. We only care about the // parameter fragments here, and they always appear in this order: // [ - // 'externalParam', - // ..., - // `internalParam`, - // ..., - // `typeIdentifier`, - // ... - // 'externalParam', - // ..., - // `internalParam`, - // ..., - // `typeIdentifier` + // ..., '(', + // externalParam, ' ', internalParam, ': ', type..., ', ' + // externalParam, ': ', type..., ', ' + // externalParam, ' ', internalParam, ': ', type..., ')' // ] // Note: `internalParam` may or may not exist. // // The following loop attempts to extract parameters from this flat array // while making sure the parameter fragments have the expected order. - String? externalParam; - String? internalParam; - String? typeId; - final parameters = []; - for (final fragmentJson in declarationFragments) { - final kind = fragmentJson['kind'].get(); - final invalidOrderException = Exception( - 'Invalid fragments order at ${fragmentJson.path}', + var tokens = TokenList(declarationFragments); + final openParen = tokens.indexWhere((tok) => matchFragment(tok, 'text', '(')); + if (openParen != -1) { + tokens = tokens.slice(openParen + 1); + String? consume(String kind) { + if (tokens.isEmpty) return null; + final token = tokens[0]; + tokens = tokens.slice(1); + return getSpellingForKind(token, kind); + } + + final malformedInitializerException = Exception( + 'Malformed initializer at ${declarationFragments.path}', ); + while (true) { + final externalParam = consume('externalParam'); + if (externalParam == null) throw malformedInitializerException; - switch (kind) { - case 'externalParam': - if (externalParam != null || internalParam != null || typeId != null) { - throw invalidOrderException; - } - externalParam = fragmentJson['spelling'].get(); - break; - case 'internalParam': - if (externalParam == null || internalParam != null || typeId != null) { - throw invalidOrderException; - } - internalParam = fragmentJson['spelling'].get(); - break; - case 'typeIdentifier': - if (externalParam == null || typeId != null) { - throw invalidOrderException; - } - typeId = fragmentJson['preciseIdentifier'].get(); - } + var sep = consume('text'); + String? internalParam; + if (sep == ' ') { + internalParam = consume('internalParam'); + if (internalParam == null) throw malformedInitializerException; + sep = consume('text'); + } + + if (sep != ': ') throw malformedInitializerException; + final (type, remainingTokens) = parseType(symbolgraph, tokens); + tokens = remainingTokens; - if (externalParam != null && typeId != null) { parameters.add(Parameter( name: externalParam, internalName: internalParam, - type: parseTypeFromId(typeId, symbolgraph), + type: type, )); - internalParam = null; - externalParam = null; - typeId = null; + final end = consume('text'); + if (end == ')') break; + if (end != ', ') throw malformedInitializerException; } - } - - // This ensures there's no half-described parameter at the end - // of `declarationFragments` array. - if (externalParam != null || internalParam != null || typeId != null) { - throw Exception( - 'Missing parameter fragments at the end of ${declarationFragments.path}', - ); + if (!tokens.isEmpty) throw malformedInitializerException; } return parameters; diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart index 171fc2acf..a2288404e 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart @@ -1,11 +1,14 @@ -import '../../../ast/_core/interfaces/declaration.dart'; +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + import '../../../ast/_core/shared/referred_type.dart'; import '../../../ast/declarations/compounds/members/property_declaration.dart'; import '../../../ast/declarations/globals/globals.dart'; import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; +import '../../_core/token_list.dart'; import '../../_core/utils.dart'; -import '../parse_declarations.dart'; PropertyDeclaration parsePropertyDeclaration( Json propertySymbolJson, @@ -42,28 +45,9 @@ GlobalVariableDeclaration parseGlobalVariableDeclaration( ReferredType _parseVariableType( Json propertySymbolJson, ParsedSymbolgraph symbolgraph, -) { - final subHeadings = propertySymbolJson['names']['subHeading']; - - final typeSymbolJson = - subHeadings.firstJsonWhereKey('kind', 'typeIdentifier'); - final typeSymbolId = typeSymbolJson['preciseIdentifier'].get(); - final typeSymbol = symbolgraph.symbols[typeSymbolId]; - - if (typeSymbol == null) { - throw Exception( - 'The property at path "${propertySymbolJson.path}" has a return type ' - 'that does not exist among parsed symbols.', - ); - } - - final typeDeclaration = parseDeclaration( - typeSymbol, - symbolgraph, - ); - - return typeDeclaration.asDeclaredType; -} +) => + parseTypeAfterSeparator( + TokenList(propertySymbolJson['names']['subHeading']), symbolgraph); bool _parseVariableIsConstant(Json variableSymbolJson) { final fragmentsJson = variableSymbolJson['declarationFragments']; diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart index 674e0ac5c..5036bba8d 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart @@ -8,9 +8,9 @@ import '../../ast/_core/interfaces/declaration.dart'; import '../_core/parsed_symbolgraph.dart'; import '../_core/utils.dart'; import 'declaration_parsers/parse_compound_declaration.dart'; +import 'declaration_parsers/parse_function_declaration.dart'; import 'declaration_parsers/parse_initializer_declaration.dart'; import 'declaration_parsers/parse_variable_declaration.dart'; -import 'declaration_parsers/pase_function_declaration.dart'; List parseDeclarations(ParsedSymbolgraph symbolgraph) { final declarations = []; diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart new file mode 100644 index 000000000..79d821ee8 --- /dev/null +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart @@ -0,0 +1,108 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import '../../ast/_core/interfaces/declaration.dart'; +import '../../ast/_core/shared/referred_type.dart'; +import '../../ast/declarations/built_in/built_in_declaration.dart'; +import '../_core/json.dart'; +import '../_core/parsed_symbolgraph.dart'; +import '../_core/token_list.dart'; +import 'parse_declarations.dart'; + +/// Parse a type from a list of Json fragments. +/// +/// Returns the parsed type, and a Json slice of the remaining fragments that +/// weren't part of the type. +(ReferredType, TokenList) parseType( + ParsedSymbolgraph symbolgraph, TokenList fragments) { + var (type, suffix) = _parsePrefixTypeExpression(symbolgraph, fragments); + while (true) { + final (nextType, nextSuffix) = + _maybeParseSuffixTypeExpression(symbolgraph, type, suffix); + if (nextType == null) break; + type = nextType; + suffix = nextSuffix; + } + return (type, suffix); +} + +// Prefix expressions are literals or prefix operators (stuff that can appear +// at the beginning of the list of fragments). If we were parsing a programming +// language, these would be things like `123` or `-x`. +(ReferredType, TokenList) _parsePrefixTypeExpression( + ParsedSymbolgraph symbolgraph, TokenList fragments) { + final token = fragments[0]; + final parselet = _prefixParsets[_tokenId(token)]; + if (parselet == null) throw Exception('Invalid type at "${token.path}"'); + return parselet(symbolgraph, token, fragments.slice(1)); +} + +// Suffix expressions are infix operators or suffix operators (basically +// anything that isn't a prefix). If we were parsing a programming language, +// these would be things like `x + y`, `z!`, or even `x ? y : z`. +(ReferredType?, TokenList) _maybeParseSuffixTypeExpression( + ParsedSymbolgraph symbolgraph, + ReferredType prefixType, + TokenList fragments) { + if (fragments.isEmpty) return (null, fragments); + final token = fragments[0]; + final parselet = _suffixParsets[_tokenId(token)]; + if (parselet == null) return (null, fragments); + return parselet(symbolgraph, prefixType, token, fragments.slice(1)); +} + +// For most tokens, we only care about the kind. But some tokens just have a +// kind of 'text', and the spelling is what distinguishes them. +String _tokenId(Json token) { + final kind = token['kind'].get(); + return kind == 'text' ? 'text: ${token['spelling'].get()}' : kind; +} + +// ======================== +// === Prefix parselets === +// ======================== + +typedef PrefixParselet = (ReferredType, TokenList) Function( + ParsedSymbolgraph symbolgraph, Json token, TokenList fragments); + +(ReferredType, TokenList) _typeIdentifierParselet( + ParsedSymbolgraph symbolgraph, Json token, TokenList fragments) { + final id = token['preciseIdentifier'].get(); + final symbol = symbolgraph.symbols[id]; + + if (symbol == null) { + throw Exception( + 'The type at "${token.path}" does not exist among parsed symbols.'); + } + + final type = parseDeclaration(symbol, symbolgraph).asDeclaredType; + return (type, fragments); +} + +(ReferredType, TokenList) _emptyTupleParselet( + ParsedSymbolgraph symbolgraph, Json token, TokenList fragments) => + (voidType, fragments); + +Map _prefixParsets = { + 'typeIdentifier': _typeIdentifierParselet, + 'text: ()': _emptyTupleParselet, +}; + +// ======================== +// === Suffix parselets === +// ======================== + +typedef SuffixParselet = (ReferredType, TokenList) Function( + ParsedSymbolgraph symbolgraph, + ReferredType prefixType, + Json token, + TokenList fragments); + +(ReferredType, TokenList) _optionalParselet(ParsedSymbolgraph symbolgraph, + ReferredType prefixType, Json token, TokenList fragments) => + (OptionalType(prefixType), fragments); + +Map _suffixParsets = { + 'text: ?': _optionalParselet, +}; diff --git a/pkgs/swift2objc/lib/src/transformer/_core/utils.dart b/pkgs/swift2objc/lib/src/transformer/_core/utils.dart index 33b99b58d..429285e66 100644 --- a/pkgs/swift2objc/lib/src/transformer/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/transformer/_core/utils.dart @@ -8,48 +8,67 @@ import '../../ast/declarations/compounds/class_declaration.dart'; import '../transform.dart'; import 'unique_namer.dart'; +// TODO(https://github.com/dart-lang/native/issues/1358): These functions should +// probably be methods on ReferredType, but the transformDeclaration call makes +// that weird. Refactor this as part of the transformer refactor. + (String value, ReferredType type) maybeWrapValue( ReferredType type, - String valueIdentifier, + String value, UniqueNamer globalNamer, TransformationMap transformationMap, ) { - if (type is GenericType) { - throw UnimplementedError('Generic types are not implemented yet'); - } - - type as DeclaredType; - if (type.isObjCRepresentable) { - return (valueIdentifier, type); + return (value, type); } - final transformedTypeDeclaration = transformDeclaration( - type.declaration, - globalNamer, - transformationMap, - ); + if (type is GenericType) { + throw UnimplementedError('Generic types are not implemented yet'); + } else if (type is DeclaredType) { + final transformedTypeDeclaration = transformDeclaration( + type.declaration, + globalNamer, + transformationMap, + ); - return ( - '${transformedTypeDeclaration.name}($valueIdentifier)', - transformedTypeDeclaration.asDeclaredType - ); + return ( + '${transformedTypeDeclaration.name}($value)', + transformedTypeDeclaration.asDeclaredType + ); + } else if (type is OptionalType) { + final (newValue, newType) = + maybeWrapValue(type.child, '$value!', globalNamer, transformationMap); + return ( + '$value == nil ? nil : $newValue', + OptionalType(newType), + ); + } else { + throw UnimplementedError('Unknown type: $type'); + } } (String value, ReferredType type) maybeUnwrapValue( ReferredType type, - String valueIdentifier, + String value, ) { - if (type is GenericType) { - throw UnimplementedError('Generic types are not implemented yet'); + if (!type.isObjCRepresentable) { + return (value, type); } - final declaration = (type as DeclaredType).declaration; - - if (declaration is ClassDeclaration && declaration.wrappedInstance != null) { - final wrappedInstance = declaration.wrappedInstance; - return ('$valueIdentifier.${wrappedInstance!.name}', wrappedInstance.type); + if (type is GenericType) { + throw UnimplementedError('Generic types are not implemented yet'); + } else if (type is DeclaredType) { + final declaration = type.declaration; + if (declaration is ClassDeclaration) { + final wrappedInstance = declaration.wrappedInstance!; + return ('$value.${wrappedInstance.name}', wrappedInstance.type); + } else { + return (value, type); + } + } else if (type is OptionalType) { + final (newValue, newType) = maybeUnwrapValue(type.child, '$value?'); + return (newValue, OptionalType(newType)); } else { - return (valueIdentifier, type); + throw UnimplementedError('Unknown type: $type'); } } diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart index 5f6cfd830..ad1480a1e 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart @@ -37,7 +37,7 @@ MethodDeclaration? transformMethod( wrapperMethodName: originalMethod.name, originalCallStatementGenerator: (arguments) { final methodSource = originalMethod.isStatic - ? wrappedClassInstance.type.name + ? wrappedClassInstance.type.swiftType : wrappedClassInstance.name; return '$methodSource.${originalMethod.name}($arguments)'; }, @@ -84,17 +84,11 @@ MethodDeclaration _transformFunction( ) .toList(); - final ReferredType? transformedReturnType; - - if (originalFunction.returnType == null) { - transformedReturnType = null; - } else { - transformedReturnType = transformReferredType( - originalFunction.returnType!, - globalNamer, - transformationMap, - ); - } + final transformedReturnType = transformReferredType( + originalFunction.returnType, + globalNamer, + transformationMap, + ); final transformedMethod = MethodDeclaration( id: originalFunction.id, @@ -139,7 +133,7 @@ List _generateStatements( transformedParamName, ); - assert(unwrappedType.id == originalParam.type.id); + assert(unwrappedType.sameAs(originalParam.type)); var methodCallArg = '${originalParam.name}: $unwrappedParamValue'; @@ -150,11 +144,7 @@ List _generateStatements( final originalMethodCall = originalCallGenerator(arguments); - if (originalFunction.returnType == null) { - return [originalMethodCall]; - } - - if (originalFunction.returnType!.id == transformedMethod.returnType?.id) { + if (originalFunction.returnType.sameAs(transformedMethod.returnType)) { return ['return $originalMethodCall']; } @@ -165,13 +155,13 @@ List _generateStatements( final methodCallStmt = 'let result = $originalMethodCall'; final (wrappedResult, wrapperType) = maybeWrapValue( - originalFunction.returnType!, + originalFunction.returnType, 'result', globalNamer, transformationMap, ); - assert(transformedMethod.returnType?.id == wrapperType.id); + assert(wrapperType.sameAs(transformedMethod.returnType)); final returnStmt = 'return $wrappedResult'; diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart index 2fa043edd..795c65531 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart @@ -69,7 +69,7 @@ List _generateInitializerStatements( transformedParamName, ); - assert(unwrappedType.id == originalParam.type.id); + assert(unwrappedType.sameAs(originalParam.type)); var methodCallArg = '${originalParam.name}: $unwrappedParamValue'; @@ -78,7 +78,8 @@ List _generateInitializerStatements( final arguments = argumentsList.join(', '); - final instanceConstruction = '${wrappedClassInstance.type.name}($arguments)'; + final instanceConstruction = + '${wrappedClassInstance.type.swiftType}($arguments)'; if (originalInitializer.isFailable) { final instance = localNamer.makeUnique('instance'); return [ diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_referred_type.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_referred_type.dart index 8ea30a15e..fcfd52f1f 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_referred_type.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_referred_type.dart @@ -7,24 +7,28 @@ import '../../ast/_core/shared/referred_type.dart'; import '../_core/unique_namer.dart'; import '../transform.dart'; -DeclaredType transformReferredType( - ReferredType referredType, +// TODO(https://github.com/dart-lang/native/issues/1358): Refactor this as a +// transformer or visitor. + +ReferredType transformReferredType( + ReferredType type, UniqueNamer globalNamer, TransformationMap transformationMap, ) { - if (referredType is GenericType) { + if (type.isObjCRepresentable) return type; + + if (type is GenericType) { throw UnimplementedError('Generic types are not supported yet'); + } else if (type is DeclaredType) { + return transformDeclaration( + type.declaration, + globalNamer, + transformationMap, + ).asDeclaredType; + } else if (type is OptionalType) { + return OptionalType( + transformReferredType(type.child, globalNamer, transformationMap)); + } else { + throw UnimplementedError('Unknown type: $type'); } - - referredType as DeclaredType; - - if (referredType.isObjCRepresentable) return referredType; - - final transformedDeclaration = transformDeclaration( - referredType.declaration, - globalNamer, - transformationMap, - ); - - return transformedDeclaration.asDeclaredType; } diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart index fd0c20892..c6da95e8c 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart @@ -24,7 +24,7 @@ PropertyDeclaration? transformProperty( } final propertySource = originalProperty.isStatic - ? wrappedClassInstance.type.name + ? wrappedClassInstance.type.swiftType : wrappedClassInstance.name; return _transformVariable( @@ -120,7 +120,7 @@ List _generateGetterStatements( transformationMap, ); - assert(wrapperType.id == transformedProperty.type.id); + assert(wrapperType.sameAs(transformedProperty.type)); return [wrappedValue]; } @@ -137,7 +137,8 @@ List _generateSetterStatements( 'newValue', ); - assert(unwrappedType.id == originalVariable.type.id); + assert(unwrappedType.sameAs(originalVariable.type), + '$unwrappedType\tvs\t${originalVariable.type}'); return ['$variableReference = $unwrappedValue']; } diff --git a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift index 02e76b506..7b5a5596b 100644 --- a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift @@ -22,11 +22,11 @@ import Foundation return MyOtherClassWrapper(result) } - @objc public func myMethod2() -> Void { + @objc public func myMethod2() { return wrappedInstance.myMethod2() } @objc public func myMethod3() { - wrappedInstance.myMethod3() + return wrappedInstance.myMethod3() } } diff --git a/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift index 4a798ff59..1c7bf97d3 100644 --- a/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift @@ -22,11 +22,11 @@ import Foundation return MyOtherClassWrapper(result) } - @objc static public func myMethod2() -> Void { + @objc static public func myMethod2() { return MyClass.myMethod2() } @objc static public func myMethod3() { - MyClass.myMethod3() + return MyClass.myMethod3() } } diff --git a/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift b/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift index 9409f4d2d..b495a1f9f 100644 --- a/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift +++ b/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift @@ -53,12 +53,12 @@ import Foundation return MyOtherClassWrapper(result) } - @objc static public func globalRepresentableFunctionWrapper1() -> Void { + @objc static public func globalRepresentableFunctionWrapper1() { return globalRepresentableFunction() } @objc static public func globalRepresentableFunctionWrapperWrapper() { - globalRepresentableFunctionWrapper() + return globalRepresentableFunctionWrapper() } } diff --git a/pkgs/swift2objc/test/integration/optional_input.swift b/pkgs/swift2objc/test/integration/optional_input.swift new file mode 100644 index 000000000..5552fbf90 --- /dev/null +++ b/pkgs/swift2objc/test/integration/optional_input.swift @@ -0,0 +1,36 @@ +import Foundation + +// public func funcOptionalPrimitiveReturn() -> Int? { return 123 } +public func funcOptionalClassReturn() -> MyClass? { return MyClass(label: nil) } +public func funcOptionalStructReturn() -> MyStruct? { return nil } +public func funcOptionalArgs(label param: MyClass?) -> MyClass { return param! } +public func funcMultipleOptionalArgs( + label1 param1: MyClass?,label2 param2: Int, label3 param3: MyStruct?){} + +public var globalOptional: MyStruct? + +public class MyClass { + public var optionalProperty: MyClass? + + public init(label param: MyClass?) { + self.optionalProperty = param + } + + public init(label1 param1: MyClass?, label2: Int, label3 param3: MyStruct?) { + self.optionalProperty = param1 + } + + public func methodOptionalReturn() -> MyClass? { return nil } + public func methodOptionalArgs(label param: MyClass?) {} +} + +public struct MyStruct { + public var optionalProperty: MyClass? + + public init(label param: MyClass?) { + self.optionalProperty = param + } + + public func methodOptionalReturn() -> MyStruct? { return nil } + public func methodOptionalArgs(label param: MyClass?) {} +} diff --git a/pkgs/swift2objc/test/integration/optional_output.swift b/pkgs/swift2objc/test/integration/optional_output.swift new file mode 100644 index 000000000..ff15219b2 --- /dev/null +++ b/pkgs/swift2objc/test/integration/optional_output.swift @@ -0,0 +1,97 @@ +// Test preamble text + +import Foundation + +@objc public class GlobalsWrapper: NSObject { + @objc static public var globalOptionalWrapper: MyStructWrapper? { + get { + globalOptional == nil ? nil : MyStructWrapper(globalOptional!) + } + set { + globalOptional = newValue?.wrappedInstance + } + } + + @objc static public func funcOptionalArgsWrapper(label param: MyClassWrapper?) -> MyClassWrapper { + let result = funcOptionalArgs(label: param?.wrappedInstance) + return MyClassWrapper(result) + } + + @objc static public func funcOptionalClassReturnWrapper() -> MyClassWrapper? { + let result = funcOptionalClassReturn() + return result == nil ? nil : MyClassWrapper(result!) + } + + @objc static public func funcMultipleOptionalArgsWrapper(label1 param1: MyClassWrapper?, label2 param2: Int, label3 param3: MyStructWrapper?) { + return funcMultipleOptionalArgs(label1: param1?.wrappedInstance, label2: param2, label3: param3?.wrappedInstance) + } + + @objc static public func funcOptionalStructReturnWrapper() -> MyStructWrapper? { + let result = funcOptionalStructReturn() + return result == nil ? nil : MyStructWrapper(result!) + } +} + +@objc public class MyClassWrapper: NSObject { + var wrappedInstance: MyClass + + @objc public var optionalProperty: MyClassWrapper? { + get { + wrappedInstance.optionalProperty == nil ? nil : MyClassWrapper(wrappedInstance.optionalProperty!) + } + set { + wrappedInstance.optionalProperty = newValue?.wrappedInstance + } + } + + init(_ wrappedInstance: MyClass) { + self.wrappedInstance = wrappedInstance + } + + @objc init(label param: MyClassWrapper?) { + wrappedInstance = MyClass(label: param?.wrappedInstance) + } + + @objc init(label1 param1: MyClassWrapper?, label2: Int, label3 param3: MyStructWrapper?) { + wrappedInstance = MyClass(label1: param1?.wrappedInstance, label2: label2, label3: param3?.wrappedInstance) + } + + @objc public func methodOptionalArgs(label param: MyClassWrapper?) { + return wrappedInstance.methodOptionalArgs(label: param?.wrappedInstance) + } + + @objc public func methodOptionalReturn() -> MyClassWrapper? { + let result = wrappedInstance.methodOptionalReturn() + return result == nil ? nil : MyClassWrapper(result!) + } +} + +@objc public class MyStructWrapper: NSObject { + var wrappedInstance: MyStruct + + @objc public var optionalProperty: MyClassWrapper? { + get { + wrappedInstance.optionalProperty == nil ? nil : MyClassWrapper(wrappedInstance.optionalProperty!) + } + set { + wrappedInstance.optionalProperty = newValue?.wrappedInstance + } + } + + init(_ wrappedInstance: MyStruct) { + self.wrappedInstance = wrappedInstance + } + + @objc init(label param: MyClassWrapper?) { + wrappedInstance = MyStruct(label: param?.wrappedInstance) + } + + @objc public func methodOptionalArgs(label param: MyClassWrapper?) { + return wrappedInstance.methodOptionalArgs(label: param?.wrappedInstance) + } + + @objc public func methodOptionalReturn() -> MyStructWrapper? { + let result = wrappedInstance.methodOptionalReturn() + return result == nil ? nil : MyStructWrapper(result!) + } +} diff --git a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift index 788b88e9a..76943f7e7 100644 --- a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift @@ -22,11 +22,11 @@ import Foundation return MyOtherStructWrapper(result) } - @objc public func myMethod2() -> Void { + @objc public func myMethod2() { return wrappedInstance.myMethod2() } @objc public func myMethod3() { - wrappedInstance.myMethod3() + return wrappedInstance.myMethod3() } } diff --git a/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift index 671a6088e..47ff615fa 100644 --- a/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift @@ -22,11 +22,11 @@ import Foundation return MyOtherStructWrapper(result) } - @objc static public func myMethod2() -> Void { + @objc static public func myMethod2() { return MyStruct.myMethod2() } @objc static public func myMethod3() { - MyStruct.myMethod3() + return MyStruct.myMethod3() } } diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_input.json b/pkgs/swift2objc/test/unit/parse_initializer_param_input.json deleted file mode 100644 index d5fbdfd6d..000000000 --- a/pkgs/swift2objc/test/unit/parse_initializer_param_input.json +++ /dev/null @@ -1,73 +0,0 @@ -[ - { - "testName": "Two params with one internal name", - "inputJson": { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "externalParam", "spelling": "outerLabel" }, - { "kind": "text", "spelling": " " }, - { "kind": "internalParam", "spelling": "representableProperty" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ", " }, - { "kind": "externalParam", "spelling": "customProperty" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ")" } - ] - }, - "outputParams": [ - { - "name": "outerLabel", - "internalName": "representableProperty", - "typeId": "s:Si" - }, - { - "name": "customProperty", - "typeId": "s:Si" - } - ] - }, - { - "testName": "One param", - "inputJson": { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "(" }, - { "kind": "externalParam", "spelling": "property" }, - { "kind": "text", "spelling": ": " }, - { - "kind": "typeIdentifier", - "spelling": "Int", - "preciseIdentifier": "s:Si" - }, - { "kind": "text", "spelling": ")" } - ] - }, - "outputParams": [ - { - "name": "property", - "typeId": "s:Si" - } - ] - }, - { - "testName": "No params", - "inputJson": { - "declarationFragments": [ - { "kind": "keyword", "spelling": "init" }, - { "kind": "text", "spelling": "()" } - ] - }, - "outputParams": [] - } -] diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart b/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart index 26a7707ec..f6d1f9603 100644 --- a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart +++ b/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart @@ -1,7 +1,11 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + import 'dart:convert'; -import 'package:swift2objc/src/ast/_core/interfaces/declaration.dart'; import 'package:swift2objc/src/ast/_core/shared/parameter.dart'; +import 'package:swift2objc/src/ast/_core/shared/referred_type.dart'; import 'package:swift2objc/src/ast/declarations/built_in/built_in_declaration.dart'; import 'package:swift2objc/src/parser/_core/json.dart'; import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; @@ -27,7 +31,7 @@ void main() { expect(actualParam.name, expectedParam.name); expect(actualParam.internalName, expectedParam.internalName); - expect(actualParam.type.id, expectedParam.type.id); + expect(actualParam.type.sameAs(expectedParam.type), isTrue); } } @@ -65,16 +69,77 @@ void main() { Parameter( name: 'outerLabel', internalName: 'internalLabel', - type: BuiltInDeclaration.swiftInt.asDeclaredType, + type: intType, ), Parameter( name: 'singleLabel', - type: BuiltInDeclaration.swiftInt.asDeclaredType, + type: intType, ), ]; expectEqualParams(outputParams, expectedParams); }); + + test('Three params with some optional', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "init" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "label1" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "param1" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": "?, " }, + { "kind": "externalParam", "spelling": "label2" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ", " }, + { "kind": "externalParam", "spelling": "label3" }, + { "kind": "text", "spelling": " " }, + { "kind": "internalParam", "spelling": "param3" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": "?)" } + ] + ''', + )); + + final outputParams = parseInitializerParams(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'label1', + internalName: 'param1', + type: OptionalType(intType), + ), + Parameter( + name: 'label2', + type: intType, + ), + Parameter( + name: 'label3', + internalName: 'param3', + type: OptionalType(intType), + ), + ]; + + expectEqualParams(outputParams, expectedParams); + }); + test('One param', () { final json = Json(jsonDecode( ''' @@ -98,7 +163,7 @@ void main() { final expectedParams = [ Parameter( name: 'parameter', - type: BuiltInDeclaration.swiftInt.asDeclaredType, + type: intType, ), ]; diff --git a/pkgs/swift2objc/test/unit/parse_type_test.dart b/pkgs/swift2objc/test/unit/parse_type_test.dart new file mode 100644 index 000000000..9c1a3b59a --- /dev/null +++ b/pkgs/swift2objc/test/unit/parse_type_test.dart @@ -0,0 +1,149 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; + +import 'package:swift2objc/src/ast/_core/shared/referred_type.dart'; +import 'package:swift2objc/src/ast/declarations/built_in/built_in_declaration.dart'; +import 'package:swift2objc/src/parser/_core/json.dart'; +import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; +import 'package:swift2objc/src/parser/_core/token_list.dart'; +import 'package:swift2objc/src/parser/parsers/parse_type.dart'; +import 'package:test/test.dart'; + +void main() { + final parsedSymbols = ParsedSymbolgraph({ + for (final decl in BuiltInDeclaration.values) + decl.id: ParsedSymbol(json: Json(null), declaration: decl) + }, {}); + + test('Type identifier', () { + final fragments = Json(jsonDecode( + ''' + [ + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final (type, remaining) = parseType(parsedSymbols, TokenList(fragments)); + + expect(type.sameAs(intType), isTrue); + expect(remaining.length, 0); + }); + + test('Empty tuple', () { + final fragments = Json(jsonDecode( + ''' + [ + { + "kind": "text", + "spelling": "()" + } + ] + ''', + )); + + final (type, remaining) = parseType(parsedSymbols, TokenList(fragments)); + + expect(type.sameAs(voidType), isTrue); + expect(remaining.length, 0); + }); + + test('Optional', () { + final fragments = Json(jsonDecode( + ''' + [ + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { + "kind": "text", + "spelling": "?" + } + ] + ''', + )); + + final (type, remaining) = parseType(parsedSymbols, TokenList(fragments)); + + expect(type.sameAs(OptionalType(intType)), isTrue); + expect(remaining.length, 0); + }); + + test('Multiple suffixes', () { + // This test is verifying that we can parse multiple suffix operators in a + // row. Nested OptionalTypes don't really make sense though. So in future if + // we start collapsing nested OptionalTypes, change this test to use a + // different suffix type. + final fragments = Json(jsonDecode( + ''' + [ + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { + "kind": "text", + "spelling": "?" + }, + { + "kind": "text", + "spelling": "?" + }, + { + "kind": "text", + "spelling": "?" + } + ] + ''', + )); + + final (type, remaining) = parseType(parsedSymbols, TokenList(fragments)); + + expect(type.sameAs(OptionalType(intType)), isFalse); + expect( + type.sameAs(OptionalType(OptionalType(OptionalType(intType)))), isTrue); + expect(remaining.length, 0); + }); + + test('Stop parsing when we find a non-type token', () { + final fragments = Json(jsonDecode( + ''' + [ + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { + "kind": "text", + "spelling": "?" + }, + { + "kind": "text", + "spelling": "," + }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final (type, remaining) = parseType(parsedSymbols, TokenList(fragments)); + + expect(type.sameAs(OptionalType(intType)), isTrue); + expect(remaining.length, 2); + }); +} diff --git a/pkgs/swift2objc/test/unit/token_list_test.dart b/pkgs/swift2objc/test/unit/token_list_test.dart new file mode 100644 index 000000000..d67b2904b --- /dev/null +++ b/pkgs/swift2objc/test/unit/token_list_test.dart @@ -0,0 +1,75 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; + +import 'package:swift2objc/src/parser/_core/json.dart'; +import 'package:swift2objc/src/parser/_core/token_list.dart'; +import 'package:test/test.dart'; + +void main() { + String spelling(TokenList list) => [ + for (var i = 0; i < list.length; ++i) list[i]['spelling'].toString() + ].toString(); + + test('Slicing', () { + final list = TokenList(Json(jsonDecode(''' +[ + { "spelling": "a" }, + { "spelling": "b" }, + { "spelling": "c" }, + { "spelling": "d" }, + { "spelling": "e" }, + { "spelling": "f" } +] +'''))); + + expect(list.length, 6); + expect(list.slice(3).length, 3); + expect(list.slice(2, 4).length, 2); + expect(list.slice(3, 3).length, 0); + + expect(list.isEmpty, isFalse); + expect(list.slice(3).isEmpty, isFalse); + expect(list.slice(2, 4).isEmpty, isFalse); + expect(list.slice(3, 3).isEmpty, isTrue); + + expect(spelling(list), '["a", "b", "c", "d", "e", "f"]'); + expect(spelling(list.slice(3)), '["d", "e", "f"]'); + expect(spelling(list.slice(2, 4)), '["c", "d"]'); + expect(spelling(list.slice(3, 3)), '[]'); + + expect(list[2].toString(), '{"spelling":"c"}'); + expect(list.slice(2, 4)[1].toString(), '{"spelling":"d"}'); + + expect(list.indexWhere((tok) => tok['spelling'].get() == 'd'), 3); + expect( + list + .slice(2, 4) + .indexWhere((tok) => tok['spelling'].get() == 'd'), + 1); + }); + + test('Splitting', () { + final list = TokenList(Json(jsonDecode(''' +[ + { "kind": "text", "spelling": "a" }, + { "kind": "text", "spelling": "?(" }, + { "kind": "text", "spelling": "b" }, + { "kind": "text", "spelling": "c" }, + { "kind": "text", "spelling": "?)" }, + { "kind": "text", "spelling": "?, " }, + { "kind": "text", "spelling": "d" }, + { "kind": "typeIdentifier", "spelling": "?(" }, + { "kind": "text", "spelling": "e" } +] +'''))); + + expect(spelling(list), + '["a", "?", "(", "b", "c", "?", ")", "?", ", ", "d", "?(", "e"]'); + + // If kind != "text", the token isn't changed. + expect(list[10].toString(), '{"kind":"typeIdentifier","spelling":"?("}'); + }); +} From 4069de367751b4ee1ab50dcf1aeb41085c10edac Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 26 Nov 2024 10:58:19 +0100 Subject: [PATCH 12/50] [native_assets_builder] Don't change `outputDirectory` if `assetsForLinking` changes (#1746) https://github.com/dart-lang/native/pull/1643 accidentally made the output directory of link hooks change when different assets are passed in for linking. --- .../lib/src/build_runner/build_runner.dart | 8 +++++--- pkgs/native_assets_cli/lib/src/config.dart | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 27ce85f91..1eea17597 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -232,13 +232,15 @@ class NativeAssetsBuildRunner { buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), - ) - ..setupLinkConfig( - assets: buildResult.encodedAssetsForLinking[package.name] ?? []); + ); final (buildDirUri, outDirUri, outDirSharedUri) = await _setupDirectories( Hook.link, packageLayout, configBuilder, package); + configBuilder.setupLinkConfig( + assets: buildResult.encodedAssetsForLinking[package.name] ?? [], + ); + File? resourcesFile; if (resourceIdentifiers != null) { resourcesFile = File.fromUri(buildDirUri.resolve('resources.json')); diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index d46af373f..f0466003b 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -135,10 +135,13 @@ sealed class HookConfigBuilder { /// assumed the output directory has not been set yet. String computeChecksum() { if (json.containsKey(_outDirConfigKey) || - json.containsKey(_outDirSharedConfigKey)) { + json.containsKey(_outDirSharedConfigKey) || + json.containsKey(_assetsKey)) { // The bundling tools would first calculate the checksum, create an output // directory and then call [BuildConfigBuilder.setupBuildRunConfig] & // [LinkConfigBuilder.setupLinkRunConfig]. + // The output directory should not depend on the assets passed in for + // linking. throw StateError('The checksum should be generated before setting ' 'up the run configuration'); } From 071dcf3e93ec6400148f3805530c571d6ef4c7c0 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 27 Nov 2024 10:43:46 +1300 Subject: [PATCH 13/50] [swift2objc] Support nested declarations (#1749) --- .../interfaces/compound_declaration.dart | 10 +- .../_core/interfaces/enum_declaration.dart | 7 +- .../interfaces/nestable_declaration.dart | 20 ++ .../src/ast/_core/shared/referred_type.dart | 10 +- .../compounds/class_declaration.dart | 9 +- .../members/initializer_declaration.dart | 5 + .../compounds/protocol_declaration.dart | 9 +- .../compounds/struct_declaration.dart | 9 +- .../associated_value_enum_declaration.dart | 9 + .../enums/normal_enum_declaration.dart | 9 + .../enums/raw_value_enum_declaration.dart | 9 + .../lib/src/generator/_core/utils.dart | 11 +- .../lib/src/generator/generator.dart | 9 +- .../generator/generators/class_generator.dart | 180 ++++++++++-------- .../lib/src/parser/_core/utils.dart | 17 +- .../parse_compound_declaration.dart | 18 +- .../parse_function_declaration.dart | 2 +- .../parser/parsers/parse_relations_map.dart | 2 +- .../lib/src/parser/parsers/parse_type.dart | 9 + .../lib/src/transformer/transform.dart | 20 +- .../transformers/transform_compound.dart | 20 +- .../classes_and_initializers_output.swift | 15 +- .../classes_and_methods_output.swift | 13 +- .../classes_and_properties_output.swift | 25 +-- .../classes_and_static_methods_output.swift | 13 +- ...classes_and_static_properties_output.swift | 23 ++- ...lobal_variables_and_functions_output.swift | 21 +- .../test/integration/nested_types_input.swift | 31 +++ .../integration/nested_types_output.swift | 128 +++++++++++++ .../test/integration/optional_output.swift | 34 ++-- .../structs_and_initializers_output.swift | 11 +- .../structs_and_methods_output.swift | 13 +- .../structs_and_properties_output.swift | 25 +-- .../structs_and_static_methods_output.swift | 13 +- ...structs_and_static_properties_output.swift | 23 ++- .../swift2objc/test/unit/parse_type_test.dart | 42 +++- 36 files changed, 586 insertions(+), 238 deletions(-) create mode 100644 pkgs/swift2objc/lib/src/ast/_core/interfaces/nestable_declaration.dart create mode 100644 pkgs/swift2objc/test/integration/nested_types_input.swift create mode 100644 pkgs/swift2objc/test/integration/nested_types_output.swift diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart index 63b6daa1e..cd2bca599 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/compound_declaration.dart @@ -6,6 +6,7 @@ import '../../declarations/compounds/members/initializer_declaration.dart'; import '../../declarations/compounds/members/method_declaration.dart'; import '../../declarations/compounds/members/property_declaration.dart'; import 'declaration.dart'; +import 'nestable_declaration.dart'; import 'protocol_conformable.dart'; import 'type_parameterizable.dart'; @@ -13,11 +14,12 @@ import 'type_parameterizable.dart'; /// See `ClassDeclaration`, `StructDeclaration` and `ProtocolDeclaration` /// for concrete implementations. abstract interface class CompoundDeclaration - implements Declaration, TypeParameterizable, ProtocolConformable { + implements + Declaration, + TypeParameterizable, + ProtocolConformable, + NestableDeclaration { abstract List properties; abstract List methods; abstract List initializers; - - /// For handling nested classes - abstract List pathComponents; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart index 28c1e9cd6..33e3bf263 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/enum_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'declaration.dart'; +import 'nestable_declaration.dart'; import 'protocol_conformable.dart'; import 'type_parameterizable.dart'; @@ -10,7 +11,11 @@ import 'type_parameterizable.dart'; /// See `NormalEnumDeclaration`, `AssociatedValueEnumDeclaration` and /// `RawValueEnumDeclaration` for concrete implementations. abstract interface class EnumDeclaration - implements Declaration, TypeParameterizable, ProtocolConformable { + implements + Declaration, + TypeParameterizable, + ProtocolConformable, + NestableDeclaration { abstract List cases; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/nestable_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/nestable_declaration.dart new file mode 100644 index 000000000..b857a3b68 --- /dev/null +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/nestable_declaration.dart @@ -0,0 +1,20 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'declaration.dart'; + +/// A Swift entity that can be nested inside other declarations. +abstract interface class NestableDeclaration implements Declaration { + abstract NestableDeclaration? nestingParent; + abstract final List nestedDeclarations; +} + +extension FillNestingParents on List { + void fillNestingParents(NestableDeclaration parent) { + for (final nested in this) { + assert(nested.nestingParent == null); + nested.nestingParent = parent; + } + } +} diff --git a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart index e3c1c8a98..56f50b72d 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/shared/referred_type.dart @@ -2,8 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../interfaces/compound_declaration.dart'; import '../interfaces/declaration.dart'; +import '../interfaces/nestable_declaration.dart'; import '../interfaces/objc_annotatable.dart'; /// Describes a type reference in declaration of Swift @@ -25,11 +25,9 @@ class DeclaredType implements ReferredType { String get name { final decl = declaration; - if (decl is CompoundDeclaration && decl.pathComponents.isNotEmpty) { - return decl.pathComponents.join('.'); - } - - return declaration.name; + final parent = decl is NestableDeclaration ? decl.nestingParent : null; + final nesting = parent != null ? '${parent.name}.' : ''; + return '$nesting${declaration.name}'; } final T declaration; diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart index f6496960b..9bf875b91 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/class_declaration.dart @@ -4,6 +4,7 @@ import '../../_core/interfaces/compound_declaration.dart'; import '../../_core/interfaces/declaration.dart'; +import '../../_core/interfaces/nestable_declaration.dart'; import '../../_core/interfaces/objc_annotatable.dart'; import '../../_core/shared/referred_type.dart'; import '../built_in/built_in_declaration.dart'; @@ -52,14 +53,18 @@ class ClassDeclaration implements CompoundDeclaration, ObjCAnnotatable { List initializers; @override - List pathComponents; + NestableDeclaration? nestingParent; + + @override + List nestedDeclarations; ClassDeclaration({ required this.id, required this.name, this.properties = const [], this.methods = const [], - this.pathComponents = const [], + this.nestingParent, + this.nestedDeclarations = const [], this.conformedProtocols = const [], this.typeParams = const [], this.hasObjCAnnotation = false, diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart index 287afbbbf..12d19698e 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart @@ -37,6 +37,11 @@ class InitializerDeclaration @override List statements; + String get fullName => [ + name, + for (final p in params) p.name, + ].join(':'); + InitializerDeclaration({ required this.id, required this.params, diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart index 4f077932f..197b5ee6d 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/protocol_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/compound_declaration.dart'; +import '../../_core/interfaces/nestable_declaration.dart'; import '../../_core/shared/referred_type.dart'; import 'members/initializer_declaration.dart'; import 'members/method_declaration.dart'; @@ -32,7 +33,10 @@ class ProtocolDeclaration implements CompoundDeclaration { List initializers; @override - List pathComponents; + NestableDeclaration? nestingParent; + + @override + List nestedDeclarations; ProtocolDeclaration({ required this.id, @@ -42,6 +46,7 @@ class ProtocolDeclaration implements CompoundDeclaration { required this.initializers, required this.conformedProtocols, required this.typeParams, - required this.pathComponents, + this.nestingParent, + this.nestedDeclarations = const [], }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart index fc54184d4..ba157ff29 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/struct_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/compound_declaration.dart'; +import '../../_core/interfaces/nestable_declaration.dart'; import '../../_core/shared/referred_type.dart'; import 'members/initializer_declaration.dart'; import 'members/method_declaration.dart'; @@ -33,7 +34,10 @@ class StructDeclaration implements CompoundDeclaration { List initializers; @override - List pathComponents; + NestableDeclaration? nestingParent; + + @override + List nestedDeclarations; StructDeclaration({ required this.id, @@ -43,6 +47,7 @@ class StructDeclaration implements CompoundDeclaration { this.initializers = const [], this.conformedProtocols = const [], this.typeParams = const [], - this.pathComponents = const [], + this.nestingParent, + this.nestedDeclarations = const [], }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart index a56e44f88..d8f374354 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/enums/associated_value_enum_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/enum_declaration.dart'; +import '../../_core/interfaces/nestable_declaration.dart'; import '../../_core/interfaces/parameterizable.dart'; import '../../_core/shared/parameter.dart'; import '../../_core/shared/referred_type.dart'; @@ -25,12 +26,20 @@ class AssociatedValueEnumDeclaration implements EnumDeclaration { @override List> conformedProtocols; + @override + NestableDeclaration? nestingParent; + + @override + List nestedDeclarations; + AssociatedValueEnumDeclaration({ required this.id, required this.name, required this.cases, required this.typeParams, required this.conformedProtocols, + this.nestingParent, + this.nestedDeclarations = const [], }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart index 97532d36d..cd4e05b70 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/enums/normal_enum_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/enum_declaration.dart'; +import '../../_core/interfaces/nestable_declaration.dart'; import '../../_core/shared/referred_type.dart'; import '../compounds/protocol_declaration.dart'; @@ -24,12 +25,20 @@ class NormalEnumDeclaration implements EnumDeclaration { @override List> conformedProtocols; + @override + NestableDeclaration? nestingParent; + + @override + List nestedDeclarations; + NormalEnumDeclaration({ required this.id, required this.name, required this.cases, required this.typeParams, required this.conformedProtocols, + this.nestingParent, + this.nestedDeclarations = const [], }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart index 75d8e158a..7774a02d8 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/enums/raw_value_enum_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../../_core/interfaces/enum_declaration.dart'; +import '../../_core/interfaces/nestable_declaration.dart'; import '../../_core/interfaces/objc_annotatable.dart'; import '../../_core/shared/referred_type.dart'; import '../compounds/protocol_declaration.dart'; @@ -27,6 +28,12 @@ class RawValueEnumDeclaration implements EnumDeclaration, ObjCAnnotatable { @override bool hasObjCAnnotation; + @override + NestableDeclaration? nestingParent; + + @override + List nestedDeclarations; + ReferredType rawValueType; RawValueEnumDeclaration({ @@ -37,6 +44,8 @@ class RawValueEnumDeclaration implements EnumDeclaration, ObjCAnnotatable { required this.conformedProtocols, required this.hasObjCAnnotation, required this.rawValueType, + this.nestingParent, + this.nestedDeclarations = const [], }); } diff --git a/pkgs/swift2objc/lib/src/generator/_core/utils.dart b/pkgs/swift2objc/lib/src/generator/_core/utils.dart index 571c70835..9ab8a6fba 100644 --- a/pkgs/swift2objc/lib/src/generator/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/generator/_core/utils.dart @@ -15,12 +15,11 @@ String generateParameters(List params) { }).join(', '); } -extension Indentation on String { - String indent([int count = 1]) { - assert(count > 0); - final lines = split('\n'); - final indentation = List.filled(count, ' ').join(); - return lines.map((line) => '$indentation$line').join('\n'); +extension Indentation on Iterable { + Iterable indent([int count = 1]) { + assert(count >= 0); + final indentation = ' ' * count; + return map((line) => line.isEmpty ? '' : '$indentation$line'); } } diff --git a/pkgs/swift2objc/lib/src/generator/generator.dart b/pkgs/swift2objc/lib/src/generator/generator.dart index 82d64fe5c..86f6a5454 100644 --- a/pkgs/swift2objc/lib/src/generator/generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generator.dart @@ -9,13 +9,14 @@ String generate( }) { return '${[ preamble, + '', if (moduleName != null) 'import $moduleName', - 'import Foundation', - ...declarations.map(generateDeclaration), - ].nonNulls.join('\n\n')}\n'; + 'import Foundation\n', + ...declarations.map((decl) => generateDeclaration(decl).join('\n')), + ].nonNulls.join('\n')}\n'; } -String generateDeclaration(Declaration declaration) { +List generateDeclaration(Declaration declaration) { return switch (declaration) { ClassDeclaration() => generateClass(declaration), _ => throw UnimplementedError( diff --git a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart index 6be8971e9..2b4c32efb 100644 --- a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart @@ -5,19 +5,24 @@ import '../../ast/_core/shared/referred_type.dart'; import '../../ast/declarations/built_in/built_in_declaration.dart'; import '../../ast/declarations/compounds/class_declaration.dart'; +import '../../ast/declarations/compounds/members/initializer_declaration.dart'; +import '../../ast/declarations/compounds/members/method_declaration.dart'; +import '../../ast/declarations/compounds/members/property_declaration.dart'; import '../_core/utils.dart'; +import '../generator.dart'; -String generateClass(ClassDeclaration declaration) { +List generateClass(ClassDeclaration declaration) { return [ '${_generateClassHeader(declaration)} {', - [ + ...[ _generateClassWrappedInstance(declaration), ..._generateClassProperties(declaration), ..._generateInitializers(declaration), ..._generateClassMethods(declaration), - ].nonNulls.join('\n\n').indent(), - '}', - ].join('\n'); + ..._generateNestedDeclarations(declaration), + ].nonNulls.indent(), + '}\n', + ]; } String _generateClassHeader(ClassDeclaration declaration) { @@ -52,7 +57,7 @@ String? _generateClassWrappedInstance(ClassDeclaration declaration) { "Wrapped instance can't have a generic type", ); - return 'var ${property.name}: ${property.type.swiftType}'; + return 'var ${property.name}: ${property.type.swiftType}\n'; } List _generateInitializers(ClassDeclaration declaration) { @@ -60,98 +65,107 @@ List _generateInitializers(ClassDeclaration declaration) { declaration.wrapperInitializer, ...declaration.initializers, ].nonNulls; + return [for (final init in initializers) ..._generateInitializer(init)]; +} - return initializers.map( - (initializer) { - final header = StringBuffer(); +List _generateInitializer(InitializerDeclaration initializer) { + final header = StringBuffer(); - if (initializer.hasObjCAnnotation) { - header.write('@objc '); - } + if (initializer.hasObjCAnnotation) { + header.write('@objc '); + } - if (initializer.isOverriding) { - header.write('override '); - } + if (initializer.isOverriding) { + header.write('override '); + } - header.write('init'); + header.write('init'); - if (initializer.isFailable) { - header.write('?'); - } + if (initializer.isFailable) { + header.write('?'); + } - header.write('(${generateParameters(initializer.params)})'); + header.write('(${generateParameters(initializer.params)})'); - return ['$header {', initializer.statements.join('\n').indent(), '}'] - .join('\n'); - }, - ).toList(); + return [ + '$header {', + ...initializer.statements.indent(), + '}\n', + ]; } -List _generateClassMethods(ClassDeclaration declaration) { - return declaration.methods.map((method) { - final header = StringBuffer(); +List _generateClassMethods(ClassDeclaration declaration) => + [for (final method in declaration.methods) ..._generateClassMethod(method)]; - if (method.hasObjCAnnotation) { - header.write('@objc '); - } +List _generateClassMethod(MethodDeclaration method) { + final header = StringBuffer(); - if (method.isStatic) { - header.write('static '); - } + if (method.hasObjCAnnotation) { + header.write('@objc '); + } - if (method.isOverriding) { - header.write('override '); - } + if (method.isStatic) { + header.write('static '); + } - header.write( - 'public func ${method.name}(${generateParameters(method.params)})', - ); + if (method.isOverriding) { + header.write('override '); + } - if (!method.returnType.sameAs(voidType)) { - header.write(' -> ${method.returnType.swiftType}'); - } + header.write( + 'public func ${method.name}(${generateParameters(method.params)})', + ); + + if (!method.returnType.sameAs(voidType)) { + header.write(' -> ${method.returnType.swiftType}'); + } - return [ - '$header {', - method.statements.join('\n').indent(), - '}', - ].join('\n'); - }).toList(); + return [ + '$header {', + ...method.statements.indent(), + '}\n', + ]; } -List _generateClassProperties(ClassDeclaration declaration) { - return declaration.properties.map( - (property) { - final header = StringBuffer(); - - if (property.hasObjCAnnotation) { - header.write('@objc '); - } - - if (property.isStatic) { - header.write('static '); - } - - header.write('public var ${property.name}: ${property.type.swiftType} {'); - - final getterLines = [ - 'get {', - property.getter?.statements.join('\n').indent(), - '}' - ]; - - final setterLines = [ - 'set {', - property.setter?.statements.join('\n').indent(), - '}' - ]; - - return [ - header, - getterLines.join('\n').indent(), - if (property.hasSetter) setterLines.join('\n').indent(), - '}', - ].join('\n'); - }, - ).toList(); +List _generateClassProperties(ClassDeclaration declaration) => [ + for (final property in declaration.properties) + ..._generateClassProperty(property), + ]; + +List _generateClassProperty(PropertyDeclaration property) { + final header = StringBuffer(); + + if (property.hasObjCAnnotation) { + header.write('@objc '); + } + + if (property.isStatic) { + header.write('static '); + } + + header.write('public var ${property.name}: ${property.type.swiftType} {'); + + final getterLines = [ + 'get {', + ...(property.getter?.statements.indent() ?? []), + '}' + ]; + + final setterLines = [ + 'set {', + ...(property.setter?.statements.indent() ?? []), + '}' + ]; + + return [ + header.toString(), + ...getterLines.indent(), + if (property.hasSetter) ...setterLines.indent(), + '}\n', + ]; } + +List _generateNestedDeclarations(ClassDeclaration declaration) => [ + for (final nested in declaration.nestedDeclarations) + ...generateDeclaration(nested), + ]; diff --git a/pkgs/swift2objc/lib/src/parser/_core/utils.dart b/pkgs/swift2objc/lib/src/parser/_core/utils.dart index 6c680ab27..398986b29 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/utils.dart @@ -5,9 +5,8 @@ import 'dart:convert'; import 'dart:io'; -import '../../ast/_core/interfaces/compound_declaration.dart'; import '../../ast/_core/interfaces/declaration.dart'; -import '../../ast/_core/interfaces/enum_declaration.dart'; +import '../../ast/_core/interfaces/nestable_declaration.dart'; import '../../ast/_core/shared/referred_type.dart'; import '../../ast/declarations/globals/globals.dart'; import '../parsers/parse_type.dart'; @@ -31,13 +30,13 @@ extension AddIdSuffix on String { } extension TopLevelOnly on List { - List get topLevelOnly => where( - (declaration) => - declaration is CompoundDeclaration || - declaration is EnumDeclaration || - declaration is GlobalVariableDeclaration || - declaration is GlobalFunctionDeclaration, - ).toList(); + List get topLevelOnly => where((declaration) { + if (declaration is NestableDeclaration) { + return declaration.nestingParent == null; + } + return declaration is GlobalVariableDeclaration || + declaration is GlobalFunctionDeclaration; + }).toList(); } /// If `fragment['kind'] == kind`, returns `fragment['spelling']`. Otherwise diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart index 20b05aa3d..cf3e9a27a 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_compound_declaration.dart @@ -3,12 +3,12 @@ // BSD-style license that can be found in the LICENSE file. import '../../../ast/_core/interfaces/compound_declaration.dart'; +import '../../../ast/_core/interfaces/nestable_declaration.dart'; import '../../../ast/declarations/compounds/class_declaration.dart'; import '../../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../../ast/declarations/compounds/members/method_declaration.dart'; import '../../../ast/declarations/compounds/members/property_declaration.dart'; import '../../../ast/declarations/compounds/struct_declaration.dart'; -import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; import '../../_core/utils.dart'; import '../parse_declarations.dart'; @@ -16,10 +16,10 @@ import '../parse_declarations.dart'; typedef CompoundTearOff = T Function({ required String id, required String name, - required List pathComponents, required List properties, required List methods, required List initializers, + required List nestedDeclarations, }); T _parseCompoundDeclaration( @@ -34,10 +34,10 @@ T _parseCompoundDeclaration( final compound = tearoffConstructor( id: compoundId, name: parseSymbolName(compoundSymbol.json), - pathComponents: _parseCompoundPathComponents(compoundSymbol.json), methods: [], properties: [], initializers: [], + nestedDeclarations: [], ); compoundSymbol.declaration = compound; @@ -73,15 +73,19 @@ T _parseCompoundDeclaration( memberDeclarations.whereType(), ); compound.initializers.addAll( - memberDeclarations.whereType(), + memberDeclarations + .whereType() + .dedupeBy((m) => m.fullName), + ); + compound.nestedDeclarations.addAll( + memberDeclarations.whereType(), ); + compound.nestedDeclarations.fillNestingParents(compound); + return compound; } -List _parseCompoundPathComponents(Json compoundSymbolJson) => - compoundSymbolJson['pathComponents'].get>().cast(); - ClassDeclaration parseClassDeclaration( ParsedSymbol classSymbol, ParsedSymbolgraph symbolgraph, diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart index 8764189bf..e0c71bdc5 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart @@ -46,7 +46,7 @@ ReferredType _parseFunctionReturnType( final returnJson = TokenList(methodSymbolJson['functionSignature']['returns']); final (returnType, unparsed) = parseType(symbolgraph, returnJson); - assert(unparsed.isEmpty); + assert(unparsed.isEmpty, '$returnJson\n\n$returnType\n\n$unparsed\n'); return returnType; } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_relations_map.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_relations_map.dart index 6a9c061dc..93019bbb6 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_relations_map.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_relations_map.dart @@ -32,7 +32,7 @@ ParsedRelationsMap parseRelationsMap(Json symbolgraphJson) { json: relationJson, ); - for (var id in [sourceId, targetId]) { + for (final id in [sourceId, targetId]) { (relationsMap[id] ??= []).add(relation); } } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart index 79d821ee8..a6e97a5d6 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart @@ -103,6 +103,15 @@ typedef SuffixParselet = (ReferredType, TokenList) Function( ReferredType prefixType, Json token, TokenList fragments) => (OptionalType(prefixType), fragments); +(ReferredType, TokenList) _nestedTypeParselet(ParsedSymbolgraph symbolgraph, + ReferredType prefixType, Json token, TokenList fragments) { + // Parsing Foo.Bar. Foo is in prefixType, and the token is ".". Bar's ID + // is a globally uniquely identifier. We don't need to use Foo as a namespace. + // So we can actually completely discard Foo and just parse Bar. + return parseType(symbolgraph, fragments); +} + Map _suffixParsets = { 'text: ?': _optionalParselet, + 'text: .': _nestedTypeParselet, }; diff --git a/pkgs/swift2objc/lib/src/transformer/transform.dart b/pkgs/swift2objc/lib/src/transformer/transform.dart index e7d4618c5..4322dd366 100644 --- a/pkgs/swift2objc/lib/src/transformer/transform.dart +++ b/pkgs/swift2objc/lib/src/transformer/transform.dart @@ -4,6 +4,7 @@ import '../ast/_core/interfaces/compound_declaration.dart'; import '../ast/_core/interfaces/declaration.dart'; +import '../ast/_core/interfaces/nestable_declaration.dart'; import '../ast/declarations/compounds/class_declaration.dart'; import '../ast/declarations/compounds/struct_declaration.dart'; import '../ast/declarations/globals/globals.dart'; @@ -14,9 +15,7 @@ import 'transformers/transform_globals.dart'; typedef TransformationMap = Map; List transform(List declarations) { - final TransformationMap transformationMap; - - transformationMap = {}; + final transformationMap = {}; final globalNamer = UniqueNamer( declarations.map((declaration) => declaration.name), @@ -48,17 +47,24 @@ List transform(List declarations) { Declaration transformDeclaration( Declaration declaration, - UniqueNamer globalNamer, - TransformationMap transformationMap, -) { + UniqueNamer parentNamer, + TransformationMap transformationMap, { + bool nested = false, +}) { if (transformationMap[declaration] != null) { return transformationMap[declaration]!; } + if (declaration is NestableDeclaration && declaration.nestingParent != null) { + // It's important that nested declarations are only transformed in the + // context of their parent, so that their parentNamer is correct. + assert(nested); + } + return switch (declaration) { ClassDeclaration() || StructDeclaration() => transformCompound( declaration as CompoundDeclaration, - globalNamer, + parentNamer, transformationMap, ), _ => throw UnimplementedError(), diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart index 7ccd5f0b0..4b5047820 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart @@ -4,6 +4,7 @@ import '../../ast/_core/interfaces/compound_declaration.dart'; import '../../ast/_core/interfaces/declaration.dart'; +import '../../ast/_core/interfaces/nestable_declaration.dart'; import '../../ast/_core/shared/parameter.dart'; import '../../ast/declarations/built_in/built_in_declaration.dart'; import '../../ast/declarations/compounds/class_declaration.dart'; @@ -18,7 +19,7 @@ import 'transform_variable.dart'; ClassDeclaration transformCompound( CompoundDeclaration originalCompound, - UniqueNamer globalNamer, + UniqueNamer parentNamer, TransformationMap transformationMap, ) { final compoundNamer = UniqueNamer.inCompound(originalCompound); @@ -31,7 +32,7 @@ ClassDeclaration transformCompound( final transformedCompound = ClassDeclaration( id: originalCompound.id.addIdSuffix('wrapper'), - name: globalNamer.makeUnique('${originalCompound.name}Wrapper'), + name: parentNamer.makeUnique('${originalCompound.name}Wrapper'), hasObjCAnnotation: true, superClass: BuiltInDeclaration.swiftNSObject.asDeclaredType, isWrapper: true, @@ -41,11 +42,20 @@ ClassDeclaration transformCompound( transformationMap[originalCompound] = transformedCompound; + transformedCompound.nestedDeclarations = originalCompound.nestedDeclarations + .map((nested) => transformDeclaration( + nested, compoundNamer, transformationMap, nested: true) + as NestableDeclaration) + .toList() + ..sort((Declaration a, Declaration b) => a.id.compareTo(b.id)); + transformedCompound.nestedDeclarations + .fillNestingParents(transformedCompound); + transformedCompound.properties = originalCompound.properties .map((property) => transformProperty( property, wrappedCompoundInstance, - globalNamer, + parentNamer, transformationMap, )) .nonNulls @@ -56,7 +66,7 @@ ClassDeclaration transformCompound( .map((initializer) => transformInitializer( initializer, wrappedCompoundInstance, - globalNamer, + parentNamer, transformationMap, )) .toList() @@ -66,7 +76,7 @@ ClassDeclaration transformCompound( .map((method) => transformMethod( method, wrappedCompoundInstance, - globalNamer, + parentNamer, transformationMap, )) .nonNulls diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift index 235624df8..142114857 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift @@ -4,35 +4,36 @@ import Foundation @objc public class MyOtherClassWrapper: NSObject { var wrappedInstance: MyOtherClass - + init(_ wrappedInstance: MyOtherClass) { self.wrappedInstance = wrappedInstance } + } @objc public class MyClassWrapper: NSObject { var wrappedInstance: MyClass - + @objc public var customProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(wrappedInstance.customProperty) } } - + @objc public var representableProperty: Int { get { wrappedInstance.representableProperty } } - + init(_ wrappedInstance: MyClass) { self.wrappedInstance = wrappedInstance } - + @objc init(outerLabel representableProperty: Int, customProperty: MyOtherClassWrapper) { wrappedInstance = MyClass(outerLabel: representableProperty, customProperty: customProperty.wrappedInstance) } - + @objc init?(outerLabel x: Int) { if let instance = MyClass(outerLabel: x) { wrappedInstance = instance @@ -40,4 +41,6 @@ import Foundation return nil } } + } + diff --git a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift index 7b5a5596b..283f898ab 100644 --- a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift @@ -4,29 +4,32 @@ import Foundation @objc public class MyOtherClassWrapper: NSObject { var wrappedInstance: MyOtherClass - + init(_ wrappedInstance: MyOtherClass) { self.wrappedInstance = wrappedInstance } + } @objc public class MyClassWrapper: NSObject { var wrappedInstance: MyClass - + init(_ wrappedInstance: MyClass) { self.wrappedInstance = wrappedInstance } - + @objc public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper) -> MyOtherClassWrapper { let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance) return MyOtherClassWrapper(result) } - + @objc public func myMethod2() { return wrappedInstance.myMethod2() } - + @objc public func myMethod3() { return wrappedInstance.myMethod3() } + } + diff --git a/pkgs/swift2objc/test/integration/classes_and_properties_output.swift b/pkgs/swift2objc/test/integration/classes_and_properties_output.swift index 828c5eb6d..550713da1 100644 --- a/pkgs/swift2objc/test/integration/classes_and_properties_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_properties_output.swift @@ -4,21 +4,22 @@ import Foundation @objc public class MyOtherClassWrapper: NSObject { var wrappedInstance: MyOtherClass - + init(_ wrappedInstance: MyOtherClass) { self.wrappedInstance = wrappedInstance } + } @objc public class MyClassWrapper: NSObject { var wrappedInstance: MyClass - + @objc public var customGetterProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(wrappedInstance.customGetterProperty) } } - + @objc public var customSetterProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(wrappedInstance.customSetterProperty) @@ -27,13 +28,13 @@ import Foundation wrappedInstance.customSetterProperty = newValue.wrappedInstance } } - + @objc public var customConstantProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(wrappedInstance.customConstantProperty) } } - + @objc public var customVariableProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(wrappedInstance.customVariableProperty) @@ -42,19 +43,19 @@ import Foundation wrappedInstance.customVariableProperty = newValue.wrappedInstance } } - + @objc public var implicitGetterProperty: Int { get { wrappedInstance.implicitGetterProperty } } - + @objc public var representableGetterProperty: Int { get { wrappedInstance.representableGetterProperty } } - + @objc public var representableSetterProperty: Int { get { wrappedInstance.representableSetterProperty @@ -63,13 +64,13 @@ import Foundation wrappedInstance.representableSetterProperty = newValue } } - + @objc public var representableConstantProperty: Int { get { wrappedInstance.representableConstantProperty } } - + @objc public var representableVariableProperty: Int { get { wrappedInstance.representableVariableProperty @@ -78,8 +79,10 @@ import Foundation wrappedInstance.representableVariableProperty = newValue } } - + init(_ wrappedInstance: MyClass) { self.wrappedInstance = wrappedInstance } + } + diff --git a/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift index 1c7bf97d3..137adc87a 100644 --- a/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_static_methods_output.swift @@ -4,29 +4,32 @@ import Foundation @objc public class MyOtherClassWrapper: NSObject { var wrappedInstance: MyOtherClass - + init(_ wrappedInstance: MyOtherClass) { self.wrappedInstance = wrappedInstance } + } @objc public class MyClassWrapper: NSObject { var wrappedInstance: MyClass - + init(_ wrappedInstance: MyClass) { self.wrappedInstance = wrappedInstance } - + @objc static public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper) -> MyOtherClassWrapper { let result = MyClass.myMethod(label1: param1, param2: param2.wrappedInstance) return MyOtherClassWrapper(result) } - + @objc static public func myMethod2() { return MyClass.myMethod2() } - + @objc static public func myMethod3() { return MyClass.myMethod3() } + } + diff --git a/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift b/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift index bb6a4d13f..af4ee8130 100644 --- a/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_static_properties_output.swift @@ -4,21 +4,22 @@ import Foundation @objc public class MyOtherClassWrapper: NSObject { var wrappedInstance: MyOtherClass - + init(_ wrappedInstance: MyOtherClass) { self.wrappedInstance = wrappedInstance } + } @objc public class MyClassWrapper: NSObject { var wrappedInstance: MyClass - + @objc static public var customGetterVariable: MyOtherClassWrapper { get { MyOtherClassWrapper(MyClass.customGetterVariable) } } - + @objc static public var customSetterVariable: MyOtherClassWrapper { get { MyOtherClassWrapper(MyClass.customSetterVariable) @@ -27,13 +28,13 @@ import Foundation MyClass.customSetterVariable = newValue.wrappedInstance } } - + @objc static public var customConstantProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(MyClass.customConstantProperty) } } - + @objc static public var customVariableProperty: MyOtherClassWrapper { get { MyOtherClassWrapper(MyClass.customVariableProperty) @@ -42,13 +43,13 @@ import Foundation MyClass.customVariableProperty = newValue.wrappedInstance } } - + @objc static public var representableGetterVariable: Int { get { MyClass.representableGetterVariable } } - + @objc static public var representableSetterVariable: Int { get { MyClass.representableSetterVariable @@ -57,13 +58,13 @@ import Foundation MyClass.representableSetterVariable = newValue } } - + @objc static public var representableConstantProperty: Int { get { MyClass.representableConstantProperty } } - + @objc static public var representableVariableProperty: Int { get { MyClass.representableVariableProperty @@ -72,8 +73,10 @@ import Foundation MyClass.representableVariableProperty = newValue } } - + init(_ wrappedInstance: MyClass) { self.wrappedInstance = wrappedInstance } + } + diff --git a/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift b/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift index b495a1f9f..9a34ec514 100644 --- a/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift +++ b/pkgs/swift2objc/test/integration/global_variables_and_functions_output.swift @@ -8,7 +8,7 @@ import Foundation MyOtherClassWrapper(globalCustomConstant) } } - + @objc static public var globalCustomVariableWrapper: MyOtherClassWrapper { get { MyOtherClassWrapper(globalCustomVariable) @@ -17,13 +17,13 @@ import Foundation globalCustomVariable = newValue.wrappedInstance } } - + @objc static public var globalGetterVariableWrapper: Double { get { globalGetterVariable } } - + @objc static public var globalSetterVariableWrapper: Double { get { globalSetterVariable @@ -32,13 +32,13 @@ import Foundation globalSetterVariable = newValue } } - + @objc static public var globalRepresentableConstantWrapper: Int { get { globalRepresentableConstant } } - + @objc static public var globalRepresentableVariableWrapper: Int { get { globalRepresentableVariable @@ -47,25 +47,28 @@ import Foundation globalRepresentableVariable = newValue } } - + @objc static public func globalCustomFunctionWrapper(label1 param1: Int, param2: MyOtherClassWrapper) -> MyOtherClassWrapper { let result = globalCustomFunction(label1: param1, param2: param2.wrappedInstance) return MyOtherClassWrapper(result) } - + @objc static public func globalRepresentableFunctionWrapper1() { return globalRepresentableFunction() } - + @objc static public func globalRepresentableFunctionWrapperWrapper() { return globalRepresentableFunctionWrapper() } + } @objc public class MyOtherClassWrapper: NSObject { var wrappedInstance: MyOtherClass - + init(_ wrappedInstance: MyOtherClass) { self.wrappedInstance = wrappedInstance } + } + diff --git a/pkgs/swift2objc/test/integration/nested_types_input.swift b/pkgs/swift2objc/test/integration/nested_types_input.swift new file mode 100644 index 000000000..2d9173518 --- /dev/null +++ b/pkgs/swift2objc/test/integration/nested_types_input.swift @@ -0,0 +1,31 @@ +public class OuterClass { + public static func makeOuter() -> OuterClass { return OuterClass(); } + public static func makeInnerClass() -> InnerClass { return InnerClass(); } + public static func makeInnerStruct() -> InnerStruct { return InnerStruct(); } + + public class InnerClass { + public static func makeOuter() -> OuterClass { return OuterClass(); } + public static func makeInner() -> InnerClass { return InnerClass(); } + } + + public struct InnerStruct { + public static func makeOuter() -> OuterClass { return OuterClass(); } + public static func makeInner() -> InnerStruct { return InnerStruct(); } + } +} + +public struct OuterStruct { + public static func makeOuter() -> OuterStruct { return OuterStruct(); } + public static func makeInnerClass() -> InnerClass { return InnerClass(); } + public static func makeInnerStruct() -> InnerStruct { return InnerStruct(); } + + public class InnerClass { + public static func makeOuter() -> OuterStruct { return OuterStruct(); } + public static func makeInner() -> InnerClass { return InnerClass(); } + } + + public struct InnerStruct { + public static func makeOuter() -> OuterStruct { return OuterStruct(); } + public static func makeInner() -> InnerStruct { return InnerStruct(); } + } +} diff --git a/pkgs/swift2objc/test/integration/nested_types_output.swift b/pkgs/swift2objc/test/integration/nested_types_output.swift new file mode 100644 index 000000000..76654a4a5 --- /dev/null +++ b/pkgs/swift2objc/test/integration/nested_types_output.swift @@ -0,0 +1,128 @@ +// Test preamble text + +import Foundation + +@objc public class OuterClassWrapper: NSObject { + var wrappedInstance: OuterClass + + init(_ wrappedInstance: OuterClass) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func makeOuter() -> OuterClassWrapper { + let result = OuterClass.makeOuter() + return OuterClassWrapper(result) + } + + @objc static public func makeInnerClass() -> OuterClassWrapper.InnerClassWrapper { + let result = OuterClass.makeInnerClass() + return InnerClassWrapper(result) + } + + @objc static public func makeInnerStruct() -> OuterClassWrapper.InnerStructWrapper { + let result = OuterClass.makeInnerStruct() + return InnerStructWrapper(result) + } + + @objc public class InnerClassWrapper: NSObject { + var wrappedInstance: OuterClass.InnerClass + + init(_ wrappedInstance: OuterClass.InnerClass) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func makeOuter() -> OuterClassWrapper { + let result = OuterClass.InnerClass.makeOuter() + return OuterClassWrapper(result) + } + + @objc static public func makeInner() -> OuterClassWrapper.InnerClassWrapper { + let result = OuterClass.InnerClass.makeInner() + return InnerClassWrapper(result) + } + + } + + @objc public class InnerStructWrapper: NSObject { + var wrappedInstance: OuterClass.InnerStruct + + init(_ wrappedInstance: OuterClass.InnerStruct) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func makeOuter() -> OuterClassWrapper { + let result = OuterClass.InnerStruct.makeOuter() + return OuterClassWrapper(result) + } + + @objc static public func makeInner() -> OuterClassWrapper.InnerStructWrapper { + let result = OuterClass.InnerStruct.makeInner() + return InnerStructWrapper(result) + } + + } + +} + +@objc public class OuterStructWrapper: NSObject { + var wrappedInstance: OuterStruct + + init(_ wrappedInstance: OuterStruct) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func makeOuter() -> OuterStructWrapper { + let result = OuterStruct.makeOuter() + return OuterStructWrapper(result) + } + + @objc static public func makeInnerStruct() -> OuterStructWrapper.InnerStructWrapper { + let result = OuterStruct.makeInnerStruct() + return InnerStructWrapper(result) + } + + @objc static public func makeInnerClass() -> OuterStructWrapper.InnerClassWrapper { + let result = OuterStruct.makeInnerClass() + return InnerClassWrapper(result) + } + + @objc public class InnerStructWrapper: NSObject { + var wrappedInstance: OuterStruct.InnerStruct + + init(_ wrappedInstance: OuterStruct.InnerStruct) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func makeOuter() -> OuterStructWrapper { + let result = OuterStruct.InnerStruct.makeOuter() + return OuterStructWrapper(result) + } + + @objc static public func makeInner() -> OuterStructWrapper.InnerStructWrapper { + let result = OuterStruct.InnerStruct.makeInner() + return InnerStructWrapper(result) + } + + } + + @objc public class InnerClassWrapper: NSObject { + var wrappedInstance: OuterStruct.InnerClass + + init(_ wrappedInstance: OuterStruct.InnerClass) { + self.wrappedInstance = wrappedInstance + } + + @objc static public func makeOuter() -> OuterStructWrapper { + let result = OuterStruct.InnerClass.makeOuter() + return OuterStructWrapper(result) + } + + @objc static public func makeInner() -> OuterStructWrapper.InnerClassWrapper { + let result = OuterStruct.InnerClass.makeInner() + return InnerClassWrapper(result) + } + + } + +} + diff --git a/pkgs/swift2objc/test/integration/optional_output.swift b/pkgs/swift2objc/test/integration/optional_output.swift index ff15219b2..920c486e6 100644 --- a/pkgs/swift2objc/test/integration/optional_output.swift +++ b/pkgs/swift2objc/test/integration/optional_output.swift @@ -11,30 +11,31 @@ import Foundation globalOptional = newValue?.wrappedInstance } } - + @objc static public func funcOptionalArgsWrapper(label param: MyClassWrapper?) -> MyClassWrapper { let result = funcOptionalArgs(label: param?.wrappedInstance) return MyClassWrapper(result) } - + @objc static public func funcOptionalClassReturnWrapper() -> MyClassWrapper? { let result = funcOptionalClassReturn() return result == nil ? nil : MyClassWrapper(result!) } - + @objc static public func funcMultipleOptionalArgsWrapper(label1 param1: MyClassWrapper?, label2 param2: Int, label3 param3: MyStructWrapper?) { return funcMultipleOptionalArgs(label1: param1?.wrappedInstance, label2: param2, label3: param3?.wrappedInstance) } - + @objc static public func funcOptionalStructReturnWrapper() -> MyStructWrapper? { let result = funcOptionalStructReturn() return result == nil ? nil : MyStructWrapper(result!) } + } @objc public class MyClassWrapper: NSObject { var wrappedInstance: MyClass - + @objc public var optionalProperty: MyClassWrapper? { get { wrappedInstance.optionalProperty == nil ? nil : MyClassWrapper(wrappedInstance.optionalProperty!) @@ -43,32 +44,33 @@ import Foundation wrappedInstance.optionalProperty = newValue?.wrappedInstance } } - + init(_ wrappedInstance: MyClass) { self.wrappedInstance = wrappedInstance } - + @objc init(label param: MyClassWrapper?) { wrappedInstance = MyClass(label: param?.wrappedInstance) } - + @objc init(label1 param1: MyClassWrapper?, label2: Int, label3 param3: MyStructWrapper?) { wrappedInstance = MyClass(label1: param1?.wrappedInstance, label2: label2, label3: param3?.wrappedInstance) } - + @objc public func methodOptionalArgs(label param: MyClassWrapper?) { return wrappedInstance.methodOptionalArgs(label: param?.wrappedInstance) } - + @objc public func methodOptionalReturn() -> MyClassWrapper? { let result = wrappedInstance.methodOptionalReturn() return result == nil ? nil : MyClassWrapper(result!) } + } @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct - + @objc public var optionalProperty: MyClassWrapper? { get { wrappedInstance.optionalProperty == nil ? nil : MyClassWrapper(wrappedInstance.optionalProperty!) @@ -77,21 +79,23 @@ import Foundation wrappedInstance.optionalProperty = newValue?.wrappedInstance } } - + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } - + @objc init(label param: MyClassWrapper?) { wrappedInstance = MyStruct(label: param?.wrappedInstance) } - + @objc public func methodOptionalArgs(label param: MyClassWrapper?) { return wrappedInstance.methodOptionalArgs(label: param?.wrappedInstance) } - + @objc public func methodOptionalReturn() -> MyStructWrapper? { let result = wrappedInstance.methodOptionalReturn() return result == nil ? nil : MyStructWrapper(result!) } + } + diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift index 14031a883..72a7109fd 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift @@ -4,23 +4,24 @@ import Foundation @objc public class MyOtherStructWrapper: NSObject { var wrappedInstance: MyOtherStruct - + init(_ wrappedInstance: MyOtherStruct) { self.wrappedInstance = wrappedInstance } + } @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct - + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } - + @objc init(outerLabel representableProperty: Int, customProperty: MyOtherStructWrapper) { wrappedInstance = MyStruct(outerLabel: representableProperty, customProperty: customProperty.wrappedInstance) } - + @objc init?(outerLabel x: Int) { if let instance = MyStruct(outerLabel: x) { wrappedInstance = instance @@ -28,4 +29,6 @@ import Foundation return nil } } + } + diff --git a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift index 76943f7e7..b7a81cab1 100644 --- a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift @@ -4,29 +4,32 @@ import Foundation @objc public class MyOtherStructWrapper: NSObject { var wrappedInstance: MyOtherStruct - + init(_ wrappedInstance: MyOtherStruct) { self.wrappedInstance = wrappedInstance } + } @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct - + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } - + @objc public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper) -> MyOtherStructWrapper { let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance) return MyOtherStructWrapper(result) } - + @objc public func myMethod2() { return wrappedInstance.myMethod2() } - + @objc public func myMethod3() { return wrappedInstance.myMethod3() } + } + diff --git a/pkgs/swift2objc/test/integration/structs_and_properties_output.swift b/pkgs/swift2objc/test/integration/structs_and_properties_output.swift index 535abb0cd..3203e8752 100644 --- a/pkgs/swift2objc/test/integration/structs_and_properties_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_properties_output.swift @@ -4,21 +4,22 @@ import Foundation @objc public class MyOtherStructWrapper: NSObject { var wrappedInstance: MyOtherStruct - + init(_ wrappedInstance: MyOtherStruct) { self.wrappedInstance = wrappedInstance } + } @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct - + @objc public var customGetterProperty: MyOtherStructWrapper { get { MyOtherStructWrapper(wrappedInstance.customGetterProperty) } } - + @objc public var customSetterProperty: MyOtherStructWrapper { get { MyOtherStructWrapper(wrappedInstance.customSetterProperty) @@ -27,13 +28,13 @@ import Foundation wrappedInstance.customSetterProperty = newValue.wrappedInstance } } - + @objc public var customConstantProperty: MyOtherStructWrapper { get { MyOtherStructWrapper(wrappedInstance.customConstantProperty) } } - + @objc public var customVariableProperty: MyOtherStructWrapper { get { MyOtherStructWrapper(wrappedInstance.customVariableProperty) @@ -42,19 +43,19 @@ import Foundation wrappedInstance.customVariableProperty = newValue.wrappedInstance } } - + @objc public var implicitGetterProperty: Int { get { wrappedInstance.implicitGetterProperty } } - + @objc public var representableGetterProperty: Int { get { wrappedInstance.representableGetterProperty } } - + @objc public var representableSetterProperty: Int { get { wrappedInstance.representableSetterProperty @@ -63,13 +64,13 @@ import Foundation wrappedInstance.representableSetterProperty = newValue } } - + @objc public var representableConstantProperty: Int { get { wrappedInstance.representableConstantProperty } } - + @objc public var representableVariableProperty: Int { get { wrappedInstance.representableVariableProperty @@ -78,8 +79,10 @@ import Foundation wrappedInstance.representableVariableProperty = newValue } } - + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } + } + diff --git a/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift index 47ff615fa..befac1910 100644 --- a/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_static_methods_output.swift @@ -4,29 +4,32 @@ import Foundation @objc public class MyOtherStructWrapper: NSObject { var wrappedInstance: MyOtherStruct - + init(_ wrappedInstance: MyOtherStruct) { self.wrappedInstance = wrappedInstance } + } @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct - + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } - + @objc static public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper) -> MyOtherStructWrapper { let result = MyStruct.myMethod(label1: param1, param2: param2.wrappedInstance) return MyOtherStructWrapper(result) } - + @objc static public func myMethod2() { return MyStruct.myMethod2() } - + @objc static public func myMethod3() { return MyStruct.myMethod3() } + } + diff --git a/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift b/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift index 7633573ed..6518209f0 100644 --- a/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_static_properties_output.swift @@ -4,21 +4,22 @@ import Foundation @objc public class MyOtherStructWrapper: NSObject { var wrappedInstance: MyOtherStruct - + init(_ wrappedInstance: MyOtherStruct) { self.wrappedInstance = wrappedInstance } + } @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct - + @objc static public var customGetterVariable: MyOtherStructWrapper { get { MyOtherStructWrapper(MyStruct.customGetterVariable) } } - + @objc static public var customSetterVariable: MyOtherStructWrapper { get { MyOtherStructWrapper(MyStruct.customSetterVariable) @@ -27,13 +28,13 @@ import Foundation MyStruct.customSetterVariable = newValue.wrappedInstance } } - + @objc static public var customConstantProperty: MyOtherStructWrapper { get { MyOtherStructWrapper(MyStruct.customConstantProperty) } } - + @objc static public var customVariableProperty: MyOtherStructWrapper { get { MyOtherStructWrapper(MyStruct.customVariableProperty) @@ -42,13 +43,13 @@ import Foundation MyStruct.customVariableProperty = newValue.wrappedInstance } } - + @objc static public var representableGetterVariable: Int { get { MyStruct.representableGetterVariable } } - + @objc static public var representableSetterVariable: Int { get { MyStruct.representableSetterVariable @@ -57,13 +58,13 @@ import Foundation MyStruct.representableSetterVariable = newValue } } - + @objc static public var representableConstantProperty: Int { get { MyStruct.representableConstantProperty } } - + @objc static public var representableVariableProperty: Int { get { MyStruct.representableVariableProperty @@ -72,8 +73,10 @@ import Foundation MyStruct.representableVariableProperty = newValue } } - + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } + } + diff --git a/pkgs/swift2objc/test/unit/parse_type_test.dart b/pkgs/swift2objc/test/unit/parse_type_test.dart index 9c1a3b59a..309de86f6 100644 --- a/pkgs/swift2objc/test/unit/parse_type_test.dart +++ b/pkgs/swift2objc/test/unit/parse_type_test.dart @@ -4,8 +4,10 @@ import 'dart:convert'; +import 'package:swift2objc/src/ast/_core/interfaces/declaration.dart'; import 'package:swift2objc/src/ast/_core/shared/referred_type.dart'; import 'package:swift2objc/src/ast/declarations/built_in/built_in_declaration.dart'; +import 'package:swift2objc/src/ast/declarations/compounds/class_declaration.dart'; import 'package:swift2objc/src/parser/_core/json.dart'; import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; import 'package:swift2objc/src/parser/_core/token_list.dart'; @@ -13,9 +15,17 @@ import 'package:swift2objc/src/parser/parsers/parse_type.dart'; import 'package:test/test.dart'; void main() { + final classFoo = ClassDeclaration(id: 'Foo', name: 'Foo'); + final classBar = ClassDeclaration(id: 'Bar', name: 'Bar'); + + final testDecls = [ + ...BuiltInDeclaration.values, + classFoo, + classBar, + ]; final parsedSymbols = ParsedSymbolgraph({ - for (final decl in BuiltInDeclaration.values) - decl.id: ParsedSymbol(json: Json(null), declaration: decl) + for (final decl in testDecls) + decl.id: ParsedSymbol(json: Json(null), declaration: decl), }, {}); test('Type identifier', () { @@ -78,6 +88,34 @@ void main() { expect(remaining.length, 0); }); + test('Nested type', () { + final fragments = Json(jsonDecode( + ''' + [ + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "Foo" + }, + { + "kind": "text", + "spelling": "." + }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "Bar" + } + ] + ''', + )); + + final (type, remaining) = parseType(parsedSymbols, TokenList(fragments)); + + expect(type.sameAs(classBar.asDeclaredType), isTrue); + expect(remaining.length, 0); + }); + test('Multiple suffixes', () { // This test is verifying that we can parse multiple suffix operators in a // row. Nested OptionalTypes don't really make sense though. So in future if From 9ec7403db4c5d78203183032b5b7580628397c4d Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 27 Nov 2024 17:46:19 +0100 Subject: [PATCH 14/50] [native_x] Deprecate `dryRun` (#1757) This deprecates `BuildConfig.dryRun`. We will be able to remove it after Dart 3.7 is released and we can increase the SDK bound in `native_assets_cli` to that version. For now, add some ignores to suppress to suppress the deprecation lints. Bug: * https://github.com/dart-lang/native/issues/1485 --- .../test_data/transformer/hook/build.dart | 2 ++ .../test_data/wrong_linker/hook/build.dart | 1 + .../wrong_namespace_asset/hook/build.dart | 1 + .../example/build/local_asset/hook/build.dart | 2 ++ .../lib/src/code_assets/code_asset.dart | 16 +++++++--------- .../lib/src/code_assets/config.dart | 1 + .../lib/src/code_assets/link_mode.dart | 6 ------ .../lib/src/code_assets/validation.dart | 18 +++++++++++++++--- pkgs/native_assets_cli/lib/src/config.dart | 4 ++++ .../lib/src/data_assets/data_asset.dart | 3 --- .../lib/src/data_assets/validation.dart | 7 ++++++- .../lib/src/cbuilder/cbuilder.dart | 3 +++ 12 files changed, 42 insertions(+), 22 deletions(-) diff --git a/pkgs/native_assets_builder/test_data/transformer/hook/build.dart b/pkgs/native_assets_builder/test_data/transformer/hook/build.dart index 6cacae904..1a2ff86e6 100644 --- a/pkgs/native_assets_builder/test_data/transformer/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/transformer/hook/build.dart @@ -28,6 +28,7 @@ void main(List arguments) async { final targetFile = File.fromUri(config.outputDirectoryShared .resolve(sourceName.replaceFirst('data', 'data_transformed'))); + // ignore: deprecated_member_use if (!config.dryRun) { // TODO(dacoharkes): Timestamps are not enough for correct caching. if (!await targetFile.exists() || @@ -52,6 +53,7 @@ void main(List arguments) async { ); } + // ignore: deprecated_member_use if (!config.dryRun) { print('Transformed $transformedFiles files.'); print('Reused $cachedFiles cached files.'); diff --git a/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart index 6da96e5f7..4f1509250 100644 --- a/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart @@ -11,6 +11,7 @@ void main(List arguments) async { final assetUri = config.outputDirectory.resolve( OS.current.dylibFileName('foo'), ); + // ignore: deprecated_member_use if (!config.dryRun) { await File.fromUri(assetUri).writeAsBytes([1, 2, 3]); } diff --git a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart index ed5e053d2..1ce65d36f 100644 --- a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart @@ -11,6 +11,7 @@ void main(List arguments) async { final assetUri = config.outputDirectory.resolve( OS.current.dylibFileName('foo'), ); + // ignore: deprecated_member_use if (!config.dryRun) { await File.fromUri(assetUri).writeAsBytes([1, 2, 3]); } diff --git a/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart b/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart index cb4a237d8..3e61c0c4a 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart +++ b/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart @@ -21,6 +21,7 @@ Future main(List args) async { final packageName = config.packageName; final assetPath = config.outputDirectory.resolve(assetName); final assetSourcePath = config.packageRoot.resolveUri(packageAssetPath); + // ignore: deprecated_member_use if (!config.dryRun) { // Insert code that downloads or builds the asset to `assetPath`. await File.fromUri(assetSourcePath).copy(assetPath.toFilePath()); @@ -39,6 +40,7 @@ Future main(List args) async { linkMode: DynamicLoadingBundled(), os: config.targetOS, architecture: + // ignore: deprecated_member_use config.dryRun ? null : config.codeConfig.targetArchitecture, ), ); diff --git a/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart b/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart index 594fff571..dcfeaf4ff 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart @@ -61,8 +61,6 @@ final class CodeAsset { final OS os; /// The architecture this asset can run on. - /// - /// Not available during a [BuildConfig.dryRun]. final Architecture? architecture; /// The link mode for this native code. @@ -72,14 +70,14 @@ final class CodeAsset { /// The file to be bundled with the Dart or Flutter application. /// - /// If the [linkMode] is [DynamicLoadingBundled], the file name must be - /// provided in the [BuildOutput] for [BuildConfig.dryRun]. Supplying a file - /// name instead of an absolute path is enough for [BuildConfig.dryRun]. The - /// file does not have to exist on disk during a dry run. + /// If the [linkMode] is [DynamicLoadingBundled], the file must be provided + /// and exist. + /// + /// If the [linkMode] is [DynamicLoadingSystem], the file must be provided, + /// and not exist. /// - /// If the [linkMode] is [DynamicLoadingSystem], [LookupInProcess], or - /// [LookupInExecutable] the file must be omitted in the [BuildOutput] for - /// [BuildConfig.dryRun]. + /// If the [linkMode] is [LookupInProcess], or [LookupInExecutable] the file + /// must be omitted in the [BuildOutput]. final Uri? file; /// Constructs a native code asset. diff --git a/pkgs/native_assets_cli/lib/src/code_assets/config.dart b/pkgs/native_assets_cli/lib/src/code_assets/config.dart index 3d5acb1fa..f9a3d97e8 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/config.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/config.dart @@ -51,6 +51,7 @@ class CodeConfig { CodeConfig(HookConfig config) : linkModePreference = LinkModePreference.fromString( config.json.string(_linkModePreferenceKey)), + // ignore: deprecated_member_use_from_same_package _targetArchitecture = (config is BuildConfig && config.dryRun) ? null : Architecture.fromString(config.json.string(_targetArchitectureKey, diff --git a/pkgs/native_assets_cli/lib/src/code_assets/link_mode.dart b/pkgs/native_assets_cli/lib/src/code_assets/link_mode.dart index 4f210e6c5..ad6b33889 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/link_mode.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/link_mode.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../config.dart'; - import 'code_asset.dart'; /// The link mode for a [CodeAsset]. @@ -75,10 +73,6 @@ abstract final class DynamicLoading extends LinkMode { /// An asset with this dynamic loading method must provide a /// [CodeAsset.file]. The Dart and Flutter SDK will bundle this code in /// the final application. -/// -/// During a [BuildConfig.dryRun], the [CodeAsset.file] can be a file name -/// instead of a the full path. The file does not have to exist during a dry -/// run. final class DynamicLoadingBundled extends DynamicLoading { DynamicLoadingBundled._() : super._(); diff --git a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart index 54330fab9..8361824b5 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart @@ -11,7 +11,12 @@ import 'link_mode.dart'; Future validateCodeAssetBuildConfig( BuildConfig config) async => _validateCodeConfig( - 'BuildConfig', config.targetOS, config.dryRun, config.codeConfig); + 'BuildConfig', + config.targetOS, + // ignore: deprecated_member_use_from_same_package + config.dryRun, + config.codeConfig, + ); Future validateCodeAssetLinkConfig(LinkConfig config) async => _validateCodeConfig( @@ -71,8 +76,15 @@ Future validateCodeAssetBuildOutput( BuildConfig config, BuildOutput output, ) => - _validateCodeAssetBuildOrLinkOutput(config, config.codeConfig, - output.encodedAssets, config.dryRun, output, true); + _validateCodeAssetBuildOrLinkOutput( + config, + config.codeConfig, + output.encodedAssets, + // ignore: deprecated_member_use_from_same_package + config.dryRun, + output, + true, + ); Future validateCodeAssetLinkOutput( LinkConfig config, diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index f0466003b..40da1c770 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -166,10 +166,13 @@ const _packageRootConfigKey = 'package_root'; const _supportedAssetTypesKey = 'supported_asset_types'; final class BuildConfig extends HookConfig { + // TODO(dcharkes): Remove after 3.7.0 stable is released and bump the SDK + // constraint in the pubspec. Ditto for all uses in related packages. /// Whether this run is a dry-run, which doesn't build anything. /// /// A dry-run only reports information about which assets a build would /// create, but doesn't actually create files. + @Deprecated('Flutter will no longer invoke dry run as of 3.27.') final bool dryRun; final bool linkingEnabled; @@ -177,6 +180,7 @@ final class BuildConfig extends HookConfig { final Map metadata; BuildConfig(super.json) + // ignore: deprecated_member_use_from_same_package : dryRun = json.getOptional(_dryRunConfigKey) ?? false, linkingEnabled = json.get(_linkingEnabledKey), metadata = { diff --git a/pkgs/native_assets_cli/lib/src/data_assets/data_asset.dart b/pkgs/native_assets_cli/lib/src/data_assets/data_asset.dart index 96d5193ca..5043ad25f 100644 --- a/pkgs/native_assets_cli/lib/src/data_assets/data_asset.dart +++ b/pkgs/native_assets_cli/lib/src/data_assets/data_asset.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import '../config.dart'; import '../encoded_asset.dart'; import '../json_utils.dart'; import '../utils/map.dart'; @@ -18,8 +17,6 @@ import '../utils/map.dart'; final class DataAsset { /// The file to be bundled with the Dart or Flutter application. /// - /// The file can be omitted in the [BuildOutput] for [BuildConfig.dryRun]. - /// /// The file can also be omitted for asset types which refer to an asset /// already present on the target system or an asset already present in Dart /// or Flutter. diff --git a/pkgs/native_assets_cli/lib/src/data_assets/validation.dart b/pkgs/native_assets_cli/lib/src/data_assets/validation.dart index 2c4165551..8b575a8ef 100644 --- a/pkgs/native_assets_cli/lib/src/data_assets/validation.dart +++ b/pkgs/native_assets_cli/lib/src/data_assets/validation.dart @@ -26,7 +26,12 @@ Future validateDataAssetBuildOutput( BuildOutput output, ) => _validateDataAssetBuildOrLinkOutput( - config, output.encodedAssets, config.dryRun, true); + config, + output.encodedAssets, + // ignore: deprecated_member_use_from_same_package + config.dryRun, + true, + ); Future validateDataAssetLinkOutput( LinkConfig config, diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart index 62ec22015..81d6b8f11 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart @@ -132,6 +132,7 @@ class CBuilder extends CTool implements Builder { // ignore: deprecated_member_use_from_same_package for (final source in this.dartBuildFiles) packageRoot.resolve(source), ]; + // ignore: deprecated_member_use if (!config.dryRun) { final task = RunCBuilder( config: config, @@ -175,11 +176,13 @@ class CBuilder extends CTool implements Builder { linkMode: linkMode, os: config.targetOS, architecture: + // ignore: deprecated_member_use config.dryRun ? null : config.codeConfig.targetArchitecture, ), linkInPackage: linkInPackage, ); } + // ignore: deprecated_member_use if (!config.dryRun) { final includeFiles = await Stream.fromIterable(includes) .asyncExpand( From 70e83a93c519d6807872c66ff2ab669b90881abd Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Thu, 28 Nov 2024 11:22:19 +1300 Subject: [PATCH 15/50] Support unlabeled parameters (#1756) --- .../lib/src/parser/_core/token_list.dart | 2 + .../parse_function_declaration.dart | 100 +++++++++++++----- .../parse_initializer_declaration.dart | 72 +------------ .../transformers/transform_function.dart | 47 ++++---- .../transformers/transform_initializer.dart | 27 +---- pkgs/swift2objc/pubspec.yaml | 1 + .../classes_and_initializers_input.swift | 5 + .../classes_and_initializers_output.swift | 4 + .../classes_and_methods_input.swift | 2 +- .../classes_and_methods_output.swift | 4 +- .../test/integration/integration_test.dart | 49 ++++++--- .../structs_and_initializers_input.swift | 9 +- .../structs_and_initializers_output.swift | 16 +++ .../structs_and_methods_input.swift | 2 +- .../structs_and_methods_output.swift | 4 +- ...st.dart => parse_function_param_test.dart} | 16 +-- 16 files changed, 186 insertions(+), 174 deletions(-) rename pkgs/swift2objc/test/unit/{parse_initializer_param_test.dart => parse_function_param_test.dart} (93%) diff --git a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart index c2e38fdc4..8939d1036 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart @@ -28,6 +28,8 @@ class TokenList { '?(': ['?', '('], '?)': ['?', ')'], '?, ': ['?', ', '], + ') -> ': [')', '->'], + '?) -> ': ['?', ')', '->'], }; final list = []; diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart index e0c71bdc5..27a4e35b5 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart @@ -20,7 +20,8 @@ GlobalFunctionDeclaration parseGlobalFunctionDeclaration( id: parseSymbolId(globalFunctionSymbolJson), name: parseSymbolName(globalFunctionSymbolJson), returnType: _parseFunctionReturnType(globalFunctionSymbolJson, symbolgraph), - params: _parseFunctionParams(globalFunctionSymbolJson, symbolgraph), + params: parseFunctionParams( + globalFunctionSymbolJson['declarationFragments'], symbolgraph), ); } @@ -33,12 +34,81 @@ MethodDeclaration parseMethodDeclaration( id: parseSymbolId(methodSymbolJson), name: parseSymbolName(methodSymbolJson), returnType: _parseFunctionReturnType(methodSymbolJson, symbolgraph), - params: _parseFunctionParams(methodSymbolJson, symbolgraph), + params: parseFunctionParams( + methodSymbolJson['declarationFragments'], symbolgraph), hasObjCAnnotation: parseSymbolHasObjcAnnotation(methodSymbolJson), isStatic: isStatic, ); } +List parseFunctionParams( + Json declarationFragments, + ParsedSymbolgraph symbolgraph, +) { + // `declarationFragments` describes each part of the initializer declaration, + // things like the `func` keyword, brackets, spaces, etc. We only care about + // the parameter fragments here, and they always appear in this order: + // [ + // ..., '(', + // externalParam, ' ', internalParam, ': ', type..., ', ' + // externalParam, ': ', type..., ', ' + // externalParam, ' ', internalParam, ': ', type..., ')' + // ] + // Note: `internalParam` may or may not exist. + // + // The following loop attempts to extract parameters from this flat array + // while making sure the parameter fragments have the expected order. + + final parameters = []; + + var tokens = TokenList(declarationFragments); + final openParen = tokens.indexWhere((tok) => matchFragment(tok, 'text', '(')); + if (openParen != -1) { + tokens = tokens.slice(openParen + 1); + String? consume(String kind) { + if (tokens.isEmpty) return null; + final token = tokens[0]; + tokens = tokens.slice(1); + return getSpellingForKind(token, kind); + } + + final malformedInitializerException = Exception( + 'Malformed initializer at ${declarationFragments.path}', + ); + while (true) { + final externalParam = consume('externalParam'); + if (externalParam == null) throw malformedInitializerException; + + var sep = consume('text'); + String? internalParam; + if (sep == ' ') { + internalParam = consume('internalParam'); + if (internalParam == null) throw malformedInitializerException; + sep = consume('text'); + } + + if (sep != ': ') throw malformedInitializerException; + final (type, remainingTokens) = parseType(symbolgraph, tokens); + tokens = remainingTokens; + + parameters.add(Parameter( + name: externalParam, + internalName: internalParam, + type: type, + )); + + final end = consume('text'); + if (end == ')') break; + if (end != ', ') throw malformedInitializerException; + } + if (!(tokens.isEmpty || consume('text') == '->')) { + throw malformedInitializerException; + } + } + + return parameters; +} + ReferredType _parseFunctionReturnType( Json methodSymbolJson, ParsedSymbolgraph symbolgraph, @@ -49,29 +119,3 @@ ReferredType _parseFunctionReturnType( assert(unparsed.isEmpty, '$returnJson\n\n$returnType\n\n$unparsed\n'); return returnType; } - -List _parseFunctionParams( - Json methodSymbolJson, - ParsedSymbolgraph symbolgraph, -) { - final paramList = methodSymbolJson['functionSignature']['parameters']; - - if (!paramList.exists) return []; - - return paramList - .map( - (param) => Parameter( - name: param['name'].get(), - internalName: param['internalName'].get(), - type: _parseParamType(param, symbolgraph), - ), - ) - .toList(); -} - -ReferredType _parseParamType( - Json paramSymbolJson, - ParsedSymbolgraph symbolgraph, -) => - parseTypeAfterSeparator( - TokenList(paramSymbolJson['declarationFragments']), symbolgraph); diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index 7f7dabb33..6d5b725a7 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -1,10 +1,8 @@ -import '../../../ast/_core/shared/parameter.dart'; import '../../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../_core/json.dart'; import '../../_core/parsed_symbolgraph.dart'; -import '../../_core/token_list.dart'; import '../../_core/utils.dart'; -import '../parse_type.dart'; +import 'parse_function_declaration.dart'; InitializerDeclaration parseInitializerDeclaration( Json initializerSymbolJson, @@ -23,7 +21,7 @@ InitializerDeclaration parseInitializerDeclaration( return InitializerDeclaration( id: id, - params: parseInitializerParams(declarationFragments, symbolgraph), + params: parseFunctionParams(declarationFragments, symbolgraph), hasObjCAnnotation: parseSymbolHasObjcAnnotation(initializerSymbolJson), isOverriding: parseIsOverriding(initializerSymbolJson), isFailable: parseIsFailableInit(id, declarationFragments), @@ -32,69 +30,3 @@ InitializerDeclaration parseInitializerDeclaration( bool parseIsFailableInit(String id, Json declarationFragments) => matchFragment(declarationFragments[1], 'text', '?('); - -List parseInitializerParams( - Json declarationFragments, - ParsedSymbolgraph symbolgraph, -) { - // `declarationFragments` describes each part of the initializer declaration, - // things like `init` keyword, brackets, spaces, etc. We only care about the - // parameter fragments here, and they always appear in this order: - // [ - // ..., '(', - // externalParam, ' ', internalParam, ': ', type..., ', ' - // externalParam, ': ', type..., ', ' - // externalParam, ' ', internalParam, ': ', type..., ')' - // ] - // Note: `internalParam` may or may not exist. - // - // The following loop attempts to extract parameters from this flat array - // while making sure the parameter fragments have the expected order. - - final parameters = []; - - var tokens = TokenList(declarationFragments); - final openParen = tokens.indexWhere((tok) => matchFragment(tok, 'text', '(')); - if (openParen != -1) { - tokens = tokens.slice(openParen + 1); - String? consume(String kind) { - if (tokens.isEmpty) return null; - final token = tokens[0]; - tokens = tokens.slice(1); - return getSpellingForKind(token, kind); - } - - final malformedInitializerException = Exception( - 'Malformed initializer at ${declarationFragments.path}', - ); - while (true) { - final externalParam = consume('externalParam'); - if (externalParam == null) throw malformedInitializerException; - - var sep = consume('text'); - String? internalParam; - if (sep == ' ') { - internalParam = consume('internalParam'); - if (internalParam == null) throw malformedInitializerException; - sep = consume('text'); - } - - if (sep != ': ') throw malformedInitializerException; - final (type, remainingTokens) = parseType(symbolgraph, tokens); - tokens = remainingTokens; - - parameters.add(Parameter( - name: externalParam, - internalName: internalParam, - type: type, - )); - - final end = consume('text'); - if (end == ')') break; - if (end != ', ') throw malformedInitializerException; - } - if (!tokens.isEmpty) throw malformedInitializerException; - } - - return parameters; -} diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart index ad1480a1e..eebfbbc69 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart @@ -112,21 +112,17 @@ MethodDeclaration _transformFunction( return transformedMethod; } -List _generateStatements( - FunctionDeclaration originalFunction, - MethodDeclaration transformedMethod, - UniqueNamer globalNamer, - TransformationMap transformationMap, { - required String Function(String arguments) originalCallGenerator, -}) { - final argumentsList = []; +String generateInvocationParams(UniqueNamer localNamer, + List originalParams, List transformedParams) { + assert(originalParams.length == transformedParams.length); - for (var i = 0; i < originalFunction.params.length; i++) { - final originalParam = originalFunction.params[i]; - final transformedParam = transformedMethod.params[i]; + final argumentsList = []; + for (var i = 0; i < originalParams.length; i++) { + final originalParam = originalParams[i]; + final transformedParam = transformedParams[i]; - final transformedParamName = - transformedParam.internalName ?? transformedParam.name; + final transformedParamName = localNamer + .makeUnique(transformedParam.internalName ?? transformedParam.name); final (unwrappedParamValue, unwrappedType) = maybeUnwrapValue( transformedParam.type, @@ -135,13 +131,23 @@ List _generateStatements( assert(unwrappedType.sameAs(originalParam.type)); - var methodCallArg = '${originalParam.name}: $unwrappedParamValue'; - - argumentsList.add(methodCallArg); + argumentsList.add(originalParam.name == '_' + ? unwrappedParamValue + : '${originalParam.name}: $unwrappedParamValue'); } + return argumentsList.join(', '); +} - final arguments = argumentsList.join(', '); - +List _generateStatements( + FunctionDeclaration originalFunction, + MethodDeclaration transformedMethod, + UniqueNamer globalNamer, + TransformationMap transformationMap, { + required String Function(String arguments) originalCallGenerator, +}) { + final localNamer = UniqueNamer(); + final arguments = generateInvocationParams( + localNamer, originalFunction.params, transformedMethod.params); final originalMethodCall = originalCallGenerator(arguments); if (originalFunction.returnType.sameAs(transformedMethod.returnType)) { @@ -152,11 +158,12 @@ List _generateStatements( throw UnimplementedError('Generic types are not implemented yet'); } - final methodCallStmt = 'let result = $originalMethodCall'; + final resultName = localNamer.makeUnique('result'); + final methodCallStmt = 'let $resultName = $originalMethodCall'; final (wrappedResult, wrapperType) = maybeWrapValue( originalFunction.returnType, - 'result', + resultName, globalNamer, transformationMap, ); diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart index 795c65531..08a065bbd 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart @@ -6,8 +6,8 @@ import '../../ast/_core/shared/parameter.dart'; import '../../ast/declarations/compounds/members/initializer_declaration.dart'; import '../../ast/declarations/compounds/members/property_declaration.dart'; import '../_core/unique_namer.dart'; -import '../_core/utils.dart'; import '../transform.dart'; +import 'transform_function.dart'; import 'transform_referred_type.dart'; InitializerDeclaration transformInitializer( @@ -54,30 +54,9 @@ List _generateInitializerStatements( PropertyDeclaration wrappedClassInstance, InitializerDeclaration transformedInitializer, ) { - final argumentsList = []; final localNamer = UniqueNamer(); - - for (var i = 0; i < originalInitializer.params.length; i++) { - final originalParam = originalInitializer.params[i]; - final transformedParam = transformedInitializer.params[i]; - - final transformedParamName = localNamer - .makeUnique(transformedParam.internalName ?? transformedParam.name); - - final (unwrappedParamValue, unwrappedType) = maybeUnwrapValue( - transformedParam.type, - transformedParamName, - ); - - assert(unwrappedType.sameAs(originalParam.type)); - - var methodCallArg = '${originalParam.name}: $unwrappedParamValue'; - - argumentsList.add(methodCallArg); - } - - final arguments = argumentsList.join(', '); - + final arguments = generateInvocationParams( + localNamer, originalInitializer.params, transformedInitializer.params); final instanceConstruction = '${wrappedClassInstance.type.swiftType}($arguments)'; if (originalInitializer.isFailable) { diff --git a/pkgs/swift2objc/pubspec.yaml b/pkgs/swift2objc/pubspec.yaml index 5b9755140..a0b28fcef 100644 --- a/pkgs/swift2objc/pubspec.yaml +++ b/pkgs/swift2objc/pubspec.yaml @@ -22,5 +22,6 @@ environment: sdk: '>=3.3.0 <4.0.0' dev_dependencies: + args: ^2.6.0 dart_flutter_team_lints: ^2.0.0 test: ^1.21.1 diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift index 46977f5ab..cfe87560f 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_input.swift @@ -9,6 +9,11 @@ public class MyClass { self.customProperty = customProperty } + public init(label1 name1: Int, label2: Int, _ name3: Int) { + self.representableProperty = name1 + self.customProperty = MyOtherClass() + } + public init?(outerLabel x: Int) { if x == 0 { return nil diff --git a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift index 142114857..7387672d9 100644 --- a/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_initializers_output.swift @@ -42,5 +42,9 @@ import Foundation } } + @objc init(label1 name1: Int, label2: Int, _ name3: Int) { + wrappedInstance = MyClass(label1: name1, label2: label2, name3) + } + } diff --git a/pkgs/swift2objc/test/integration/classes_and_methods_input.swift b/pkgs/swift2objc/test/integration/classes_and_methods_input.swift index 448d22be2..c238a3546 100644 --- a/pkgs/swift2objc/test/integration/classes_and_methods_input.swift +++ b/pkgs/swift2objc/test/integration/classes_and_methods_input.swift @@ -1,7 +1,7 @@ import Foundation public class MyClass { - public func myMethod(label1 param1: Int, param2: MyOtherClass) -> MyOtherClass { + public func myMethod(label1 param1: Int, param2: MyOtherClass, _ param3: Int) -> MyOtherClass { return MyOtherClass() } diff --git a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift index 283f898ab..e7bb6938d 100644 --- a/pkgs/swift2objc/test/integration/classes_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/classes_and_methods_output.swift @@ -18,8 +18,8 @@ import Foundation self.wrappedInstance = wrappedInstance } - @objc public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper) -> MyOtherClassWrapper { - let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance) + @objc public func myMethod(label1 param1: Int, param2: MyOtherClassWrapper, _ param3: Int) -> MyOtherClassWrapper { + let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance, param3) return MyOtherClassWrapper(result) } diff --git a/pkgs/swift2objc/test/integration/integration_test.dart b/pkgs/swift2objc/test/integration/integration_test.dart index e762ce9cb..81b5400b2 100644 --- a/pkgs/swift2objc/test/integration/integration_test.dart +++ b/pkgs/swift2objc/test/integration/integration_test.dart @@ -2,40 +2,57 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// Tests that every *_input.swift in this directory produces *_output.swift. +// Also tests that the generated output compiles without errors. + +// This test is run in the usual way through dart test, but can also be run +// standalone, passing flags to run specific integration tests and to regenerate +// the expected outputs: +// dart test/integration/integration_test.dart --regen +// dart test/integration/integration_test.dart --regen nested_types +// dart test/integration/integration_test.dart nested_types structs_and_methods + import 'dart:io'; +import 'package:args/args.dart'; import 'package:logging/logging.dart'; import 'package:path/path.dart' as path; import 'package:swift2objc/swift2objc.dart'; import 'package:test/test.dart'; -const regenerateExpectedOutputs = false; +void main([List? args]) { + const inputSuffix = '_input.swift'; + const outputSuffix = '_output.swift'; -void main() { - Logger.root.onRecord.listen((record) { - stderr.writeln('${record.level.name}: ${record.message}'); - }); - - group('Integration tests', () { - const inputSuffix = '_input.swift'; - const outputSuffix = '_output.swift'; + final thisDir = path.join(Directory.current.path, 'test/integration'); + final tempDir = path.join(thisDir, 'temp'); - final thisDir = path.join(Directory.current.path, 'test/integration'); - final tempDir = path.join(thisDir, 'temp'); - - final names = []; + var regen = false; + final testNames = []; + if (args != null) { + final p = ArgParser()..addFlag('regen', callback: (value) => regen = value); + testNames.addAll(p.parse(args).rest); + } + if (testNames.isEmpty) { for (final entity in Directory(thisDir).listSync()) { final filename = path.basename(entity.path); if (filename.endsWith(inputSuffix)) { - names.add(filename.substring(0, filename.length - inputSuffix.length)); + testNames + .add(filename.substring(0, filename.length - inputSuffix.length)); } } + } + + Logger.root.onRecord.listen((record) { + stderr.writeln('${record.level.name}: ${record.message}'); + }); - for (final name in names) { + group('Integration tests', () { + for (final name in testNames) { test(name, () async { final inputFile = path.join(thisDir, '$name$inputSuffix'); final expectedOutputFile = path.join(thisDir, '$name$outputSuffix'); - final actualOutputFile = regenerateExpectedOutputs + final actualOutputFile = regen ? expectedOutputFile : path.join(tempDir, '$name$outputSuffix'); diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift index fa505854d..d41f5c364 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_input.swift @@ -1,14 +1,19 @@ import Foundation public class MyStruct { - let representableProperty: Int - let customProperty: MyOtherStruct + public let representableProperty: Int + public let customProperty: MyOtherStruct public init(outerLabel representableProperty: Int, customProperty: MyOtherStruct) { self.representableProperty = representableProperty self.customProperty = customProperty } + public init(label1 name1: Int, label2: Int, _ name3: Int) { + self.representableProperty = name1 + self.customProperty = MyOtherStruct() + } + public init?(outerLabel x: Int) { if x == 0 { return nil diff --git a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift index 72a7109fd..923d83a04 100644 --- a/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_initializers_output.swift @@ -14,6 +14,18 @@ import Foundation @objc public class MyStructWrapper: NSObject { var wrappedInstance: MyStruct + @objc public var customProperty: MyOtherStructWrapper { + get { + MyOtherStructWrapper(wrappedInstance.customProperty) + } + } + + @objc public var representableProperty: Int { + get { + wrappedInstance.representableProperty + } + } + init(_ wrappedInstance: MyStruct) { self.wrappedInstance = wrappedInstance } @@ -30,5 +42,9 @@ import Foundation } } + @objc init(label1 name1: Int, label2: Int, _ name3: Int) { + wrappedInstance = MyStruct(label1: name1, label2: label2, name3) + } + } diff --git a/pkgs/swift2objc/test/integration/structs_and_methods_input.swift b/pkgs/swift2objc/test/integration/structs_and_methods_input.swift index 6e756855e..c9e6e178b 100644 --- a/pkgs/swift2objc/test/integration/structs_and_methods_input.swift +++ b/pkgs/swift2objc/test/integration/structs_and_methods_input.swift @@ -1,7 +1,7 @@ import Foundation public struct MyStruct { - public func myMethod(label1 param1: Int, param2: MyOtherStruct) -> MyOtherStruct { + public func myMethod(label1 param1: Int, param2: MyOtherStruct, _ param3: Int) -> MyOtherStruct { return MyOtherStruct() } diff --git a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift index b7a81cab1..c8600c9ee 100644 --- a/pkgs/swift2objc/test/integration/structs_and_methods_output.swift +++ b/pkgs/swift2objc/test/integration/structs_and_methods_output.swift @@ -18,8 +18,8 @@ import Foundation self.wrappedInstance = wrappedInstance } - @objc public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper) -> MyOtherStructWrapper { - let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance) + @objc public func myMethod(label1 param1: Int, param2: MyOtherStructWrapper, _ param3: Int) -> MyOtherStructWrapper { + let result = wrappedInstance.myMethod(label1: param1, param2: param2.wrappedInstance, param3) return MyOtherStructWrapper(result) } diff --git a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart b/pkgs/swift2objc/test/unit/parse_function_param_test.dart similarity index 93% rename from pkgs/swift2objc/test/unit/parse_initializer_param_test.dart rename to pkgs/swift2objc/test/unit/parse_function_param_test.dart index f6d1f9603..e6ca95fed 100644 --- a/pkgs/swift2objc/test/unit/parse_initializer_param_test.dart +++ b/pkgs/swift2objc/test/unit/parse_function_param_test.dart @@ -9,7 +9,7 @@ import 'package:swift2objc/src/ast/_core/shared/referred_type.dart'; import 'package:swift2objc/src/ast/declarations/built_in/built_in_declaration.dart'; import 'package:swift2objc/src/parser/_core/json.dart'; import 'package:swift2objc/src/parser/_core/parsed_symbolgraph.dart'; -import 'package:swift2objc/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart'; +import 'package:swift2objc/src/parser/parsers/declaration_parsers/parse_function_declaration.dart'; import 'package:test/test.dart'; void main() { @@ -63,7 +63,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -118,7 +118,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -158,7 +158,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -180,7 +180,7 @@ void main() { ''', )); - final outputParams = parseInitializerParams(json, emptySymbolgraph); + final outputParams = parseFunctionParams(json, emptySymbolgraph); expectEqualParams(outputParams, []); }); @@ -206,7 +206,7 @@ void main() { )); expect( - () => parseInitializerParams(json, emptySymbolgraph), + () => parseFunctionParams(json, emptySymbolgraph), throwsA(isA()), ); }); @@ -226,7 +226,7 @@ void main() { )); expect( - () => parseInitializerParams(json, emptySymbolgraph), + () => parseFunctionParams(json, emptySymbolgraph), throwsA(isA()), ); }); @@ -249,7 +249,7 @@ void main() { )); expect( - () => parseInitializerParams(json, emptySymbolgraph), + () => parseFunctionParams(json, emptySymbolgraph), throwsA(isA()), ); }); From d60f12d312640f48c0e3cadfe8e2c5820428d881 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 27 Nov 2024 14:55:22 -0800 Subject: [PATCH 16/50] Ensure that required symbols are available to FFI even when the final binary is linked with `-dead_strip` (#1748) * Ensure that required symbols are not removed by -dead_strip * Update version * Update CHANGELOG.md --- pkgs/ffigen/CHANGELOG.md | 5 ++++ .../example/swift/third_party/swift_api.h | 6 ++++- .../lib/src/code_generator/objc_block.dart | 1 + pkgs/ffigen/pubspec.yaml | 2 +- pkgs/objective_c/CHANGELOG.md | 4 ++- pkgs/objective_c/src/ffi.h | 12 +++++++++ pkgs/objective_c/src/objective_c.h | 18 +++++++------ pkgs/objective_c/src/objective_c.m | 4 ++- .../src/objective_c_bindings_generated.m | 5 ++++ pkgs/objective_c/test/main.c | 27 +++++++++++++++++++ pkgs/objective_c/test/setup.dart | 11 ++++++++ 11 files changed, 83 insertions(+), 12 deletions(-) create mode 100644 pkgs/objective_c/src/ffi.h create mode 100644 pkgs/objective_c/test/main.c diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 9ef02a34b..fbb1224a8 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -1,3 +1,8 @@ +## 16.0.1-wip + +- Ensure that required symbols are available to FFI even when the final binary + is linked with `-dead_strip`. + ## 16.0.0 - Ensure all protocols referenced in bindings are available at runtime. diff --git a/pkgs/ffigen/example/swift/third_party/swift_api.h b/pkgs/ffigen/example/swift/third_party/swift_api.h index 2c6185a0c..41849f321 100644 --- a/pkgs/ffigen/example/swift/third_party/swift_api.h +++ b/pkgs/ffigen/example/swift/third_party/swift_api.h @@ -1,4 +1,4 @@ -// Generated by Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1) +// Generated by Apple Swift version 6.0.2 effective-5.10 (swiftlang-6.0.2.1.2 clang-1600.0.26.4) #ifndef SWIFT_MODULE_SWIFT_H #define SWIFT_MODULE_SWIFT_H #pragma clang diagnostic push @@ -40,6 +40,8 @@ #include #endif #if defined(__cplusplus) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnon-modular-include-in-framework-module" #if defined(__arm64e__) && __has_include() # include #else @@ -53,6 +55,7 @@ # endif #pragma clang diagnostic pop #endif +#pragma clang diagnostic pop #endif #if !defined(SWIFT_TYPEDEFS) @@ -287,6 +290,7 @@ typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); #pragma clang diagnostic ignored "-Wunknown-pragmas" #pragma clang diagnostic ignored "-Wnullability" #pragma clang diagnostic ignored "-Wdollar-in-identifier-extension" +#pragma clang diagnostic ignored "-Wunsafe-buffer-usage" #if __has_attribute(external_source_symbol) # pragma push_macro("any") diff --git a/pkgs/ffigen/lib/src/code_generator/objc_block.dart b/pkgs/ffigen/lib/src/code_generator/objc_block.dart index f466c623d..d22958ce5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_block.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_block.dart @@ -322,6 +322,7 @@ ref.pointer.ref.invoke.cast<$natTrampFnType>().asFunction<$trampFuncFfiDartType> s.write(''' typedef $blockTypedef; +__attribute__((visibility("default"))) __attribute__((used)) $blockName $fnName($blockName block) NS_RETURNS_RETAINED { return ^void($argStr) { ${generateRetain('block')}; diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index d4150f9c9..0ae4f98b9 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 16.0.0 +version: 16.0.1-wip description: > Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files. diff --git a/pkgs/objective_c/CHANGELOG.md b/pkgs/objective_c/CHANGELOG.md index 3607b54cc..e3b4b3899 100644 --- a/pkgs/objective_c/CHANGELOG.md +++ b/pkgs/objective_c/CHANGELOG.md @@ -1,6 +1,8 @@ ## 4.0.1-wip -- Reduces the changes of duplicate symbols by adding a `DOBJC_` prefix. +- Reduces the chances of duplicate symbols by adding a `DOBJC_` prefix. +- Ensure that required symbols are available to FFI even when the final binary + is linked with `-dead_strip`. ## 4.0.0 diff --git a/pkgs/objective_c/src/ffi.h b/pkgs/objective_c/src/ffi.h new file mode 100644 index 000000000..716965763 --- /dev/null +++ b/pkgs/objective_c/src/ffi.h @@ -0,0 +1,12 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#ifndef OBJECTIVE_C_SRC_FFI_H_ +#define OBJECTIVE_C_SRC_FFI_H_ + +// Ensure that an FFI function, that will appear unused by the linker, will +// not be removed. +#define FFI_EXPORT __attribute__((visibility("default"))) __attribute__((used)) + +#endif // OBJECTIVE_C_SRC_FFI_H_ diff --git a/pkgs/objective_c/src/objective_c.h b/pkgs/objective_c/src/objective_c.h index 8d64c9ba1..c2fefcb10 100644 --- a/pkgs/objective_c/src/objective_c.h +++ b/pkgs/objective_c/src/objective_c.h @@ -5,28 +5,30 @@ #ifndef OBJECTIVE_C_SRC_OBJECTIVE_C_H_ #define OBJECTIVE_C_SRC_OBJECTIVE_C_H_ +#include "ffi.h" #include "include/dart_api_dl.h" #include "objective_c_runtime.h" // Dispose helper for ObjC blocks that wrap a Dart closure. -void DOBJC_disposeObjCBlockWithClosure(ObjCBlockImpl* block); +FFI_EXPORT void DOBJC_disposeObjCBlockWithClosure(ObjCBlockImpl *block); // Returns whether the block is valid and live. The pointer must point to // readable memory, or be null. May (rarely) return false positives. -bool DOBJC_isValidBlock(ObjCBlockImpl* block); +FFI_EXPORT bool DOBJC_isValidBlock(ObjCBlockImpl *block); // Returns a new Dart_FinalizableHandle that will clean up the object when the // Dart owner is garbage collected. -Dart_FinalizableHandle DOBJC_newFinalizableHandle( - Dart_Handle owner, ObjCObject *object); +FFI_EXPORT Dart_FinalizableHandle +DOBJC_newFinalizableHandle(Dart_Handle owner, ObjCObject *object); // Delete a finalizable handle. Doesn't run the finalization callback, so // doesn't clean up the assocated pointer. -void DOBJC_deleteFinalizableHandle(Dart_FinalizableHandle handle, Dart_Handle owner); +FFI_EXPORT void DOBJC_deleteFinalizableHandle(Dart_FinalizableHandle handle, + Dart_Handle owner); // Returns a newly allocated bool* (initialized to false) that will be deleted // by a Dart_FinalizableHandle when the owner is garbage collected. -bool* DOBJC_newFinalizableBool(Dart_Handle owner); +FFI_EXPORT bool *DOBJC_newFinalizableBool(Dart_Handle owner); // Runs fn(arg) on the main thread. If runOnMainThread is already running on the // main thread, fn(arg) is invoked synchronously. Otherwise it is dispatched to @@ -35,6 +37,6 @@ bool* DOBJC_newFinalizableBool(Dart_Handle owner); // This assumes that the main thread is executing its queue. If not, #define // NO_MAIN_THREAD_DISPATCH to disable this, and run fn(arg) synchronously. The // flutter runner does execute the main dispatch queue, but the Dart VM doesn't. -void DOBJC_runOnMainThread(void (*fn)(void*), void* arg); +FFI_EXPORT void DOBJC_runOnMainThread(void (*fn)(void *), void *arg); -#endif // OBJECTIVE_C_SRC_OBJECTIVE_C_H_ +#endif // OBJECTIVE_C_SRC_OBJECTIVE_C_H_ diff --git a/pkgs/objective_c/src/objective_c.m b/pkgs/objective_c/src/objective_c.m index b3256e09f..ca3035c5a 100644 --- a/pkgs/objective_c/src/objective_c.m +++ b/pkgs/objective_c/src/objective_c.m @@ -5,7 +5,9 @@ #import #import -void DOBJC_runOnMainThread(void (*fn)(void*), void* arg) { +#include "ffi.h" + +FFI_EXPORT void DOBJC_runOnMainThread(void (*fn)(void *), void *arg) { #ifdef NO_MAIN_THREAD_DISPATCH fn(arg); #else diff --git a/pkgs/objective_c/src/objective_c_bindings_generated.m b/pkgs/objective_c/src/objective_c_bindings_generated.m index 478c8ffd6..80ce85af1 100644 --- a/pkgs/objective_c/src/objective_c_bindings_generated.m +++ b/pkgs/objective_c/src/objective_c_bindings_generated.m @@ -13,6 +13,7 @@ Protocol* _ObjectiveCBindings_NSStreamDelegate() { return @protocol(NSStreamDelegate); } typedef void (^_ListenerTrampoline)(id arg0, id arg1, id arg2); +__attribute__((visibility("default"))) __attribute__((used)) _ListenerTrampoline _ObjectiveCBindings_wrapListenerBlock_1j2nt86(_ListenerTrampoline block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1, id arg2) { objc_retainBlock(block); @@ -21,6 +22,7 @@ _ListenerTrampoline _ObjectiveCBindings_wrapListenerBlock_1j2nt86(_ListenerTramp } typedef void (^_ListenerTrampoline1)(void * arg0); +__attribute__((visibility("default"))) __attribute__((used)) _ListenerTrampoline1 _ObjectiveCBindings_wrapListenerBlock_ovsamd(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { return ^void(void * arg0) { objc_retainBlock(block); @@ -29,6 +31,7 @@ _ListenerTrampoline1 _ObjectiveCBindings_wrapListenerBlock_ovsamd(_ListenerTramp } typedef void (^_ListenerTrampoline2)(void * arg0, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) _ListenerTrampoline2 _ObjectiveCBindings_wrapListenerBlock_wjovn7(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1) { objc_retainBlock(block); @@ -37,6 +40,7 @@ _ListenerTrampoline2 _ObjectiveCBindings_wrapListenerBlock_wjovn7(_ListenerTramp } typedef void (^_ListenerTrampoline3)(void * arg0, id arg1, NSStreamEvent arg2); +__attribute__((visibility("default"))) __attribute__((used)) _ListenerTrampoline3 _ObjectiveCBindings_wrapListenerBlock_18d6mda(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { return ^void(void * arg0, id arg1, NSStreamEvent arg2) { objc_retainBlock(block); @@ -45,6 +49,7 @@ _ListenerTrampoline3 _ObjectiveCBindings_wrapListenerBlock_18d6mda(_ListenerTram } typedef void (^_ListenerTrampoline4)(id arg0, id arg1); +__attribute__((visibility("default"))) __attribute__((used)) _ListenerTrampoline4 _ObjectiveCBindings_wrapListenerBlock_wjvic9(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { return ^void(id arg0, id arg1) { objc_retainBlock(block); diff --git a/pkgs/objective_c/test/main.c b/pkgs/objective_c/test/main.c new file mode 100644 index 000000000..88bd241be --- /dev/null +++ b/pkgs/objective_c/test/main.c @@ -0,0 +1,27 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +// Verify that the required symbols were not stripped from the binary. + +#include +#include +#include + +#define ASSERT_SYMBOL(s) \ + if (dlsym(RTLD_DEFAULT, s) == 0) { \ + fprintf(stderr, "Missing symbol: %s\n", s); \ + exit(1); \ + } + +int main() { + ASSERT_SYMBOL("DOBJC_disposeObjCBlockWithClosure"); // objective_c.c + ASSERT_SYMBOL("DOBJC_runOnMainThread"); + + ASSERT_SYMBOL("DOBJC_disposeObjCBlockWithClosure"); // objective_c.c + ASSERT_SYMBOL("DOBJC_runOnMainThread"); // objective_c.m + ASSERT_SYMBOL("OBJC_CLASS_$_DOBJCDartProxy"); // proxy.m + // objective_c_bindings_generated.m + ASSERT_SYMBOL("_ObjectiveCBindings_wrapListenerBlock_ovsamd"); + return 0; +} diff --git a/pkgs/objective_c/test/setup.dart b/pkgs/objective_c/test/setup.dart index c9dcc83bb..4c63b4d6f 100644 --- a/pkgs/objective_c/test/setup.dart +++ b/pkgs/objective_c/test/setup.dart @@ -19,6 +19,7 @@ final cFiles = [ 'src/include/dart_api_dl.c', 'test/util.c', ].map(_resolve); +final cMain = _resolve('test/main.c'); final objCFiles = [ 'src/input_stream_adapter.m', 'src/objective_c.m', @@ -74,6 +75,9 @@ String _buildObject(String input, List flags) { void _linkLib(List inputs, String output) => _runClang(['-shared', '-undefined', 'dynamic_lookup', ...inputs], output); +void _linkMain(List inputs, String output) => + _runClang(['-dead_strip', '-fobjc-arc', ...inputs], output); + void main(List arguments) { final parser = ArgParser(); parser.addFlag('main-thread-dispatcher'); @@ -96,4 +100,11 @@ void main(List arguments) { lib.lookup('OBJC_CLASS_\$_DOBJCDartProxy'); // proxy.m // objective_c_bindings_generated.m lib.lookup('_ObjectiveCBindings_wrapListenerBlock_ovsamd'); + + // Sanity check that the executable can find FFI symbols. + _linkMain([...objFiles, cMain], '$cMain.exe'); + final result = Process.runSync('$cMain.exe', []); + if (result.exitCode != 0) { + throw Exception('Missing symbols from executable:\n${result.stderr}'); + } } From bdb8a7de8deebdc78e0b86f2eb156d3b7da2502a Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Thu, 28 Nov 2024 10:38:12 +0100 Subject: [PATCH 17/50] [jnigen] Add doc about threading (#1751) * Close #611 --- pkgs/jnigen/doc/threading.md | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 pkgs/jnigen/doc/threading.md diff --git a/pkgs/jnigen/doc/threading.md b/pkgs/jnigen/doc/threading.md new file mode 100644 index 000000000..01fbb8a63 --- /dev/null +++ b/pkgs/jnigen/doc/threading.md @@ -0,0 +1,67 @@ +## Threading considerations + +Unlike method channels, JNIgen uses FFI calls. This means that the calls happen +on the calling thread. + +Dart callbacks are executed on the isolate where they were created. This means +the Dart isolate remains active until the associated Java objects are garbage +collected by the JVM. + +Java calls Dart callbacks directly when both are on the same thread. If they are +on different threads, Java sends a message to the Dart isolate and waits for a +response. However, you can +[configure void-returning callbacks to avoid waiting](<(../interface_implementation.md#implement-as-a-listener)>), +as they don't produce a return value. + +### Deadlocks + +When implementing Java/Kotlin interfaces in Dart, it is possible to create +deadlocks. Suppose we have created an object that implements `Runnable` in Dart +in the main isolate. This means that the code will always be run on the platform +thread. + +```dart +// Dart +final runnableFromDart = Runnable.implement( + $Runnable(run: () => print('hello')) +); +``` + +If Java creates a second thread from the platform thread and calls +`runnableFromDart.run()` from that thread and then attempts to join or +synchronize with the main thread, it will cause a deadlock. + +This is because the body of the `runnableFromDart` needs to be run on the +platform thread, so JNIgen waits until platform thread is available. However in +this setting the platform thread will not be available until +`runnableFromDart.run` is executed. + +If the callback does not need to be blocking, +[making it a listener](../interface_implementation.md#implement-as-a-listener) +solves this issue: + +```dart +// Dart +final runnableFromDart = Runnable.implement($Runnable( + run: () => print('hello'), + run$async: true, +)); +``` + +Of course, only void-returning methods can be non-blocking. + +### Calling thread restricted APIs + +When developing for Flutter Android, certain APIs can be thread-restricted to +the platform thread which is currently different than the Flutter's UI thread. + +These two threads will be merged in +[the near future](https://github.com/flutter/flutter/issues/150525). + +Until then you can wrap your calls with `runOnPlatformThread` which is available +in `dart:ui`. + +### Dart-standalone + +On Dart-standalone, call `Jni.setDylibsDir` in each new isolate, since each +isolate loads the dynamic libararies separately. From 081b195dd9c58012b2e67cc6417dfa7f2b2ab40e Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 28 Nov 2024 11:22:25 +0100 Subject: [PATCH 18/50] [native_assets_builder] Use file content hashing (#1750) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR changes the caching behavior for hooks to be file content hashing instead of last modified timestamps. Closes: https://github.com/dart-lang/native/issues/1593. In addition to using file hashes, a timestamp is passed in to detect if files were modified during a build. The moment of hashing contents is after a build is finished, but we should consider files changed after the build started to invalidate the build. If this happens, the build succeeds, but the cache is invalidated and a warning is printed to the logger. The implementation was modeled after the [`FileStore` in flutter_tools](https://github.com/flutter/flutter/blob/1e824af6bd217beb0cc201394c9832316b6150da/packages/flutter_tools/lib/src/build_system/file_store.dart). However, it was adapted to support caching directories and to match the code style in this repository. Directory caching is defined as follows: the hash of the names of the children. This excludes recursive descendants, and excludes the contents of children. For recursive caching (and glob patterns), the populator of the cache should do the glob/recursion to add all directories and files. ### Testing * The existing caching tests (such as `pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart`) cover caching behavior. * Now that last-modified are no longer used, some sleeps have been removed from tests. 🎉 ### Performance Adding a stopwatch to pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart for the second invocation of the hooks so that it is cached. * `lastModified` timestamps: 0.028 seconds (pre this PR) * `package:crypto` `md5`: 0.047 seconds (current PR) * `package:xxh3` `xxh3`: 0.042 seconds The implementation does not use parallel system IO for loading files (no `Future.wait`), but does use async I/O to allow flutter_tools to run other `Target`s in parallel. The (pre and post this PR) implementation is fast enough for a handful of packages with native assets in a `flutter run`. The implementation (pre and post this PR) is not fast enough for hot restart / hot reload with 10+ packages with native assets. So, when exploring support for that, we'll need to revisit the implementation. ### Related issues not addressed in this PR * https://github.com/dart-lang/native/issues/32 * Changing environment variables should also cause the hook to rerun. * https://github.com/dart-lang/native/issues/1578 * Hook compilation can potentially be shared. (This requires taking more directory locks due to concurrent and re-entrant invocations.) --- .../lib/src/build_runner/build_runner.dart | 109 +++++---- .../dependencies_hash_file.dart | 211 ++++++++++++++++++ pkgs/native_assets_builder/pubspec.yaml | 1 + .../build_runner_caching_test.dart | 12 - .../test/build_runner/build_runner_test.dart | 5 - .../test/build_runner/link_caching_test.dart | 7 - .../dependencies_hash_file_test.dart | 108 +++++++++ 7 files changed, 388 insertions(+), 65 deletions(-) create mode 100644 pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart create mode 100644 pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 1eea17597..449fe9a2c 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -10,15 +10,14 @@ import 'package:logging/logging.dart'; import 'package:native_assets_cli/native_assets_cli_internal.dart'; import 'package:package_config/package_config.dart'; +import '../dependencies_hash_file/dependencies_hash_file.dart'; import '../locking/locking.dart'; import '../model/build_dry_run_result.dart'; import '../model/build_result.dart'; import '../model/hook_result.dart'; import '../model/link_result.dart'; import '../package_layout/package_layout.dart'; -import '../utils/file.dart'; import '../utils/run_process.dart'; -import '../utils/uri.dart'; import 'build_planner.dart'; typedef DependencyMetadata = Map; @@ -451,6 +450,8 @@ class NativeAssetsBuildRunner { return hookResult; } + // TODO(https://github.com/dart-lang/native/issues/32): Rerun hook if + // environment variables change. Future _runHookForPackageCached( Hook hook, HookConfig config, @@ -473,7 +474,7 @@ class NativeAssetsBuildRunner { final ( compileSuccess, hookKernelFile, - hookLastSourceChange, + hookHashesFile, ) = await _compileHookForPackageCached( config.packageName, config.outputDirectory, @@ -488,7 +489,14 @@ class NativeAssetsBuildRunner { final buildOutputFile = File.fromUri(config.outputDirectory.resolve(hook.outputName)); - if (buildOutputFile.existsSync()) { + final dependenciesHashFile = File.fromUri( + config.outputDirectory + .resolve('../dependencies.dependencies_hash_file.json'), + ); + final dependenciesHashes = + DependenciesHashFile(file: dependenciesHashFile); + final lastModifiedCutoffTime = DateTime.now(); + if (buildOutputFile.existsSync() && dependenciesHashFile.existsSync()) { late final HookOutput output; try { output = _readHookOutputFromUri(hook, buildOutputFile); @@ -503,17 +511,13 @@ ${e.message} return null; } - final lastBuilt = output.timestamp.roundDownToSeconds(); - final dependenciesLastChange = - await Dependencies(output.dependencies).lastModified(); - if (lastBuilt.isAfter(dependenciesLastChange) && - lastBuilt.isAfter(hookLastSourceChange)) { + final outdated = + (await dependenciesHashes.findOutdatedFileSystemEntity()) != null; + if (!outdated) { logger.info( [ 'Skipping ${hook.name} for ${config.packageName} in $outDir.', - 'Last build on $lastBuilt.', - 'Last dependencies change on $dependenciesLastChange.', - 'Last hook change on $hookLastSourceChange.', + 'Last build on ${output.timestamp}.', ].join(' '), ); // All build flags go into [outDir]. Therefore we do not have to @@ -522,7 +526,7 @@ ${e.message} } } - return await _runHookForPackage( + final result = await _runHookForPackage( hook, config, validator, @@ -533,6 +537,24 @@ ${e.message} hookKernelFile, packageLayout, ); + if (result == null) { + if (await dependenciesHashFile.exists()) { + await dependenciesHashFile.delete(); + } + } else { + final modifiedDuringBuild = await dependenciesHashes.hashFiles( + [ + ...result.dependencies, + // Also depend on the hook source code. + hookHashesFile.uri, + ], + validBeforeLastModified: lastModifiedCutoffTime, + ); + if (modifiedDuringBuild != null) { + logger.severe('File modified during build. Build must be rerun.'); + } + } + return result; }, ); } @@ -644,7 +666,10 @@ ${e.message} /// It does not reuse the cached kernel for different configs due to /// reentrancy requirements. For more info see: /// https://github.com/dart-lang/native/issues/1319 - Future<(bool success, File kernelFile, DateTime lastSourceChange)> + /// + /// TODO(https://github.com/dart-lang/native/issues/1578): Compile only once + /// instead of per config. This requires more locking. + Future<(bool success, File kernelFile, File cacheFile)> _compileHookForPackageCached( String packageName, Uri outputDirectory, @@ -659,29 +684,17 @@ ${e.message} final depFile = File.fromUri( outputDirectory.resolve('../hook.dill.d'), ); + final dependenciesHashFile = File.fromUri( + outputDirectory.resolve('../hook.dependencies_hash_file.json'), + ); + final dependenciesHashes = DependenciesHashFile(file: dependenciesHashFile); + final lastModifiedCutoffTime = DateTime.now(); final bool mustCompile; - final DateTime sourceLastChange; - if (!await depFile.exists()) { + if (!await dependenciesHashFile.exists()) { mustCompile = true; - sourceLastChange = DateTime.now(); } else { - // Format: `path/to/my.dill: path/to/my.dart, path/to/more.dart` - final depFileContents = await depFile.readAsString(); - final dartSourceFiles = depFileContents - .trim() - .split(' ') - .skip(1) // ':' - .map((u) => Uri.file(u).fileSystemEntity) - .toList(); - final dartFilesLastChange = await dartSourceFiles.lastModified(); - final packageConfigLastChange = - await packageConfigUri.fileSystemEntity.lastModified(); - sourceLastChange = packageConfigLastChange.isAfter(dartFilesLastChange) - ? packageConfigLastChange - : dartFilesLastChange; - final kernelLastChange = await kernelFile.lastModified(); - mustCompile = sourceLastChange == kernelLastChange || - sourceLastChange.isAfter(kernelLastChange); + mustCompile = + (await dependenciesHashes.findOutdatedFileSystemEntity()) != null; } final bool success; if (!mustCompile) { @@ -696,8 +709,28 @@ ${e.message} kernelFile, depFile, ); + + if (success) { + // Format: `path/to/my.dill: path/to/my.dart, path/to/more.dart` + final depFileContents = await depFile.readAsString(); + final dartSources = depFileContents + .trim() + .split(' ') + .skip(1) // ':' + .map(Uri.file) + .toList(); + final modifiedDuringBuild = await dependenciesHashes.hashFiles( + dartSources, + validBeforeLastModified: lastModifiedCutoffTime, + ); + if (modifiedDuringBuild != null) { + logger.severe('File modified during build. Build must be rerun.'); + } + } else { + await dependenciesHashFile.delete(); + } } - return (success, kernelFile, sourceLastChange); + return (success, kernelFile, dependenciesHashFile); } Future _compileHookForPackage( @@ -859,12 +892,6 @@ ${compileResult.stdout} } } -extension on DateTime { - DateTime roundDownToSeconds() => - DateTime.fromMillisecondsSinceEpoch(millisecondsSinceEpoch - - millisecondsSinceEpoch % const Duration(seconds: 1).inMilliseconds); -} - extension on Uri { Uri get parent => File(toFilePath()).parent.uri; } diff --git a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart new file mode 100644 index 000000000..6e23e319c --- /dev/null +++ b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart @@ -0,0 +1,211 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:convert'; +import 'dart:io'; +import 'dart:typed_data'; + +import 'package:crypto/crypto.dart'; + +import '../utils/file.dart'; +import '../utils/uri.dart'; + +class DependenciesHashFile { + DependenciesHashFile({ + required File file, + }) : _file = file; + + final File _file; + FileSystemHashes _hashes = FileSystemHashes(); + + Future _readFile() async { + if (!await _file.exists()) { + _hashes = FileSystemHashes(); + return; + } + final jsonObject = + (json.decode(utf8.decode(await _file.readAsBytes())) as Map) + .cast(); + _hashes = FileSystemHashes.fromJson(jsonObject); + } + + void _reset() => _hashes = FileSystemHashes(); + + /// Populate the hashes and persist file with entries from + /// [fileSystemEntities]. + /// + /// If [validBeforeLastModified] is provided, any entities that were modified + /// after [validBeforeLastModified] will get a dummy hash so that they will + /// show up as outdated. If any such entity exists, its uri will be returned. + Future hashFiles( + List fileSystemEntities, { + DateTime? validBeforeLastModified, + }) async { + _reset(); + + Uri? modifiedAfterTimeStamp; + for (final uri in fileSystemEntities) { + int hash; + if (validBeforeLastModified != null && + (await uri.fileSystemEntity.lastModified()) + .isAfter(validBeforeLastModified)) { + hash = _hashLastModifiedAfterCutoff; + modifiedAfterTimeStamp = uri; + } else { + if (_isDirectoryPath(uri.path)) { + hash = await _hashDirectory(uri); + } else { + hash = await _hashFile(uri); + } + } + _hashes.files.add(FilesystemEntityHash(uri, hash)); + } + await _persist(); + return modifiedAfterTimeStamp; + } + + Future _persist() => _file.writeAsString(json.encode(_hashes.toJson())); + + /// Reads the file with hashes and finds an outdated file or directory if it + /// exists. + Future findOutdatedFileSystemEntity() async { + await _readFile(); + + for (final savedHash in _hashes.files) { + final uri = savedHash.path; + final savedHashValue = savedHash.hash; + final int hashValue; + if (_isDirectoryPath(uri.path)) { + hashValue = await _hashDirectory(uri); + } else { + hashValue = await _hashFile(uri); + } + if (savedHashValue != hashValue) { + return uri; + } + } + return null; + } + + // A 64 bit hash from an md5 hash. + int _md5int64(Uint8List bytes) { + final md5bytes = md5.convert(bytes); + final md5ints = (md5bytes.bytes as Uint8List).buffer.asUint64List(); + return md5ints[0]; + } + + Future _hashFile(Uri uri) async { + final file = File.fromUri(uri); + if (!await file.exists()) { + return _hashNotExists; + } + return _md5int64(await file.readAsBytes()); + } + + Future _hashDirectory(Uri uri) async { + final directory = Directory.fromUri(uri); + if (!await directory.exists()) { + return _hashNotExists; + } + final children = directory.listSync(followLinks: true, recursive: false); + final childrenNames = children.map((e) => _pathBaseName(e.path)).join(';'); + return _md5int64(utf8.encode(childrenNames)); + } + + /// Predefined hash for files and directories that do not exist. + /// + /// There are two predefined hash values. The chance that a predefined hash + /// collides with a real hash is 2/2^64. + static const _hashNotExists = 0; + + /// Predefined hash for files and directories that were modified after the + /// time that the hashes file was created. + /// + /// There are two predefined hash values. The chance that a predefined hash + /// collides with a real hash is 2/2^64. + static const _hashLastModifiedAfterCutoff = 1; +} + +/// Storage format for file system entity hashes. +/// +/// [File] hashes are a hash of the file. +/// +/// [Directory] hashes are a hash of the names of the direct children. +class FileSystemHashes { + FileSystemHashes({ + this.version = 1, + List? files, + }) : files = files ?? []; + + factory FileSystemHashes.fromJson(Map json) { + final version = json[_versionKey] as int; + final rawEntries = + (json[_entitiesKey] as List).cast>(); + final files = [ + for (final Map rawEntry in rawEntries) + FilesystemEntityHash._fromJson(rawEntry), + ]; + return FileSystemHashes( + version: version, + files: files, + ); + } + + final int version; + final List files; + + static const _versionKey = 'version'; + static const _entitiesKey = 'entities'; + + Map toJson() => { + _versionKey: version, + _entitiesKey: [ + for (final FilesystemEntityHash file in files) file.toJson(), + ], + }; +} + +/// A stored file or directory hash and path. +/// +/// [File] hashes are a hash of the file. +/// +/// [Directory] hashes are a hash of the names of the direct children. +class FilesystemEntityHash { + FilesystemEntityHash( + this.path, + this.hash, + ); + + factory FilesystemEntityHash._fromJson(Map json) => + FilesystemEntityHash( + _fileSystemPathToUri(json[_pathKey] as String), + json[_hashKey] as int, + ); + + static const _pathKey = 'path'; + static const _hashKey = 'hash'; + + final Uri path; + + /// A 64 bit hash. + final int hash; + + Object toJson() => { + _pathKey: path.toFilePath(), + _hashKey: hash, + }; +} + +bool _isDirectoryPath(String path) => + path.endsWith(Platform.pathSeparator) || path.endsWith('/'); + +Uri _fileSystemPathToUri(String path) { + if (_isDirectoryPath(path)) { + return Uri.directory(path); + } + return Uri.file(path); +} + +String _pathBaseName(String path) => + path.split(Platform.pathSeparator).where((e) => e.isNotEmpty).last; diff --git a/pkgs/native_assets_builder/pubspec.yaml b/pkgs/native_assets_builder/pubspec.yaml index a70c6ceb0..1eaaee1a1 100644 --- a/pkgs/native_assets_builder/pubspec.yaml +++ b/pkgs/native_assets_builder/pubspec.yaml @@ -11,6 +11,7 @@ environment: dependencies: collection: ^1.18.0 + crypto: ^3.0.6 graphs: ^2.3.1 logging: ^1.2.0 # native_assets_cli: ^0.9.0 diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index e83948421..0df4b2478 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -21,10 +21,6 @@ void main() async { workingDirectory: packageUri, logger: logger, ); - // Make sure the first compile is at least one second after the - // package_config.json is written, otherwise dill compilation isn't - // cached. - await Future.delayed(const Duration(seconds: 1)); { final logMessages = []; @@ -95,10 +91,6 @@ void main() async { workingDirectory: packageUri, logger: logger, ); - // Make sure the first compile is at least one second after the - // package_config.json is written, otherwise dill compilation isn't - // cached. - await Future.delayed(const Duration(seconds: 1)); { final result = (await build( @@ -151,10 +143,6 @@ void main() async { await runPubGet(workingDirectory: packageUri, logger: logger); logMessages.clear(); - // Make sure the first compile is at least one second after the - // package_config.json is written, otherwise dill compilation isn't - // cached. - await Future.delayed(const Duration(seconds: 1)); final result = (await build( packageUri, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart index 51a5d68f2..239542042 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart @@ -24,11 +24,6 @@ void main() async { logger: logger, ); - // Make sure the first compile is at least one second after the - // package_config.json is written, otherwise dill compilation isn't - // cached. - await Future.delayed(const Duration(seconds: 1)); - // Trigger a build, should invoke build for libraries with native assets. { final logMessages = []; diff --git a/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart index 36e02c2cd..ded8c8a2a 100644 --- a/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart @@ -23,10 +23,6 @@ void main() async { workingDirectory: packageUri, logger: logger, ); - // Make sure the first compile is at least one second after the - // package_config.json is written, otherwise dill compilation isn't - // cached. - await Future.delayed(const Duration(seconds: 1)); final logMessages = []; late BuildResult buildResult; @@ -107,9 +103,6 @@ void main() async { sourceUri: testDataUri.resolve('simple_link_change_asset/'), targetUri: packageUri, ); - // Make sure the first hook is at least one second after the last - // change, or caching will not work. - await Future.delayed(const Duration(seconds: 1)); await runBuild(); expect(buildResult, isNotNull); diff --git a/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart b/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart new file mode 100644 index 000000000..2865bb4c4 --- /dev/null +++ b/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart @@ -0,0 +1,108 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:async'; +import 'dart:io'; + +import 'package:native_assets_builder/src/dependencies_hash_file/dependencies_hash_file.dart'; +import 'package:test/test.dart'; + +import '../helpers.dart'; + +void main() async { + test('json format', () async { + await inTempDir((tempUri) async { + final hashes = FileSystemHashes( + files: [ + FilesystemEntityHash( + tempUri.resolve('foo.dll'), + 1337, + ), + ], + ); + final hashes2 = FileSystemHashes.fromJson(hashes.toJson()); + expect(hashes.files.single.path, equals(hashes2.files.single.path)); + expect(hashes.files.single.hash, equals(hashes2.files.single.hash)); + }); + }); + + test('dependencies hash file', () async { + await inTempDir((tempUri) async { + final tempFile = File.fromUri(tempUri.resolve('foo.txt')); + final tempSubDir = Directory.fromUri(tempUri.resolve('subdir/')); + final subFile = File.fromUri(tempSubDir.uri.resolve('bar.txt')); + + final hashesFile = File.fromUri(tempUri.resolve('hashes.json')); + final hashes = DependenciesHashFile(file: hashesFile); + + Future reset() async { + await tempFile.create(recursive: true); + await tempSubDir.create(recursive: true); + await subFile.create(recursive: true); + await tempFile.writeAsString('hello'); + await subFile.writeAsString('world'); + + await hashes.hashFiles([ + tempFile.uri, + tempSubDir.uri, + ]); + } + + await reset(); + + // No changes + expect(await hashes.findOutdatedFileSystemEntity(), isNull); + + // Change file contents. + await tempFile.writeAsString('asdf'); + expect(await hashes.findOutdatedFileSystemEntity(), tempFile.uri); + await reset(); + + // Delete file. + await tempFile.delete(); + expect(await hashes.findOutdatedFileSystemEntity(), tempFile.uri); + await reset(); + + // Add file to tracked directory. + final subFile2 = File.fromUri(tempSubDir.uri.resolve('baz.txt')); + await subFile2.create(recursive: true); + await subFile2.writeAsString('hello'); + expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + await reset(); + + // Delete file from tracked directory. + await subFile.delete(); + expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + await reset(); + + // Delete tracked directory. + await tempSubDir.delete(recursive: true); + expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + await reset(); + + // Add directory to tracked directory. + final subDir2 = Directory.fromUri(tempSubDir.uri.resolve('baz/')); + await subDir2.create(recursive: true); + expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + await reset(); + + // Overwriting a file with identical contents. + await tempFile.writeAsString('something something'); + await tempFile.writeAsString('hello'); + expect(await hashes.findOutdatedFileSystemEntity(), isNull); + await reset(); + + // If a file is modified after the valid timestamp, it should be marked + // as changed. + await hashes.hashFiles( + [ + tempFile.uri, + ], + validBeforeLastModified: (await tempFile.lastModified()) + .subtract(const Duration(seconds: 1)), + ); + expect(await hashes.findOutdatedFileSystemEntity(), tempFile.uri); + }); + }); +} From e69c74d1b15e53115f8bb7adc4d20a15034b604d Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 28 Nov 2024 12:26:26 +0100 Subject: [PATCH 19/50] [native_assets_cli] Document exit code behavior (#1762) Closes: https://github.com/dart-lang/native/issues/33 The behavior is already tested by pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart. --- pkgs/native_assets_cli/lib/src/api/build.dart | 7 +++++++ pkgs/native_assets_cli/lib/src/api/link.dart | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/pkgs/native_assets_cli/lib/src/api/build.dart b/pkgs/native_assets_cli/lib/src/api/build.dart index 5534773ec..c033a8c58 100644 --- a/pkgs/native_assets_cli/lib/src/api/build.dart +++ b/pkgs/native_assets_cli/lib/src/api/build.dart @@ -11,6 +11,8 @@ import '../validation.dart'; /// Runs a native assets build. /// +/// Meant to be used in build hooks (`hook/build.dart`). +/// /// Can build native assets which are not already available, or expose existing /// files. Each individual asset is assigned a unique asset ID. /// @@ -87,6 +89,11 @@ import '../validation.dart'; /// }); /// } /// ``` +/// +/// If the [builder] fails, it must `throw`. Build hooks are guaranteed to be +/// invoked with a process invocation and should return a non-zero exit code on +/// failure. Throwing will lead to an uncaught exception, causing a non-zero +/// exit code. Future build( List arguments, Future Function(BuildConfig config, BuildOutputBuilder output) builder, diff --git a/pkgs/native_assets_cli/lib/src/api/link.dart b/pkgs/native_assets_cli/lib/src/api/link.dart index 975ec280b..fe3d445bf 100644 --- a/pkgs/native_assets_cli/lib/src/api/link.dart +++ b/pkgs/native_assets_cli/lib/src/api/link.dart @@ -11,6 +11,8 @@ import '../validation.dart'; /// Runs a native assets link. /// +/// Meant to be used in link hooks (`hook/link.dart`). +/// /// Can link native assets which are not already available, or expose existing /// files. Each individual asset is assigned a unique asset ID. /// @@ -30,6 +32,10 @@ import '../validation.dart'; /// }); /// } /// ``` +/// If the [linker] fails, it must `throw`. Link hooks are guaranteed to be +/// invoked with a process invocation and should return a non-zero exit code on +/// failure. Throwing will lead to an uncaught exception, causing a non-zero +/// exit code. Future link( List arguments, Future Function(LinkConfig config, LinkOutputBuilder output) linker, From 9c331682996654e63a9f00f2285d6365937ca4f0 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 29 Nov 2024 10:10:05 +0100 Subject: [PATCH 20/50] [native_assets_builder] Recompile hook kernel if Dart changes (#1763) Addresses the remaining comments on https://github.com/dart-lang/native/pull/1750. I'm unsure how to test the recompiling of the kernel file if Dart changes without writing a test that downloads a different Dart SDK. --- .../lib/src/build_runner/build_runner.dart | 108 +++++++++++------- .../dependencies_hash_file.dart | 21 ++-- .../build_runner_caching_test.dart | 38 ++++-- .../dependencies_hash_file_test.dart | 4 +- 4 files changed, 104 insertions(+), 67 deletions(-) diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 449fe9a2c..1559ec803 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -510,20 +510,23 @@ ${e.message} '''); return null; } - - final outdated = - (await dependenciesHashes.findOutdatedFileSystemEntity()) != null; - if (!outdated) { + final outdatedFile = + await dependenciesHashes.findOutdatedFileSystemEntity(); + if (outdatedFile == null) { logger.info( - [ - 'Skipping ${hook.name} for ${config.packageName} in $outDir.', - 'Last build on ${output.timestamp}.', - ].join(' '), + 'Skipping ${hook.name} for ${config.packageName}' + ' in ${outDir.toFilePath()}.' + ' Last build on ${output.timestamp}.', ); // All build flags go into [outDir]. Therefore we do not have to // check here whether the config is equal. return output; } + logger.info( + 'Rerunning ${hook.name} for ${config.packageName}' + ' in ${outDir.toFilePath()}.' + ' ${outdatedFile.toFilePath()} changed.', + ); } final result = await _runHookForPackage( @@ -542,7 +545,8 @@ ${e.message} await dependenciesHashFile.delete(); } } else { - final modifiedDuringBuild = await dependenciesHashes.hashFiles( + final modifiedDuringBuild = + await dependenciesHashes.hashFilesAndDirectories( [ ...result.dependencies, // Also depend on the hook source code. @@ -689,50 +693,68 @@ ${e.message} ); final dependenciesHashes = DependenciesHashFile(file: dependenciesHashFile); final lastModifiedCutoffTime = DateTime.now(); - final bool mustCompile; + var mustCompile = false; if (!await dependenciesHashFile.exists()) { mustCompile = true; } else { - mustCompile = - (await dependenciesHashes.findOutdatedFileSystemEntity()) != null; + final outdatedFile = + await dependenciesHashes.findOutdatedFileSystemEntity(); + if (outdatedFile != null) { + mustCompile = true; + logger.info( + 'Recompiling ${scriptUri.toFilePath()}, ' + '${outdatedFile.toFilePath()} changed.', + ); + } } - final bool success; + if (!mustCompile) { - success = true; - } else { - success = await _compileHookForPackage( - packageName, - scriptUri, - packageConfigUri, - workingDirectory, - includeParentEnvironment, - kernelFile, - depFile, - ); + return (true, kernelFile, dependenciesHashFile); + } - if (success) { - // Format: `path/to/my.dill: path/to/my.dart, path/to/more.dart` - final depFileContents = await depFile.readAsString(); - final dartSources = depFileContents - .trim() - .split(' ') - .skip(1) // ':' - .map(Uri.file) - .toList(); - final modifiedDuringBuild = await dependenciesHashes.hashFiles( - dartSources, - validBeforeLastModified: lastModifiedCutoffTime, - ); - if (modifiedDuringBuild != null) { - logger.severe('File modified during build. Build must be rerun.'); - } - } else { - await dependenciesHashFile.delete(); - } + final success = await _compileHookForPackage( + packageName, + scriptUri, + packageConfigUri, + workingDirectory, + includeParentEnvironment, + kernelFile, + depFile, + ); + if (!success) { + await dependenciesHashFile.delete(); + return (success, kernelFile, dependenciesHashFile); + } + + final dartSources = await _readDepFile(depFile); + final modifiedDuringBuild = + await dependenciesHashes.hashFilesAndDirectories( + [ + ...dartSources, + // If the Dart version changed, recompile. + dartExecutable.resolve('../version'), + ], + validBeforeLastModified: lastModifiedCutoffTime, + ); + if (modifiedDuringBuild != null) { + logger.severe('File modified during build. Build must be rerun.'); } + return (success, kernelFile, dependenciesHashFile); } + Future> _readDepFile(File depFile) async { + // Format: `path/to/my.dill: path/to/my.dart, path/to/more.dart` + final depFileContents = await depFile.readAsString(); + final dartSources = depFileContents + .trim() + .split(' ') + .skip(1) // ':' + .map(Uri.file) + .toList(); + return dartSources; + } + Future _compileHookForPackage( String packageName, Uri scriptUri, diff --git a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart index 6e23e319c..259be5793 100644 --- a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart +++ b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart @@ -26,7 +26,7 @@ class DependenciesHashFile { } final jsonObject = (json.decode(utf8.decode(await _file.readAsBytes())) as Map) - .cast(); + .cast(); _hashes = FileSystemHashes.fromJson(jsonObject); } @@ -38,7 +38,7 @@ class DependenciesHashFile { /// If [validBeforeLastModified] is provided, any entities that were modified /// after [validBeforeLastModified] will get a dummy hash so that they will /// show up as outdated. If any such entity exists, its uri will be returned. - Future hashFiles( + Future hashFilesAndDirectories( List fileSystemEntities, { DateTime? validBeforeLastModified, }) async { @@ -134,32 +134,25 @@ class DependenciesHashFile { /// [Directory] hashes are a hash of the names of the direct children. class FileSystemHashes { FileSystemHashes({ - this.version = 1, List? files, }) : files = files ?? []; - factory FileSystemHashes.fromJson(Map json) { - final version = json[_versionKey] as int; - final rawEntries = - (json[_entitiesKey] as List).cast>(); + factory FileSystemHashes.fromJson(Map json) { + final rawEntries = (json[_entitiesKey] as List).cast(); final files = [ - for (final Map rawEntry in rawEntries) - FilesystemEntityHash._fromJson(rawEntry), + for (final rawEntry in rawEntries) + FilesystemEntityHash._fromJson((rawEntry as Map).cast()), ]; return FileSystemHashes( - version: version, files: files, ); } - final int version; final List files; - static const _versionKey = 'version'; static const _entitiesKey = 'entities'; Map toJson() => { - _versionKey: version, _entitiesKey: [ for (final FilesystemEntityHash file in files) file.toJson(), ], @@ -177,7 +170,7 @@ class FilesystemEntityHash { this.hash, ); - factory FilesystemEntityHash._fromJson(Map json) => + factory FilesystemEntityHash._fromJson(Map json) => FilesystemEntityHash( _fileSystemPathToUri(json[_pathKey] as String), json[_hashKey] as int, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index 0df4b2478..42c5e4939 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -61,6 +61,12 @@ void main() async { buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, ))!; + final hookUri = packageUri.resolve('hook/build.dart'); + print(logMessages.join('\n')); + expect( + logMessages.join('\n'), + isNot(contains('Recompiling ${hookUri.toFilePath()}')), + ); expect( logMessages.join('\n'), contains('Skipping build for native_add'), @@ -87,10 +93,14 @@ void main() async { await copyTestProjects(targetUri: tempUri); final packageUri = tempUri.resolve('native_add/'); + final logMessages = []; + final logger = createCapturingLogger(logMessages); + await runPubGet( workingDirectory: packageUri, logger: logger, ); + logMessages.clear(); { final result = (await build( @@ -105,6 +115,7 @@ void main() async { await expectSymbols( asset: CodeAsset.fromEncoded(result.encodedAssets.single), symbols: ['add']); + logMessages.clear(); } await copyTestProjects( @@ -122,6 +133,18 @@ void main() async { buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, ))!; + + final cUri = packageUri.resolve('src/').resolve('native_add.c'); + expect( + logMessages.join('\n'), + stringContainsInOrder( + [ + 'Rerunning build for native_add in', + '${cUri.toFilePath()} changed.' + ], + ), + ); + await expectSymbols( asset: CodeAsset.fromEncoded(result.encodedAssets.single), symbols: ['add', 'subtract'], @@ -181,14 +204,13 @@ void main() async { buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, ))!; - { - final compiledHook = logMessages - .where((m) => - m.contains('dart compile kernel') || - m.contains('dart.exe compile kernel')) - .isNotEmpty; - expect(compiledHook, isTrue); - } + + final hookUri = packageUri.resolve('hook/build.dart'); + expect( + logMessages.join('\n'), + contains('Recompiling ${hookUri.toFilePath()}'), + ); + logMessages.clear(); await expectSymbols( asset: CodeAsset.fromEncoded(result.encodedAssets.single), diff --git a/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart b/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart index 2865bb4c4..ae4fd2522 100644 --- a/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart +++ b/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart @@ -43,7 +43,7 @@ void main() async { await tempFile.writeAsString('hello'); await subFile.writeAsString('world'); - await hashes.hashFiles([ + await hashes.hashFilesAndDirectories([ tempFile.uri, tempSubDir.uri, ]); @@ -95,7 +95,7 @@ void main() async { // If a file is modified after the valid timestamp, it should be marked // as changed. - await hashes.hashFiles( + await hashes.hashFilesAndDirectories( [ tempFile.uri, ], From 058675e4e2a39d9f4f6fd68183bd20cd9477f2f4 Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Fri, 29 Nov 2024 12:48:26 +0100 Subject: [PATCH 21/50] Update build output test to use .compareTo()/.isSameMomentAs() as operators don't exist on DateTime (#1769) Closes: https://github.com/dart-lang/native/issues/1745 --- pkgs/native_assets_cli/test/build_output_test.dart | 10 ++++++---- pkgs/native_assets_cli/test/link_output_test.dart | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/native_assets_cli/test/build_output_test.dart b/pkgs/native_assets_cli/test/build_output_test.dart index 7eb7b30da..d58f1c920 100644 --- a/pkgs/native_assets_cli/test/build_output_test.dart +++ b/pkgs/native_assets_cli/test/build_output_test.dart @@ -40,10 +40,12 @@ void main() { linkInPackage: 'package:linker2'); final config = BuildOutput(builder.json); - expect(config.timestamp, greaterThanOrEqualTo(before)); - expect(config.timestamp, lessThanOrEqualTo(after)); - expect(config.timestamp, - lessThanOrEqualTo(config.timestamp.roundDownToSeconds())); + expect(config.timestamp.compareTo(before), greaterThanOrEqualTo(0)); + expect(config.timestamp.compareTo(after), lessThanOrEqualTo(0)); + expect( + config.timestamp + .isAtSameMomentAs(config.timestamp.roundDownToSeconds()), + true); // The JSON format of the build output. { diff --git a/pkgs/native_assets_cli/test/link_output_test.dart b/pkgs/native_assets_cli/test/link_output_test.dart index a79d81a18..adb5e80a3 100644 --- a/pkgs/native_assets_cli/test/link_output_test.dart +++ b/pkgs/native_assets_cli/test/link_output_test.dart @@ -26,10 +26,12 @@ void main() { builder.addEncodedAssets(assets.skip(1).take(2).toList()); final config = BuildOutput(builder.json); - expect(config.timestamp, greaterThanOrEqualTo(before)); - expect(config.timestamp, lessThanOrEqualTo(after)); - expect(config.timestamp, - lessThanOrEqualTo(config.timestamp.roundDownToSeconds())); + expect(config.timestamp.compareTo(before), greaterThanOrEqualTo(0)); + expect(config.timestamp.compareTo(after), lessThanOrEqualTo(0)); + expect( + config.timestamp + .isAtSameMomentAs(config.timestamp.roundDownToSeconds()), + true); // The JSON format of the link output. { From 25f36d67bf631de39d5519e096ab83101ada5b21 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Fri, 29 Nov 2024 21:37:39 +0100 Subject: [PATCH 22/50] Generate null-safe Kotlin code (#1758) Now we parse the Kotlin metadata and add a `Nullable` or `NonNull` annotation to each type based on that. Not everything is covered because we simply don't support all Kotlin features. --- pkgs/jnigen/CHANGELOG.md | 2 +- .../kotlin_plugin/example/lib/main.dart | 4 +- .../kotlin_plugin/lib/kotlin_bindings.dart | 12 +- .../apisummarizer/elements/KotlinPackage.java | 3 + .../apisummarizer/elements/KotlinType.java | 4 + .../lib/src/bindings/kotlin_processor.dart | 225 ++- pkgs/jnigen/lib/src/elements/elements.dart | 233 ++- pkgs/jnigen/lib/src/elements/elements.g.dart | 210 ++- .../test/kotlin_test/bindings/kotlin.dart | 1425 +++++++++++++++-- .../github/dart_lang/jnigen/Nullability.kt | 84 + .../kotlin_test/runtime_test_registrant.dart | 217 ++- 11 files changed, 2194 insertions(+), 225 deletions(-) create mode 100644 pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/Nullability.kt diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 7d94206cb..f8408ec7c 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -1,7 +1,7 @@ ## 0.13.0-wip - **Breaking Change**([#1644](https://github.com/dart-lang/native/issues/1644)): - Generate null-safe Dart bindings. + Generate null-safe Dart bindings for Java and Kotlin. ## 0.12.2 diff --git a/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart b/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart index a7e671ef8..84a91337c 100644 --- a/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart @@ -62,8 +62,8 @@ class _MyHomePageState extends State { ElevatedButton( onPressed: () { setState(() { - answer = example.thinkBeforeAnswering().then((value) => - value?.toDartString(releaseOriginal: true) ?? 'null'); + answer = example.thinkBeforeAnswering().then( + (value) => value.toDartString(releaseOriginal: true)); }); }, child: const Text('Think...'), diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index 60b859b65..fceb46300 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart @@ -94,7 +94,7 @@ class Example extends _$jni.JObject { /// from: `public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString?> thinkBeforeAnswering() async { + _$core.Future<_$jni.JString> thinkBeforeAnswering() async { final $p = _$jni.ReceivePort(); final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); @@ -102,17 +102,17 @@ class Example extends _$jni.JObject { reference.pointer, _id_thinkBeforeAnswering as _$jni.JMethodIDPtr, _$continuation.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object<_$jni.JObject>(const _$jni.JObjectType()); _$continuation.release(); final $o = _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringNullableType().jClass.reference; + final $k = const _$jni.JStringType().jClass.reference; if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { $k.release(); throw 'Failed'; } $k.release(); - return const _$jni.JStringNullableType().fromReference($o); + return const _$jni.JStringType().fromReference($o); } } @@ -133,7 +133,7 @@ final class $Example$NullableType extends _$jni.JObjType { ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override @@ -168,7 +168,7 @@ final class $Example$Type extends _$jni.JObjType { ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinPackage.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinPackage.java index 5252e0071..3610a18aa 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinPackage.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinPackage.java @@ -6,11 +6,14 @@ public class KotlinPackage { public List functions; + public List properties; public static KotlinPackage fromKmPackage(KmPackage p) { var pkg = new KotlinPackage(); pkg.functions = p.getFunctions().stream().map(KotlinFunction::fromKmFunction).collect(Collectors.toList()); + pkg.properties = + p.getProperties().stream().map(KotlinProperty::fromKmProperty).collect(Collectors.toList()); return pkg; } } diff --git a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinType.java b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinType.java index 8e91122ef..69af1b9ee 100644 --- a/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinType.java +++ b/pkgs/jnigen/java/src/main/java/com/github/dart_lang/jnigen/apisummarizer/elements/KotlinType.java @@ -6,6 +6,7 @@ import java.util.List; import java.util.stream.Collectors; +import kotlinx.metadata.Flag; import kotlinx.metadata.KmClassifier; import kotlinx.metadata.KmType; @@ -15,11 +16,14 @@ public class KotlinType { public String name; public int id; public List arguments; + public boolean isNullable; public static KotlinType fromKmType(KmType t) { if (t == null) return null; var type = new KotlinType(); type.flags = t.getFlags(); + // Processing the information needed from the flags. + type.isNullable = Flag.Type.IS_NULLABLE.invoke(type.flags); var classifier = t.getClassifier(); if (classifier instanceof KmClassifier.Class) { type.kind = "class"; diff --git a/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart b/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart index 53de1ed2d..b1539fa94 100644 --- a/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart +++ b/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart @@ -5,6 +5,31 @@ import '../elements/elements.dart'; import 'visitor.dart'; +String _toJavaBinaryName(String kotlinBinaryName) { + final binaryName = + kotlinBinaryName.replaceAll('.', r'$').replaceAll('/', '.'); + return const { + 'kotlin.Any': 'java.lang.Object', + 'kotlin.Byte': 'java.lang.Byte', + 'kotlin.Short': 'java.lang.Short', + 'kotlin.Int': 'java.lang.Integer', + 'kotlin.Long': 'java.lang.Long', + 'kotlin.Char': 'java.lang.Character', + 'kotlin.Float': 'java.lang.Float', + 'kotlin.Double': 'java.lang.Double', + 'kotlin.Boolean': 'java.lang.Boolean', + 'kotlin.Cloneable': 'java.lang.Cloneable', + 'kotlin.Comparable': 'java.lang.Comparable', + 'kotlin.Enum': 'java.lang.Enum', + 'kotlin.Annotation': 'java.lang.annotation.Annotation', + 'kotlin.CharSequence': 'java.lang.CharSequence', + 'kotlin.String': 'java.lang.String', + 'kotlin.Number': 'java.lang.Number', + 'kotlin.Throwable': 'java.lang.Throwable', + }[binaryName] ?? + binaryName; +} + /// A [Visitor] that adds the the information from Kotlin's metadata to the Java /// classes and methods. class KotlinProcessor extends Visitor { @@ -24,6 +49,46 @@ class _KotlinClassProcessor extends Visitor { return; } // This [ClassDecl] is actually a Kotlin class. + if (node.kotlinClass != null) { + for (var i = 0; i < node.kotlinClass!.typeParameters.length; ++i) { + node.typeParams[i].accept( + _KotlinTypeParamProcessor(node.kotlinClass!.typeParameters[i])); + } + if (node.superclass case final superClass?) { + final kotlinSuperTypes = node.kotlinClass!.superTypes.where( + (superType) => + _toJavaBinaryName(superType.name ?? '') == superClass.name, + ); + if (kotlinSuperTypes.isNotEmpty) { + superClass.accept(_KotlinTypeProcessor(kotlinSuperTypes.single)); + } + } + } + + // Matching fields and properties from the metadata. + final properties = {}; + final getters = {}; + final setters = {}; + final kotlinProperties = + (node.kotlinClass?.properties ?? node.kotlinPackage?.properties)!; + for (final property in kotlinProperties) { + if (property.fieldName case final fieldName?) { + properties[fieldName] = property; + } + if (property.getterName case final getterName?) { + final getterSignature = getterName + property.getterDescriptor!; + getters[getterSignature] = property; + } + if (property.setterName case final setterName?) { + final setterSignature = setterName + property.setterDescriptor!; + setters[setterSignature] = property; + } + } + for (final field in node.fields) { + if (properties[field.name] case final property?) { + field.accept(_KotlinPropertyProcessor(property)); + } + } // Matching methods and functions from the metadata. final functions = {}; final kotlinFunctions = @@ -32,15 +97,37 @@ class _KotlinClassProcessor extends Visitor { final signature = function.name + function.descriptor; functions[signature] = function; } + final constructors = {}; + final kotlinConstructors = node.kotlinClass?.constructors ?? []; + for (final constructor in kotlinConstructors) { + final signature = constructor.name + constructor.descriptor; + constructors[signature] = constructor; + } for (final method in node.methods) { final signature = method.name + method.descriptor!; - if (functions.containsKey(signature)) { - method.accept(_KotlinMethodProcessor(functions[signature]!)); + if (functions[signature] case final function?) { + method.accept(_KotlinMethodProcessor(function)); + } else if (constructors[signature] case final constructor?) { + method.accept(_KotlinConstructorProcessor(constructor)); + } else if (getters[signature] case final getter?) { + method.accept(_KotlinGetterProcessor(getter)); + } else if (setters[signature] case final setter?) { + method.accept(_KotlinSetterProcessor(setter)); } } } } +void _processParams( + List params, List kotlinParams) { + if (params.length != kotlinParams.length) { + return; + } + for (var i = 0; i < params.length; ++i) { + params[i].accept(_KotlinParamProcessor(kotlinParams[i])); + } +} + class _KotlinMethodProcessor extends Visitor { final KotlinFunction function; @@ -48,6 +135,11 @@ class _KotlinMethodProcessor extends Visitor { @override void visit(Method node) { + _processParams(node.params, function.valueParameters); + for (var i = 0; i < node.typeParams.length; ++i) { + node.typeParams[i] + .accept(_KotlinTypeParamProcessor(function.typeParameters[i])); + } if (function.isSuspend) { const kotlinContinutationType = 'kotlin.coroutines.Continuation'; assert(node.params.isNotEmpty && @@ -63,6 +155,135 @@ class _KotlinMethodProcessor extends Visitor { node.asyncReturnType = continuationType == null ? TypeUsage.object : continuationType.clone(); + node.asyncReturnType!.accept(_KotlinTypeProcessor(function.returnType)); + + // The continuation object is always non-null. + node.returnType.type.annotations ??= []; + node.returnType.type.annotations!.add(Annotation.nonNull); + } else { + node.returnType.accept(_KotlinTypeProcessor(function.returnType)); + } + } +} + +class _KotlinConstructorProcessor extends Visitor { + final KotlinConstructor constructor; + + _KotlinConstructorProcessor(this.constructor); + + @override + void visit(Method node) { + _processParams(node.params, constructor.valueParameters); + } +} + +class _KotlinGetterProcessor extends Visitor { + final KotlinProperty getter; + + _KotlinGetterProcessor(this.getter); + + @override + void visit(Method node) { + node.returnType.accept(_KotlinTypeProcessor(getter.returnType)); + } +} + +class _KotlinSetterProcessor extends Visitor { + final KotlinProperty setter; + + _KotlinSetterProcessor(this.setter); + + @override + void visit(Method node) { + if (setter.setterParameter case final setterParam?) { + node.params.single.type.accept(_KotlinTypeProcessor(setterParam.type)); } + node.params.single.type.accept(_KotlinTypeProcessor(setter.returnType)); + } +} + +class _KotlinPropertyProcessor extends Visitor { + final KotlinProperty property; + + _KotlinPropertyProcessor(this.property); + + @override + void visit(Field node) { + node.type.accept(_KotlinTypeProcessor(property.returnType)); + } +} + +class _KotlinParamProcessor extends Visitor { + final KotlinValueParameter kotlinParam; + + _KotlinParamProcessor(this.kotlinParam); + + @override + void visit(Param node) { + node.type.accept(_KotlinTypeProcessor(kotlinParam.type)); + } +} + +class _KotlinTypeParamProcessor extends Visitor { + final KotlinTypeParameter kotlinTypeParam; + + _KotlinTypeParamProcessor(this.kotlinTypeParam); + + @override + void visit(TypeParam node) { + final kotlinBounds = kotlinTypeParam.upperBounds; + final bounds = {}; + for (final bound in kotlinBounds) { + if (bound.name case final boundName?) { + bounds[_toJavaBinaryName(boundName)] = bound; + } + } + for (final bound in node.bounds) { + if (bounds[bound.name] case final kotlinBound?) { + bound.accept(_KotlinTypeProcessor(kotlinBound)); + } + } + } +} + +class _KotlinTypeProcessor extends TypeVisitor { + final KotlinType kotlinType; + + _KotlinTypeProcessor(this.kotlinType); + + @override + void visitDeclaredType(DeclaredType node) { + for (var i = 0; i < node.params.length; ++i) { + node.params[i].accept(_KotlinTypeProcessor(kotlinType.arguments[i].type)); + } + super.visitDeclaredType(node); + } + + @override + void visitArrayType(ArrayType node) { + if (kotlinType.arguments.isNotEmpty) { + node.elementType + .accept(_KotlinTypeProcessor(kotlinType.arguments.first.type)); + } + super.visitArrayType(node); + } + + @override + void visitWildcard(Wildcard node) { + node.extendsBound?.accept(_KotlinTypeProcessor(kotlinType)); + node.superBound?.accept(_KotlinTypeProcessor(kotlinType)); + super.visitWildcard(node); + } + + @override + void visitNonPrimitiveType(ReferredType node) { + node.annotations ??= []; + node.annotations! + .add(kotlinType.isNullable ? Annotation.nullable : Annotation.nonNull); + } + + @override + void visitPrimitiveType(PrimitiveType node) { + // Do nothing. } } diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart index 9ab4aa720..cbdbea653 100644 --- a/pkgs/jnigen/lib/src/elements/elements.dart +++ b/pkgs/jnigen/lib/src/elements/elements.dart @@ -21,9 +21,8 @@ abstract class Element> { R accept(Visitor v); } -@JsonEnum() - /// A kind describes the type of a declaration. +@JsonEnum() enum DeclKind { @JsonValue('CLASS') classKind, @@ -915,11 +914,39 @@ class Annotation implements Element { class KotlinClass implements Element { KotlinClass({ required this.name, + required this.moduleName, this.functions = const [], + this.properties = const [], + this.constructors = const [], + this.typeParameters = const [], + this.contextReceiverTypes = const [], + this.superTypes = const [], + this.nestedClasses = const [], + this.enumEntries = const [], + this.sealedClasses = const [], + required this.companionObject, + required this.inlineClassUnderlyingPropertyName, + required this.inlineClassUnderlyingType, + required this.flags, + required this.jvmFlags, }); final String name; + final String moduleName; final List functions; + final List properties; + final List constructors; + final List typeParameters; + final List contextReceiverTypes; + final List superTypes; + final List nestedClasses; + final List enumEntries; + final List sealedClasses; + final String? companionObject; + final String? inlineClassUnderlyingPropertyName; + final KotlinType? inlineClassUnderlyingType; + final int flags; + final int jvmFlags; factory KotlinClass.fromJson(Map json) => _$KotlinClassFromJson(json); @@ -934,9 +961,11 @@ class KotlinClass implements Element { class KotlinPackage implements Element { KotlinPackage({ this.functions = const [], + this.properties = const [], }); final List functions; + final List properties; factory KotlinPackage.fromJson(Map json) => _$KotlinPackageFromJson(json); @@ -948,28 +977,216 @@ class KotlinPackage implements Element { } @JsonSerializable(createToJson: false) -class KotlinFunction implements Element { +class KotlinFunction { KotlinFunction({ required this.name, required this.descriptor, required this.kotlinName, + this.valueParameters = const [], + required this.returnType, + this.receiverParameterType, + this.contextReceiverTypes = const [], + this.typeParameters = const [], + required this.flags, required this.isSuspend, }); + /// Name in the byte code. final String name; - - /// Used to match with [Method]'s descriptor. - /// - /// Creates a unique signature in combination with [name]. final String descriptor; + + /// Name in the Kotlin's metadata. final String kotlinName; + + final List valueParameters; + final KotlinType returnType; + final KotlinType? receiverParameterType; + final List contextReceiverTypes; + final List typeParameters; + final int flags; final bool isSuspend; factory KotlinFunction.fromJson(Map json) => _$KotlinFunctionFromJson(json); +} + +@JsonSerializable(createToJson: false) +class KotlinConstructor implements Element { + KotlinConstructor({ + required this.name, + required this.descriptor, + this.valueParameters = const [], + required this.flags, + }); + + final String name; + final String descriptor; + final List valueParameters; + final int flags; + + factory KotlinConstructor.fromJson(Map json) => + _$KotlinConstructorFromJson(json); + + @override + R accept(Visitor v) { + return v.visit(this); + } +} + +@JsonSerializable(createToJson: false) +class KotlinProperty implements Element { + KotlinProperty({ + this.fieldName, + this.fieldDescriptor, + this.getterName, + this.getterDescriptor, + this.setterName, + this.setterDescriptor, + required this.kotlinName, + required this.returnType, + required this.receiverParameterType, + this.contextReceiverTypes = const [], + required this.jvmFlags, + required this.flags, + required this.setterFlags, + required this.getterFlags, + this.typeParameters = const [], + required this.setterParameter, + }); + + final String? fieldName; + final String? fieldDescriptor; + + /// Getter's name in the byte code. + final String? getterName; + final String? getterDescriptor; + + /// Setter's name in the byte code. + final String? setterName; + final String? setterDescriptor; + + /// Name in the Kotlin's metadata. + final String kotlinName; + + final KotlinType returnType; + final KotlinType? receiverParameterType; + final List contextReceiverTypes; + final int jvmFlags; + final int flags; + final int setterFlags; + final int getterFlags; + final List typeParameters; + final KotlinValueParameter? setterParameter; + + factory KotlinProperty.fromJson(Map json) => + _$KotlinPropertyFromJson(json); + + @override + R accept(Visitor v) { + return v.visit(this); + } +} + +@JsonSerializable(createToJson: false) +class KotlinType implements Element { + KotlinType({ + required this.flags, + required this.kind, + required this.name, + required this.id, + required this.isNullable, + this.arguments = const [], + }); + + final int flags; + final String kind; + final String? name; + final int id; + final List arguments; + final bool isNullable; + + factory KotlinType.fromJson(Map json) => + _$KotlinTypeFromJson(json); + + @override + R accept(Visitor v) { + return v.visit(this); + } +} + +@JsonEnum() +enum KmVariance { + @JsonValue('INVARIANT') + invariant, + @JsonValue('IN') + contravariant, + @JsonValue('OUT') + covariant, +} + +@JsonSerializable(createToJson: false) +class KotlinTypeParameter implements Element { + KotlinTypeParameter({ + required this.name, + required this.id, + required this.flags, + this.upperBounds = const [], + required this.variance, + }); + + final String name; + final int id; + final int flags; + final List upperBounds; + final KmVariance variance; + + factory KotlinTypeParameter.fromJson(Map json) => + _$KotlinTypeParameterFromJson(json); + + @override + R accept(Visitor v) { + return v.visit(this); + } +} + +@JsonSerializable(createToJson: false) +class KotlinValueParameter implements Element { + KotlinValueParameter({ + required this.name, + required this.flags, + required this.type, + required this.varargElementType, + }); + + final String name; + final int flags; + final KotlinType type; + final KotlinType? varargElementType; + + factory KotlinValueParameter.fromJson(Map json) => + _$KotlinValueParameterFromJson(json); + + @override + R accept(Visitor v) { + return v.visit(this); + } +} + +@JsonSerializable(createToJson: false) +class KotlinTypeProjection implements Element { + KotlinTypeProjection({ + required this.type, + required this.variance, + }); + + final KotlinType type; + final KmVariance variance; + + factory KotlinTypeProjection.fromJson(Map json) => + _$KotlinTypeProjectionFromJson(json); @override - R accept(Visitor v) { + R accept(Visitor v) { return v.visit(this); } } diff --git a/pkgs/jnigen/lib/src/elements/elements.g.dart b/pkgs/jnigen/lib/src/elements/elements.g.dart index e981d2054..180741d65 100644 --- a/pkgs/jnigen/lib/src/elements/elements.g.dart +++ b/pkgs/jnigen/lib/src/elements/elements.g.dart @@ -8,9 +8,8 @@ part of 'elements.dart'; ClassDecl _$ClassDeclFromJson(Map json) => ClassDecl( annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), javadoc: json['javadoc'] == null ? null : JavaDocComment.fromJson(json['javadoc'] as Map), @@ -76,9 +75,8 @@ const _$KindEnumMap = { DeclaredType _$DeclaredTypeFromJson(Map json) => DeclaredType( binaryName: json['binaryName'] as String, annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), params: (json['params'] as List?) ?.map((e) => TypeUsage.fromJson(e as Map)) .toList() ?? @@ -88,9 +86,8 @@ DeclaredType _$DeclaredTypeFromJson(Map json) => DeclaredType( TypeVar _$TypeVarFromJson(Map json) => TypeVar( name: json['name'] as String, annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), ); Wildcard _$WildcardFromJson(Map json) => Wildcard( @@ -101,25 +98,22 @@ Wildcard _$WildcardFromJson(Map json) => Wildcard( ? null : TypeUsage.fromJson(json['superBound'] as Map), annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), ); ArrayType _$ArrayTypeFromJson(Map json) => ArrayType( elementType: TypeUsage.fromJson(json['elementType'] as Map), annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), ); Method _$MethodFromJson(Map json) => Method( annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), javadoc: json['javadoc'] == null ? null : JavaDocComment.fromJson(json['javadoc'] as Map), @@ -143,9 +137,8 @@ Method _$MethodFromJson(Map json) => Method( Param _$ParamFromJson(Map json) => Param( annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), javadoc: json['javadoc'] == null ? null : JavaDocComment.fromJson(json['javadoc'] as Map), @@ -155,9 +148,8 @@ Param _$ParamFromJson(Map json) => Param( Field _$FieldFromJson(Map json) => Field( annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), javadoc: json['javadoc'] == null ? null : JavaDocComment.fromJson(json['javadoc'] as Map), @@ -177,9 +169,8 @@ TypeParam _$TypeParamFromJson(Map json) => TypeParam( .toList() ?? const [], annotations: (json['annotations'] as List?) - ?.map((e) => Annotation.fromJson(e as Map)) - .toList() ?? - const [], + ?.map((e) => Annotation.fromJson(e as Map)) + .toList(), ); JavaDocComment _$JavaDocCommentFromJson(Map json) => @@ -200,10 +191,54 @@ Annotation _$AnnotationFromJson(Map json) => Annotation( KotlinClass _$KotlinClassFromJson(Map json) => KotlinClass( name: json['name'] as String, + moduleName: json['moduleName'] as String, functions: (json['functions'] as List?) ?.map((e) => KotlinFunction.fromJson(e as Map)) .toList() ?? const [], + properties: (json['properties'] as List?) + ?.map((e) => KotlinProperty.fromJson(e as Map)) + .toList() ?? + const [], + constructors: (json['constructors'] as List?) + ?.map( + (e) => KotlinConstructor.fromJson(e as Map)) + .toList() ?? + const [], + typeParameters: (json['typeParameters'] as List?) + ?.map((e) => + KotlinTypeParameter.fromJson(e as Map)) + .toList() ?? + const [], + contextReceiverTypes: (json['contextReceiverTypes'] as List?) + ?.map((e) => KotlinType.fromJson(e as Map)) + .toList() ?? + const [], + superTypes: (json['superTypes'] as List?) + ?.map((e) => KotlinType.fromJson(e as Map)) + .toList() ?? + const [], + nestedClasses: (json['nestedClasses'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + enumEntries: (json['enumEntries'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + sealedClasses: (json['sealedClasses'] as List?) + ?.map((e) => e as String) + .toList() ?? + const [], + companionObject: json['companionObject'] as String?, + inlineClassUnderlyingPropertyName: + json['inlineClassUnderlyingPropertyName'] as String?, + inlineClassUnderlyingType: json['inlineClassUnderlyingType'] == null + ? null + : KotlinType.fromJson( + json['inlineClassUnderlyingType'] as Map), + flags: (json['flags'] as num).toInt(), + jvmFlags: (json['jvmFlags'] as num).toInt(), ); KotlinPackage _$KotlinPackageFromJson(Map json) => @@ -212,6 +247,10 @@ KotlinPackage _$KotlinPackageFromJson(Map json) => ?.map((e) => KotlinFunction.fromJson(e as Map)) .toList() ?? const [], + properties: (json['properties'] as List?) + ?.map((e) => KotlinProperty.fromJson(e as Map)) + .toList() ?? + const [], ); KotlinFunction _$KotlinFunctionFromJson(Map json) => @@ -219,5 +258,122 @@ KotlinFunction _$KotlinFunctionFromJson(Map json) => name: json['name'] as String, descriptor: json['descriptor'] as String, kotlinName: json['kotlinName'] as String, + valueParameters: (json['valueParameters'] as List?) + ?.map((e) => + KotlinValueParameter.fromJson(e as Map)) + .toList() ?? + const [], + returnType: + KotlinType.fromJson(json['returnType'] as Map), + receiverParameterType: json['receiverParameterType'] == null + ? null + : KotlinType.fromJson( + json['receiverParameterType'] as Map), + contextReceiverTypes: (json['contextReceiverTypes'] as List?) + ?.map((e) => KotlinType.fromJson(e as Map)) + .toList() ?? + const [], + typeParameters: (json['typeParameters'] as List?) + ?.map((e) => + KotlinTypeParameter.fromJson(e as Map)) + .toList() ?? + const [], + flags: (json['flags'] as num).toInt(), isSuspend: json['isSuspend'] as bool, ); + +KotlinConstructor _$KotlinConstructorFromJson(Map json) => + KotlinConstructor( + name: json['name'] as String, + descriptor: json['descriptor'] as String, + valueParameters: (json['valueParameters'] as List?) + ?.map((e) => + KotlinValueParameter.fromJson(e as Map)) + .toList() ?? + const [], + flags: (json['flags'] as num).toInt(), + ); + +KotlinProperty _$KotlinPropertyFromJson(Map json) => + KotlinProperty( + fieldName: json['fieldName'] as String?, + fieldDescriptor: json['fieldDescriptor'] as String?, + getterName: json['getterName'] as String?, + getterDescriptor: json['getterDescriptor'] as String?, + setterName: json['setterName'] as String?, + setterDescriptor: json['setterDescriptor'] as String?, + kotlinName: json['kotlinName'] as String, + returnType: + KotlinType.fromJson(json['returnType'] as Map), + receiverParameterType: json['receiverParameterType'] == null + ? null + : KotlinType.fromJson( + json['receiverParameterType'] as Map), + contextReceiverTypes: (json['contextReceiverTypes'] as List?) + ?.map((e) => KotlinType.fromJson(e as Map)) + .toList() ?? + const [], + jvmFlags: (json['jvmFlags'] as num).toInt(), + flags: (json['flags'] as num).toInt(), + setterFlags: (json['setterFlags'] as num).toInt(), + getterFlags: (json['getterFlags'] as num).toInt(), + typeParameters: (json['typeParameters'] as List?) + ?.map((e) => + KotlinTypeParameter.fromJson(e as Map)) + .toList() ?? + const [], + setterParameter: json['setterParameter'] == null + ? null + : KotlinValueParameter.fromJson( + json['setterParameter'] as Map), + ); + +KotlinType _$KotlinTypeFromJson(Map json) => KotlinType( + flags: (json['flags'] as num).toInt(), + kind: json['kind'] as String, + name: json['name'] as String?, + id: (json['id'] as num).toInt(), + isNullable: json['isNullable'] as bool, + arguments: (json['arguments'] as List?) + ?.map((e) => + KotlinTypeProjection.fromJson(e as Map)) + .toList() ?? + const [], + ); + +KotlinTypeParameter _$KotlinTypeParameterFromJson(Map json) => + KotlinTypeParameter( + name: json['name'] as String, + id: (json['id'] as num).toInt(), + flags: (json['flags'] as num).toInt(), + upperBounds: (json['upperBounds'] as List?) + ?.map((e) => KotlinType.fromJson(e as Map)) + .toList() ?? + const [], + variance: $enumDecode(_$KmVarianceEnumMap, json['variance']), + ); + +const _$KmVarianceEnumMap = { + KmVariance.invariant: 'INVARIANT', + KmVariance.contravariant: 'IN', + KmVariance.covariant: 'OUT', +}; + +KotlinValueParameter _$KotlinValueParameterFromJson( + Map json) => + KotlinValueParameter( + name: json['name'] as String, + flags: (json['flags'] as num).toInt(), + type: KotlinType.fromJson(json['type'] as Map), + varargElementType: json['varargElementType'] == null + ? null + : KotlinType.fromJson( + json['varargElementType'] as Map), + ); + +KotlinTypeProjection _$KotlinTypeProjectionFromJson( + Map json) => + KotlinTypeProjection( + type: KotlinType.fromJson(json['type'] as Map), + variance: $enumDecode(_$KmVarianceEnumMap, json['variance']), + ); diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index 42b7ca029..d6769f1aa 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -40,7 +40,7 @@ import 'package:jni/_internal.dart' as _$jni; import 'package:jni/jni.dart' as _$jni; /// from: `com.github.dart_lang.jnigen.Measure` -class Measure<$T extends _$jni.JObject?> extends _$jni.JObject { +class Measure<$T extends _$jni.JObject> extends _$jni.JObject { @_$jni.internal @_$core.override final _$jni.JObjType> $type; @@ -59,7 +59,7 @@ class Measure<$T extends _$jni.JObject?> extends _$jni.JObject { _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Measure'); /// The type which includes information such as the signature of this class. - static $Measure$NullableType<$T> nullableType<$T extends _$jni.JObject?>( + static $Measure$NullableType<$T> nullableType<$T extends _$jni.JObject>( _$jni.JObjType<$T> T, ) { return $Measure$NullableType<$T>( @@ -67,7 +67,7 @@ class Measure<$T extends _$jni.JObject?> extends _$jni.JObject { ); } - static $Measure$Type<$T> type<$T extends _$jni.JObject?>( + static $Measure$Type<$T> type<$T extends _$jni.JObject>( _$jni.JObjType<$T> T, ) { return $Measure$Type<$T>( @@ -117,9 +117,9 @@ class Measure<$T extends _$jni.JObject?> extends _$jni.JObject { /// from: `public T getUnit()` /// The returned object must be released after use, by calling the [release] method. - $T? getUnit() { + $T getUnit() { return _getUnit(reference.pointer, _id_getUnit as _$jni.JMethodIDPtr) - .object<$T?>(T.nullableType); + .object<$T>(T); } static final _id_convertValue = _class.instanceMethodId( @@ -140,16 +140,16 @@ class Measure<$T extends _$jni.JObject?> extends _$jni.JObject { /// from: `public final float convertValue(T measureUnit)` double convertValue( - $T? measureUnit, + $T measureUnit, ) { - final _$measureUnit = measureUnit?.reference ?? _$jni.jNullReference; + final _$measureUnit = measureUnit.reference; return _convertValue(reference.pointer, _id_convertValue as _$jni.JMethodIDPtr, _$measureUnit.pointer) .float; } } -final class $Measure$NullableType<$T extends _$jni.JObject?> +final class $Measure$NullableType<$T extends _$jni.JObject> extends _$jni.JObjType?> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -173,7 +173,7 @@ final class $Measure$NullableType<$T extends _$jni.JObject?> ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override @@ -194,7 +194,7 @@ final class $Measure$NullableType<$T extends _$jni.JObject?> } } -final class $Measure$Type<$T extends _$jni.JObject?> +final class $Measure$Type<$T extends _$jni.JObject> extends _$jni.JObjType> { @_$jni.internal final _$jni.JObjType<$T> T; @@ -217,7 +217,7 @@ final class $Measure$Type<$T extends _$jni.JObject?> ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override @@ -275,224 +275,1299 @@ class MeasureUnit extends _$jni.JObject { /// from: `public abstract java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getSign() { + _$jni.JString getSign() { return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) + .object<_$jni.JString>(const _$jni.JStringType()); + } + + static final _id_getCoefficient = _class.instanceMethodId( + r'getCoefficient', + r'()F', + ); + + static final _getCoefficient = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallFloatMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public abstract float getCoefficient()` + double getCoefficient() { + return _getCoefficient( + reference.pointer, _id_getCoefficient as _$jni.JMethodIDPtr) + .float; + } + + /// Maps a specific port to the implemented interface. + static final _$core.Map _$impls = {}; + static _$jni.JObjectPtr _$invoke( + int port, + _$jni.JObjectPtr descriptor, + _$jni.JObjectPtr args, + ) { + return _$invokeMethod( + port, + _$jni.MethodInvocation.fromAddresses( + 0, + descriptor.address, + args.address, + ), + ); + } + + static final _$jni.Pointer< + _$jni.NativeFunction< + _$jni.JObjectPtr Function( + _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> + _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + + static _$jni.Pointer<_$jni.Void> _$invokeMethod( + int $p, + _$jni.MethodInvocation $i, + ) { + try { + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); + final $a = $i.args; + if ($d == r'getSign()Ljava/lang/String;') { + final $r = _$impls[$p]!.getSign(); + return ($r as _$jni.JObject?) + ?.as(const _$jni.JObjectType()) + .reference + .toPointer() ?? + _$jni.nullptr; + } + if ($d == r'getCoefficient()F') { + final $r = _$impls[$p]!.getCoefficient(); + return _$jni.JFloat($r).reference.toPointer(); + } + } catch (e) { + return _$jni.ProtectedJniExtensions.newDartException(e); + } + return _$jni.nullptr; + } + + static void implementIn( + _$jni.JImplementer implementer, + $MeasureUnit $impl, + ) { + late final _$jni.RawReceivePort $p; + $p = _$jni.RawReceivePort(($m) { + if ($m == null) { + _$impls.remove($p.sendPort.nativePort); + $p.close(); + return; + } + final $i = _$jni.MethodInvocation.fromMessage($m); + final $r = _$invokeMethod($p.sendPort.nativePort, $i); + _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + }); + implementer.add( + r'com.github.dart_lang.jnigen.MeasureUnit', + $p, + _$invokePointer, + [], + ); + final $a = $p.sendPort.nativePort; + _$impls[$a] = $impl; + } + + factory MeasureUnit.implement( + $MeasureUnit $impl, + ) { + final $i = _$jni.JImplementer(); + implementIn($i, $impl); + return MeasureUnit.fromReference( + $i.implementReference(), + ); + } +} + +abstract base mixin class $MeasureUnit { + factory $MeasureUnit({ + required _$jni.JString Function() getSign, + required double Function() getCoefficient, + }) = _$MeasureUnit; + + _$jni.JString getSign(); + double getCoefficient(); +} + +final class _$MeasureUnit with $MeasureUnit { + _$MeasureUnit({ + required _$jni.JString Function() getSign, + required double Function() getCoefficient, + }) : _getSign = getSign, + _getCoefficient = getCoefficient; + + final _$jni.JString Function() _getSign; + final double Function() _getCoefficient; + + _$jni.JString getSign() { + return _getSign(); + } + + double getCoefficient() { + return _getCoefficient(); + } +} + +final class $MeasureUnit$NullableType extends _$jni.JObjType { + @_$jni.internal + const $MeasureUnit$NullableType(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; + + @_$jni.internal + @_$core.override + MeasureUnit? fromReference(_$jni.JReference reference) => reference.isNull + ? null + : MeasureUnit.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MeasureUnit$NullableType).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MeasureUnit$NullableType) && + other is $MeasureUnit$NullableType; + } +} + +final class $MeasureUnit$Type extends _$jni.JObjType { + @_$jni.internal + const $MeasureUnit$Type(); + + @_$jni.internal + @_$core.override + String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; + + @_$jni.internal + @_$core.override + MeasureUnit fromReference(_$jni.JReference reference) => + MeasureUnit.fromReference( + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType get nullableType => + const $MeasureUnit$NullableType(); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => ($MeasureUnit$Type).hashCode; + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($MeasureUnit$Type) && + other is $MeasureUnit$Type; + } +} + +/// from: `com.github.dart_lang.jnigen.Nullability$InnerClass` +class Nullability_InnerClass<$T extends _$jni.JObject?, + $U extends _$jni.JObject, $V extends _$jni.JObject?> extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + Nullability_InnerClass.fromReference( + this.T, + this.U, + this.V, + _$jni.JReference reference, + ) : $type = type<$T, $U, $V>(T, U, V), + super.fromReference(reference); + + static final _class = _$jni.JClass.forName( + r'com/github/dart_lang/jnigen/Nullability$InnerClass'); + + /// The type which includes information such as the signature of this class. + static $Nullability_InnerClass$NullableType<$T, $U, $V> nullableType< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $V extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + _$jni.JObjType<$V> V, + ) { + return $Nullability_InnerClass$NullableType<$T, $U, $V>( + T, + U, + V, + ); + } + + static $Nullability_InnerClass$Type<$T, $U, $V> type< + $T extends _$jni.JObject?, + $U extends _$jni.JObject, + $V extends _$jni.JObject?>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + _$jni.JObjType<$V> V, + ) { + return $Nullability_InnerClass$Type<$T, $U, $V>( + T, + U, + V, + ); + } + + static final _id_new$ = _class.constructorId( + r'(Lcom/github/dart_lang/jnigen/Nullability;)V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public void (com.github.dart_lang.jnigen.Nullability $outerClass)` + /// The returned object must be released after use, by calling the [release] method. + factory Nullability_InnerClass( + Nullability<$T?, $U> $outerClass, { + _$jni.JObjType<$T>? T, + _$jni.JObjType<$U>? U, + required _$jni.JObjType<$V> V, + }) { + T ??= _$jni.lowestCommonSuperType([ + ($outerClass.$type as $Nullability$Type<_$core.dynamic, _$core.dynamic>) + .T, + ]) as _$jni.JObjType<$T>; + U ??= _$jni.lowestCommonSuperType([ + ($outerClass.$type as $Nullability$Type<_$core.dynamic, _$core.dynamic>) + .U, + ]) as _$jni.JObjType<$U>; + final _$$outerClass = $outerClass.reference; + return Nullability_InnerClass<$T, $U, $V>.fromReference( + T, + U, + V, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _$$outerClass.pointer) + .reference); + } + + static final _id_f = _class.instanceMethodId( + r'f', + r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V', + ); + + static final _f = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final void f(T object, U object1, V object2)` + void f( + $T object, + $U object1, + $V object2, + ) { + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1.reference; + final _$object2 = object2?.reference ?? _$jni.jNullReference; + _f(reference.pointer, _id_f as _$jni.JMethodIDPtr, _$object.pointer, + _$object1.pointer, _$object2.pointer) + .check(); + } +} + +final class $Nullability_InnerClass$NullableType<$T extends _$jni.JObject?, + $U extends _$jni.JObject, $V extends _$jni.JObject?> + extends _$jni.JObjType?> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $Nullability_InnerClass$NullableType( + this.T, + this.U, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/Nullability$InnerClass;'; + + @_$jni.internal + @_$core.override + Nullability_InnerClass<$T, $U, $V>? fromReference( + _$jni.JReference reference) => + reference.isNull + ? null + : Nullability_InnerClass<$T, $U, $V>.fromReference( + T, + U, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => this; + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => + Object.hash($Nullability_InnerClass$NullableType, T, U, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == + ($Nullability_InnerClass$NullableType<$T, $U, $V>) && + other is $Nullability_InnerClass$NullableType<$T, $U, $V> && + T == other.T && + U == other.U && + V == other.V; + } +} + +final class $Nullability_InnerClass$Type<$T extends _$jni.JObject?, + $U extends _$jni.JObject, $V extends _$jni.JObject?> + extends _$jni.JObjType> { + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + final _$jni.JObjType<$V> V; + + @_$jni.internal + const $Nullability_InnerClass$Type( + this.T, + this.U, + this.V, + ); + + @_$jni.internal + @_$core.override + String get signature => + r'Lcom/github/dart_lang/jnigen/Nullability$InnerClass;'; + + @_$jni.internal + @_$core.override + Nullability_InnerClass<$T, $U, $V> fromReference( + _$jni.JReference reference) => + Nullability_InnerClass<$T, $U, $V>.fromReference( + T, + U, + V, + reference, + ); + @_$jni.internal + @_$core.override + _$jni.JObjType get superType => const _$jni.JObjectType(); + + @_$jni.internal + @_$core.override + _$jni.JObjType?> get nullableType => + $Nullability_InnerClass$NullableType<$T, $U, $V>(T, U, V); + + @_$jni.internal + @_$core.override + final superCount = 1; + + @_$core.override + int get hashCode => Object.hash($Nullability_InnerClass$Type, T, U, V); + + @_$core.override + bool operator ==(Object other) { + return other.runtimeType == ($Nullability_InnerClass$Type<$T, $U, $V>) && + other is $Nullability_InnerClass$Type<$T, $U, $V> && + T == other.T && + U == other.U && + V == other.V; + } +} + +/// from: `com.github.dart_lang.jnigen.Nullability` +class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> + extends _$jni.JObject { + @_$jni.internal + @_$core.override + final _$jni.JObjType> $type; + + @_$jni.internal + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + Nullability.fromReference( + this.T, + this.U, + _$jni.JReference reference, + ) : $type = type<$T, $U>(T, U), + super.fromReference(reference); + + static final _class = + _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Nullability'); + + /// The type which includes information such as the signature of this class. + static $Nullability$NullableType<$T, $U> + nullableType<$T extends _$jni.JObject?, $U extends _$jni.JObject>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + ) { + return $Nullability$NullableType<$T, $U>( + T, + U, + ); + } + + static $Nullability$Type<$T, $U> + type<$T extends _$jni.JObject?, $U extends _$jni.JObject>( + _$jni.JObjType<$T> T, + _$jni.JObjType<$U> U, + ) { + return $Nullability$Type<$T, $U>( + T, + U, + ); + } + + static final _id_new$ = _class.constructorId( + r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V', + ); + + static final _new$ = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs< + ( + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void> + )>)>>('globalEnv_NewObject') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>, + _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public void (T object, U object1, U object2)` + /// The returned object must be released after use, by calling the [release] method. + factory Nullability( + $T object, + $U object1, + $U? object2, { + required _$jni.JObjType<$T> T, + _$jni.JObjType<$U>? U, + }) { + U ??= _$jni.lowestCommonSuperType([ + object1.$type, + ]) as _$jni.JObjType<$U>; + final _$object = object?.reference ?? _$jni.jNullReference; + final _$object1 = object1.reference; + final _$object2 = object2?.reference ?? _$jni.jNullReference; + return Nullability<$T, $U>.fromReference( + T, + U, + _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _$object.pointer, _$object1.pointer, _$object2.pointer) + .reference); + } + + static final _id_getT = _class.instanceMethodId( + r'getT', + r'()Ljava/lang/Object;', + ); + + static final _getT = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public final T getT()` + /// The returned object must be released after use, by calling the [release] method. + $T getT() { + return _getT(reference.pointer, _id_getT as _$jni.JMethodIDPtr) + .object<$T>(T); + } + + static final _id_getU = _class.instanceMethodId( + r'getU', + r'()Ljava/lang/Object;', + ); + + static final _getU = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public final U getU()` + /// The returned object must be released after use, by calling the [release] method. + $U getU() { + return _getU(reference.pointer, _id_getU as _$jni.JMethodIDPtr) + .object<$U>(U); + } + + static final _id_getNullableU = _class.instanceMethodId( + r'getNullableU', + r'()Ljava/lang/Object;', + ); + + static final _getNullableU = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public final U getNullableU()` + /// The returned object must be released after use, by calling the [release] method. + $U? getNullableU() { + return _getNullableU( + reference.pointer, _id_getNullableU as _$jni.JMethodIDPtr) + .object<$U?>(U.nullableType); + } + + static final _id_setNullableU = _class.instanceMethodId( + r'setNullableU', + r'(Ljava/lang/Object;)V', + ); + + static final _setNullableU = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JThrowablePtr Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final void setNullableU(U object)` + void setNullableU( + $U? object, + ) { + final _$object = object?.reference ?? _$jni.jNullReference; + _setNullableU(reference.pointer, _id_setNullableU as _$jni.JMethodIDPtr, + _$object.pointer) + .check(); + } + + static final _id_hello = _class.instanceMethodId( + r'hello', + r'()Ljava/lang/String;', + ); + + static final _hello = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + )>(); + + /// from: `public final java.lang.String hello()` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString hello() { + return _hello(reference.pointer, _id_hello as _$jni.JMethodIDPtr) + .object<_$jni.JString>(const _$jni.JStringType()); + } + + static final _id_nullableHello = _class.instanceMethodId( + r'nullableHello', + r'(Z)Ljava/lang/String;', + ); + + static final _nullableHello = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + + /// from: `public final java.lang.String nullableHello(boolean z)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString? nullableHello( + bool z, + ) { + return _nullableHello(reference.pointer, + _id_nullableHello as _$jni.JMethodIDPtr, z ? 1 : 0) + .object<_$jni.JString?>(const _$jni.JStringNullableType()); + } + + static final _id_methodGenericEcho = _class.instanceMethodId( + r'methodGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _methodGenericEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final V methodGenericEcho(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericEcho<$V extends _$jni.JObject>( + $V object, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + object.$type, + ]) as _$jni.JObjType<$V>; + final _$object = object.reference; + return _methodGenericEcho(reference.pointer, + _id_methodGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + .object<$V>(V); + } + + static final _id_methodGenericNullableEcho = _class.instanceMethodId( + r'methodGenericNullableEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _methodGenericNullableEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final V methodGenericNullableEcho(V object)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericNullableEcho<$V extends _$jni.JObject?>( + $V object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _methodGenericNullableEcho( + reference.pointer, + _id_methodGenericNullableEcho as _$jni.JMethodIDPtr, + _$object.pointer) + .object<$V>(V); + } + + static final _id_classGenericEcho = _class.instanceMethodId( + r'classGenericEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _classGenericEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final U classGenericEcho(U object)` + /// The returned object must be released after use, by calling the [release] method. + $U classGenericEcho( + $U object, + ) { + final _$object = object.reference; + return _classGenericEcho(reference.pointer, + _id_classGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + .object<$U>(U); + } + + static final _id_classGenericNullableEcho = _class.instanceMethodId( + r'classGenericNullableEcho', + r'(Ljava/lang/Object;)Ljava/lang/Object;', + ); + + static final _classGenericNullableEcho = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final T classGenericNullableEcho(T object)` + /// The returned object must be released after use, by calling the [release] method. + $T classGenericNullableEcho( + $T object, + ) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _classGenericNullableEcho( + reference.pointer, + _id_classGenericNullableEcho as _$jni.JMethodIDPtr, + _$object.pointer) + .object<$T>(T); + } + + static final _id_firstOf = _class.instanceMethodId( + r'firstOf', + r'(Ljava/util/List;)Ljava/lang/String;', + ); + + static final _firstOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.lang.String firstOf(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString firstOf( + _$jni.JList<_$jni.JString> list, + ) { + final _$list = list.reference; + return _firstOf(reference.pointer, _id_firstOf as _$jni.JMethodIDPtr, + _$list.pointer) + .object<_$jni.JString>(const _$jni.JStringType()); + } + + static final _id_firstOfNullable = _class.instanceMethodId( + r'firstOfNullable', + r'(Ljava/util/List;)Ljava/lang/String;', + ); + + static final _firstOfNullable = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.lang.String firstOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JString? firstOfNullable( + _$jni.JList<_$jni.JString?> list, + ) { + final _$list = list.reference; + return _firstOfNullable(reference.pointer, + _id_firstOfNullable as _$jni.JMethodIDPtr, _$list.pointer) .object<_$jni.JString?>(const _$jni.JStringNullableType()); } - static final _id_getCoefficient = _class.instanceMethodId( - r'getCoefficient', - r'()F', + static final _id_classGenericFirstOf = _class.instanceMethodId( + r'classGenericFirstOf', + r'(Ljava/util/List;)Ljava/lang/Object;', ); - static final _getCoefficient = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>>('globalEnv_CallFloatMethod') + static final _classGenericFirstOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - )>(); + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - /// from: `public abstract float getCoefficient()` - double getCoefficient() { - return _getCoefficient( - reference.pointer, _id_getCoefficient as _$jni.JMethodIDPtr) - .float; + /// from: `public final U classGenericFirstOf(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $U classGenericFirstOf( + _$jni.JList<$U> list, + ) { + final _$list = list.reference; + return _classGenericFirstOf(reference.pointer, + _id_classGenericFirstOf as _$jni.JMethodIDPtr, _$list.pointer) + .object<$U>(U); } - /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( - int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + static final _id_classGenericFirstOfNullable = _class.instanceMethodId( + r'classGenericFirstOfNullable', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _classGenericFirstOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final T classGenericFirstOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $T classGenericFirstOfNullable( + _$jni.JList<$T> list, ) { - return _$invokeMethod( - port, - _$jni.MethodInvocation.fromAddresses( - 0, - descriptor.address, - args.address, - ), - ); + final _$list = list.reference; + return _classGenericFirstOfNullable( + reference.pointer, + _id_classGenericFirstOfNullable as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$T>(T); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final _id_methodGenericFirstOf = _class.instanceMethodId( + r'methodGenericFirstOf', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( - int $p, - _$jni.MethodInvocation $i, + static final _methodGenericFirstOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final V methodGenericFirstOf(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericFirstOf<$V extends _$jni.JObject>( + _$jni.JList<$V> list, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (list.$type as _$jni.JListType<_$core.dynamic>).E, + ]) as _$jni.JObjType<$V>; + final _$list = list.reference; + return _methodGenericFirstOf(reference.pointer, + _id_methodGenericFirstOf as _$jni.JMethodIDPtr, _$list.pointer) + .object<$V>(V); + } + + static final _id_methodGenericFirstOfNullable = _class.instanceMethodId( + r'methodGenericFirstOfNullable', + r'(Ljava/util/List;)Ljava/lang/Object;', + ); + + static final _methodGenericFirstOfNullable = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final V methodGenericFirstOfNullable(java.util.List list)` + /// The returned object must be released after use, by calling the [release] method. + $V methodGenericFirstOfNullable<$V extends _$jni.JObject?>( + _$jni.JList<$V> list, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + (list.$type as _$jni.JListType<_$core.dynamic>).E, + ]) as _$jni.JObjType<$V>; + final _$list = list.reference; + return _methodGenericFirstOfNullable( + reference.pointer, + _id_methodGenericFirstOfNullable as _$jni.JMethodIDPtr, + _$list.pointer) + .object<$V>(V); + } + + static final _id_stringListOf = _class.instanceMethodId( + r'stringListOf', + r'(Ljava/lang/String;)Ljava/util/List;', + ); + + static final _stringListOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.util.List stringListOf(java.lang.String string)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JString> stringListOf( + _$jni.JString string, ) { - try { - final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); - final $a = $i.args; - if ($d == r'getSign()Ljava/lang/String;') { - final $r = _$impls[$p]!.getSign(); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) - .reference - .toPointer() ?? - _$jni.nullptr; - } - if ($d == r'getCoefficient()F') { - final $r = _$impls[$p]!.getCoefficient(); - return _$jni.JFloat($r).reference.toPointer(); - } - } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); - } - return _$jni.nullptr; + final _$string = string.reference; + return _stringListOf(reference.pointer, + _id_stringListOf as _$jni.JMethodIDPtr, _$string.pointer) + .object<_$jni.JList<_$jni.JString>>( + const _$jni.JListType<_$jni.JString>(_$jni.JStringType())); } - static void implementIn( - _$jni.JImplementer implementer, - $MeasureUnit $impl, + static final _id_nullableListOf = _class.instanceMethodId( + r'nullableListOf', + r'(Ljava/lang/String;)Ljava/util/List;', + ); + + static final _nullableListOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.util.List nullableListOf(java.lang.String string)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<_$jni.JString?> nullableListOf( + _$jni.JString? string, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { - if ($m == null) { - _$impls.remove($p.sendPort.nativePort); - $p.close(); - return; - } - final $i = _$jni.MethodInvocation.fromMessage($m); - final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); - }); - implementer.add( - r'com.github.dart_lang.jnigen.MeasureUnit', - $p, - _$invokePointer, - [], - ); - final $a = $p.sendPort.nativePort; - _$impls[$a] = $impl; + final _$string = string?.reference ?? _$jni.jNullReference; + return _nullableListOf(reference.pointer, + _id_nullableListOf as _$jni.JMethodIDPtr, _$string.pointer) + .object<_$jni.JList<_$jni.JString?>>( + const _$jni.JListType<_$jni.JString?>(_$jni.JStringNullableType())); } - factory MeasureUnit.implement( - $MeasureUnit $impl, + static final _id_classGenericListOf = _class.instanceMethodId( + r'classGenericListOf', + r'(Ljava/lang/Object;)Ljava/util/List;', + ); + + static final _classGenericListOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.util.List classGenericListOf(U object)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$U> classGenericListOf( + $U object, ) { - final $i = _$jni.JImplementer(); - implementIn($i, $impl); - return MeasureUnit.fromReference( - $i.implementReference(), - ); + final _$object = object.reference; + return _classGenericListOf(reference.pointer, + _id_classGenericListOf as _$jni.JMethodIDPtr, _$object.pointer) + .object<_$jni.JList<$U>>(_$jni.JListType<$U>(U)); } -} -abstract base mixin class $MeasureUnit { - factory $MeasureUnit({ - required _$jni.JString? Function() getSign, - required double Function() getCoefficient, - }) = _$MeasureUnit; + static final _id_classGenericNullableListOf = _class.instanceMethodId( + r'classGenericNullableListOf', + r'(Ljava/lang/Object;)Ljava/util/List;', + ); - _$jni.JString? getSign(); - double getCoefficient(); -} + static final _classGenericNullableListOf = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.util.List classGenericNullableListOf(T object)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$T> classGenericNullableListOf( + $T object, + ) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _classGenericNullableListOf( + reference.pointer, + _id_classGenericNullableListOf as _$jni.JMethodIDPtr, + _$object.pointer) + .object<_$jni.JList<$T>>(_$jni.JListType<$T>(T)); + } -final class _$MeasureUnit with $MeasureUnit { - _$MeasureUnit({ - required _$jni.JString? Function() getSign, - required double Function() getCoefficient, - }) : _getSign = getSign, - _getCoefficient = getCoefficient; + static final _id_methodGenericListOf = _class.instanceMethodId( + r'methodGenericListOf', + r'(Ljava/lang/Object;)Ljava/util/List;', + ); - final _$jni.JString? Function() _getSign; - final double Function() _getCoefficient; + static final _methodGenericListOf = _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); - _$jni.JString? getSign() { - return _getSign(); + /// from: `public final java.util.List methodGenericListOf(V object)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$V> methodGenericListOf<$V extends _$jni.JObject>( + $V object, { + _$jni.JObjType<$V>? V, + }) { + V ??= _$jni.lowestCommonSuperType([ + object.$type, + ]) as _$jni.JObjType<$V>; + final _$object = object.reference; + return _methodGenericListOf(reference.pointer, + _id_methodGenericListOf as _$jni.JMethodIDPtr, _$object.pointer) + .object<_$jni.JList<$V>>(_$jni.JListType<$V>(V)); } - double getCoefficient() { - return _getCoefficient(); + static final _id_methodGenericNullableListOf = _class.instanceMethodId( + r'methodGenericNullableListOf', + r'(Ljava/lang/Object;)Ljava/util/List;', + ); + + static final _methodGenericNullableListOf = + _$jni.ProtectedJniExtensions.lookup< + _$jni.NativeFunction< + _$jni.JniResult Function( + _$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, + _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, + _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + + /// from: `public final java.util.List methodGenericNullableListOf(V object)` + /// The returned object must be released after use, by calling the [release] method. + _$jni.JList<$V> methodGenericNullableListOf<$V extends _$jni.JObject?>( + $V object, { + required _$jni.JObjType<$V> V, + }) { + final _$object = object?.reference ?? _$jni.jNullReference; + return _methodGenericNullableListOf( + reference.pointer, + _id_methodGenericNullableListOf as _$jni.JMethodIDPtr, + _$object.pointer) + .object<_$jni.JList<$V>>(_$jni.JListType<$V>(V)); } } -final class $MeasureUnit$NullableType extends _$jni.JObjType { +final class $Nullability$NullableType<$T extends _$jni.JObject?, + $U extends _$jni.JObject> extends _$jni.JObjType?> { @_$jni.internal - const $MeasureUnit$NullableType(); + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + const $Nullability$NullableType( + this.T, + this.U, + ); @_$jni.internal @_$core.override - String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; + String get signature => r'Lcom/github/dart_lang/jnigen/Nullability;'; @_$jni.internal @_$core.override - MeasureUnit? fromReference(_$jni.JReference reference) => reference.isNull - ? null - : MeasureUnit.fromReference( - reference, - ); + Nullability<$T, $U>? fromReference(_$jni.JReference reference) => + reference.isNull + ? null + : Nullability<$T, $U>.fromReference( + T, + U, + reference, + ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override - _$jni.JObjType get nullableType => this; + _$jni.JObjType?> get nullableType => this; @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => ($MeasureUnit$NullableType).hashCode; + int get hashCode => Object.hash($Nullability$NullableType, T, U); @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MeasureUnit$NullableType) && - other is $MeasureUnit$NullableType; + return other.runtimeType == ($Nullability$NullableType<$T, $U>) && + other is $Nullability$NullableType<$T, $U> && + T == other.T && + U == other.U; } } -final class $MeasureUnit$Type extends _$jni.JObjType { +final class $Nullability$Type<$T extends _$jni.JObject?, + $U extends _$jni.JObject> extends _$jni.JObjType> { @_$jni.internal - const $MeasureUnit$Type(); + final _$jni.JObjType<$T> T; + + @_$jni.internal + final _$jni.JObjType<$U> U; + + @_$jni.internal + const $Nullability$Type( + this.T, + this.U, + ); @_$jni.internal @_$core.override - String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; + String get signature => r'Lcom/github/dart_lang/jnigen/Nullability;'; @_$jni.internal @_$core.override - MeasureUnit fromReference(_$jni.JReference reference) => - MeasureUnit.fromReference( + Nullability<$T, $U> fromReference(_$jni.JReference reference) => + Nullability<$T, $U>.fromReference( + T, + U, reference, ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override - _$jni.JObjType get nullableType => - const $MeasureUnit$NullableType(); + _$jni.JObjType?> get nullableType => + $Nullability$NullableType<$T, $U>(T, U); @_$jni.internal @_$core.override final superCount = 1; @_$core.override - int get hashCode => ($MeasureUnit$Type).hashCode; + int get hashCode => Object.hash($Nullability$Type, T, U); @_$core.override bool operator ==(Object other) { - return other.runtimeType == ($MeasureUnit$Type) && - other is $MeasureUnit$Type; + return other.runtimeType == ($Nullability$Type<$T, $U>) && + other is $Nullability$Type<$T, $U> && + T == other.T && + U == other.U; } } /// from: `com.github.dart_lang.jnigen.Speed` -class Speed extends Measure { +class Speed extends Measure { @_$jni.internal @_$core.override final _$jni.JObjType $type; @@ -501,7 +1576,7 @@ class Speed extends Measure { Speed.fromReference( _$jni.JReference reference, ) : $type = type, - super.fromReference(const $SpeedUnit$NullableType(), reference); + super.fromReference(const $SpeedUnit$Type(), reference); static final _class = _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Speed'); @@ -531,9 +1606,9 @@ class Speed extends Measure { /// The returned object must be released after use, by calling the [release] method. factory Speed( double f, - SpeedUnit? speedUnit, + SpeedUnit speedUnit, ) { - final _$speedUnit = speedUnit?.reference ?? _$jni.jNullReference; + final _$speedUnit = speedUnit.reference; return Speed.fromReference(_new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, f, _$speedUnit.pointer) .reference); @@ -581,9 +1656,9 @@ class Speed extends Measure { /// from: `public com.github.dart_lang.jnigen.SpeedUnit getUnit()` /// The returned object must be released after use, by calling the [release] method. - SpeedUnit? getUnit$1() { + SpeedUnit getUnit$1() { return _getUnit$1(reference.pointer, _id_getUnit$1 as _$jni.JMethodIDPtr) - .object(const $SpeedUnit$NullableType()); + .object(const $SpeedUnit$Type()); } static final _id_toString$1 = _class.instanceMethodId( @@ -605,9 +1680,9 @@ class Speed extends Measure { /// from: `public java.lang.String toString()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? toString$1() { + _$jni.JString toString$1() { return _toString$1(reference.pointer, _id_toString$1 as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + .object<_$jni.JString>(const _$jni.JStringType()); } static final _id_component1 = _class.instanceMethodId( @@ -652,9 +1727,9 @@ class Speed extends Measure { /// from: `public final com.github.dart_lang.jnigen.SpeedUnit component2()` /// The returned object must be released after use, by calling the [release] method. - SpeedUnit? component2() { + SpeedUnit component2() { return _component2(reference.pointer, _id_component2 as _$jni.JMethodIDPtr) - .object(const $SpeedUnit$NullableType()); + .object(const $SpeedUnit$Type()); } static final _id_copy = _class.instanceMethodId( @@ -678,14 +1753,14 @@ class Speed extends Measure { /// from: `public final com.github.dart_lang.jnigen.Speed copy(float f, com.github.dart_lang.jnigen.SpeedUnit speedUnit)` /// The returned object must be released after use, by calling the [release] method. - Speed? copy( + Speed copy( double f, - SpeedUnit? speedUnit, + SpeedUnit speedUnit, ) { - final _$speedUnit = speedUnit?.reference ?? _$jni.jNullReference; + final _$speedUnit = speedUnit.reference; return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr, f, _$speedUnit.pointer) - .object(const $Speed$NullableType()); + .object(const $Speed$Type()); } static final _id_hashCode$1 = _class.instanceMethodId( @@ -756,7 +1831,7 @@ final class $Speed$NullableType extends _$jni.JObjType { @_$jni.internal @_$core.override _$jni.JObjType get superType => - const $Measure$NullableType($SpeedUnit$NullableType()); + const $Measure$Type($SpeedUnit$Type()); @_$jni.internal @_$core.override @@ -792,7 +1867,7 @@ final class $Speed$Type extends _$jni.JObjType { @_$jni.internal @_$core.override _$jni.JObjType get superType => - const $Measure$NullableType($SpeedUnit$NullableType()); + const $Measure$Type($SpeedUnit$Type()); @_$jni.internal @_$core.override @@ -868,9 +1943,9 @@ class SpeedUnit extends _$jni.JObject { /// from: `public java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getSign() { + _$jni.JString getSign() { return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + .object<_$jni.JString>(const _$jni.JStringType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -968,7 +2043,7 @@ final class $SpeedUnit$NullableType extends _$jni.JObjType { ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override @@ -1004,7 +2079,7 @@ final class $SpeedUnit$Type extends _$jni.JObjType { ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override @@ -1084,23 +2159,23 @@ class SuspendFun extends _$jni.JObject { /// from: `public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString?> sayHello() async { + _$core.Future<_$jni.JString> sayHello() async { final $p = _$jni.ReceivePort(); final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); _sayHello(reference.pointer, _id_sayHello as _$jni.JMethodIDPtr, _$continuation.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object<_$jni.JObject>(const _$jni.JObjectType()); _$continuation.release(); final $o = _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringNullableType().jClass.reference; + final $k = const _$jni.JStringType().jClass.reference; if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { $k.release(); throw 'Failed'; } $k.release(); - return const _$jni.JStringNullableType().fromReference($o); + return const _$jni.JStringType().fromReference($o); } static final _id_sayHello$1 = _class.instanceMethodId( @@ -1127,7 +2202,7 @@ class SuspendFun extends _$jni.JObject { /// from: `public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString?> sayHello$1( + _$core.Future<_$jni.JString> sayHello$1( _$jni.JString? string, ) async { final $p = _$jni.ReceivePort(); @@ -1135,17 +2210,17 @@ class SuspendFun extends _$jni.JObject { final _$string = string?.reference ?? _$jni.jNullReference; _sayHello$1(reference.pointer, _id_sayHello$1 as _$jni.JMethodIDPtr, _$string.pointer, _$continuation.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object<_$jni.JObject>(const _$jni.JObjectType()); _$continuation.release(); final $o = _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringNullableType().jClass.reference; + final $k = const _$jni.JStringType().jClass.reference; if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { $k.release(); throw 'Failed'; } $k.release(); - return const _$jni.JStringNullableType().fromReference($o); + return const _$jni.JStringType().fromReference($o); } } @@ -1166,7 +2241,7 @@ final class $SuspendFun$NullableType extends _$jni.JObjType { ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override @@ -1202,7 +2277,7 @@ final class $SuspendFun$Type extends _$jni.JObjType { ); @_$jni.internal @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + _$jni.JObjType get superType => const _$jni.JObjectType(); @_$jni.internal @_$core.override diff --git a/pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/Nullability.kt b/pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/Nullability.kt new file mode 100644 index 000000000..159be46ba --- /dev/null +++ b/pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/Nullability.kt @@ -0,0 +1,84 @@ +/* Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file + * for details. All rights reserved. Use of this source code is governed by a + * BSD-style license that can be found in the LICENSE file. + */ + +package com.github.dart_lang.jnigen + +public class Nullability(val t: T, val u: U, var nullableU: U?) { + public fun hello(): String { + return "hello" + } + + public fun nullableHello(returnNull: Boolean): String? { + return if (returnNull) null else "hello" + } + + public fun methodGenericEcho(v: V): V { + return v + } + + public fun methodGenericNullableEcho(v: V): V { + return v + } + + public fun classGenericEcho(u: U): U { + return u + } + + public fun classGenericNullableEcho(t: T): T { + return t + } + + public fun firstOf(list: List): String { + return list.first(); + } + + public fun firstOfNullable(list: List): String? { + return list.first(); + } + + public fun classGenericFirstOf(list: List): U { + return list.first(); + } + + public fun classGenericFirstOfNullable(list: List): T { + return list.first(); + } + + public fun methodGenericFirstOf(list: List): V { + return list.first(); + } + + public fun methodGenericFirstOfNullable(list: List): V { + return list.first(); + } + + public fun stringListOf(element: String): List { + return listOf(element) + } + + public fun nullableListOf(element: String?): List { + return listOf(element) + } + + public fun classGenericListOf(element: U): List { + return listOf(element) + } + + public fun classGenericNullableListOf(element: T): List { + return listOf(element) + } + + public fun methodGenericListOf(element: V): List { + return listOf(element) + } + + public fun methodGenericNullableListOf(element: V): List { + return listOf(element) + } + + public inner class InnerClass { + public fun f(t: T, u: U, v: V) {} + } +} diff --git a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart index 1dca0b082..aceef678f 100644 --- a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart @@ -13,11 +13,11 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Suspend functions', () async { await using((arena) async { final suspendFun = SuspendFun()..releasedBy(arena); - final hello = (await suspendFun.sayHello())!; + final hello = await suspendFun.sayHello(); expect(hello.toDartString(releaseOriginal: true), 'Hello!'); const name = 'Bob'; final helloBob = - (await suspendFun.sayHello$1(name.toJString()..releasedBy(arena)))!; + await suspendFun.sayHello$1(name.toJString()..releasedBy(arena)); expect(helloBob.toDartString(releaseOriginal: true), 'Hello $name!'); }); }); @@ -32,8 +32,217 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Generics', () { using((arena) { - final speed = Speed(10, SpeedUnit.MetrePerSec)..releasedBy(arena); - expect(speed.convertValue(SpeedUnit.KmPerHour), closeTo(36, 1e-6)); + final speed = Speed(10, SpeedUnit.MetrePerSec!)..releasedBy(arena); + expect(speed.convertValue(SpeedUnit.KmPerHour!), closeTo(36, 1e-6)); + }); + }); + + group('Nullability', () { + Nullability testObject(Arena arena) { + return Nullability( + null, + 'hello'.toJString(), + null, + T: JString.nullableType, + U: JString.type, + )..releasedBy(arena); + } + + test('Getters', () { + using((arena) { + final obj = testObject(arena); + expect( + obj.getU().toDartString(releaseOriginal: true), + 'hello', + ); + expect(obj.getT(), null); + expect(obj.getNullableU(), null); + }); + }); + test('Setters', () { + using((arena) { + final obj = testObject(arena); + obj.setNullableU('hello'.toJString()..releasedBy(arena)); + expect( + obj.getNullableU()!.toDartString(releaseOriginal: true), + 'hello', + ); + obj.setNullableU(null); + expect( + obj.getNullableU(), + null, + ); + }); + }); + test('Methods', () { + using((arena) { + final obj = testObject(arena); + expect(obj.hello().toDartString(releaseOriginal: true), 'hello'); + expect( + obj.nullableHello(false)!.toDartString(releaseOriginal: true), + 'hello', + ); + expect(obj.nullableHello(true), null); + expect( + obj + .classGenericEcho('hello'.toJString()..releasedBy(arena)) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .classGenericNullableEcho( + 'hello'.toJString()..releasedBy(arena))! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect(obj.classGenericNullableEcho(null), null); + expect( + obj + .methodGenericEcho( + 'hello'.toJString()..releasedBy(arena), + V: JString.type, + ) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .methodGenericNullableEcho( + 'hello'.toJString()..releasedBy(arena), + V: JString.nullableType, + )! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj.methodGenericNullableEcho(null, V: JString.nullableType), + null, + ); + expect( + obj + .stringListOf('hello'.toJString()..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .nullableListOf('hello'.toJString()..releasedBy(arena))[0]! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect(obj.nullableListOf(null)[0], null); + expect( + obj + .classGenericListOf('hello'.toJString()..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .classGenericNullableListOf( + 'hello'.toJString()..releasedBy(arena))[0]! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect(obj.classGenericNullableListOf(null)[0], null); + expect( + obj + .methodGenericListOf('hello'.toJString()..releasedBy(arena))[0] + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .methodGenericNullableListOf( + 'hello'.toJString()..releasedBy(arena), + V: JString.nullableType, + )[0]! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj.methodGenericNullableListOf(null, V: JString.nullableType)[0], + null, + ); + expect( + obj + .firstOf(['hello'.toJString()..releasedBy(arena)] + .toJList(JString.type)) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .firstOfNullable(['hello'.toJString()..releasedBy(arena), null] + .toJList(JString.nullableType))! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj.firstOfNullable([null, 'hello'.toJString()..releasedBy(arena)] + .toJList(JString.nullableType)), + null, + ); + expect( + obj + .classGenericFirstOf(['hello'.toJString()..releasedBy(arena)] + .toJList(JString.type)) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .classGenericFirstOfNullable([ + 'hello'.toJString()..releasedBy(arena), + null, + ].toJList(JString.nullableType))! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj.classGenericFirstOfNullable([ + null, + 'hello'.toJString()..releasedBy(arena), + ].toJList(JString.nullableType)), + null, + ); + expect( + obj + .methodGenericFirstOf(['hello'.toJString()..releasedBy(arena)] + .toJList(JString.type)) + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj + .methodGenericFirstOfNullable([ + 'hello'.toJString()..releasedBy(arena), + null, + ].toJList(JString.nullableType))! + .toDartString(releaseOriginal: true), + 'hello', + ); + expect( + obj.methodGenericFirstOfNullable([ + null, + 'hello'.toJString()..releasedBy(arena), + ].toJList(JString.nullableType)), + null, + ); + }); + }); + test('Inner class', () { + using((arena) { + final obj = testObject(arena); + final innerObj = Nullability_InnerClass( + obj, + V: JInteger.type); + expect( + innerObj.f, + isA(), + ); + }); }); }); }); From f59efc7c1db501eb89aaaf68b7c1e0c81b7ba4bc Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 2 Dec 2024 11:38:38 +1300 Subject: [PATCH 23/50] Fix bug with optional string params (#1767) --- pkgs/swift2objc/lib/src/transformer/_core/utils.dart | 7 ++++++- pkgs/swift2objc/test/integration/optional_input.swift | 2 +- pkgs/swift2objc/test/integration/optional_output.swift | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/swift2objc/lib/src/transformer/_core/utils.dart b/pkgs/swift2objc/lib/src/transformer/_core/utils.dart index 429285e66..e594a24ac 100644 --- a/pkgs/swift2objc/lib/src/transformer/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/transformer/_core/utils.dart @@ -66,7 +66,12 @@ import 'unique_namer.dart'; return (value, type); } } else if (type is OptionalType) { - final (newValue, newType) = maybeUnwrapValue(type.child, '$value?'); + final optValue = '$value?'; + var (newValue, newType) = maybeUnwrapValue(type.child, optValue); + if (newValue == optValue) { + // newValue is value?, so the ? isn't necessary and causes compile errors. + newValue = value; + } return (newValue, OptionalType(newType)); } else { throw UnimplementedError('Unknown type: $type'); diff --git a/pkgs/swift2objc/test/integration/optional_input.swift b/pkgs/swift2objc/test/integration/optional_input.swift index 5552fbf90..af19d6dd7 100644 --- a/pkgs/swift2objc/test/integration/optional_input.swift +++ b/pkgs/swift2objc/test/integration/optional_input.swift @@ -1,11 +1,11 @@ import Foundation -// public func funcOptionalPrimitiveReturn() -> Int? { return 123 } public func funcOptionalClassReturn() -> MyClass? { return MyClass(label: nil) } public func funcOptionalStructReturn() -> MyStruct? { return nil } public func funcOptionalArgs(label param: MyClass?) -> MyClass { return param! } public func funcMultipleOptionalArgs( label1 param1: MyClass?,label2 param2: Int, label3 param3: MyStruct?){} +public func funcOptionalStrings(str: String?) -> String? { return str; } public var globalOptional: MyStruct? diff --git a/pkgs/swift2objc/test/integration/optional_output.swift b/pkgs/swift2objc/test/integration/optional_output.swift index 920c486e6..add55f0c4 100644 --- a/pkgs/swift2objc/test/integration/optional_output.swift +++ b/pkgs/swift2objc/test/integration/optional_output.swift @@ -17,6 +17,10 @@ import Foundation return MyClassWrapper(result) } + @objc static public func funcOptionalStringsWrapper(str: String?) -> String? { + return funcOptionalStrings(str: str) + } + @objc static public func funcOptionalClassReturnWrapper() -> MyClassWrapper? { let result = funcOptionalClassReturn() return result == nil ? nil : MyClassWrapper(result!) From d79f68c534b1a642838ca22bcc3fe376be6d01e6 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Mon, 2 Dec 2024 11:40:14 +1300 Subject: [PATCH 24/50] [swift2objc] Support `throws` annotation (#1766) --- .../src/ast/_core/interfaces/can_throw.dart | 9 + .../interfaces/function_declaration.dart | 8 +- .../src/ast/_core/interfaces/overridable.dart | 2 +- .../interfaces/variable_declaration.dart | 7 +- .../members/initializer_declaration.dart | 8 +- .../compounds/members/method_declaration.dart | 4 + .../members/property_declaration.dart | 7 +- .../src/ast/declarations/globals/globals.dart | 10 +- .../generator/generators/class_generator.dart | 8 + .../swift2objc/lib/src/parser/_core/json.dart | 15 +- .../lib/src/parser/_core/token_list.dart | 81 +++++-- .../lib/src/parser/_core/utils.dart | 2 +- .../parse_function_declaration.dart | 85 +++++--- .../parse_initializer_declaration.dart | 4 +- .../parse_variable_declaration.dart | 39 ++-- .../lib/src/parser/parsers/parse_type.dart | 13 +- .../transformers/transform_compound.dart | 1 + .../transformers/transform_function.dart | 6 +- .../transformers/transform_initializer.dart | 6 +- .../transformers/transform_variable.dart | 1 + pkgs/swift2objc/pubspec.yaml | 1 + .../test/integration/integration_test.dart | 4 + .../test/integration/throws_input.swift | 11 + .../test/integration/throws_output.swift | 38 ++++ ...est.dart => parse_function_info_test.dart} | 200 +++++++++++++++++- .../swift2objc/test/unit/token_list_test.dart | 35 ++- 26 files changed, 500 insertions(+), 105 deletions(-) create mode 100644 pkgs/swift2objc/lib/src/ast/_core/interfaces/can_throw.dart create mode 100644 pkgs/swift2objc/test/integration/throws_input.swift create mode 100644 pkgs/swift2objc/test/integration/throws_output.swift rename pkgs/swift2objc/test/unit/{parse_function_param_test.dart => parse_function_info_test.dart} (54%) diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/can_throw.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/can_throw.dart new file mode 100644 index 000000000..a7ef31385 --- /dev/null +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/can_throw.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// An interface to describe a Swift entity's ability to be annotated +/// with `throws`. +abstract interface class CanThrow { + abstract final bool throws; +} diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart index a354941a8..ca90dc5c7 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../shared/referred_type.dart'; +import 'can_throw.dart'; import 'declaration.dart'; import 'executable.dart'; import 'parameterizable.dart'; @@ -10,6 +11,11 @@ import 'type_parameterizable.dart'; /// Describes a function-like entity. abstract interface class FunctionDeclaration - implements Declaration, Parameterizable, Executable, TypeParameterizable { + implements + Declaration, + Parameterizable, + Executable, + TypeParameterizable, + CanThrow { abstract final ReferredType returnType; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/overridable.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/overridable.dart index 937991701..2ec2d385a 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/overridable.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/overridable.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// An interface to describe a Swift entity's ability to be annotated -/// with `@objc`. +/// with `override`. abstract interface class Overridable { abstract final bool isOverriding; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart index 1f024735b..c2c694e35 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart @@ -3,10 +3,15 @@ // BSD-style license that can be found in the LICENSE file. import '../shared/referred_type.dart'; +import 'can_throw.dart'; import 'declaration.dart'; /// Describes a variable-like entity. -abstract interface class VariableDeclaration implements Declaration { +/// +/// This declaration [CanThrow] because Swift variables can have explicit +/// getters, which can be marked with `throws`. Such variables may not have a +/// setter. +abstract interface class VariableDeclaration implements Declaration, CanThrow { abstract final bool isConstant; abstract final ReferredType type; } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart index 12d19698e..1fdf10d96 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import '../../../_core/interfaces/can_throw.dart'; import '../../../_core/interfaces/declaration.dart'; import '../../../_core/interfaces/executable.dart'; import '../../../_core/interfaces/objc_annotatable.dart'; @@ -16,7 +17,8 @@ class InitializerDeclaration Executable, Parameterizable, ObjCAnnotatable, - Overridable { + Overridable, + CanThrow { @override String id; @@ -29,6 +31,9 @@ class InitializerDeclaration @override bool isOverriding; + @override + bool throws; + bool isFailable; @override @@ -48,6 +53,7 @@ class InitializerDeclaration this.statements = const [], required this.hasObjCAnnotation, required this.isOverriding, + required this.throws, required this.isFailable, }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart index 849dac94e..72315a962 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart @@ -30,6 +30,9 @@ class MethodDeclaration @override bool isOverriding; + @override + bool throws; + @override List statements; @@ -53,5 +56,6 @@ class MethodDeclaration this.statements = const [], this.isStatic = false, this.isOverriding = false, + this.throws = false, }) : assert(!isStatic || !isOverriding); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart index 536edf414..adf151e51 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart @@ -25,6 +25,9 @@ class PropertyDeclaration implements VariableDeclaration, ObjCAnnotatable { @override bool isConstant; + @override + bool throws; + bool hasSetter; PropertyStatements? getter; @@ -42,7 +45,9 @@ class PropertyDeclaration implements VariableDeclaration, ObjCAnnotatable { this.getter, this.setter, this.isStatic = false, - }) : assert(!isConstant || !hasSetter); + this.throws = false, + }) : assert(!(isConstant && hasSetter)), + assert(!(hasSetter && throws)); } class PropertyStatements implements Executable { diff --git a/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart b/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart index 73c55ffa1..1dd6c248b 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart @@ -33,6 +33,9 @@ class GlobalFunctionDeclaration implements FunctionDeclaration { @override List typeParams; + @override + bool throws; + @override ReferredType returnType; @@ -46,6 +49,7 @@ class GlobalFunctionDeclaration implements FunctionDeclaration { required this.returnType, this.typeParams = const [], this.statements = const [], + this.throws = false, }); } @@ -63,10 +67,14 @@ class GlobalVariableDeclaration implements VariableDeclaration { @override bool isConstant; + @override + bool throws; + GlobalVariableDeclaration({ required this.id, required this.name, required this.type, required this.isConstant, - }); + required this.throws, + }) : assert(!(throws && !isConstant)); } diff --git a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart index 2b4c32efb..c54837fd7 100644 --- a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart @@ -87,6 +87,10 @@ List _generateInitializer(InitializerDeclaration initializer) { header.write('(${generateParameters(initializer.params)})'); + if (initializer.throws) { + header.write(' throws'); + } + return [ '$header {', ...initializer.statements.indent(), @@ -116,6 +120,10 @@ List _generateClassMethod(MethodDeclaration method) { 'public func ${method.name}(${generateParameters(method.params)})', ); + if (method.throws) { + header.write(' throws'); + } + if (!method.returnType.sameAs(voidType)) { header.write(' -> ${method.returnType.swiftType}'); } diff --git a/pkgs/swift2objc/lib/src/parser/_core/json.dart b/pkgs/swift2objc/lib/src/parser/_core/json.dart index 3f8fd5a59..aa0d1a0f5 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/json.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/json.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:collection'; import 'dart:convert'; /// This is a helper class that helps with parsing Json values. It supports @@ -18,13 +17,13 @@ import 'dart:convert'; /// The class is also an `Iterable` so if the json is an array, you can directly /// iterate over it with a `for` loop. If the json isn't an array, attempting to /// iterate over it will throw an error. -class Json extends IterableBase { - final List _pathSegments; +class Json extends Iterable { + final List pathSegments; final dynamic _json; - String get path => _pathSegments.join('/'); + String get path => pathSegments.join('/'); - Json(this._json, [this._pathSegments = const []]); + Json(this._json, [this.pathSegments = const []]); /// The subscript syntax is intended to access a value at a field of a map or /// at an index if an array, and thus, the `index` parameter here can either @@ -37,7 +36,7 @@ class Json extends IterableBase { 'Expected a map at "$path", found a ${_json.runtimeType}', ); } - return Json(_json[index], [..._pathSegments, index]); + return Json(_json[index], [...pathSegments, index]); } if (index is int) { @@ -57,7 +56,7 @@ class Json extends IterableBase { 'Invalid negative index at "$path" (supplied index: $index)', ); } - return Json(_json[index], [..._pathSegments, '$index']); + return Json(_json[index], [...pathSegments, '$index']); } throw Exception( @@ -115,7 +114,7 @@ class _JsonIterator implements Iterator { _JsonIterator(this._json) : _list = _json.get(); @override - Json get current => Json(_list[_index], [..._json._pathSegments, '$_index']); + Json get current => Json(_list[_index], [..._json.pathSegments, '$_index']); @override bool moveNext() { diff --git a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart index 8939d1036..46b7d3c44 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/token_list.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/token_list.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'package:meta/meta.dart'; + import 'json.dart'; import 'utils.dart'; @@ -15,7 +17,7 @@ import 'utils.dart'; /// can pass it to parseType, because certain tokens get concatenated by the /// swift compiler. This class performs that preprocessing, as well as providing /// convenience methods for parsing, like slicing. -class TokenList { +class TokenList extends Iterable { final List _list; final int _start; final int _end; @@ -24,30 +26,55 @@ class TokenList { : assert(0 <= _start && _start <= _end && _end <= _list.length); factory TokenList(Json fragments) { - const splits = { - '?(': ['?', '('], - '?)': ['?', ')'], - '?, ': ['?', ', '], - ') -> ': [')', '->'], - '?) -> ': ['?', ')', '->'], - }; - - final list = []; - for (final token in fragments) { - final split = splits[getSpellingForKind(token, 'text')]; - if (split != null) { - for (final sub in split) { - list.add(Json({'kind': 'text', 'spelling': sub})); + final list = [for (final token in fragments) ...splitToken(token)]; + return TokenList._(list, 0, list.length); + } + + @visibleForTesting + static Iterable splitToken(Json token) sync* { + const splittables = ['(', ')', '?', ',', '->']; + Json textToken(String text) => + Json({'kind': 'text', 'spelling': text}, token.pathSegments); + + final text = getSpellingForKind(token, 'text')?.trim(); + if (text == null) { + // Not a text token. Pass it though unchanged. + yield token; + return; + } + + if (text.isEmpty) { + // Input text token was nothing but whitespace. The loop below would yield + // nothing, but we still need it as a separator. + yield textToken(text); + return; + } + + var suffix = text; + while (true) { + var any = false; + for (final prefix in splittables) { + if (suffix.startsWith(prefix)) { + yield textToken(prefix); + suffix = suffix.substring(prefix.length).trim(); + any = true; + break; } - } else { - list.add(token); + } + if (!any) { + // Remaining text isn't splittable. + if (suffix.isNotEmpty) yield textToken(suffix); + break; } } - return TokenList._(list, 0, list.length); } + @override int get length => _end - _start; - bool get isEmpty => length == 0; + + @override + Iterator get iterator => _TokenListIterator(this); + Json operator [](int index) => _list[index + _start]; int indexWhere(bool Function(Json element) test) { @@ -63,3 +90,19 @@ class TokenList { @override String toString() => _list.getRange(_start, _end).toString(); } + +class _TokenListIterator implements Iterator { + final TokenList _list; + var _index = -1; + + _TokenListIterator(this._list); + + @override + Json get current => _list[_index]; + + @override + bool moveNext() { + _index++; + return _index < _list.length; + } +} diff --git a/pkgs/swift2objc/lib/src/parser/_core/utils.dart b/pkgs/swift2objc/lib/src/parser/_core/utils.dart index 398986b29..7c42046f0 100644 --- a/pkgs/swift2objc/lib/src/parser/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/parser/_core/utils.dart @@ -107,7 +107,7 @@ ReferredType parseTypeAfterSeparator( ) { // fragments = [..., ': ', type tokens...] final separatorIndex = - fragments.indexWhere((token) => matchFragment(token, 'text', ': ')); + fragments.indexWhere((token) => matchFragment(token, 'text', ':')); final (type, suffix) = parseType(symbolgraph, fragments.slice(separatorIndex + 1)); assert(suffix.isEmpty, '$suffix'); diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart index 27a4e35b5..6f0acf973 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart @@ -16,12 +16,14 @@ GlobalFunctionDeclaration parseGlobalFunctionDeclaration( Json globalFunctionSymbolJson, ParsedSymbolgraph symbolgraph, ) { + final info = parseFunctionInfo( + globalFunctionSymbolJson['declarationFragments'], symbolgraph); return GlobalFunctionDeclaration( id: parseSymbolId(globalFunctionSymbolJson), name: parseSymbolName(globalFunctionSymbolJson), returnType: _parseFunctionReturnType(globalFunctionSymbolJson, symbolgraph), - params: parseFunctionParams( - globalFunctionSymbolJson['declarationFragments'], symbolgraph), + params: info.params, + throws: info.throws, ); } @@ -30,29 +32,38 @@ MethodDeclaration parseMethodDeclaration( ParsedSymbolgraph symbolgraph, { bool isStatic = false, }) { + final info = + parseFunctionInfo(methodSymbolJson['declarationFragments'], symbolgraph); return MethodDeclaration( id: parseSymbolId(methodSymbolJson), name: parseSymbolName(methodSymbolJson), returnType: _parseFunctionReturnType(methodSymbolJson, symbolgraph), - params: parseFunctionParams( - methodSymbolJson['declarationFragments'], symbolgraph), + params: info.params, hasObjCAnnotation: parseSymbolHasObjcAnnotation(methodSymbolJson), isStatic: isStatic, + throws: info.throws, ); } -List parseFunctionParams( +typedef ParsedFunctionInfo = ({ + List params, + bool throws, +}); + +ParsedFunctionInfo parseFunctionInfo( Json declarationFragments, ParsedSymbolgraph symbolgraph, ) { - // `declarationFragments` describes each part of the initializer declaration, + // `declarationFragments` describes each part of the function declaration, // things like the `func` keyword, brackets, spaces, etc. We only care about - // the parameter fragments here, and they always appear in this order: + // the parameter fragments and annotations here, and they always appear in + // this order: // [ // ..., '(', // externalParam, ' ', internalParam, ': ', type..., ', ' // externalParam, ': ', type..., ', ' // externalParam, ' ', internalParam, ': ', type..., ')' + // annotations..., '->', returnType... // ] // Note: `internalParam` may or may not exist. // @@ -60,34 +71,40 @@ List parseFunctionParams( // while making sure the parameter fragments have the expected order. final parameters = []; + final malformedInitializerException = Exception( + 'Malformed parameter list at ${declarationFragments.path}: ' + '$declarationFragments', + ); var tokens = TokenList(declarationFragments); + String? maybeConsume(String kind) { + if (tokens.isEmpty) return null; + final spelling = getSpellingForKind(tokens[0], kind); + if (spelling != null) tokens = tokens.slice(1); + return spelling; + } + final openParen = tokens.indexWhere((tok) => matchFragment(tok, 'text', '(')); - if (openParen != -1) { - tokens = tokens.slice(openParen + 1); - String? consume(String kind) { - if (tokens.isEmpty) return null; - final token = tokens[0]; - tokens = tokens.slice(1); - return getSpellingForKind(token, kind); - } + if (openParen == -1) throw malformedInitializerException; + tokens = tokens.slice(openParen + 1); - final malformedInitializerException = Exception( - 'Malformed initializer at ${declarationFragments.path}', - ); + // Parse parameters until we find a ')'. + if (maybeConsume('text') == ')') { + // Empty param list. + } else { while (true) { - final externalParam = consume('externalParam'); + final externalParam = maybeConsume('externalParam'); if (externalParam == null) throw malformedInitializerException; - var sep = consume('text'); + var sep = maybeConsume('text'); String? internalParam; - if (sep == ' ') { - internalParam = consume('internalParam'); + if (sep == '') { + internalParam = maybeConsume('internalParam'); if (internalParam == null) throw malformedInitializerException; - sep = consume('text'); + sep = maybeConsume('text'); } - if (sep != ': ') throw malformedInitializerException; + if (sep != ':') throw malformedInitializerException; final (type, remainingTokens) = parseType(symbolgraph, tokens); tokens = remainingTokens; @@ -97,16 +114,24 @@ List parseFunctionParams( type: type, )); - final end = consume('text'); + final end = maybeConsume('text'); if (end == ')') break; - if (end != ', ') throw malformedInitializerException; - } - if (!(tokens.isEmpty || consume('text') == '->')) { - throw malformedInitializerException; + if (end != ',') throw malformedInitializerException; } } - return parameters; + // Parse annotations until we run out. + final annotations = {}; + while (true) { + final keyword = maybeConsume('keyword'); + if (keyword == null) break; + annotations.add(keyword); + } + + return ( + params: parameters, + throws: annotations.contains('throws'), + ); } ReferredType _parseFunctionReturnType( diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index 6d5b725a7..b9ce98411 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -19,12 +19,14 @@ InitializerDeclaration parseInitializerDeclaration( throw Exception('Invalid initializer at ${declarationFragments.path}: $id'); } + final info = parseFunctionInfo(declarationFragments, symbolgraph); return InitializerDeclaration( id: id, - params: parseFunctionParams(declarationFragments, symbolgraph), + params: info.params, hasObjCAnnotation: parseSymbolHasObjcAnnotation(initializerSymbolJson), isOverriding: parseIsOverriding(initializerSymbolJson), isFailable: parseIsFailableInit(id, declarationFragments), + throws: info.throws, ); } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart index a2288404e..b1aa8c78d 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart @@ -24,6 +24,7 @@ PropertyDeclaration parsePropertyDeclaration( isConstant: isConstant, hasSetter: isConstant ? false : _parsePropertyHasSetter(propertySymbolJson), isStatic: isStatic, + throws: _parseVariableThrows(propertySymbolJson), ); } @@ -39,6 +40,7 @@ GlobalVariableDeclaration parseGlobalVariableDeclaration( name: parseSymbolName(variableSymbolJson), type: _parseVariableType(variableSymbolJson, symbolgraph), isConstant: isConstant || !hasSetter, + throws: _parseVariableThrows(variableSymbolJson), ); } @@ -52,36 +54,37 @@ ReferredType _parseVariableType( bool _parseVariableIsConstant(Json variableSymbolJson) { final fragmentsJson = variableSymbolJson['declarationFragments']; - final declarationKeywordJson = fragmentsJson.firstWhere( - (json) { - if (json['kind'].get() != 'keyword') return false; - - final keyword = json['spelling'].get(); - if (keyword != 'var' && keyword != 'let') return false; - - return true; - }, + final declarationKeyword = fragmentsJson.firstWhere( + (json) => + matchFragment(json, 'keyword', 'var') || + matchFragment(json, 'keyword', 'let'), orElse: () => throw ArgumentError( 'Invalid property declaration fragments at path: ${fragmentsJson.path}. ' 'Expected to find "var" or "let" as a keyword, found none', ), ); - final declarationKeyword = declarationKeywordJson['spelling'].get(); + return matchFragment(declarationKeyword, 'keyword', 'let'); +} - return declarationKeyword == 'let'; +bool _parseVariableThrows(Json json) { + final throws = json['declarationFragments'] + .any((frag) => matchFragment(frag, 'keyword', 'throws')); + if (throws) { + // TODO(https://github.com/dart-lang/native/issues/1765): Support throwing + // getters. + throw Exception("Throwing getters aren't supported yet, at ${json.path}"); + } + return throws; } bool _parsePropertyHasSetter(Json propertySymbolJson) { final fragmentsJson = propertySymbolJson['declarationFragments']; - final hasExplicitSetter = fragmentsJson.any( - (json) => json['spelling'].get() == 'set', - ); - - final hasExplicitGetter = fragmentsJson.any( - (json) => json['spelling'].get() == 'get', - ); + final hasExplicitSetter = + fragmentsJson.any((frag) => matchFragment(frag, 'keyword', 'set')); + final hasExplicitGetter = + fragmentsJson.any((frag) => matchFragment(frag, 'keyword', 'get')); if (hasExplicitGetter) { if (hasExplicitSetter) { diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart index a6e97a5d6..6e7a4231f 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_type.dart @@ -80,13 +80,18 @@ typedef PrefixParselet = (ReferredType, TokenList) Function( return (type, fragments); } -(ReferredType, TokenList) _emptyTupleParselet( - ParsedSymbolgraph symbolgraph, Json token, TokenList fragments) => - (voidType, fragments); +(ReferredType, TokenList) _tupleParselet( + ParsedSymbolgraph symbolgraph, Json token, TokenList fragments) { + final nextToken = fragments[0]; + if (_tokenId(nextToken) != 'text: )') { + throw Exception('Tuples not supported yet, at ${token.path}'); + } + return (voidType, fragments.slice(1)); +} Map _prefixParsets = { 'typeIdentifier': _typeIdentifierParselet, - 'text: ()': _emptyTupleParselet, + 'text: (': _tupleParselet, }; // ======================== diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart index 4b5047820..d01bd06f8 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart @@ -100,6 +100,7 @@ InitializerDeclaration _buildWrapperInitializer( ], isOverriding: false, isFailable: false, + throws: false, statements: ['self.${wrappedClassInstance.name} = wrappedInstance'], hasObjCAnnotation: wrappedClassInstance.hasObjCAnnotation, ); diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart index eebfbbc69..a1ce97dc0 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart @@ -99,6 +99,7 @@ MethodDeclaration _transformFunction( isStatic: originalFunction is MethodDeclaration ? originalFunction.isStatic : true, + throws: originalFunction.throws, ); transformedMethod.statements = _generateStatements( @@ -148,7 +149,10 @@ List _generateStatements( final localNamer = UniqueNamer(); final arguments = generateInvocationParams( localNamer, originalFunction.params, transformedMethod.params); - final originalMethodCall = originalCallGenerator(arguments); + var originalMethodCall = originalCallGenerator(arguments); + if (transformedMethod.throws) { + originalMethodCall = 'try $originalMethodCall'; + } if (originalFunction.returnType.sameAs(transformedMethod.returnType)) { return ['return $originalMethodCall']; diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart index 08a065bbd..a7af3c365 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart @@ -35,6 +35,7 @@ InitializerDeclaration transformInitializer( params: transformedParams, hasObjCAnnotation: true, isFailable: originalInitializer.isFailable, + throws: originalInitializer.throws, // Because the wrapper class extends NSObject that has an initializer with // no parameters. If we make a similar parameterless initializer we need // to add `override` keyword. @@ -57,8 +58,11 @@ List _generateInitializerStatements( final localNamer = UniqueNamer(); final arguments = generateInvocationParams( localNamer, originalInitializer.params, transformedInitializer.params); - final instanceConstruction = + var instanceConstruction = '${wrappedClassInstance.type.swiftType}($arguments)'; + if (transformedInitializer.throws) { + instanceConstruction = 'try $instanceConstruction'; + } if (originalInitializer.isFailable) { final instance = localNamer.makeUnique('instance'); return [ diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart index c6da95e8c..9c061542e 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart @@ -81,6 +81,7 @@ PropertyDeclaration _transformVariable( ? originalVariable.isStatic : true, isConstant: originalVariable.isConstant, + throws: originalVariable.throws, ); final getterStatements = _generateGetterStatements( diff --git a/pkgs/swift2objc/pubspec.yaml b/pkgs/swift2objc/pubspec.yaml index a0b28fcef..f49adf983 100644 --- a/pkgs/swift2objc/pubspec.yaml +++ b/pkgs/swift2objc/pubspec.yaml @@ -16,6 +16,7 @@ topics: dependencies: logging: ^1.3.0 + meta: ^1.16.0 path: ^1.9.0 environment: diff --git a/pkgs/swift2objc/test/integration/integration_test.dart b/pkgs/swift2objc/test/integration/integration_test.dart index 81b5400b2..b32e01ad6 100644 --- a/pkgs/swift2objc/test/integration/integration_test.dart +++ b/pkgs/swift2objc/test/integration/integration_test.dart @@ -43,13 +43,16 @@ void main([List? args]) { } } + var loggedErrors = 0; Logger.root.onRecord.listen((record) { stderr.writeln('${record.level.name}: ${record.message}'); + if (record.level >= Level.WARNING) ++loggedErrors; }); group('Integration tests', () { for (final name in testNames) { test(name, () async { + loggedErrors = 0; final inputFile = path.join(thisDir, '$name$inputSuffix'); final expectedOutputFile = path.join(thisDir, '$name$outputSuffix'); final actualOutputFile = regen @@ -69,6 +72,7 @@ void main([List? args]) { final expectedOutput = File(expectedOutputFile).readAsStringSync(); expect(actualOutput, expectedOutput); + expect(loggedErrors, 0); // Try generating symbolgraph for input & output files // to make sure the result compiles. Input file must be included cause diff --git a/pkgs/swift2objc/test/integration/throws_input.swift b/pkgs/swift2objc/test/integration/throws_input.swift new file mode 100644 index 000000000..53186dd80 --- /dev/null +++ b/pkgs/swift2objc/test/integration/throws_input.swift @@ -0,0 +1,11 @@ +import Foundation + +public class MyClass { + public init(y: Int) throws {} + + public func voidMethod() throws {} + public func intMethod(y: Int) throws -> MyClass { return try MyClass(y: 123) } +} + +public func voidFunc(x: Int, y: Int) throws {} +public func intFunc() throws -> MyClass { return try MyClass(y: 123) } diff --git a/pkgs/swift2objc/test/integration/throws_output.swift b/pkgs/swift2objc/test/integration/throws_output.swift new file mode 100644 index 000000000..dd1d16df2 --- /dev/null +++ b/pkgs/swift2objc/test/integration/throws_output.swift @@ -0,0 +1,38 @@ +// Test preamble text + +import Foundation + +@objc public class GlobalsWrapper: NSObject { + @objc static public func intFuncWrapper() throws -> MyClassWrapper { + let result = try intFunc() + return MyClassWrapper(result) + } + + @objc static public func voidFuncWrapper(x: Int, y: Int) throws { + return try voidFunc(x: x, y: y) + } + +} + +@objc public class MyClassWrapper: NSObject { + var wrappedInstance: MyClass + + init(_ wrappedInstance: MyClass) { + self.wrappedInstance = wrappedInstance + } + + @objc init(y: Int) throws { + wrappedInstance = try MyClass(y: y) + } + + @objc public func voidMethod() throws { + return try wrappedInstance.voidMethod() + } + + @objc public func intMethod(y: Int) throws -> MyClassWrapper { + let result = try wrappedInstance.intMethod(y: y) + return MyClassWrapper(result) + } + +} + diff --git a/pkgs/swift2objc/test/unit/parse_function_param_test.dart b/pkgs/swift2objc/test/unit/parse_function_info_test.dart similarity index 54% rename from pkgs/swift2objc/test/unit/parse_function_param_test.dart rename to pkgs/swift2objc/test/unit/parse_function_info_test.dart index e6ca95fed..909b07cd0 100644 --- a/pkgs/swift2objc/test/unit/parse_function_param_test.dart +++ b/pkgs/swift2objc/test/unit/parse_function_info_test.dart @@ -63,7 +63,7 @@ void main() { ''', )); - final outputParams = parseFunctionParams(json, emptySymbolgraph); + final info = parseFunctionInfo(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -77,7 +77,8 @@ void main() { ), ]; - expectEqualParams(outputParams, expectedParams); + expectEqualParams(info.params, expectedParams); + expect(info.throws, isFalse); }); test('Three params with some optional', () { @@ -118,7 +119,7 @@ void main() { ''', )); - final outputParams = parseFunctionParams(json, emptySymbolgraph); + final info = parseFunctionInfo(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -137,7 +138,8 @@ void main() { ), ]; - expectEqualParams(outputParams, expectedParams); + expectEqualParams(info.params, expectedParams); + expect(info.throws, isFalse); }); test('One param', () { @@ -158,7 +160,7 @@ void main() { ''', )); - final outputParams = parseFunctionParams(json, emptySymbolgraph); + final info = parseFunctionInfo(json, emptySymbolgraph); final expectedParams = [ Parameter( @@ -167,7 +169,8 @@ void main() { ), ]; - expectEqualParams(outputParams, expectedParams); + expectEqualParams(info.params, expectedParams); + expect(info.throws, isFalse); }); test('No params', () { @@ -180,9 +183,184 @@ void main() { ''', )); - final outputParams = parseFunctionParams(json, emptySymbolgraph); + final info = parseFunctionInfo(json, emptySymbolgraph); - expectEqualParams(outputParams, []); + expectEqualParams(info.params, []); + expect(info.throws, isFalse); + }); + + test('Function with return type', () { + // parseFunctionInfo doesn't parse the return type, but it should be able + // to cope with one. + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ") -> " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'parameter', + type: intType, + ), + ]; + + expectEqualParams(info.params, expectedParams); + expect(info.throws, isFalse); + }); + + test('Function with no params with return type', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "() -> " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + expectEqualParams(info.params, []); + expect(info.throws, isFalse); + }); + + test('Function with no params and no return type', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "()" } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + expectEqualParams(info.params, []); + expect(info.throws, isFalse); + }); + + test('Function with return type that throws', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ") " }, + { "kind": "keyword", "spelling": "throws" }, + { "kind": "text", "spelling": " -> " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'parameter', + type: intType, + ), + ]; + + expectEqualParams(info.params, expectedParams); + expect(info.throws, isTrue); + }); + + test('Function with no return type that throws', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ") " }, + { "kind": "keyword", "spelling": "throws" } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'parameter', + type: intType, + ), + ]; + + expectEqualParams(info.params, expectedParams); + expect(info.throws, isTrue); + }); + + test('Function with no params that throws', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "() " }, + { "kind": "keyword", "spelling": "throws" } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + expectEqualParams(info.params, []); + expect(info.throws, isTrue); }); }); @@ -206,7 +384,7 @@ void main() { )); expect( - () => parseFunctionParams(json, emptySymbolgraph), + () => parseFunctionInfo(json, emptySymbolgraph), throwsA(isA()), ); }); @@ -226,7 +404,7 @@ void main() { )); expect( - () => parseFunctionParams(json, emptySymbolgraph), + () => parseFunctionInfo(json, emptySymbolgraph), throwsA(isA()), ); }); @@ -249,7 +427,7 @@ void main() { )); expect( - () => parseFunctionParams(json, emptySymbolgraph), + () => parseFunctionInfo(json, emptySymbolgraph), throwsA(isA()), ); }); diff --git a/pkgs/swift2objc/test/unit/token_list_test.dart b/pkgs/swift2objc/test/unit/token_list_test.dart index d67b2904b..e3b115f40 100644 --- a/pkgs/swift2objc/test/unit/token_list_test.dart +++ b/pkgs/swift2objc/test/unit/token_list_test.dart @@ -9,9 +9,8 @@ import 'package:swift2objc/src/parser/_core/token_list.dart'; import 'package:test/test.dart'; void main() { - String spelling(TokenList list) => [ - for (var i = 0; i < list.length; ++i) list[i]['spelling'].toString() - ].toString(); + String spelling(Iterable tokens) => + [...tokens.map((t) => t['spelling'])].toString(); test('Slicing', () { final list = TokenList(Json(jsonDecode(''' @@ -51,7 +50,33 @@ void main() { 1); }); - test('Splitting', () { + test('Split one token', () { + List split(String json) => + TokenList.splitToken(Json(jsonDecode(json))).toList(); + expect(spelling(split('{ "kind": "text", "spelling": "a" }')), '["a"]'); + expect(spelling(split('{ "kind": "text", "spelling": "" }')), '[""]'); + expect(spelling(split('{ "kind": "text", "spelling": " " }')), '[""]'); + expect(spelling(split('{ "kind": "text", "spelling": "?" }')), '["?"]'); + expect(spelling(split('{ "kind": "text", "spelling": "???" }')), + '["?", "?", "?"]'); + expect( + spelling(split('{ "kind": "text", "spelling": "()" }')), '["(", ")"]'); + expect(spelling(split('{ "kind": "text", "spelling": " ?) -> () " }')), + '["?", ")", "->", "(", ")"]'); + expect(spelling(split('{ "kind": "typeIdentifier", "spelling": "?)" }')), + '["?)"]'); + + // splitToken gives up as soon as it finds a non-matching prefix. Ideally + // we'd keep splitting out any other tokens we find in the text, but that's + // more complicated to implement (we're writing a full tokenizer at that + // point), and we haven't seen a symbolgraph where that's necessary yet. + expect(spelling(split('{ "kind": "text", "spelling": "?)>-??" }')), + '["?", ")", ">-??"]'); + expect(spelling(split('{ "kind": "text", "spelling": "?)abc??" }')), + '["?", ")", "abc??"]'); + }); + + test('Split list', () { final list = TokenList(Json(jsonDecode(''' [ { "kind": "text", "spelling": "a" }, @@ -67,7 +92,7 @@ void main() { '''))); expect(spelling(list), - '["a", "?", "(", "b", "c", "?", ")", "?", ", ", "d", "?(", "e"]'); + '["a", "?", "(", "b", "c", "?", ")", "?", ",", "d", "?(", "e"]'); // If kind != "text", the token isn't changed. expect(list[10].toString(), '{"kind":"typeIdentifier","spelling":"?("}'); From a97e338f689b0075600e54c9fd5735c3ee9aee5f Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Mon, 2 Dec 2024 15:06:30 +0100 Subject: [PATCH 25/50] [native_assets_builder] Test hooks stopping after failure (#1768) Closes: https://github.com/dart-lang/native/issues/1630 --- .github/workflows/native.yaml | 9 +++ .../build_runner_caching_test.dart | 1 - .../build_runner_failure_test.dart | 40 ++++++++++ .../depend_on_fail_build/hook/build.dart | 13 +++ .../lib/depend_on_fail_build.dart | 5 ++ .../depend_on_fail_build/pubspec.yaml | 20 +++++ .../bin/depend_on_fail_build_app.dart | 9 +++ .../depend_on_fail_build_app/pubspec.yaml | 20 +++++ .../test_data/fail_build/hook/build.dart | 10 +++ .../test_data/fail_build/lib/fail_build.dart | 5 ++ .../test_data/fail_build/pubspec.yaml | 18 +++++ .../test_data/manifest.yaml | 80 ++++++++++--------- 12 files changed, 193 insertions(+), 37 deletions(-) create mode 100644 pkgs/native_assets_builder/test_data/depend_on_fail_build/hook/build.dart create mode 100644 pkgs/native_assets_builder/test_data/depend_on_fail_build/lib/depend_on_fail_build.dart create mode 100644 pkgs/native_assets_builder/test_data/depend_on_fail_build/pubspec.yaml create mode 100644 pkgs/native_assets_builder/test_data/depend_on_fail_build_app/bin/depend_on_fail_build_app.dart create mode 100644 pkgs/native_assets_builder/test_data/depend_on_fail_build_app/pubspec.yaml create mode 100644 pkgs/native_assets_builder/test_data/fail_build/hook/build.dart create mode 100644 pkgs/native_assets_builder/test_data/fail_build/lib/fail_build.dart create mode 100644 pkgs/native_assets_builder/test_data/fail_build/pubspec.yaml diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 21094bde1..4e2396cf5 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -120,6 +120,15 @@ jobs: - run: dart pub get -C example/link/app_with_asset_treeshaking/ if: ${{ matrix.package == 'native_assets_cli' }} + - run: dart pub get -C test_data/fail_build/ + if: ${{ matrix.package == 'native_assets_builder' }} + + - run: dart pub get -C test_data/depend_on_fail_build/ + if: ${{ matrix.package == 'native_assets_builder' }} + + - run: dart pub get -C test_data/depend_on_fail_build_app/ + if: ${{ matrix.package == 'native_assets_builder' }} + - run: dart analyze --fatal-infos # Run on dev to ensure we're not depending on deprecated SDK things. diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index 42c5e4939..5b31cae41 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -62,7 +62,6 @@ void main() async { applicationAssetValidator: validateCodeAssetInApplication, ))!; final hookUri = packageUri.resolve('hook/build.dart'); - print(logMessages.join('\n')); expect( logMessages.join('\n'), isNot(contains('Recompiling ${hookUri.toFilePath()}')), diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart index b15331721..7b9566828 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart @@ -102,4 +102,44 @@ void main() async { } }); }); + + test('do not build dependees after build failure', timeout: longTimeout, + () async { + await inTempDir((tempUri) async { + await copyTestProjects(targetUri: tempUri); + final packageUri = tempUri.resolve('depend_on_fail_build_app/'); + + await runPubGet( + workingDirectory: packageUri, + logger: logger, + ); + + final logMessages = []; + await build( + packageUri, + logger, + capturedLogs: logMessages, + dartExecutable, + supportedAssetTypes: [CodeAsset.type], + configValidator: validateCodeAssetBuildConfig, + buildValidator: validateCodeAssetBuildOutput, + applicationAssetValidator: validateCodeAssetInApplication, + ); + Matcher stringContainsBuildHookCompilation(String packageName) => + stringContainsInOrder([ + 'Running', + 'hook.dill', + '$packageName${Platform.pathSeparator}' + 'hook${Platform.pathSeparator}build.dart', + ]); + expect( + logMessages.join('\n'), + stringContainsBuildHookCompilation('fail_build'), + ); + expect( + logMessages.join('\n'), + isNot(stringContainsBuildHookCompilation('depends_on_fail_build')), + ); + }); + }); } diff --git a/pkgs/native_assets_builder/test_data/depend_on_fail_build/hook/build.dart b/pkgs/native_assets_builder/test_data/depend_on_fail_build/hook/build.dart new file mode 100644 index 000000000..bee5aadf4 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/depend_on_fail_build/hook/build.dart @@ -0,0 +1,13 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:fail_build/fail_build.dart'; +import 'package:native_assets_cli/data_assets.dart'; + +void main(List arguments) async { + await build(arguments, (config, output) async { + // Does nothing, just depends on `package:fail_build`. + invokeFailBuildCode(); + }); +} diff --git a/pkgs/native_assets_builder/test_data/depend_on_fail_build/lib/depend_on_fail_build.dart b/pkgs/native_assets_builder/test_data/depend_on_fail_build/lib/depend_on_fail_build.dart new file mode 100644 index 000000000..0457dc633 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/depend_on_fail_build/lib/depend_on_fail_build.dart @@ -0,0 +1,5 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void invokeDependOnFailBuildCode() {} diff --git a/pkgs/native_assets_builder/test_data/depend_on_fail_build/pubspec.yaml b/pkgs/native_assets_builder/test_data/depend_on_fail_build/pubspec.yaml new file mode 100644 index 000000000..253d3141f --- /dev/null +++ b/pkgs/native_assets_builder/test_data/depend_on_fail_build/pubspec.yaml @@ -0,0 +1,20 @@ +name: depend_on_fail_build +description: Has a dependency that fails to build. +version: 0.1.0 + +publish_to: none + +environment: + sdk: '>=3.3.0 <4.0.0' + +dependencies: + fail_build: + path: ../fail_build/ + # native_assets_cli: ^0.9.0 + native_assets_cli: + path: ../../../native_assets_cli/ + +dev_dependencies: + ffigen: ^8.0.2 + lints: ^3.0.0 + test: ^1.23.1 diff --git a/pkgs/native_assets_builder/test_data/depend_on_fail_build_app/bin/depend_on_fail_build_app.dart b/pkgs/native_assets_builder/test_data/depend_on_fail_build_app/bin/depend_on_fail_build_app.dart new file mode 100644 index 000000000..2abcfd041 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/depend_on_fail_build_app/bin/depend_on_fail_build_app.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:depend_on_fail_build/depend_on_fail_build.dart'; + +void main() { + invokeDependOnFailBuildCode(); +} diff --git a/pkgs/native_assets_builder/test_data/depend_on_fail_build_app/pubspec.yaml b/pkgs/native_assets_builder/test_data/depend_on_fail_build_app/pubspec.yaml new file mode 100644 index 000000000..ddb0ec04d --- /dev/null +++ b/pkgs/native_assets_builder/test_data/depend_on_fail_build_app/pubspec.yaml @@ -0,0 +1,20 @@ +name: depend_on_fail_build_app +description: Has a dependency that has a dependency that fails to build. +version: 0.1.0 + +publish_to: none + +environment: + sdk: '>=3.3.0 <4.0.0' + +dependencies: + depend_on_fail_build: + path: ../depend_on_fail_build/ + # native_assets_cli: ^0.9.0 + native_assets_cli: + path: ../../../native_assets_cli/ + +dev_dependencies: + ffigen: ^8.0.2 + lints: ^3.0.0 + test: ^1.23.1 diff --git a/pkgs/native_assets_builder/test_data/fail_build/hook/build.dart b/pkgs/native_assets_builder/test_data/fail_build/hook/build.dart new file mode 100644 index 000000000..790b93525 --- /dev/null +++ b/pkgs/native_assets_builder/test_data/fail_build/hook/build.dart @@ -0,0 +1,10 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +void main(List arguments) async { + print('Just here to fail the build!'); + exit(1); +} diff --git a/pkgs/native_assets_builder/test_data/fail_build/lib/fail_build.dart b/pkgs/native_assets_builder/test_data/fail_build/lib/fail_build.dart new file mode 100644 index 000000000..d6eb1aacc --- /dev/null +++ b/pkgs/native_assets_builder/test_data/fail_build/lib/fail_build.dart @@ -0,0 +1,5 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +void invokeFailBuildCode() {} diff --git a/pkgs/native_assets_builder/test_data/fail_build/pubspec.yaml b/pkgs/native_assets_builder/test_data/fail_build/pubspec.yaml new file mode 100644 index 000000000..b04fe9a5d --- /dev/null +++ b/pkgs/native_assets_builder/test_data/fail_build/pubspec.yaml @@ -0,0 +1,18 @@ +name: fail_build +description: Always fails to build +version: 0.1.0 + +publish_to: none + +environment: + sdk: '>=3.3.0 <4.0.0' + +dependencies: + # native_assets_cli: ^0.9.0 + native_assets_cli: + path: ../../../native_assets_cli/ + +dev_dependencies: + ffigen: ^8.0.2 + lints: ^3.0.0 + test: ^1.23.1 diff --git a/pkgs/native_assets_builder/test_data/manifest.yaml b/pkgs/native_assets_builder/test_data/manifest.yaml index 6bcdcd32c..9ed41c7c9 100644 --- a/pkgs/native_assets_builder/test_data/manifest.yaml +++ b/pkgs/native_assets_builder/test_data/manifest.yaml @@ -28,6 +28,11 @@ - cyclic_package_2/pubspec.yaml - dart_app/bin/dart_app.dart - dart_app/pubspec.yaml +- depend_on_fail_build_app/bin/depend_on_fail_build_app.dart +- depend_on_fail_build_app/pubspec.yaml +- depend_on_fail_build/hook/build.dart +- depend_on_fail_build/lib/depend_on_fail_build.dart +- depend_on_fail_build/pubspec.yaml - drop_dylib_link/bin/drop_dylib_link.dart - drop_dylib_link/hook/build.dart - drop_dylib_link/hook/link.dart @@ -39,6 +44,9 @@ - drop_dylib_link/src/native_add.h - drop_dylib_link/src/native_multiply.c - drop_dylib_link/src/native_multiply.h +- fail_build/hook/build.dart +- fail_build/lib/fail_build.dart +- fail_build/pubspec.yaml - fail_on_os_sdk_version_link/assets/data.json - fail_on_os_sdk_version_link/hook/build.dart - fail_on_os_sdk_version_link/pubspec.yaml @@ -46,6 +54,12 @@ - fail_on_os_sdk_version_linker/pubspec.yaml - fail_on_os_sdk_version/hook/build.dart - fail_on_os_sdk_version/pubspec.yaml +- native_add_duplicate/bin/native_add_duplicate.dart +- native_add_duplicate/hook/build.dart +- native_add_duplicate/hook/link.dart +- native_add_duplicate/pubspec.yaml +- native_add_duplicate/src/native_add.c +- native_add_duplicate/src/native_add.h - native_add/ffigen.yaml - native_add/hook/build.dart - native_add/lib/native_add.dart @@ -55,12 +69,19 @@ - native_add/src/native_add.c - native_add/src/native_add.h - native_add/test/native_add_test.dart -- native_add_duplicate/bin/native_add_duplicate.dart -- native_add_duplicate/hook/build.dart -- native_add_duplicate/hook/link.dart -- native_add_duplicate/pubspec.yaml -- native_add_duplicate/src/native_add.c -- native_add_duplicate/src/native_add.h +- native_dynamic_linking/bin/native_dynamic_linking.dart +- native_dynamic_linking/ffigen.yaml +- native_dynamic_linking/hook/build.dart +- native_dynamic_linking/lib/add.dart +- native_dynamic_linking/pubspec.yaml +- native_dynamic_linking/README.md +- native_dynamic_linking/src/add.c +- native_dynamic_linking/src/add.h +- native_dynamic_linking/src/debug.c +- native_dynamic_linking/src/debug.h +- native_dynamic_linking/src/math.c +- native_dynamic_linking/src/math.h +- native_dynamic_linking/test/add_test.dart - native_subtract/ffigen.yaml - native_subtract/hook/build.dart - native_subtract/lib/native_subtract.dart @@ -75,6 +96,13 @@ - package_reading_metadata/pubspec.yaml - package_with_metadata/hook/build.dart - package_with_metadata/pubspec.yaml +- simple_data_asset/assets/test_asset.txt +- simple_data_asset/bin/deep_modify_data_asset.dart.debug +- simple_data_asset/bin/modify_data_asset.dart.debug +- simple_data_asset/bin/simple_data_asset.dart.debug +- simple_data_asset/hook/build.dart +- simple_data_asset/pubspec.yaml +- simple_data_asset/README.md - simple_link/assets/data_0.json - simple_link/assets/data_1.json - simple_link/assets/data_2.json @@ -82,13 +110,6 @@ - simple_link/hook/build.dart - simple_link/hook/link.dart - simple_link/pubspec.yaml -- simple_data_asset/pubspec.yaml -- simple_data_asset/assets/test_asset.txt -- simple_data_asset/README.md -- simple_data_asset/hook/build.dart -- simple_data_asset/bin/simple_data_asset.dart.debug -- simple_data_asset/bin/modify_data_asset.dart.debug -- simple_data_asset/bin/deep_modify_data_asset.dart.debug - some_dev_dep/bin/some_dev_dep.dart - some_dev_dep/pubspec.yaml - transformer/data/data0.json @@ -103,20 +124,20 @@ - transformer/data/data9.json - transformer/hook/build.dart - transformer/lib/src/transform.dart -- transformer/tool/generate_data.dart - transformer/pubspec.yaml -- treeshaking_native_libs/pubspec.yaml -- treeshaking_native_libs/lib/treeshaking_native_libs.dart -- treeshaking_native_libs/lib/src/treeshaking_native_libs.dart +- transformer/tool/generate_data.dart +- treeshaking_native_libs/bin/treeshaking_native_libs.dart +- treeshaking_native_libs/ffigen.yaml +- treeshaking_native_libs/hook/build.dart +- treeshaking_native_libs/hook/link.dart - treeshaking_native_libs/lib/src/treeshaking_native_libs_bindings_generated.dart -- treeshaking_native_libs/src/native_add.h -- treeshaking_native_libs/src/native_multiply.h +- treeshaking_native_libs/lib/src/treeshaking_native_libs.dart +- treeshaking_native_libs/lib/treeshaking_native_libs.dart +- treeshaking_native_libs/pubspec.yaml - treeshaking_native_libs/src/native_add.c +- treeshaking_native_libs/src/native_add.h - treeshaking_native_libs/src/native_multiply.c -- treeshaking_native_libs/hook/link.dart -- treeshaking_native_libs/hook/build.dart -- treeshaking_native_libs/bin/treeshaking_native_libs.dart -- treeshaking_native_libs/ffigen.yaml +- treeshaking_native_libs/src/native_multiply.h - wrong_build_output_2/hook/build.dart - wrong_build_output_2/pubspec.yaml - wrong_build_output_3/hook/build.dart @@ -127,16 +148,3 @@ - wrong_linker/pubspec.yaml - wrong_namespace_asset/hook/build.dart - wrong_namespace_asset/pubspec.yaml -- native_dynamic_linking/bin/native_dynamic_linking.dart -- native_dynamic_linking/hook/build.dart -- native_dynamic_linking/lib/add.dart -- native_dynamic_linking/src/add.c -- native_dynamic_linking/src/add.h -- native_dynamic_linking/src/debug.c -- native_dynamic_linking/src/debug.h -- native_dynamic_linking/src/math.c -- native_dynamic_linking/src/math.h -- native_dynamic_linking/test/add_test.dart -- native_dynamic_linking/ffigen.yaml -- native_dynamic_linking/pubspec.yaml -- native_dynamic_linking/README.md From 4b03d952059048149fd680ff77034887b53e7ed9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 23:50:19 +0000 Subject: [PATCH 26/50] Bump the github-actions group with 2 updates (#1771) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the github-actions group with 2 updates: [dart-lang/setup-dart](https://github.com/dart-lang/setup-dart) and [subosito/flutter-action](https://github.com/subosito/flutter-action). Updates `dart-lang/setup-dart` from 1.6.5 to 1.7.0
Release notes

Sourced from dart-lang/setup-dart's releases.

v1.7.0

What's Changed

  • Install a Flutter SDK in the publish workflow allowing for publication of flutter packages.
Changelog

Sourced from dart-lang/setup-dart's changelog.

v1.7.0

v1.6.5

  • Fix zip path handling on Windows 11 (#118[])

#118: dart-lang/setup-dart#118

v1.6.4

  • Rebuild JS code.

v1.6.3

v1.6.2

v1.6.1

  • Updated the google storage url for main channel releases.

v1.6.0

  • Enable provisioning of the latest Dart SDK patch release by specifying just the major and minor version (e.g. 3.2).

v1.5.1

  • No longer test the setup-dart action on pre-2.12 SDKs.
  • Upgrade JS interop code to use extension types (the new name for inline classes).
  • The upcoming rename of the be channel to main is now supported with forward compatibility that switches when the rename happens.

v1.5.0

... (truncated)

Commits

Updates `subosito/flutter-action` from 2.16.0 to 2.17.0
Release notes

Sourced from subosito/flutter-action's releases.

v2.17.0

This release adds support for older yq versions, as added in PR #329. Thanks for contributing, @​ThomasAunvik!

Commits

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
--- .github/workflows/ffi.yaml | 4 ++-- .github/workflows/ffigen.yml | 12 ++++++------ .github/workflows/ffigen_weekly.yml | 2 +- .github/workflows/jnigen.yaml | 24 +++++++++++------------ .github/workflows/native.yaml | 2 +- .github/workflows/native_toolchain_c.yaml | 2 +- .github/workflows/objective_c.yaml | 6 +++--- .github/workflows/swift2objc.yaml | 4 ++-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ffi.yaml b/.github/workflows/ffi.yaml index ba20ccf2b..e521a3caf 100644 --- a/.github/workflows/ffi.yaml +++ b/.github/workflows/ffi.yaml @@ -32,7 +32,7 @@ jobs: sdk: [dev] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: sdk: ${{ matrix.sdk }} - id: install @@ -62,7 +62,7 @@ jobs: sdk: [beta, dev] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: sdk: ${{ matrix.sdk }} - id: install diff --git a/.github/workflows/ffigen.yml b/.github/workflows/ffigen.yml index c237ad11d..6e1690b92 100644 --- a/.github/workflows/ffigen.yml +++ b/.github/workflows/ffigen.yml @@ -32,7 +32,7 @@ jobs: fail-fast: false steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - id: install @@ -54,7 +54,7 @@ jobs: working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies @@ -75,7 +75,7 @@ jobs: working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies @@ -106,7 +106,7 @@ jobs: working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies @@ -124,7 +124,7 @@ jobs: working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies @@ -152,7 +152,7 @@ jobs: working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: "master" - name: Install dependencies diff --git a/.github/workflows/ffigen_weekly.yml b/.github/workflows/ffigen_weekly.yml index 726160b99..863eac384 100644 --- a/.github/workflows/ffigen_weekly.yml +++ b/.github/workflows/ffigen_weekly.yml @@ -28,7 +28,7 @@ jobs: working-directory: pkgs/ffigen/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies diff --git a/.github/workflows/jnigen.yaml b/.github/workflows/jnigen.yaml index 8eb4aa321..462c84f10 100644 --- a/.github/workflows/jnigen.yaml +++ b/.github/workflows/jnigen.yaml @@ -41,7 +41,7 @@ jobs: sdk: [stable] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: ${{ matrix.sdk }} cache: true @@ -77,7 +77,7 @@ jobs: sdk: [stable, beta] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: ${{ matrix.sdk }} cache: true @@ -128,7 +128,7 @@ jobs: working-directory: ./pkgs/jni steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -167,7 +167,7 @@ jobs: working-directory: ./pkgs/jni steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -216,7 +216,7 @@ jobs: working-directory: ./pkgs/jni steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -243,7 +243,7 @@ jobs: with: version: latest platform: x64 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -269,7 +269,7 @@ jobs: working-directory: ./pkgs/jni steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -294,7 +294,7 @@ jobs: uses: ConorMacBride/install-package@3e7ad059e07782ee54fa35f827df52aae0626f30 with: brew: clang-format - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -317,7 +317,7 @@ jobs: working-directory: ./pkgs/jni/example steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -341,7 +341,7 @@ jobs: working-directory: ./pkgs/jni/example steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -365,7 +365,7 @@ jobs: with: distribution: 'zulu' java-version: '17' - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true @@ -380,7 +380,7 @@ jobs: working-directory: ./pkgs/jnigen/example/pdfbox_plugin steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' cache: true diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 4e2396cf5..26eb0676d 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -46,7 +46,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: sdk: ${{ matrix.sdk }} diff --git a/.github/workflows/native_toolchain_c.yaml b/.github/workflows/native_toolchain_c.yaml index 7ce6fab08..5af91a33d 100644 --- a/.github/workflows/native_toolchain_c.yaml +++ b/.github/workflows/native_toolchain_c.yaml @@ -34,7 +34,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: sdk: ${{ matrix.sdk }} diff --git a/.github/workflows/objective_c.yaml b/.github/workflows/objective_c.yaml index 15e6d0c35..2c2ee64cb 100644 --- a/.github/workflows/objective_c.yaml +++ b/.github/workflows/objective_c.yaml @@ -31,7 +31,7 @@ jobs: fail-fast: false steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - id: install @@ -52,7 +52,7 @@ jobs: working-directory: pkgs/objective_c/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies @@ -88,7 +88,7 @@ jobs: working-directory: pkgs/objective_c/example/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 + - uses: subosito/flutter-action@74af56c5ed2697ba4621264652728e8d217e53d3 with: channel: 'stable' - name: Install dependencies diff --git a/.github/workflows/swift2objc.yaml b/.github/workflows/swift2objc.yaml index 67bc9192e..ddd79dd8e 100644 --- a/.github/workflows/swift2objc.yaml +++ b/.github/workflows/swift2objc.yaml @@ -29,7 +29,7 @@ jobs: fail-fast: false steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: sdk: stable - id: install @@ -50,7 +50,7 @@ jobs: working-directory: pkgs/swift2objc/ steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 with: sdk: stable - name: Install dependencies From 3210a79448804b1091adc3c572544d2e3b6709cb Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 4 Dec 2024 11:56:33 +1300 Subject: [PATCH 27/50] [swift2objc] Support the `async` annotation (#1779) --- .../src/ast/_core/interfaces/can_async.dart | 9 ++ .../interfaces/function_declaration.dart | 4 +- .../interfaces/variable_declaration.dart | 10 +- .../members/initializer_declaration.dart | 8 +- .../compounds/members/method_declaration.dart | 4 + .../members/property_declaration.dart | 4 + .../src/ast/declarations/globals/globals.dart | 8 ++ .../lib/src/generator/_core/utils.dart | 14 +++ .../generator/generators/class_generator.dart | 18 ++-- .../parse_function_declaration.dart | 14 ++- .../parse_initializer_declaration.dart | 9 ++ .../parse_variable_declaration.dart | 13 +++ .../transformers/transform_compound.dart | 1 + .../transformers/transform_function.dart | 4 + .../transformers/transform_initializer.dart | 4 + .../transformers/transform_variable.dart | 1 + .../test/integration/async_input.swift | 12 +++ .../test/integration/async_output.swift | 39 ++++++++ .../test/unit/parse_function_info_test.dart | 94 +++++++++++++++++++ 19 files changed, 249 insertions(+), 21 deletions(-) create mode 100644 pkgs/swift2objc/lib/src/ast/_core/interfaces/can_async.dart create mode 100644 pkgs/swift2objc/test/integration/async_input.swift create mode 100644 pkgs/swift2objc/test/integration/async_output.swift diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/can_async.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/can_async.dart new file mode 100644 index 000000000..1479d7a96 --- /dev/null +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/can_async.dart @@ -0,0 +1,9 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/// An interface to describe a Swift entity's ability to be annotated +/// with `async`. +abstract interface class CanAsync { + abstract final bool async; +} diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart index ca90dc5c7..5ee39604b 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/function_declaration.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import '../shared/referred_type.dart'; +import 'can_async.dart'; import 'can_throw.dart'; import 'declaration.dart'; import 'executable.dart'; @@ -16,6 +17,7 @@ abstract interface class FunctionDeclaration Parameterizable, Executable, TypeParameterizable, - CanThrow { + CanThrow, + CanAsync { abstract final ReferredType returnType; } diff --git a/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart b/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart index c2c694e35..cf15229cf 100644 --- a/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/_core/interfaces/variable_declaration.dart @@ -3,15 +3,17 @@ // BSD-style license that can be found in the LICENSE file. import '../shared/referred_type.dart'; +import 'can_async.dart'; import 'can_throw.dart'; import 'declaration.dart'; /// Describes a variable-like entity. /// -/// This declaration [CanThrow] because Swift variables can have explicit -/// getters, which can be marked with `throws`. Such variables may not have a -/// setter. -abstract interface class VariableDeclaration implements Declaration, CanThrow { +/// This declaration implements [CanThrow] and [CanAsync] because Swift +/// variables can have explicit getters, which can be marked with `throws` and +/// `async`. Such variables may not have a setter. +abstract interface class VariableDeclaration + implements Declaration, CanThrow, CanAsync { abstract final bool isConstant; abstract final ReferredType type; } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart index 1fdf10d96..d7c5431b3 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/initializer_declaration.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import '../../../_core/interfaces/can_async.dart'; import '../../../_core/interfaces/can_throw.dart'; import '../../../_core/interfaces/declaration.dart'; import '../../../_core/interfaces/executable.dart'; @@ -18,7 +19,8 @@ class InitializerDeclaration Parameterizable, ObjCAnnotatable, Overridable, - CanThrow { + CanThrow, + CanAsync { @override String id; @@ -34,6 +36,9 @@ class InitializerDeclaration @override bool throws; + @override + bool async; + bool isFailable; @override @@ -54,6 +59,7 @@ class InitializerDeclaration required this.hasObjCAnnotation, required this.isOverriding, required this.throws, + required this.async, required this.isFailable, }); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart index 72315a962..c7567fe9c 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/method_declaration.dart @@ -33,6 +33,9 @@ class MethodDeclaration @override bool throws; + @override + bool async; + @override List statements; @@ -57,5 +60,6 @@ class MethodDeclaration this.isStatic = false, this.isOverriding = false, this.throws = false, + this.async = false, }) : assert(!isStatic || !isOverriding); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart index adf151e51..6bcced2d9 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/compounds/members/property_declaration.dart @@ -28,6 +28,9 @@ class PropertyDeclaration implements VariableDeclaration, ObjCAnnotatable { @override bool throws; + @override + bool async; + bool hasSetter; PropertyStatements? getter; @@ -46,6 +49,7 @@ class PropertyDeclaration implements VariableDeclaration, ObjCAnnotatable { this.setter, this.isStatic = false, this.throws = false, + this.async = false, }) : assert(!(isConstant && hasSetter)), assert(!(hasSetter && throws)); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart b/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart index 1dd6c248b..c06cc5077 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/globals/globals.dart @@ -36,6 +36,9 @@ class GlobalFunctionDeclaration implements FunctionDeclaration { @override bool throws; + @override + bool async; + @override ReferredType returnType; @@ -50,6 +53,7 @@ class GlobalFunctionDeclaration implements FunctionDeclaration { this.typeParams = const [], this.statements = const [], this.throws = false, + this.async = false, }); } @@ -70,11 +74,15 @@ class GlobalVariableDeclaration implements VariableDeclaration { @override bool throws; + @override + bool async; + GlobalVariableDeclaration({ required this.id, required this.name, required this.type, required this.isConstant, required this.throws, + required this.async, }) : assert(!(throws && !isConstant)); } diff --git a/pkgs/swift2objc/lib/src/generator/_core/utils.dart b/pkgs/swift2objc/lib/src/generator/_core/utils.dart index 9ab8a6fba..83dc01a3b 100644 --- a/pkgs/swift2objc/lib/src/generator/_core/utils.dart +++ b/pkgs/swift2objc/lib/src/generator/_core/utils.dart @@ -1,5 +1,8 @@ import 'dart:io'; import 'package:path/path.dart' as path; +import '../../ast/_core/interfaces/can_async.dart'; +import '../../ast/_core/interfaces/can_throw.dart'; +import '../../ast/_core/interfaces/declaration.dart'; import '../../ast/_core/shared/parameter.dart'; String generateParameters(List params) { @@ -34,3 +37,14 @@ void outputNextToFile({ File(outputPath).writeAsStringSync(content); } + +String generateAnnotations(Declaration decl) { + final annotations = StringBuffer(); + if (decl is CanAsync && (decl as CanAsync).async) { + annotations.write('async '); + } + if (decl is CanThrow && (decl as CanThrow).throws) { + annotations.write('throws '); + } + return annotations.toString(); +} diff --git a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart index c54837fd7..b5161bfb2 100644 --- a/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart +++ b/pkgs/swift2objc/lib/src/generator/generators/class_generator.dart @@ -87,12 +87,8 @@ List _generateInitializer(InitializerDeclaration initializer) { header.write('(${generateParameters(initializer.params)})'); - if (initializer.throws) { - header.write(' throws'); - } - return [ - '$header {', + '$header ${generateAnnotations(initializer)}{', ...initializer.statements.indent(), '}\n', ]; @@ -117,19 +113,17 @@ List _generateClassMethod(MethodDeclaration method) { } header.write( - 'public func ${method.name}(${generateParameters(method.params)})', + 'public func ${method.name}(${generateParameters(method.params)}) ', ); - if (method.throws) { - header.write(' throws'); - } + header.write(generateAnnotations(method)); if (!method.returnType.sameAs(voidType)) { - header.write(' -> ${method.returnType.swiftType}'); + header.write('-> ${method.returnType.swiftType} '); } return [ - '$header {', + '$header{', ...method.statements.indent(), '}\n', ]; @@ -154,7 +148,7 @@ List _generateClassProperty(PropertyDeclaration property) { header.write('public var ${property.name}: ${property.type.swiftType} {'); final getterLines = [ - 'get {', + 'get ${generateAnnotations(property)}{', ...(property.getter?.statements.indent() ?? []), '}' ]; diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart index 6f0acf973..02d705d22 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_function_declaration.dart @@ -24,6 +24,7 @@ GlobalFunctionDeclaration parseGlobalFunctionDeclaration( returnType: _parseFunctionReturnType(globalFunctionSymbolJson, symbolgraph), params: info.params, throws: info.throws, + async: info.async, ); } @@ -42,12 +43,14 @@ MethodDeclaration parseMethodDeclaration( hasObjCAnnotation: parseSymbolHasObjcAnnotation(methodSymbolJson), isStatic: isStatic, throws: info.throws, + async: info.async, ); } typedef ParsedFunctionInfo = ({ List params, bool throws, + bool async, }); ParsedFunctionInfo parseFunctionInfo( @@ -120,17 +123,22 @@ ParsedFunctionInfo parseFunctionInfo( } } - // Parse annotations until we run out. + // Parse annotations until we run out. The annotations are keywords separated + // by whitespace tokens. final annotations = {}; while (true) { final keyword = maybeConsume('keyword'); - if (keyword == null) break; - annotations.add(keyword); + if (keyword == null) { + if (maybeConsume('text') != '') break; + } else { + annotations.add(keyword); + } } return ( params: parameters, throws: annotations.contains('throws'), + async: annotations.contains('async'), ); } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart index b9ce98411..74583e447 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_initializer_declaration.dart @@ -20,6 +20,14 @@ InitializerDeclaration parseInitializerDeclaration( } final info = parseFunctionInfo(declarationFragments, symbolgraph); + + if (info.async) { + // TODO(https://github.com/dart-lang/native/issues/1778): Support async + // initializerse. + throw Exception("Async initializers aren't supported yet, at " + '${initializerSymbolJson.path}'); + } + return InitializerDeclaration( id: id, params: info.params, @@ -27,6 +35,7 @@ InitializerDeclaration parseInitializerDeclaration( isOverriding: parseIsOverriding(initializerSymbolJson), isFailable: parseIsFailableInit(id, declarationFragments), throws: info.throws, + async: info.async, ); } diff --git a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart index b1aa8c78d..1877af6c1 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/declaration_parsers/parse_variable_declaration.dart @@ -25,6 +25,7 @@ PropertyDeclaration parsePropertyDeclaration( hasSetter: isConstant ? false : _parsePropertyHasSetter(propertySymbolJson), isStatic: isStatic, throws: _parseVariableThrows(propertySymbolJson), + async: _parseVariableAsync(propertySymbolJson), ); } @@ -41,6 +42,7 @@ GlobalVariableDeclaration parseGlobalVariableDeclaration( type: _parseVariableType(variableSymbolJson, symbolgraph), isConstant: isConstant || !hasSetter, throws: _parseVariableThrows(variableSymbolJson), + async: _parseVariableAsync(variableSymbolJson), ); } @@ -78,6 +80,17 @@ bool _parseVariableThrows(Json json) { return throws; } +bool _parseVariableAsync(Json json) { + final async = json['declarationFragments'] + .any((frag) => matchFragment(frag, 'keyword', 'async')); + if (async) { + // TODO(https://github.com/dart-lang/native/issues/1778): Support async + // getters. + throw Exception("Async getters aren't supported yet, at ${json.path}"); + } + return async; +} + bool _parsePropertyHasSetter(Json propertySymbolJson) { final fragmentsJson = propertySymbolJson['declarationFragments']; diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart index d01bd06f8..cd06487a0 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_compound.dart @@ -101,6 +101,7 @@ InitializerDeclaration _buildWrapperInitializer( isOverriding: false, isFailable: false, throws: false, + async: false, statements: ['self.${wrappedClassInstance.name} = wrappedInstance'], hasObjCAnnotation: wrappedClassInstance.hasObjCAnnotation, ); diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart index a1ce97dc0..c5e375282 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_function.dart @@ -100,6 +100,7 @@ MethodDeclaration _transformFunction( ? originalFunction.isStatic : true, throws: originalFunction.throws, + async: originalFunction.async, ); transformedMethod.statements = _generateStatements( @@ -150,6 +151,9 @@ List _generateStatements( final arguments = generateInvocationParams( localNamer, originalFunction.params, transformedMethod.params); var originalMethodCall = originalCallGenerator(arguments); + if (transformedMethod.async) { + originalMethodCall = 'await $originalMethodCall'; + } if (transformedMethod.throws) { originalMethodCall = 'try $originalMethodCall'; } diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart index a7af3c365..293ec96fa 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_initializer.dart @@ -36,6 +36,7 @@ InitializerDeclaration transformInitializer( hasObjCAnnotation: true, isFailable: originalInitializer.isFailable, throws: originalInitializer.throws, + async: originalInitializer.async, // Because the wrapper class extends NSObject that has an initializer with // no parameters. If we make a similar parameterless initializer we need // to add `override` keyword. @@ -60,6 +61,9 @@ List _generateInitializerStatements( localNamer, originalInitializer.params, transformedInitializer.params); var instanceConstruction = '${wrappedClassInstance.type.swiftType}($arguments)'; + if (transformedInitializer.async) { + instanceConstruction = 'await $instanceConstruction'; + } if (transformedInitializer.throws) { instanceConstruction = 'try $instanceConstruction'; } diff --git a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart index 9c061542e..c18e02a50 100644 --- a/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart +++ b/pkgs/swift2objc/lib/src/transformer/transformers/transform_variable.dart @@ -82,6 +82,7 @@ PropertyDeclaration _transformVariable( : true, isConstant: originalVariable.isConstant, throws: originalVariable.throws, + async: originalVariable.async, ); final getterStatements = _generateGetterStatements( diff --git a/pkgs/swift2objc/test/integration/async_input.swift b/pkgs/swift2objc/test/integration/async_input.swift new file mode 100644 index 000000000..44ebd6ef9 --- /dev/null +++ b/pkgs/swift2objc/test/integration/async_input.swift @@ -0,0 +1,12 @@ +import Foundation + +public class MyClass { + public func voidMethod() async {} + public func intMethod(y: Int) async -> MyClass { return MyClass() } + public func asyncThrowsMethod(y: Int) async throws -> MyClass { + return MyClass() + } +} + +public func voidFunc(x: Int, y: Int) async {} +public func intFunc() async -> MyClass { return MyClass() } diff --git a/pkgs/swift2objc/test/integration/async_output.swift b/pkgs/swift2objc/test/integration/async_output.swift new file mode 100644 index 000000000..d10445bb7 --- /dev/null +++ b/pkgs/swift2objc/test/integration/async_output.swift @@ -0,0 +1,39 @@ +// Test preamble text + +import Foundation + +@objc public class GlobalsWrapper: NSObject { + @objc static public func intFuncWrapper() async -> MyClassWrapper { + let result = await intFunc() + return MyClassWrapper(result) + } + + @objc static public func voidFuncWrapper(x: Int, y: Int) async { + return await voidFunc(x: x, y: y) + } + +} + +@objc public class MyClassWrapper: NSObject { + var wrappedInstance: MyClass + + init(_ wrappedInstance: MyClass) { + self.wrappedInstance = wrappedInstance + } + + @objc public func voidMethod() async { + return await wrappedInstance.voidMethod() + } + + @objc public func asyncThrowsMethod(y: Int) async throws -> MyClassWrapper { + let result = try await wrappedInstance.asyncThrowsMethod(y: y) + return MyClassWrapper(result) + } + + @objc public func intMethod(y: Int) async -> MyClassWrapper { + let result = await wrappedInstance.intMethod(y: y) + return MyClassWrapper(result) + } + +} + diff --git a/pkgs/swift2objc/test/unit/parse_function_info_test.dart b/pkgs/swift2objc/test/unit/parse_function_info_test.dart index 909b07cd0..3d86a1b7b 100644 --- a/pkgs/swift2objc/test/unit/parse_function_info_test.dart +++ b/pkgs/swift2objc/test/unit/parse_function_info_test.dart @@ -79,6 +79,7 @@ void main() { expectEqualParams(info.params, expectedParams); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('Three params with some optional', () { @@ -140,6 +141,7 @@ void main() { expectEqualParams(info.params, expectedParams); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('One param', () { @@ -171,6 +173,7 @@ void main() { expectEqualParams(info.params, expectedParams); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('No params', () { @@ -187,6 +190,7 @@ void main() { expectEqualParams(info.params, []); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('Function with return type', () { @@ -227,6 +231,7 @@ void main() { expectEqualParams(info.params, expectedParams); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('Function with no params with return type', () { @@ -250,6 +255,7 @@ void main() { expectEqualParams(info.params, []); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('Function with no params and no return type', () { @@ -268,6 +274,7 @@ void main() { expectEqualParams(info.params, []); expect(info.throws, isFalse); + expect(info.async, isFalse); }); test('Function with return type that throws', () { @@ -308,6 +315,7 @@ void main() { expectEqualParams(info.params, expectedParams); expect(info.throws, isTrue); + expect(info.async, isFalse); }); test('Function with no return type that throws', () { @@ -342,6 +350,7 @@ void main() { expectEqualParams(info.params, expectedParams); expect(info.throws, isTrue); + expect(info.async, isFalse); }); test('Function with no params that throws', () { @@ -361,6 +370,91 @@ void main() { expectEqualParams(info.params, []); expect(info.throws, isTrue); + expect(info.async, isFalse); + }); + + test('Function with async annotation', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ") " }, + { "kind": "keyword", "spelling": "async" }, + { "kind": "text", "spelling": " -> " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'parameter', + type: intType, + ), + ]; + + expectEqualParams(info.params, expectedParams); + expect(info.throws, isFalse); + expect(info.async, isTrue); + }); + + test('Function with async and throws annotations', () { + final json = Json(jsonDecode( + ''' + [ + { "kind": "keyword", "spelling": "func" }, + { "kind": "text", "spelling": " " }, + { "kind": "identifier", "spelling": "foo" }, + { "kind": "text", "spelling": "(" }, + { "kind": "externalParam", "spelling": "parameter" }, + { "kind": "text", "spelling": ": " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + }, + { "kind": "text", "spelling": ") " }, + { "kind": "keyword", "spelling": "async" }, + { "kind": "text", "spelling": " " }, + { "kind": "keyword", "spelling": "throws" }, + { "kind": "text", "spelling": " -> " }, + { + "kind": "typeIdentifier", + "spelling": "Int", + "preciseIdentifier": "s:Si" + } + ] + ''', + )); + + final info = parseFunctionInfo(json, emptySymbolgraph); + + final expectedParams = [ + Parameter( + name: 'parameter', + type: intType, + ), + ]; + + expectEqualParams(info.params, expectedParams); + expect(info.throws, isTrue); + expect(info.async, isTrue); }); }); From aa82b970f720b8e1557f972ef91e65b1e92b19c8 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 4 Dec 2024 12:43:29 +1300 Subject: [PATCH 28/50] [ffigen][swift2objc] Some small fixes (#1777) --- pkgs/ffigen/lib/ffigen.dart | 9 ++++- .../lib/src/code_generator/pointer.dart | 15 ++++++++ pkgs/ffigen/lib/src/config_provider.dart | 1 + pkgs/ffigen/lib/src/header_parser/parser.dart | 1 - .../sub_parsers/objcinterfacedecl_parser.dart | 2 +- .../src/visitor/fix_overridden_methods.dart | 4 ++- .../large_objc_test.dart | 1 - .../test/unit_tests/subtyping_test.dart | 36 ++++++++++++++----- .../src/objective_c_bindings_generated.dart | 6 ++-- .../built_in/built_in_declaration.dart | 2 ++ pkgs/swift2objc/lib/src/config.dart | 18 +++++----- 11 files changed, 70 insertions(+), 25 deletions(-) diff --git a/pkgs/ffigen/lib/ffigen.dart b/pkgs/ffigen/lib/ffigen.dart index 351ffb857..aa1f364e5 100644 --- a/pkgs/ffigen/lib/ffigen.dart +++ b/pkgs/ffigen/lib/ffigen.dart @@ -8,5 +8,12 @@ /// https://pub.dev/packages/ffigen for details. library ffigen; -export 'src/config_provider.dart' show Config, YamlConfig; +export 'src/config_provider.dart' + show + Config, + DeclarationFilters, + ExternalVersions, + Language, + Versions, + YamlConfig; export 'src/ffigen.dart' show FfiGen; diff --git a/pkgs/ffigen/lib/src/code_generator/pointer.dart b/pkgs/ffigen/lib/src/code_generator/pointer.dart index b4a21c01e..4df2e867c 100644 --- a/pkgs/ffigen/lib/src/code_generator/pointer.dart +++ b/pkgs/ffigen/lib/src/code_generator/pointer.dart @@ -154,6 +154,15 @@ class ObjCObjectPointer extends PointerType { @override String? generateRetain(String value) => 'objc_retain($value)'; + + @override + bool isSupertypeOf(Type other) { + other = other.typealiasType; + // id/Object* is a supertype of all ObjC objects and blocks. + return other is ObjCObjectPointer || + other is ObjCInterface || + other is ObjCBlock; + } } /// A pointer to an Objective C block. @@ -168,4 +177,10 @@ class ObjCBlockPointer extends ObjCObjectPointer { @override String? generateRetain(String value) => 'objc_retainBlock($value)'; + + @override + bool isSupertypeOf(Type other) { + other = other.typealiasType; + return other is ObjCBlockPointer || other is ObjCBlock; + } } diff --git a/pkgs/ffigen/lib/src/config_provider.dart b/pkgs/ffigen/lib/src/config_provider.dart index f3b99499c..8feb6fe89 100644 --- a/pkgs/ffigen/lib/src/config_provider.dart +++ b/pkgs/ffigen/lib/src/config_provider.dart @@ -6,4 +6,5 @@ library config_provider; export 'config_provider/config.dart'; +export 'config_provider/config_types.dart'; export 'config_provider/yaml_config.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/parser.dart b/pkgs/ffigen/lib/src/header_parser/parser.dart index 15dc0f5e3..882e68c3f 100644 --- a/pkgs/ffigen/lib/src/header_parser/parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/parser.dart @@ -12,7 +12,6 @@ import 'package:logging/logging.dart'; import '../code_generator.dart'; import '../code_generator/utils.dart'; import '../config_provider.dart'; -import '../config_provider/config_types.dart'; import '../strings.dart' as strings; import '../visitor/apply_config_filters.dart'; import '../visitor/ast.dart'; diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index db4e70f0f..687ba22e8 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart @@ -174,7 +174,7 @@ void _parseSuperType(clang_types.CXCursor cursor, ObjCInterface itf) { kind: ObjCMethodKind.propertySetter, isClassMethod: isClassMethod, isOptional: isOptionalMethod, - returnType: NativeType(SupportedNativeType.voidType), + returnType: voidType, family: null, ); setter.params diff --git a/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart b/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart index d06c7db1a..62914e53f 100644 --- a/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart +++ b/pkgs/ffigen/lib/src/visitor/fix_overridden_methods.dart @@ -130,7 +130,9 @@ class FixOverriddenMethodsVisitation extends Visitation { final (root, rootMethod) = _findRootWithMethod(node, method); // If method and rootMethod are the same kind, then there's nothing to do. if ((method.kind == ObjCMethodKind.propertyGetter) == - (rootMethod.kind == ObjCMethodKind.propertyGetter)) continue; + (rootMethod.kind == ObjCMethodKind.propertyGetter)) { + continue; + } _convertAllSubtreeMethodsToProperties(root, rootMethod); } } diff --git a/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart b/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart index 212f997df..58f919c54 100644 --- a/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart +++ b/pkgs/ffigen/test/large_integration_tests/large_objc_test.dart @@ -14,7 +14,6 @@ import 'dart:io'; import 'package:ffigen/ffigen.dart'; import 'package:ffigen/src/code_generator/utils.dart'; -import 'package:ffigen/src/config_provider/config.dart'; import 'package:ffigen/src/config_provider/config_types.dart'; import 'package:logging/logging.dart'; import 'package:pub_semver/pub_semver.dart'; diff --git a/pkgs/ffigen/test/unit_tests/subtyping_test.dart b/pkgs/ffigen/test/unit_tests/subtyping_test.dart index 5ac548ca8..191767dad 100644 --- a/pkgs/ffigen/test/unit_tests/subtyping_test.dart +++ b/pkgs/ffigen/test/unit_tests/subtyping_test.dart @@ -32,6 +32,14 @@ void main() { final uncle = makeInterface('Uncle', grandparent); final child = makeInterface('Child', parent); + ObjCBlock makeBlock(Type returnType, List argTypes) => ObjCBlock( + returnType: returnType, + params: [ + for (final t in argTypes) Parameter(type: t, objCConsumed: false), + ], + returnsRetained: false, + builtInFunctions: builtInFunctions); + group('ObjCInterface', () { test('subtype', () { expect(parent.isSubtypeOf(parent), isTrue); @@ -140,14 +148,6 @@ void main() { }); group('ObjCBlock', () { - ObjCBlock makeBlock(Type returnType, List argTypes) => ObjCBlock( - returnType: returnType, - params: [ - for (final t in argTypes) Parameter(type: t, objCConsumed: false), - ], - returnsRetained: false, - builtInFunctions: builtInFunctions); - test('covariant returns', () { // Return types are covariant. S Function() <: T Function() if S <: T. final returnsParent = makeBlock(parent, []); @@ -237,5 +237,25 @@ void main() { expect(makeTypealias(parent).isSubtypeOf(child), isFalse); expect(parent.isSubtypeOf(makeTypealias(child)), isFalse); }); + + test('ObjCObjectPointer', () { + expect(ObjCObjectPointer().isSubtypeOf(ObjCObjectPointer()), isTrue); + expect(parent.isSubtypeOf(ObjCObjectPointer()), isTrue); + expect(ObjCObjectPointer().isSubtypeOf(parent), isFalse); + + final block = makeBlock(voidType, []); + expect(block.isSubtypeOf(ObjCObjectPointer()), isTrue); + expect(ObjCObjectPointer().isSubtypeOf(block), isFalse); + }); + + test('ObjCBlockPointer', () { + expect(ObjCBlockPointer().isSubtypeOf(ObjCBlockPointer()), isTrue); + expect(parent.isSubtypeOf(ObjCBlockPointer()), isFalse); + expect(ObjCBlockPointer().isSubtypeOf(parent), isFalse); + + final block = makeBlock(voidType, []); + expect(block.isSubtypeOf(ObjCBlockPointer()), isTrue); + expect(ObjCBlockPointer().isSubtypeOf(block), isFalse); + }); }); } diff --git a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart index 4a8f27735..e36f5d26e 100644 --- a/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart +++ b/pkgs/objective_c/lib/src/objective_c_bindings_generated.dart @@ -2362,7 +2362,7 @@ class NSItemProvider extends NSObject { /// setSuggestedName: set suggestedName(NSString? value) { - return _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setSuggestedName_, + _objc_msgSend_1jdvcbf(this.ref.pointer, _sel_setSuggestedName_, value?.ref.pointer ?? ffi.nullptr); } @@ -3074,7 +3074,7 @@ class NSMutableData extends NSData { /// setLength: set length(int value) { - return _objc_msgSend_1i9r4xy(this.ref.pointer, _sel_setLength_, value); + _objc_msgSend_1i9r4xy(this.ref.pointer, _sel_setLength_, value); } } @@ -6228,7 +6228,7 @@ class NSStream extends NSObject { /// setDelegate: set delegate(objc.ObjCObjectBase? value) { - return _objc_msgSend_1jdvcbf( + _objc_msgSend_1jdvcbf( this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); } diff --git a/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart b/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart index f3d2f319b..9c75ba42f 100644 --- a/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart +++ b/pkgs/swift2objc/lib/src/ast/declarations/built_in/built_in_declaration.dart @@ -10,6 +10,7 @@ enum BuiltInDeclaration implements Declaration, ObjCAnnotatable { swiftNSObject(id: 'c:objc(cs)NSObject', name: 'NSObject'), swiftString(id: 's:SS', name: 'String'), swiftInt(id: 's:Si', name: 'Int'), + swiftFloat(id: 's:Sf', name: 'Float'), swiftDouble(id: 's:Sd', name: 'Double'), swiftBool(id: 's:Sb', name: 'Bool'), swiftVoid(id: 's:s4Voida', name: 'Void'); @@ -32,6 +33,7 @@ enum BuiltInDeclaration implements Declaration, ObjCAnnotatable { final objectType = BuiltInDeclaration.swiftNSObject.asDeclaredType; final stringType = BuiltInDeclaration.swiftString.asDeclaredType; final intType = BuiltInDeclaration.swiftInt.asDeclaredType; +final floatType = BuiltInDeclaration.swiftFloat.asDeclaredType; final doubleType = BuiltInDeclaration.swiftDouble.asDeclaredType; final boolType = BuiltInDeclaration.swiftBool.asDeclaredType; final voidType = BuiltInDeclaration.swiftVoid.asDeclaredType; diff --git a/pkgs/swift2objc/lib/src/config.dart b/pkgs/swift2objc/lib/src/config.dart index 4f2ac6eba..2f05353c2 100644 --- a/pkgs/swift2objc/lib/src/config.dart +++ b/pkgs/swift2objc/lib/src/config.dart @@ -22,14 +22,14 @@ class Config { /// Specify where the wrapper swift file will be output. final Uri outputFile; - /// Specify where the wrapper swift file will be output. + /// Text inserted into the [outputFile] before the generated output. final String? preamble; /// Specify where to output the intermidiate files (i.g the symbolgraph json). /// If this is null, a teemp directory will be generated in the system temp /// directory (using `Directory.systemTemp`) and then deleted. /// Specifying a temp directory would prevent the tool from deleting the - /// intermediate files after generating the wrapper + /// intermediate files after generating the wrapper. final Uri? tempDir; const Config({ @@ -46,12 +46,12 @@ sealed class InputConfig { Command? get symbolgraphCommand; } -/// Used to generate a objc wrapper for one or more swift files +/// Used to generate a objc wrapper for one or more swift files. class FilesInputConfig implements InputConfig { - /// The swift file(s) to generate a wrapper for + /// The swift file(s) to generate a wrapper for. final List files; - /// The name of the module files generated by `swiftc in `tempDir` + /// The name of the module files generated by `swiftc in `tempDir`. final String generatedModuleName; FilesInputConfig({ @@ -74,17 +74,17 @@ class FilesInputConfig implements InputConfig { ); } -/// Used to generate a objc wrapper for a built-in swift module +/// Used to generate a objc wrapper for a built-in swift module. /// (e.g, AVFoundation) class ModuleInputConfig implements InputConfig { - /// The swift module to generate a wrapper for + /// The swift module to generate a wrapper for. final String module; - /// The target to generate code for + /// The target to generate code for. /// (e.g `x86_64-apple-ios17.0-simulator`) final String target; - /// The sdk to compile against + /// The sdk to compile against. /// (e.g `/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sd`) final Uri sdk; From d56a5b5fbd9a0eba48b4b0ca34e808034b3a29d9 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 4 Dec 2024 11:01:59 +0100 Subject: [PATCH 29/50] [native_assets_builder] Don't cache hook invocations if env vars change (#1759) This PR makes the native assets builder save the `Platform.environment` a hook is run in. Subsequent invocations check if the environment didn't change. This removes the `includeParentEnvironment` parameter everywhere. It was always set to true in `dartdev` and `flutter_tools` (This will require a manual roll into the Dart SDK and Flutter tools.) A follow up PR should restrict the list of environment variables (https://github.com/dart-lang/native/pull/1764), this PR is about caching correctness. Bug: * https://github.com/dart-lang/native/issues/32 --- .../lib/src/build_runner/build_runner.dart | 53 +++----- .../dependencies_hash_file.dart | 126 ++++++++++++++---- .../lib/src/utils/run_process.dart | 13 -- .../build_runner_caching_test.dart | 75 ++++++++++- .../build_runner_reusability_test.dart | 4 - .../build_runner_run_in_isolation_test.dart | 75 ----------- .../concurrency_shared_test_helper.dart | 1 - .../build_runner/concurrency_test_helper.dart | 1 - .../test/build_runner/helpers.dart | 9 -- .../dependencies_hash_file_test.dart | 59 +++++--- pkgs/native_assets_builder/test/helpers.dart | 2 - .../lib/src/utils/run_process.dart | 17 +-- 12 files changed, 235 insertions(+), 200 deletions(-) delete mode 100644 pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 1559ec803..f5a900280 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -96,7 +96,6 @@ class NativeAssetsBuildRunner { required OS targetOS, required BuildMode buildMode, required Uri workingDirectory, - required bool includeParentEnvironment, PackageLayout? packageLayout, String? runPackageName, required List supportedAssetTypes, @@ -165,7 +164,6 @@ class NativeAssetsBuildRunner { buildValidator(config as BuildConfig, output as BuildOutput), packageLayout.packageConfigUri, workingDirectory, - includeParentEnvironment, null, packageLayout, ); @@ -205,7 +203,6 @@ class NativeAssetsBuildRunner { required BuildMode buildMode, required Uri workingDirectory, required ApplicationAssetValidator applicationAssetValidator, - required bool includeParentEnvironment, PackageLayout? packageLayout, Uri? resourceIdentifiers, String? runPackageName, @@ -269,7 +266,6 @@ class NativeAssetsBuildRunner { linkValidator(config as LinkConfig, output as LinkOutput), packageLayout.packageConfigUri, workingDirectory, - includeParentEnvironment, resourceIdentifiers, packageLayout, ); @@ -330,7 +326,6 @@ class NativeAssetsBuildRunner { required OS targetOS, required Uri workingDirectory, required bool linkingEnabled, - required bool includeParentEnvironment, PackageLayout? packageLayout, String? runPackageName, required List supportedAssetTypes, @@ -341,7 +336,6 @@ class NativeAssetsBuildRunner { validator: (HookConfig config, HookOutput output) => buildValidator(config as BuildConfig, output as BuildOutput), workingDirectory: workingDirectory, - includeParentEnvironment: includeParentEnvironment, packageLayout: packageLayout, runPackageName: runPackageName, supportedAssetTypes: supportedAssetTypes, @@ -353,7 +347,6 @@ class NativeAssetsBuildRunner { required _HookValidator validator, required OS targetOS, required Uri workingDirectory, - required bool includeParentEnvironment, PackageLayout? packageLayout, String? runPackageName, required bool linkingEnabled, @@ -420,7 +413,6 @@ class NativeAssetsBuildRunner { config.packageRoot.resolve('hook/${hook.scriptName}'), packageConfigUri, workingDirectory, - includeParentEnvironment, ); if (!compileSuccess) return null; @@ -438,7 +430,6 @@ class NativeAssetsBuildRunner { validator, packageConfigUri, workingDirectory, - includeParentEnvironment, null, hookKernelFile, packageLayout!, @@ -450,18 +441,16 @@ class NativeAssetsBuildRunner { return hookResult; } - // TODO(https://github.com/dart-lang/native/issues/32): Rerun hook if - // environment variables change. Future _runHookForPackageCached( Hook hook, HookConfig config, _HookValidator validator, Uri packageConfigUri, Uri workingDirectory, - bool includeParentEnvironment, Uri? resources, PackageLayout packageLayout, ) async { + final environment = Platform.environment; final outDir = config.outputDirectory; return await runUnderDirectoriesLock( [ @@ -481,7 +470,6 @@ class NativeAssetsBuildRunner { config.packageRoot.resolve('hook/${hook.scriptName}'), packageConfigUri, workingDirectory, - includeParentEnvironment, ); if (!compileSuccess) { return null; @@ -510,9 +498,10 @@ ${e.message} '''); return null; } - final outdatedFile = - await dependenciesHashes.findOutdatedFileSystemEntity(); - if (outdatedFile == null) { + + final outdatedDependency = + await dependenciesHashes.findOutdatedDependency(environment); + if (outdatedDependency == null) { logger.info( 'Skipping ${hook.name} for ${config.packageName}' ' in ${outDir.toFilePath()}.' @@ -524,8 +513,7 @@ ${e.message} } logger.info( 'Rerunning ${hook.name} for ${config.packageName}' - ' in ${outDir.toFilePath()}.' - ' ${outdatedFile.toFilePath()} changed.', + ' in ${outDir.toFilePath()}. $outdatedDependency', ); } @@ -535,7 +523,6 @@ ${e.message} validator, packageConfigUri, workingDirectory, - includeParentEnvironment, resources, hookKernelFile, packageLayout, @@ -545,14 +532,14 @@ ${e.message} await dependenciesHashFile.delete(); } } else { - final modifiedDuringBuild = - await dependenciesHashes.hashFilesAndDirectories( + final modifiedDuringBuild = await dependenciesHashes.hashDependencies( [ ...result.dependencies, // Also depend on the hook source code. hookHashesFile.uri, ], - validBeforeLastModified: lastModifiedCutoffTime, + lastModifiedCutoffTime, + environment, ); if (modifiedDuringBuild != null) { logger.severe('File modified during build. Build must be rerun.'); @@ -569,7 +556,6 @@ ${e.message} _HookValidator validator, Uri packageConfigUri, Uri workingDirectory, - bool includeParentEnvironment, Uri? resources, File hookKernelFile, PackageLayout packageLayout, @@ -597,7 +583,6 @@ ${e.message} executable: dartExecutable, arguments: arguments, logger: logger, - includeParentEnvironment: includeParentEnvironment, ); var deleteOutputIfExists = false; @@ -680,8 +665,8 @@ ${e.message} Uri scriptUri, Uri packageConfigUri, Uri workingDirectory, - bool includeParentEnvironment, ) async { + final environment = Platform.environment; final kernelFile = File.fromUri( outputDirectory.resolve('../hook.dill'), ); @@ -697,13 +682,12 @@ ${e.message} if (!await dependenciesHashFile.exists()) { mustCompile = true; } else { - final outdatedFile = - await dependenciesHashes.findOutdatedFileSystemEntity(); - if (outdatedFile != null) { + final outdatedDependency = + await dependenciesHashes.findOutdatedDependency(environment); + if (outdatedDependency != null) { mustCompile = true; logger.info( - 'Recompiling ${scriptUri.toFilePath()}, ' - '${outdatedFile.toFilePath()} changed.', + 'Recompiling ${scriptUri.toFilePath()}. $outdatedDependency', ); } } @@ -717,7 +701,6 @@ ${e.message} scriptUri, packageConfigUri, workingDirectory, - includeParentEnvironment, kernelFile, depFile, ); @@ -727,14 +710,14 @@ ${e.message} } final dartSources = await _readDepFile(depFile); - final modifiedDuringBuild = - await dependenciesHashes.hashFilesAndDirectories( + final modifiedDuringBuild = await dependenciesHashes.hashDependencies( [ ...dartSources, // If the Dart version changed, recompile. dartExecutable.resolve('../version'), ], - validBeforeLastModified: lastModifiedCutoffTime, + lastModifiedCutoffTime, + environment, ); if (modifiedDuringBuild != null) { logger.severe('File modified during build. Build must be rerun.'); @@ -760,7 +743,6 @@ ${e.message} Uri scriptUri, Uri packageConfigUri, Uri workingDirectory, - bool includeParentEnvironment, File kernelFile, File depFile, ) async { @@ -777,7 +759,6 @@ ${e.message} executable: dartExecutable, arguments: compileArguments, logger: logger, - includeParentEnvironment: includeParentEnvironment, ); var success = true; if (compileResult.exitCode != 0) { diff --git a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart index 259be5793..2b1c49259 100644 --- a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart +++ b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart @@ -33,23 +33,24 @@ class DependenciesHashFile { void _reset() => _hashes = FileSystemHashes(); /// Populate the hashes and persist file with entries from - /// [fileSystemEntities]. + /// [fileSystemEntities] and [environment]. /// - /// If [validBeforeLastModified] is provided, any entities that were modified - /// after [validBeforeLastModified] will get a dummy hash so that they will - /// show up as outdated. If any such entity exists, its uri will be returned. - Future hashFilesAndDirectories( - List fileSystemEntities, { - DateTime? validBeforeLastModified, - }) async { + /// Any file system entities that were modified after + /// [fileSystemValidBeforeLastModified] will get a dummy hash so that they + /// will show up as outdated. If any such entity exists, its uri will be + /// returned. + Future hashDependencies( + List fileSystemEntities, + DateTime fileSystemValidBeforeLastModified, + Map environment, + ) async { _reset(); Uri? modifiedAfterTimeStamp; for (final uri in fileSystemEntities) { int hash; - if (validBeforeLastModified != null && - (await uri.fileSystemEntity.lastModified()) - .isAfter(validBeforeLastModified)) { + if ((await uri.fileSystemEntity.lastModified()) + .isAfter(fileSystemValidBeforeLastModified)) { hash = _hashLastModifiedAfterCutoff; modifiedAfterTimeStamp = uri; } else { @@ -61,30 +62,55 @@ class DependenciesHashFile { } _hashes.files.add(FilesystemEntityHash(uri, hash)); } + for (final entry in environment.entries) { + _hashes.environment.add(EnvironmentVariableHash( + entry.key, _hashEnvironmentValue(entry.value))); + } await _persist(); return modifiedAfterTimeStamp; } Future _persist() => _file.writeAsString(json.encode(_hashes.toJson())); - /// Reads the file with hashes and finds an outdated file or directory if it - /// exists. - Future findOutdatedFileSystemEntity() async { + /// Reads the file with hashes and reports if there is an outdated file, + /// directory or environment variable. + Future findOutdatedDependency( + Map environment, + ) async { await _readFile(); for (final savedHash in _hashes.files) { final uri = savedHash.path; final savedHashValue = savedHash.hash; - final int hashValue; if (_isDirectoryPath(uri.path)) { - hashValue = await _hashDirectory(uri); + final hashValue = await _hashDirectory(uri); + if (savedHashValue != hashValue) { + return 'Directory contents changed: ${uri.toFilePath()}.'; + } } else { - hashValue = await _hashFile(uri); + final hashValue = await _hashFile(uri); + if (savedHashValue != hashValue) { + return 'File contents changed: ${uri.toFilePath()}.'; + } + } + } + + // Check if env vars changed or were removed. + for (final savedHash in _hashes.environment) { + final hashValue = _hashEnvironmentValue(environment[savedHash.key]); + if (savedHash.hash != hashValue) { + return 'Environment variable changed: ${savedHash.key}.'; } - if (savedHashValue != hashValue) { - return uri; + } + + // Check if env vars were added. + final savedEnvKeys = _hashes.environment.map((e) => e.key).toSet(); + for (final envKey in environment.keys) { + if (!savedEnvKeys.contains(envKey)) { + return 'Environment variable changed: $envKey.'; } } + return null; } @@ -109,8 +135,14 @@ class DependenciesHashFile { return _hashNotExists; } final children = directory.listSync(followLinks: true, recursive: false); - final childrenNames = children.map((e) => _pathBaseName(e.path)).join(';'); - return _md5int64(utf8.encode(childrenNames)); + final childrenNames = children.map((e) => _pathBaseName(e.path)).toList() + ..sort(); + return _md5int64(utf8.encode(childrenNames.join(';'))); + } + + int _hashEnvironmentValue(String? value) { + if (value == null) return _hashNotExists; + return _md5int64(utf8.encode(value)); } /// Predefined hash for files and directories that do not exist. @@ -135,27 +167,43 @@ class DependenciesHashFile { class FileSystemHashes { FileSystemHashes({ List? files, - }) : files = files ?? []; + List? environment, + }) : files = files ?? [], + environment = environment ?? []; factory FileSystemHashes.fromJson(Map json) { - final rawEntries = (json[_entitiesKey] as List).cast(); + final rawFilesystemEntries = + (json[_filesystemKey] as List?)?.cast() ?? []; final files = [ - for (final rawEntry in rawEntries) + for (final rawEntry in rawFilesystemEntries) FilesystemEntityHash._fromJson((rawEntry as Map).cast()), ]; + final rawEnvironmentEntries = + (json[_environmentKey] as List?)?.cast() ?? []; + final environment = [ + for (final rawEntry in rawEnvironmentEntries) + EnvironmentVariableHash._fromJson((rawEntry as Map).cast()), + ]; return FileSystemHashes( files: files, + environment: environment, ); } final List files; + final List environment; - static const _entitiesKey = 'entities'; + static const _filesystemKey = 'file_system'; + + static const _environmentKey = 'environment'; Map toJson() => { - _entitiesKey: [ + _filesystemKey: [ for (final FilesystemEntityHash file in files) file.toJson(), ], + _environmentKey: [ + for (final EnvironmentVariableHash env in environment) env.toJson(), + ], }; } @@ -190,6 +238,32 @@ class FilesystemEntityHash { }; } +class EnvironmentVariableHash { + EnvironmentVariableHash( + this.key, + this.hash, + ); + + factory EnvironmentVariableHash._fromJson(Map json) => + EnvironmentVariableHash( + json[_keyKey] as String, + json[_hashKey] as int, + ); + + static const _keyKey = 'key'; + static const _hashKey = 'hash'; + + final String key; + + /// A 64 bit hash. + final int hash; + + Object toJson() => { + _keyKey: key, + _hashKey: hash, + }; +} + bool _isDirectoryPath(String path) => path.endsWith(Platform.pathSeparator) || path.endsWith('/'); diff --git a/pkgs/native_assets_builder/lib/src/utils/run_process.dart b/pkgs/native_assets_builder/lib/src/utils/run_process.dart index cb989c7bc..efb712012 100644 --- a/pkgs/native_assets_builder/lib/src/utils/run_process.dart +++ b/pkgs/native_assets_builder/lib/src/utils/run_process.dart @@ -25,19 +25,6 @@ Future runProcess({ int expectedExitCode = 0, bool throwOnUnexpectedExitCode = false, }) async { - if (Platform.isWindows && !includeParentEnvironment) { - const winEnvKeys = [ - 'SYSTEMROOT', - 'TEMP', - 'TMP', - ]; - environment = { - for (final winEnvKey in winEnvKeys) - winEnvKey: Platform.environment[winEnvKey]!, - ...?environment, - }; - } - final printWorkingDir = workingDirectory != null && workingDirectory != Directory.current.uri; final commandString = [ diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index 5b31cae41..851458b14 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -2,6 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +import 'dart:convert'; import 'dart:io'; import 'package:test/test.dart'; @@ -139,7 +140,7 @@ void main() async { stringContainsInOrder( [ 'Rerunning build for native_add in', - '${cUri.toFilePath()} changed.' + 'File contents changed: ${cUri.toFilePath()}.' ], ), ); @@ -219,4 +220,76 @@ void main() async { }); }, ); + + test( + 'change environment', + timeout: longTimeout, + () async { + await inTempDir((tempUri) async { + await copyTestProjects(targetUri: tempUri); + final packageUri = tempUri.resolve('native_add/'); + + final logMessages = []; + final logger = createCapturingLogger(logMessages); + + await runPubGet(workingDirectory: packageUri, logger: logger); + logMessages.clear(); + + final result = (await build( + packageUri, + logger, + dartExecutable, + supportedAssetTypes: [CodeAsset.type], + configValidator: validateCodeAssetBuildConfig, + buildValidator: validateCodeAssetBuildOutput, + applicationAssetValidator: validateCodeAssetInApplication, + ))!; + logMessages.clear(); + + // Simulate that the environment variables changed by augmenting the + // persisted environment from the last invocation. + final dependenciesHashFile = File.fromUri( + CodeAsset.fromEncoded(result.encodedAssets.single) + .file! + .parent + .parent + .resolve('dependencies.dependencies_hash_file.json'), + ); + expect(await dependenciesHashFile.exists(), true); + final dependenciesContent = + jsonDecode(await dependenciesHashFile.readAsString()) + as Map; + const modifiedEnvKey = 'PATH'; + (dependenciesContent['environment'] as List).add({ + 'key': modifiedEnvKey, + 'hash': 123456789, + }); + await dependenciesHashFile + .writeAsString(jsonEncode(dependenciesContent)); + + (await build( + packageUri, + logger, + dartExecutable, + supportedAssetTypes: [CodeAsset.type], + configValidator: validateCodeAssetBuildConfig, + buildValidator: validateCodeAssetBuildOutput, + applicationAssetValidator: validateCodeAssetInApplication, + ))!; + expect( + logMessages.join('\n'), + contains('hook.dill'), + ); + expect( + logMessages.join('\n'), + isNot(contains('Skipping build for native_add')), + ); + expect( + logMessages.join('\n'), + contains('Environment variable changed: $modifiedEnvKey.'), + ); + logMessages.clear(); + }); + }, + ); } diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index 19e58520d..2f8d34b45 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -37,7 +37,6 @@ void main() async { configCreator: configCreator, targetOS: Target.current.os, workingDirectory: packageUri, - includeParentEnvironment: true, linkingEnabled: false, supportedAssetTypes: [], buildValidator: (config, output) async => [], @@ -46,7 +45,6 @@ void main() async { configCreator: configCreator, targetOS: Target.current.os, workingDirectory: packageUri, - includeParentEnvironment: true, linkingEnabled: false, supportedAssetTypes: [], buildValidator: (config, output) async => [], @@ -56,7 +54,6 @@ void main() async { targetOS: OS.current, buildMode: BuildMode.release, workingDirectory: packageUri, - includeParentEnvironment: true, linkingEnabled: false, supportedAssetTypes: [], configValidator: (config) async => [], @@ -68,7 +65,6 @@ void main() async { buildMode: BuildMode.release, targetOS: OS.current, workingDirectory: packageUri, - includeParentEnvironment: true, linkingEnabled: false, supportedAssetTypes: [], configValidator: (config) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart deleted file mode 100644 index 45f6bbc17..000000000 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_run_in_isolation_test.dart +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:io'; - -import 'package:test/test.dart'; - -import '../helpers.dart'; -import 'helpers.dart'; - -const Timeout longTimeout = Timeout(Duration(minutes: 5)); - -void main() async { - final env = Platform.environment; - final cc = env['DART_HOOK_TESTING_C_COMPILER__CC']; - final ar = env['DART_HOOK_TESTING_C_COMPILER__AR']; - final ld = env['DART_HOOK_TESTING_C_COMPILER__LD']; - final envScript = env['DART_HOOK_TESTING_C_COMPILER__ENV_SCRIPT']; - final envScriptArgs = - env['DART_HOOK_TESTING_C_COMPILER__ENV_SCRIPT_ARGUMENTS'] - ?.split(' ') - .map((arg) => arg.trim()) - .where((arg) => arg.isNotEmpty) - .toList(); - - if (cc == null) { - // We don't set any compiler paths on the GitHub CI. - // We neither set compiler paths on MacOS on the Dart SDK CI - // in pkg/test_runner/lib/src/configuration.dart - // nativeCompilerEnvironmentVariables. - // - // We could potentially run this test if we default to some compilers - // we find on the path before running the test. However, the logic for - // discovering compilers is currently hidden inside - // package:native_toolchain_c. - return; - } - - test('run in isolation', timeout: longTimeout, () async { - await inTempDir((tempUri) async { - await copyTestProjects(targetUri: tempUri); - final packageUri = tempUri.resolve('native_add/'); - - await runPubGet(workingDirectory: packageUri, logger: logger); - - printOnFailure('cc: $cc'); - - final result = (await build( - packageUri, - logger, - dartExecutable, - // Manually pass in a compiler. - cCompilerConfig: CCompilerConfig( - archiver: ar?.fileUri, - compiler: cc.fileUri, - envScript: envScript?.fileUri, - envScriptArgs: envScriptArgs, - linker: ld?.fileUri, - ), - // Prevent any other environment variables. - includeParentEnvironment: false, - supportedAssetTypes: [CodeAsset.type], - configValidator: validateCodeAssetBuildConfig, - buildValidator: validateCodeAssetBuildOutput, - applicationAssetValidator: validateCodeAssetInApplication, - ))!; - expect(result.encodedAssets.length, 1); - }); - }); -} - -extension on String { - Uri get fileUri => Uri.file(this); -} diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart index cb69d2833..7b9e5d5cf 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -24,7 +24,6 @@ void main(List args) async { buildMode: BuildMode.release, targetOS: target.os, workingDirectory: packageUri, - includeParentEnvironment: true, linkingEnabled: false, supportedAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart index bebf171a7..6d3bf6a85 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart @@ -35,7 +35,6 @@ void main(List args) async { buildMode: BuildMode.release, targetOS: OS.current, workingDirectory: packageUri, - includeParentEnvironment: true, linkingEnabled: false, supportedAssetTypes: [CodeAsset.type, DataAsset.type], configValidator: (config) async => [ diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index c80f3f798..61f6fa343 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -37,7 +37,6 @@ Future build( required ApplicationAssetValidator applicationAssetValidator, LinkModePreference linkModePreference = LinkModePreference.dynamic, CCompilerConfig? cCompilerConfig, - bool includeParentEnvironment = true, List? capturedLogs, PackageLayout? packageLayout, String? runPackageName, @@ -75,7 +74,6 @@ Future build( buildMode: BuildMode.release, targetOS: targetOS, workingDirectory: packageUri, - includeParentEnvironment: includeParentEnvironment, packageLayout: packageLayout, runPackageName: runPackageName, linkingEnabled: linkingEnabled, @@ -105,7 +103,6 @@ Future link( required ApplicationAssetValidator applicationAssetValidator, LinkModePreference linkModePreference = LinkModePreference.dynamic, CCompilerConfig? cCompilerConfig, - bool includeParentEnvironment = true, List? capturedLogs, PackageLayout? packageLayout, required BuildResult buildResult, @@ -143,7 +140,6 @@ Future link( buildMode: BuildMode.release, targetOS: target?.os ?? OS.current, workingDirectory: packageUri, - includeParentEnvironment: includeParentEnvironment, packageLayout: packageLayout, buildResult: buildResult, resourceIdentifiers: resourceIdentifiers, @@ -171,7 +167,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( required BuildValidator buildValidator, required LinkValidator linkValidator, required ApplicationAssetValidator applicationAssetValidator, - bool includeParentEnvironment = true, List? capturedLogs, PackageLayout? packageLayout, String? runPackageName, @@ -203,7 +198,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( buildMode: BuildMode.release, targetOS: target?.os ?? OS.current, workingDirectory: packageUri, - includeParentEnvironment: includeParentEnvironment, packageLayout: packageLayout, runPackageName: runPackageName, linkingEnabled: true, @@ -237,7 +231,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( buildMode: BuildMode.release, targetOS: target?.os ?? OS.current, workingDirectory: packageUri, - includeParentEnvironment: includeParentEnvironment, packageLayout: packageLayout, buildResult: buildResult, resourceIdentifiers: resourceIdentifiers, @@ -279,7 +272,6 @@ Future buildDryRun( required BuildValidator buildValidator, LinkModePreference linkModePreference = LinkModePreference.dynamic, CCompilerConfig? cCompilerConfig, - bool includeParentEnvironment = true, List? capturedLogs, PackageLayout? packageLayout, required bool linkingEnabled, @@ -297,7 +289,6 @@ Future buildDryRun( ), targetOS: Target.current.os, workingDirectory: packageUri, - includeParentEnvironment: includeParentEnvironment, packageLayout: packageLayout, linkingEnabled: linkingEnabled, supportedAssetTypes: supportedAssetTypes, diff --git a/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart b/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart index ae4fd2522..c222b31a4 100644 --- a/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart +++ b/pkgs/native_assets_builder/test/dependencies_hash_file/dependencies_hash_file_test.dart @@ -11,6 +11,8 @@ import 'package:test/test.dart'; import '../helpers.dart'; void main() async { + final environment = Platform.environment; + test('json format', () async { await inTempDir((tempUri) async { final hashes = FileSystemHashes( @@ -43,66 +45,91 @@ void main() async { await tempFile.writeAsString('hello'); await subFile.writeAsString('world'); - await hashes.hashFilesAndDirectories([ - tempFile.uri, - tempSubDir.uri, - ]); + await hashes.hashDependencies( + [ + tempFile.uri, + tempSubDir.uri, + ], + (await tempFile.lastModified()).add(const Duration(minutes: 1)), + environment, + ); } await reset(); // No changes - expect(await hashes.findOutdatedFileSystemEntity(), isNull); + expect(await hashes.findOutdatedDependency(environment), isNull); // Change file contents. await tempFile.writeAsString('asdf'); - expect(await hashes.findOutdatedFileSystemEntity(), tempFile.uri); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempFile.uri.toFilePath()), + ); await reset(); // Delete file. await tempFile.delete(); - expect(await hashes.findOutdatedFileSystemEntity(), tempFile.uri); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempFile.uri.toFilePath()), + ); await reset(); // Add file to tracked directory. final subFile2 = File.fromUri(tempSubDir.uri.resolve('baz.txt')); await subFile2.create(recursive: true); await subFile2.writeAsString('hello'); - expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempSubDir.uri.toFilePath()), + ); await reset(); // Delete file from tracked directory. await subFile.delete(); - expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempSubDir.uri.toFilePath()), + ); await reset(); // Delete tracked directory. await tempSubDir.delete(recursive: true); - expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempSubDir.uri.toFilePath()), + ); await reset(); // Add directory to tracked directory. final subDir2 = Directory.fromUri(tempSubDir.uri.resolve('baz/')); await subDir2.create(recursive: true); - expect(await hashes.findOutdatedFileSystemEntity(), tempSubDir.uri); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempSubDir.uri.toFilePath()), + ); await reset(); // Overwriting a file with identical contents. await tempFile.writeAsString('something something'); await tempFile.writeAsString('hello'); - expect(await hashes.findOutdatedFileSystemEntity(), isNull); + expect(await hashes.findOutdatedDependency(environment), isNull); await reset(); // If a file is modified after the valid timestamp, it should be marked // as changed. - await hashes.hashFilesAndDirectories( + await hashes.hashDependencies( [ tempFile.uri, ], - validBeforeLastModified: (await tempFile.lastModified()) - .subtract(const Duration(seconds: 1)), + (await tempFile.lastModified()).subtract(const Duration(seconds: 1)), + environment, + ); + expect( + await hashes.findOutdatedDependency(environment), + contains(tempFile.uri.toFilePath()), ); - expect(await hashes.findOutdatedFileSystemEntity(), tempFile.uri); }); }); } diff --git a/pkgs/native_assets_builder/test/helpers.dart b/pkgs/native_assets_builder/test/helpers.dart index 3bb4c710a..ba864da71 100644 --- a/pkgs/native_assets_builder/test/helpers.dart +++ b/pkgs/native_assets_builder/test/helpers.dart @@ -69,7 +69,6 @@ Future runProcess({ List arguments = const [], Uri? workingDirectory, Map? environment, - bool includeParentEnvironment = true, required Logger? logger, bool captureOutput = true, int expectedExitCode = 0, @@ -80,7 +79,6 @@ Future runProcess({ arguments: arguments, workingDirectory: workingDirectory, environment: environment, - includeParentEnvironment: includeParentEnvironment, logger: logger, captureOutput: captureOutput, expectedExitCode: expectedExitCode, diff --git a/pkgs/native_toolchain_c/lib/src/utils/run_process.dart b/pkgs/native_toolchain_c/lib/src/utils/run_process.dart index f9204e5b9..989251409 100644 --- a/pkgs/native_toolchain_c/lib/src/utils/run_process.dart +++ b/pkgs/native_toolchain_c/lib/src/utils/run_process.dart @@ -18,25 +18,11 @@ Future runProcess({ List arguments = const [], Uri? workingDirectory, Map? environment, - bool includeParentEnvironment = true, required Logger? logger, bool captureOutput = true, int expectedExitCode = 0, bool throwOnUnexpectedExitCode = false, }) async { - if (Platform.isWindows && !includeParentEnvironment) { - const winEnvKeys = [ - 'SYSTEMROOT', - 'TEMP', - 'TMP', - ]; - environment = { - for (final winEnvKey in winEnvKeys) - winEnvKey: Platform.environment[winEnvKey]!, - ...?environment, - }; - } - final printWorkingDir = workingDirectory != null && workingDirectory != Directory.current.uri; final commandString = [ @@ -55,8 +41,7 @@ Future runProcess({ arguments, workingDirectory: workingDirectory?.toFilePath(), environment: environment, - includeParentEnvironment: includeParentEnvironment, - runInShell: Platform.isWindows && !includeParentEnvironment, + runInShell: Platform.isWindows && workingDirectory != null, ); final stdoutSub = process.stdout From 7e9897bfc5de0da3c3f7009e7710d9c0aff60b5b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 4 Dec 2024 11:15:13 +0100 Subject: [PATCH 30/50] [native_assets_builder] Don't pass in the whole environment (#1764) Closes: https://github.com/dart-lang/native/issues/32 See the referenced issue for a reasoning on the list of environment variables. Stacked on top of: * https://github.com/dart-lang/native/pull/1759 --- .../lib/src/build_runner/build_runner.dart | 39 ++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index f5a900280..b19c2a47d 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -433,6 +433,7 @@ class NativeAssetsBuildRunner { null, hookKernelFile, packageLayout!, + _filteredEnvironment(_environmentVariablesFilter), ), ); if (buildOutput == null) return null; @@ -450,7 +451,7 @@ class NativeAssetsBuildRunner { Uri? resources, PackageLayout packageLayout, ) async { - final environment = Platform.environment; + final environment = _filteredEnvironment(_environmentVariablesFilter); final outDir = config.outputDirectory; return await runUnderDirectoriesLock( [ @@ -526,6 +527,7 @@ ${e.message} resources, hookKernelFile, packageLayout, + environment, ); if (result == null) { if (await dependenciesHashFile.exists()) { @@ -550,6 +552,22 @@ ${e.message} ); } + /// Limit the environment that hook invocations get to see. + /// + /// This allowlist lists environment variables needed to run mainstream + /// compilers. + static const _environmentVariablesFilter = { + 'ANDROID_HOME', // Needed for the NDK. + 'HOME', // Needed to find tools in default install locations. + 'PATH', // Needed to invoke native tools. + 'PROGRAMDATA', // Needed for vswhere.exe. + 'SYSTEMROOT', // Needed for process invocations on Windows. + 'TEMP', // Needed for temp dirs in Dart process. + 'TMP', // Needed for temp dirs in Dart process. + 'TMPDIR', // Needed for temp dirs in Dart process. + 'USER_PROFILE', // Needed to find tools in default install locations. + }; + Future _runHookForPackage( Hook hook, HookConfig config, @@ -559,6 +577,7 @@ ${e.message} Uri? resources, File hookKernelFile, PackageLayout packageLayout, + Map environment, ) async { final configFile = config.outputDirectory.resolve('../config.json'); final configFileContents = @@ -583,6 +602,8 @@ ${e.message} executable: dartExecutable, arguments: arguments, logger: logger, + includeParentEnvironment: false, + environment: environment, ); var deleteOutputIfExists = false; @@ -639,6 +660,12 @@ ${e.message} } } + Map _filteredEnvironment(Set allowList) => { + for (final entry in Platform.environment.entries) + if (allowList.contains(entry.key.toUpperCase())) + entry.key: entry.value, + }; + /// Compiles the hook to kernel and caches the kernel. /// /// If any of the Dart source files, or the package config changed after @@ -666,7 +693,8 @@ ${e.message} Uri packageConfigUri, Uri workingDirectory, ) async { - final environment = Platform.environment; + // Don't invalidate cache with environment changes. + final environmentForCaching = {}; final kernelFile = File.fromUri( outputDirectory.resolve('../hook.dill'), ); @@ -682,8 +710,8 @@ ${e.message} if (!await dependenciesHashFile.exists()) { mustCompile = true; } else { - final outdatedDependency = - await dependenciesHashes.findOutdatedDependency(environment); + final outdatedDependency = await dependenciesHashes + .findOutdatedDependency(environmentForCaching); if (outdatedDependency != null) { mustCompile = true; logger.info( @@ -717,7 +745,7 @@ ${e.message} dartExecutable.resolve('../version'), ], lastModifiedCutoffTime, - environment, + environmentForCaching, ); if (modifiedDuringBuild != null) { logger.severe('File modified during build. Build must be rerun.'); @@ -759,6 +787,7 @@ ${e.message} executable: dartExecutable, arguments: compileArguments, logger: logger, + includeParentEnvironment: true, ); var success = true; if (compileResult.exitCode != 0) { From 0caab92e7edba7fea24ca82e7861a7daa829c2ea Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 6 Dec 2024 12:04:19 +0100 Subject: [PATCH 31/50] [native_assets_cli] Rename `supportedAssetTypes` to `buildAssetTypes` (#1786) This PR changes the `supportedAssetTypes` to `buildAssetTypes`. Hooks should not fail early if an asset type is not supported. This enables the following situations: 1. If some part of the Dart code requires an asset, but is not invoked transitively, the Dart code can still run in JIT, instead of failing on the build hook. 2. If an asset is not available, Dart code could fallback on a Dart implementation. 3. Hot reload hook invocations can omit the asset types that are not supported for hot reload (https://github.com/dart-lang/native/issues/1207#issuecomment-2505879943). The PR changes both the Dart API and the JSON protocol. The JSON protocol passes and parses the old key for the time being to allow for a graceful transition until this rolls into a next Dart stable release and we can bump the lower SDK bound. Side note: * The refactorings somehow started disallowing version skew where an older SDK is used with a newer `package:native_assets_cli`, but we do allow this, we can fill in the blanks (see `pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md`). So this PR adds a lowest-parsable-version. --- pkgs/native_assets_builder/CHANGELOG.md | 6 + .../lib/src/build_runner/build_runner.dart | 16 +- .../build_runner/build_dependencies_test.dart | 2 +- .../build_runner_asset_id_test.dart | 4 +- .../build_runner_build_dry_run_test.dart | 4 +- ...build_runner_build_output_format_test.dart | 2 +- .../build_runner_caching_test.dart | 16 +- .../build_runner/build_runner_cycle_test.dart | 4 +- .../build_runner_failure_test.dart | 8 +- .../build_runner_non_root_package_test.dart | 4 +- .../build_runner_reusability_test.dart | 8 +- .../test/build_runner/build_runner_test.dart | 4 +- .../concurrency_shared_test_helper.dart | 2 +- .../build_runner/concurrency_test_helper.dart | 2 +- .../build_runner/conflicting_dylib_test.dart | 6 +- .../fail_on_os_sdk_version_test.dart | 2 +- .../test/build_runner/helpers.dart | 22 +-- .../test/build_runner/link_caching_test.dart | 4 +- .../test/build_runner/link_test.dart | 18 +-- .../test/build_runner/metadata_test.dart | 2 +- .../packaging_preference_test.dart | 8 +- .../test/build_runner/resources_test.dart | 4 +- .../test/build_runner/wrong_linker_test.dart | 2 +- .../native_dynamic_linking_test.dart | 2 +- .../test/test_data/transformer_test.dart | 2 +- .../wrong_build_output_3/hook/build.dart | 2 +- .../build/local_asset/test/build_test.dart | 2 +- .../lib/src/code_assets/testing.dart | 4 +- pkgs/native_assets_cli/lib/src/config.dart | 22 ++- .../lib/src/model/build_config_CHANGELOG.md | 3 + .../native_assets_cli/lib/src/validation.dart | 6 +- pkgs/native_assets_cli/lib/test.dart | 4 +- .../test/api/build_test.dart | 2 +- .../test/build_config_test.dart | 40 ++--- .../test/build_output_test.dart | 2 +- .../native_assets_cli/test/checksum_test.dart | 137 +++++++++--------- .../test/code_assets/config_test.dart | 14 +- .../test/code_assets/validation_test.dart | 2 +- .../test/data_assets/validation_test.dart | 2 +- .../test/example/local_asset_test.dart | 2 +- .../test/example/native_add_library_test.dart | 2 +- .../example/native_dynamic_linking_test.dart | 2 +- .../test/link_config_test.dart | 17 ++- .../test/link_output_test.dart | 2 +- .../test/validation_test.dart | 2 +- .../cbuilder/cbuilder_build_failure_test.dart | 2 +- .../cbuilder/cbuilder_cross_android_test.dart | 2 +- .../cbuilder/cbuilder_cross_ios_test.dart | 4 +- .../cbuilder_cross_linux_host_test.dart | 2 +- .../cbuilder_cross_macos_host_test.dart | 4 +- .../cbuilder_cross_windows_host_test.dart | 2 +- .../test/cbuilder/cbuilder_test.dart | 16 +- .../test/cbuilder/compiler_resolver_test.dart | 4 +- .../test/cbuilder/objective_c_test.dart | 2 +- .../test/clinker/build_testfiles.dart | 2 +- .../test/clinker/objects_test.dart | 2 +- .../test/clinker/throws_test.dart | 2 +- .../test/clinker/treeshake_helper.dart | 2 +- 58 files changed, 243 insertions(+), 226 deletions(-) diff --git a/pkgs/native_assets_builder/CHANGELOG.md b/pkgs/native_assets_builder/CHANGELOG.md index 5ccb227cd..7f60b74ef 100644 --- a/pkgs/native_assets_builder/CHANGELOG.md +++ b/pkgs/native_assets_builder/CHANGELOG.md @@ -1,5 +1,11 @@ ## 0.9.1-wip +- **Breaking change**: Rename `supportedAssetTypes` to `buildAssetTypes`. Hooks + should no longer fail. Instead, the code should fail at runtime if an asset is + missing. This enables (1) code to run if an asset is missing but that code is + not invoked at runtime, and (2) doing fallback implementations in Dart if an + asset is missing. + ## 0.9.0 - Also lock `BuildConfig` and `LinkConfig` `outputDirectoryShared` when invoking diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index b19c2a47d..b139f5861 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -98,7 +98,7 @@ class NativeAssetsBuildRunner { required Uri workingDirectory, PackageLayout? packageLayout, String? runPackageName, - required List supportedAssetTypes, + required List buildAssetTypes, required bool linkingEnabled, }) async { packageLayout ??= await PackageLayout.fromRootPackageRoot(workingDirectory); @@ -124,7 +124,7 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator() ..setupHookConfig( targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), @@ -206,7 +206,7 @@ class NativeAssetsBuildRunner { PackageLayout? packageLayout, Uri? resourceIdentifiers, String? runPackageName, - required List supportedAssetTypes, + required List buildAssetTypes, required BuildResult buildResult, }) async { packageLayout ??= await PackageLayout.fromRootPackageRoot(workingDirectory); @@ -224,7 +224,7 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator() ..setupHookConfig( targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), @@ -328,7 +328,7 @@ class NativeAssetsBuildRunner { required bool linkingEnabled, PackageLayout? packageLayout, String? runPackageName, - required List supportedAssetTypes, + required List buildAssetTypes, }) => _runDryRun( targetOS: targetOS, @@ -338,7 +338,7 @@ class NativeAssetsBuildRunner { workingDirectory: workingDirectory, packageLayout: packageLayout, runPackageName: runPackageName, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkingEnabled: linkingEnabled, ); @@ -350,7 +350,7 @@ class NativeAssetsBuildRunner { PackageLayout? packageLayout, String? runPackageName, required bool linkingEnabled, - required List supportedAssetTypes, + required List buildAssetTypes, }) async { const hook = Hook.build; @@ -369,7 +369,7 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator(); configBuilder.setupHookConfig( targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildMode: null, // not set in dry-run mode packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), diff --git a/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart b/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart index fd248d658..bd8ec20ae 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart @@ -31,7 +31,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart index b31dd3c4a..1563350df 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_asset_id_test.dart @@ -27,7 +27,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -63,7 +63,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart index 6fe8f68a6..caf8e980a 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart @@ -28,14 +28,14 @@ void main() async { logger, dartExecutable, linkingEnabled: false, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildValidator: validateCodeAssetBuildOutput, ))!; final buildResult = (await build( packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart index 68ddeba44..65f766341 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_build_output_format_test.dart @@ -33,7 +33,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index 851458b14..ed891573f 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -30,7 +30,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -57,7 +57,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -107,7 +107,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -128,7 +128,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -171,7 +171,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -199,7 +199,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -239,7 +239,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -271,7 +271,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart index 198029f80..17476eac1 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart @@ -27,7 +27,7 @@ void main() async { createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], buildValidator: (config, output) async => [], ); final fullLog = logMessages.join('\n'); @@ -47,7 +47,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart index 7b9566828..1c5bd9e40 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart @@ -28,7 +28,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -56,7 +56,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -84,7 +84,7 @@ void main() async { packageUri, logger, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -120,7 +120,7 @@ void main() async { logger, capturedLogs: logMessages, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart index 825bbe66a..662ad2235 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart @@ -30,7 +30,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, runPackageName: 'some_dev_dep', - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -47,7 +47,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, runPackageName: 'native_add', - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index 2f8d34b45..193784b08 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -38,7 +38,7 @@ void main() async { targetOS: Target.current.os, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], buildValidator: (config, output) async => [], ); await buildRunner.buildDryRun( @@ -46,7 +46,7 @@ void main() async { targetOS: Target.current.os, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], buildValidator: (config, output) async => [], ); await buildRunner.build( @@ -55,7 +55,7 @@ void main() async { buildMode: BuildMode.release, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], @@ -66,7 +66,7 @@ void main() async { targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [], + buildAssetTypes: [], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart index 239542042..70df079d1 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_test.dart @@ -33,7 +33,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, configValidator: validateCodeAssetBuildConfig, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, ))!; @@ -59,7 +59,7 @@ void main() async { dartExecutable, capturedLogs: logMessages, packageLayout: packageLayout, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart index 7b9e5d5cf..afb2c0fb8 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -25,7 +25,7 @@ void main(List args) async { targetOS: target.os, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: (config, output) async => await validateDataAssetBuildOutput(config, output), diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart index 6d3bf6a85..870edec6d 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart @@ -36,7 +36,7 @@ void main(List args) async { targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, - supportedAssetTypes: [CodeAsset.type, DataAsset.type], + buildAssetTypes: [CodeAsset.type, DataAsset.type], configValidator: (config) async => [ ...await validateDataAssetBuildConfig(config), ...await validateCodeAssetBuildConfig(config), diff --git a/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart b/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart index ee0f53b55..2aee76303 100644 --- a/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/conflicting_dylib_test.dart @@ -27,7 +27,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -58,7 +58,7 @@ void main() async { logger, linkingEnabled: true, dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -69,7 +69,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetLinkConfig, linkValidator: validateCodeAssetLinkOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart b/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart index f56edf833..072ae2f4d 100644 --- a/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/fail_on_os_sdk_version_test.dart @@ -73,7 +73,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type, DataAsset.type], + buildAssetTypes: [CodeAsset.type, DataAsset.type], buildConfigValidator: (config) async => [ ...await validateDataAssetBuildConfig(config), ...await validateCodeAssetBuildConfig(config), diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index 61f6fa343..f252da7d4 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -46,7 +46,7 @@ Future build( int? targetAndroidNdkApi, Target? target, bool linkingEnabled = false, - required List supportedAssetTypes, + required List buildAssetTypes, }) async { final targetOS = target?.os ?? OS.current; return await runWithLog(capturedLogs, () async { @@ -56,7 +56,7 @@ Future build( ).build( configCreator: () { final configBuilder = BuildConfigBuilder(); - if (supportedAssetTypes.contains(CodeAsset.type)) { + if (buildAssetTypes.contains(CodeAsset.type)) { configBuilder.setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, linkModePreference: linkModePreference, @@ -77,7 +77,7 @@ Future build( packageLayout: packageLayout, runPackageName: runPackageName, linkingEnabled: linkingEnabled, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildValidator: buildValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -112,7 +112,7 @@ Future link( int? targetMacOSVersion, int? targetAndroidNdkApi, Target? target, - required List supportedAssetTypes, + required List buildAssetTypes, }) async { final targetOS = target?.os ?? OS.current; return await runWithLog(capturedLogs, () async { @@ -122,7 +122,7 @@ Future link( ).link( configCreator: () { final configBuilder = LinkConfigBuilder(); - if (supportedAssetTypes.contains(CodeAsset.type)) { + if (buildAssetTypes.contains(CodeAsset.type)) { configBuilder.setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, linkModePreference: linkModePreference, @@ -143,7 +143,7 @@ Future link( packageLayout: packageLayout, buildResult: buildResult, resourceIdentifiers: resourceIdentifiers, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkValidator: linkValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -176,7 +176,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( int? targetAndroidNdkApi, Target? target, Uri? resourceIdentifiers, - required List supportedAssetTypes, + required List buildAssetTypes, }) async => await runWithLog(capturedLogs, () async { final buildRunner = NativeAssetsBuildRunner( @@ -201,7 +201,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( packageLayout: packageLayout, runPackageName: runPackageName, linkingEnabled: true, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildValidator: buildValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -234,7 +234,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( packageLayout: packageLayout, buildResult: buildResult, resourceIdentifiers: resourceIdentifiers, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkValidator: linkValidator, applicationAssetValidator: applicationAssetValidator, ); @@ -275,7 +275,7 @@ Future buildDryRun( List? capturedLogs, PackageLayout? packageLayout, required bool linkingEnabled, - required List supportedAssetTypes, + required List buildAssetTypes, }) async => runWithLog(capturedLogs, () async { final result = await NativeAssetsBuildRunner( @@ -291,7 +291,7 @@ Future buildDryRun( workingDirectory: packageUri, packageLayout: packageLayout, linkingEnabled: linkingEnabled, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, buildValidator: buildValidator, ); return result; diff --git a/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart index ded8c8a2a..e83275b9b 100644 --- a/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/link_caching_test.dart @@ -34,7 +34,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], capturedLogs: logMessages, configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, @@ -49,7 +49,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], capturedLogs: logMessages, configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, diff --git a/pkgs/native_assets_builder/test/build_runner/link_test.dart b/pkgs/native_assets_builder/test/build_runner/link_test.dart index 87967cb49..1ec0046b5 100644 --- a/pkgs/native_assets_builder/test/build_runner/link_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/link_test.dart @@ -31,7 +31,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -43,7 +43,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], @@ -55,7 +55,7 @@ void main() async { logger, dartExecutable, linkingEnabled: false, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -101,7 +101,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -119,7 +119,7 @@ void main() async { logger, dartExecutable, buildResult: buildResult, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], @@ -148,7 +148,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -163,7 +163,7 @@ void main() async { dartExecutable, buildResult: buildResult, capturedLogs: logMessages, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], @@ -203,7 +203,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -218,7 +218,7 @@ void main() async { dartExecutable, buildResult: buildResult, capturedLogs: logMessages, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetLinkConfig, linkValidator: validateCodeAssetLinkOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/metadata_test.dart b/pkgs/native_assets_builder/test/build_runner/metadata_test.dart index 17aa2e5d0..274b88c9c 100644 --- a/pkgs/native_assets_builder/test/build_runner/metadata_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/metadata_test.dart @@ -31,7 +31,7 @@ void main() async { logger, dartExecutable, capturedLogs: logMessages, - supportedAssetTypes: ['foo'], + buildAssetTypes: ['foo'], configValidator: (config) async => [], buildValidator: (config, output) async => [], applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart b/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart index 140d7954f..92e60dc01 100644 --- a/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/packaging_preference_test.dart @@ -26,7 +26,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.dynamic, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -37,7 +37,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.preferDynamic, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -48,7 +48,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.static, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, @@ -59,7 +59,7 @@ void main() async { logger, dartExecutable, linkModePreference: LinkModePreference.preferStatic, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/build_runner/resources_test.dart b/pkgs/native_assets_builder/test/build_runner/resources_test.dart index 936c3522c..4d5a87207 100644 --- a/pkgs/native_assets_builder/test/build_runner/resources_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/resources_test.dart @@ -34,7 +34,7 @@ void main() async { logger, dartExecutable, linkingEnabled: true, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetBuildConfig, buildValidator: validateDataAssetBuildOutput, applicationAssetValidator: (_) async => [], @@ -53,7 +53,7 @@ void main() async { dartExecutable, buildResult: buildResult, resourceIdentifiers: resourcesUri, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], configValidator: validateDataAssetLinkConfig, linkValidator: validateDataAssetLinkOutput, applicationAssetValidator: (_) async => [], diff --git a/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart b/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart index e004fe581..4a1c58d25 100644 --- a/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/wrong_linker_test.dart @@ -27,7 +27,7 @@ void main() async { packageUri, createCapturingLogger(logMessages, level: Level.SEVERE), dartExecutable, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], configValidator: validateCodeAssetBuildConfig, buildValidator: validateCodeAssetBuildOutput, applicationAssetValidator: validateCodeAssetInApplication, diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index 5865d93fb..c105e4552 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -37,7 +37,7 @@ void main() async { packageName: name, packageRoot: testPackageUri, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildConfig(dryRun: dryRun, linkingEnabled: false) ..setupBuildRunConfig( diff --git a/pkgs/native_assets_builder/test/test_data/transformer_test.dart b/pkgs/native_assets_builder/test/test_data/transformer_test.dart index acd50699b..67c89eaa1 100644 --- a/pkgs/native_assets_builder/test/test_data/transformer_test.dart +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -50,7 +50,7 @@ void main() async { packageName: packageName, packageRoot: packageUri, targetOS: OS.current, - supportedAssetTypes: [DataAsset.type], + buildAssetTypes: [DataAsset.type], buildMode: BuildMode.debug) ..setupBuildConfig(dryRun: false, linkingEnabled: false) ..setupBuildRunConfig( diff --git a/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart index 58666acf2..b53f9c872 100644 --- a/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_build_output_3/hook/build.dart @@ -22,5 +22,5 @@ const _rightContents = '''{ "encodedAssets": [], "dependencies": [], "metadata": {}, - "version": "1.5.0" + "version": "1.6.0" }'''; diff --git a/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart b/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart index a178ff606..8f2ea6180 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart +++ b/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart @@ -18,6 +18,6 @@ void main() async { 'package:local_asset/asset.txt', ); }, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ); } diff --git a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart index 21f2ad672..7bb8ef9f9 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart @@ -25,7 +25,7 @@ Future testCodeBuildHook({ int? targetAndroidNdkApi, CCompilerConfig? cCompiler, LinkModePreference? linkModePreference, - required List supportedAssetTypes, + required List buildAssetTypes, bool? linkingEnabled, }) async { await testBuildHook( @@ -48,7 +48,7 @@ Future testCodeBuildHook({ }, buildMode: buildMode, targetOS: targetOS, - supportedAssetTypes: supportedAssetTypes, + buildAssetTypes: buildAssetTypes, linkingEnabled: linkingEnabled, ); } diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index 40da1c770..093a7dcc5 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -73,12 +73,12 @@ sealed class HookConfig { final BuildMode? _buildMode; /// The asset types that the invoker of this hook supports. - final List supportedAssetTypes; + final List buildAssetTypes; HookConfig(this.json) : version = switch (Version.parse(json.string(_versionKey))) { final Version version => (version.major != latestVersion.major || - version < latestVersion) + version < latestParsableVersion) ? throw FormatException( 'Only compatible versions with $latestVersion are supported ' '(was: $version).') @@ -89,8 +89,9 @@ sealed class HookConfig { packageRoot = json.path(_packageRootConfigKey), packageName = json.string(_packageNameConfigKey), targetOS = OS.fromString(json.string(_targetOSConfigKey)), - supportedAssetTypes = - json.optionalStringList(_supportedAssetTypesKey) ?? const [], + buildAssetTypes = json.optionalStringList(_buildAssetTypesKey) ?? + json.optionalStringList(_supportedAssetTypesKey) ?? + const [], _buildMode = switch (json.optionalString(_buildModeConfigKey)) { String value => BuildMode.fromString(value), null => null, @@ -116,13 +117,14 @@ sealed class HookConfigBuilder { required Uri packageRoot, required String packageName, required OS targetOS, - required List supportedAssetTypes, + required List buildAssetTypes, required BuildMode? buildMode, }) { json[_packageNameConfigKey] = packageName; json[_packageRootConfigKey] = packageRoot.toFilePath(); json[_targetOSConfigKey] = targetOS.toString(); - json[_supportedAssetTypesKey] = supportedAssetTypes; + json[_buildAssetTypesKey] = buildAssetTypes; + json[_supportedAssetTypesKey] = buildAssetTypes; if (buildMode != null) { json[_buildModeConfigKey] = buildMode.toString(); } @@ -164,6 +166,7 @@ const _outDirSharedConfigKey = 'out_dir_shared'; const _packageNameConfigKey = 'package_name'; const _packageRootConfigKey = 'package_root'; const _supportedAssetTypesKey = 'supported_asset_types'; +const _buildAssetTypesKey = 'build_asset_types'; final class BuildConfig extends HookConfig { // TODO(dcharkes): Remove after 3.7.0 stable is released and bump the SDK @@ -301,7 +304,7 @@ sealed class HookOutput { String toString() => const JsonEncoder.withIndent(' ').convert(json); /// The version of [HookOutput]. - static final Version latestVersion = Version(1, 5, 0); + static final Version latestVersion = Version(1, 6, 0); } List _parseDependencies(List? list) { @@ -558,4 +561,7 @@ extension EncodedAssetLinkOutputBuilder on LinkOutputBuilder { } // The latest supported config version. -final latestVersion = Version(1, 5, 0); +final latestVersion = Version(1, 6, 0); + +// The parser can deal with configs down to this version. +final latestParsableVersion = Version(1, 5, 0); diff --git a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md index f3126361e..c89032d80 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md +++ b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md @@ -1,5 +1,8 @@ ## 1.6.0 +- `BuildConfig.supportedAssetTypes` renamed to `BuildConfig.buildAssetTypes`. + Compatibility with older SDKs: Look for the old key. Compatibility with older + hooks: Also provide the old hook in the config. - `BuildConfig.outputDirectoryShared` for sharing between hook invocations. Compatibility with older SDKs: Create a sibling dir next to the output directory. This does not facilitate caching, but should not break the hook. diff --git a/pkgs/native_assets_cli/lib/src/validation.dart b/pkgs/native_assets_cli/lib/src/validation.dart index 66b314434..c20edd3fd 100644 --- a/pkgs/native_assets_cli/lib/src/validation.dart +++ b/pkgs/native_assets_cli/lib/src/validation.dart @@ -72,12 +72,12 @@ List _validateOutputAssetTypes( Iterable assets, ) { final errors = []; - final supportedAssetTypes = config.supportedAssetTypes; + final buildAssetTypes = config.buildAssetTypes; for (final asset in assets) { - if (!supportedAssetTypes.contains(asset.type)) { + if (!buildAssetTypes.contains(asset.type)) { final error = 'Asset with type "${asset.type}" is not a supported asset type ' - '(${supportedAssetTypes.join(' ')} are supported)'; + '(${buildAssetTypes.join(' ')} are supported)'; errors.add(error); } } diff --git a/pkgs/native_assets_cli/lib/test.dart b/pkgs/native_assets_cli/lib/test.dart index 26c0ab27b..a9e4c289a 100644 --- a/pkgs/native_assets_cli/lib/test.dart +++ b/pkgs/native_assets_cli/lib/test.dart @@ -24,7 +24,7 @@ Future testBuildHook({ check, BuildMode? buildMode, OS? targetOS, - List? supportedAssetTypes, + List? buildAssetTypes, bool? linkingEnabled, }) async { test( @@ -43,7 +43,7 @@ Future testBuildHook({ packageRoot: Directory.current.uri, packageName: _readPackageNameFromPubspec(), targetOS: targetOS ?? OS.current, - supportedAssetTypes: supportedAssetTypes ?? [], + buildAssetTypes: buildAssetTypes ?? [], buildMode: buildMode ?? BuildMode.release, ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/api/build_test.dart b/pkgs/native_assets_cli/test/api/build_test.dart index 0504151f4..f43c44e32 100644 --- a/pkgs/native_assets_cli/test/api/build_test.dart +++ b/pkgs/native_assets_cli/test/api/build_test.dart @@ -35,7 +35,7 @@ void main() async { packageRoot: tempUri, packageName: packageName, targetOS: OS.iOS, - supportedAssetTypes: ['foo'], + buildAssetTypes: ['foo'], buildMode: BuildMode.release, ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/build_config_test.dart b/pkgs/native_assets_cli/test/build_config_test.dart index 6c4b334df..4479eb1d1 100644 --- a/pkgs/native_assets_cli/test/build_config_test.dart +++ b/pkgs/native_assets_cli/test/build_config_test.dart @@ -42,7 +42,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: ['my-asset-type'], + buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( linkingEnabled: false, @@ -56,16 +56,8 @@ void main() async { final config = BuildConfig(configBuilder.json); final expectedConfigJson = { + 'build_asset_types': ['my-asset-type'], 'build_mode': 'release', - 'supported_asset_types': ['my-asset-type'], - 'dry_run': false, - 'linking_enabled': false, - 'out_dir': outDirUri.toFilePath(), - 'out_dir_shared': outputDirectoryShared.toFilePath(), - 'package_name': packageName, - 'package_root': packageRootUri.toFilePath(), - 'target_os': 'android', - 'version': latestVersion.toString(), 'dependency_metadata': { 'bar': { 'key': 'value', @@ -75,6 +67,15 @@ void main() async { 'key': 321, }, }, + 'dry_run': false, + 'linking_enabled': false, + 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_dir': outDirUri.toFilePath(), + 'package_name': packageName, + 'package_root': packageRootUri.toFilePath(), + 'supported_asset_types': ['my-asset-type'], + 'target_os': 'android', + 'version': latestVersion.toString(), }; expect(config.json, expectedConfigJson); @@ -87,7 +88,7 @@ void main() async { expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); expect(config.buildMode, BuildMode.release); - expect(config.supportedAssetTypes, ['my-asset-type']); + expect(config.buildAssetTypes, ['my-asset-type']); expect(config.linkingEnabled, false); expect(config.dryRun, false); @@ -101,7 +102,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: null, // not available in dry run - supportedAssetTypes: ['my-asset-type'], + buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( linkingEnabled: true, @@ -114,15 +115,16 @@ void main() async { final config = BuildConfig(configBuilder.json); final expectedConfigJson = { + 'build_asset_types': ['my-asset-type'], + 'dependency_metadata': {}, 'dry_run': true, - 'supported_asset_types': ['my-asset-type'], 'linking_enabled': true, - 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_dir': outDirUri.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), + 'supported_asset_types': ['my-asset-type'], 'target_os': 'android', - 'dependency_metadata': {}, 'version': latestVersion.toString(), }; @@ -135,7 +137,7 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); - expect(config.supportedAssetTypes, ['my-asset-type']); + expect(config.buildAssetTypes, ['my-asset-type']); expect(() => config.buildMode, throwsStateError); expect(config.linkingEnabled, true); @@ -155,7 +157,7 @@ void main() async { 'target_os': 'linux', 'version': version, 'package_name': packageName, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'dry_run': true, 'linking_enabled': false, }; @@ -189,7 +191,7 @@ void main() async { 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', 'linking_enabled': true, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], }), throwsA(predicate( (e) => @@ -209,7 +211,7 @@ void main() async { 'target_os': 'android', 'linking_enabled': true, 'build_mode': BuildMode.release.name, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'dependency_metadata': { 'bar': {'key': 'value'}, 'foo': [], diff --git a/pkgs/native_assets_cli/test/build_output_test.dart b/pkgs/native_assets_cli/test/build_output_test.dart index d58f1c920..5c7e78e4f 100644 --- a/pkgs/native_assets_cli/test/build_output_test.dart +++ b/pkgs/native_assets_cli/test/build_output_test.dart @@ -49,7 +49,7 @@ void main() { // The JSON format of the build output. { - 'version': '1.5.0', + 'version': '1.6.0', 'dependencies': ['path0', 'path1', 'path2'], 'metadata': { 'meta-a': 'meta-b', diff --git a/pkgs/native_assets_cli/test/checksum_test.dart b/pkgs/native_assets_cli/test/checksum_test.dart index 915950fb4..92740e812 100644 --- a/pkgs/native_assets_cli/test/checksum_test.dart +++ b/pkgs/native_assets_cli/test/checksum_test.dart @@ -24,7 +24,7 @@ void main() { packageRoot: Uri.file('foo'), packageName: packageName, targetOS: os, - supportedAssetTypes: [assetType], + buildAssetTypes: [assetType], buildMode: buildMode, ) ..setupBuildConfig(dryRun: dryRun, linkingEnabled: linking); @@ -44,76 +44,75 @@ void main() { // If format or algorithm for checksumming changes we'd like to know (by // needing to update this list). final expectedChecksums = [ - '05cdbdf4976a68c33e75e6b57781c5f5', - 'c36ad7dc2f0846ed134029edaeb59195', - '7f90e825f08edafe99ac7314d02f46e0', - '82279ed0fb55f7e02b8e6cf857b5a7b9', - '8aa77a554828663ccfdb30d026caf729', - '6a69060c347c20000354bb9e7cca21f5', - 'c0a1cd20d08aa29044af633dec235b36', - '72a098e698316a60e6ca2b67c4de82b1', - '16dc68a85ea9cab4a9d35c77f9d8bc6c', - 'fbb47d28d4db2082f331a6710ae293f6', - 'c557d0bffbf479b85861a648ceda8912', - '7c23bce4887d70915a5d5824142cb75f', - '88d164985687d11445a1bba4c83b299e', - 'e6b3d1a31ea2ea2c37babbf8a52393de', - 'dfe63dab862fa7789f3bf4ad882c87c7', - 'b146d5dfbcb2bfdd295cdd548832d717', - '4267a4d5f5b7e1ae3278e590cab52e48', - '461e627475397d461da3c985e17466ba', - '2e5d01733c132b2801e3068bf008e023', - 'aee031592879b62e8512cc73a064c883', - '439222774886f776f2da9a5c0051310f', - 'a59d7e43b0a9562518863d6379fddd16', - '90a0e05df0f56c8d33b3bdbe7ff785b3', - 'e00db5df53778da8aaecace162d20325', - 'b4f8ef47ab0a43f0760c68d66297f1a8', - '17c758237c24c96e1d92a4681ba2b889', - 'dd6ee4832b2c11d31a2488f671d13e9a', - '7ac636c075bcc1423e80c635fed6de6c', - '427db33751df11daa8dc9809614b66e6', - 'c8d5918f01d365e0d6c2a1d610a47d1d', - '534fce1b658242d7942f3eb6e4ca987d', - '3dcea3a8a52eebea225eacd44ee370f1', - '55fe838d0d2a01e288b3faed2adc7a04', - '80727044903ebea814198f4001fdebf0', - '6198b46894c081193b9209f9ddb66b3d', - '856c0ffe90c97d9629e847ba1b3bbb67', - '3e3d7e551f1392f53d73fd3362693184', - '5244e64af596a46940892b28739737e2', - '8a875dc22c02d815e16f50386d03195d', - '50464749a3288f2d655ccef290835776', - '1982534a5ba2f13f8ed5b4ba38386d8c', - '012e03aad8221afab6200718f7e68fa6', - '9ddaa64eadc3b21ba48d77062a12bee7', - 'f2b802ce9d7c055f721e017db5582312', - 'abc578f0fe5c4a4c43b185a7940d0dd7', - '771cd5ab05e5838cccf4a75cc224f506', - 'd41f53ff6aca0cdd74bbea8b0c26b83e', - '24c8e4535afc18981f7470cbd05a5787', - 'fddca58e36cc89868114bb399bc6cec2', - 'fec6330fac0d3d9316f2f580602fc06a', - '092c7130962283f35d5de02604cc3852', - '130517517742ea571ab39d69f56c87a0', - 'e17135e1be677fb428a761b6c3b5f421', - '510c5b24f5bbd414917c96444ff41df3', - '75993da8d1508dc1e556096da0a7c00f', - 'aad9665f7c2a8e28e99c92a90d0f2168', - 'bab93955a78ab99e6157b1568e4b03d1', - 'f2ad0bb263fd38d9fba3ca9ed5c7c66b', - '7743132a908a48c183a75d8c25635de6', - '3b326f5a0ef295d3109bcf95a63b446e', - 'e0775404b93fadf74f5bce5410854346', - 'd1fd0e95194d8d4bc513666e2067548c', - '0541de11331a9ca647f7cbde69c1abf4', - 'c8c85515946c890e3056f379ca757cfe', + '10d9fce0028fdbb72b5994307ebf227c', + '4116af41354c68fd64b58cb6a308ebbb', + '157fda96bdf938d4fe055180bf4dbabc', + 'c5507af2f5f7e8601710c5c2fffb6188', + '2ab19c5f0f4c8f6c17826f6fabca2e6e', + 'c7c3e28d58191051c70c2748aa1377ef', + 'f81cf883235927d5cca9d510c2446a3a', + '8396b8b2541fe6ee9f39ece6aede06b6', + '9e092722bb54a9bdc6434119786a538c', + 'd2d421c2c497ff6a16bbd43f4ba27152', + '6c45154e7e0be87367fd000a9386aa2a', + '4b1257c34a3de0ce91171eadb84be35f', + '7a9a8d4a6e226dbd08e3c591e379d967', + '996f318e4d30a472358d7f21eb14585b', + '7adf24fb2f2cac19d41f439fed3fa5d8', + '99574fa166e54a5c740d0e85f46bc5af', + '2c592c067f97ed13d900bc2bb8c16f86', + 'e5b8f39328001ed0417e8cd70aad4fa8', + '923b4534ee62e50b596e04aaf1392901', + '4df91b08cd288e9a5069a5fe55c64395', + 'dde8372e52f886b8293f6b691a7b76f1', + 'bfeb49adc617a567671c78936130af4c', + 'de7b54bfd2d9ab26796951592967dca2', + 'f3e73bb91a351c1743e81cd32babf90c', + 'ac98097f3d916d7bde50d9c67b2a8d9e', + 'c87086e206e304191a13baed3f29da9e', + 'c85ced6ed90adc35f0dd03b27486d66e', + 'aed9f8805210068380e2556b1bab0a99', + 'e4314b23825c872590bbb384c1072cb8', + '3f9b69de7a31c609a4b6ec125adcaca5', + '0102baa7f1f5071aefa90a18179d0d7d', + '40f84eefd62ff9062b78b655ad3ee6b1', + '723e2805985a094838464d4ab4e0af7d', + 'f5ca710868b73059ce61ded27bd0faac', + '1b0e1ad58ff192d204ca9750505b2d55', + 'a2def75febdaa8a332fc588ee3ef8014', + '59a936e9e646387fcf322a794b753b54', + '8f5945499965afcb5d6eebf30bbacb77', + '4ed56caadaf9079c96dcec668624bf2a', + '0f2a4864df014a824034f9e29ed48ee8', + '0aed524d105e71a3bfd432ade52ed132', + '6ba03bd61a4d8979fcd64e5b6ae245b6', + 'cd70cfa54dad2b6859d5c1d23b83b074', + '2aa7bf1eda6a6fb1bf3edaadcbb9a804', + 'b6fd8e4dc466f8aa1b758134d454b191', + '22c71b4626f3f59463e1276afccfd2fb', + '70ff946f65f2d46be9b323d45e4edf0e', + '7862c709b255bde8debb5ee06ddbcd74', + 'b948929ac5fd276c69ab9f76e5b280f0', + 'aa479a711b010893b3bfb46d68028ed7', + '74c9bf5365c62bd9655f7b773b5e5113', + 'bc6224160b985a2c338f414899eed664', + '78ec380b3257d8b4ca35006e922978bd', + 'c0656028d1e11a2b6cd972464e23cd30', + '11b75baa322bd7cb1362852fc4238a0e', + '6eff070403ac6171ff42fdfbdc1a36ea', + '9d026a26c3788e9d2606ee0c5e0e0e10', + '2dcc623fce0dfc380761b9e2f396d955', + '9ce27557bb269768d25b5f1bd8ffdfa4', + 'e9b1c4c9511c02c64c2112dc16924598', + 'b38af392d228d193ba3d3943d7bb189a', + 'ab5753aa337cf91a224fe89e53173324', + 'a99ffcf470d3b570fed923bbf7257d37', + '630d35827f0193efbb1b439d792ebe23', ]; + printOnFailure('final expectedChecksums = ['); + printOnFailure(checksums.map((e) => " '$e',").join('\n')); + printOnFailure('];'); for (var i = 0; i < checksums.length; ++i) { - if (checksums[i] != expectedChecksums[i]) { - print('Expected ${expectedChecksums[i]} but was ${checksums[i]}'); - print('Config:\n${configs[i]}'); - } expect(checksums[i], expectedChecksums[i]); } }); diff --git a/pkgs/native_assets_cli/test/code_assets/config_test.dart b/pkgs/native_assets_cli/test/code_assets/config_test.dart index 35618b1f9..cb63f5916 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -46,7 +46,7 @@ void main() async { void expectCorrectCodeConfigDryRun( Map json, CodeConfig codeConfig) { { - 'supported_asset_types': [CodeAsset.type], + 'build_asset_types': [CodeAsset.type], 'link_mode_preference': 'prefer-static', }.forEach((k, v) { expect(json[k], v); @@ -63,7 +63,7 @@ void main() async { void expectCorrectCodeConfig( Map json, CodeConfig codeConfig) { { - 'supported_asset_types': [CodeAsset.type], + 'build_asset_types': [CodeAsset.type], 'link_mode_preference': 'prefer-static', 'target_android_ndk_api': 30, 'target_architecture': 'arm64', @@ -93,7 +93,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: null, // not available in dry run - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( linkingEnabled: true, @@ -119,7 +119,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( linkingEnabled: false, @@ -152,7 +152,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupLinkConfig(assets: assets) ..setupLinkRunConfig( @@ -190,7 +190,7 @@ void main() async { 'target_android_ndk_api': 30, 'target_architecture': 'invalid_architecture', 'target_os': 'android', - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'version': latestVersion.toString(), }; expect( @@ -201,7 +201,7 @@ void main() async { test('LinkConfig.codeConfig: invalid architecture', () { final config = { - 'supported_asset_types': [CodeAsset.type], + 'build_asset_types': [CodeAsset.type], 'build_mode': 'release', 'dry_run': false, 'link_mode_preference': 'prefer-static', diff --git a/pkgs/native_assets_cli/test/code_assets/validation_test.dart b/pkgs/native_assets_cli/test/code_assets/validation_test.dart index f2ad1c173..7bcbe225a 100644 --- a/pkgs/native_assets_cli/test/code_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/validation_test.dart @@ -36,7 +36,7 @@ void main() { packageRoot: tempUri, targetOS: os, buildMode: BuildMode.release, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_assets_cli/test/data_assets/validation_test.dart b/pkgs/native_assets_cli/test/data_assets/validation_test.dart index c3f5fcd01..45712ddf1 100644 --- a/pkgs/native_assets_cli/test/data_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/data_assets/validation_test.dart @@ -36,7 +36,7 @@ void main() { packageRoot: tempUri, targetOS: OS.iOS, buildMode: BuildMode.release, - supportedAssetTypes: [DataAsset.type]) + buildAssetTypes: [DataAsset.type]) ..setupBuildConfig( linkingEnabled: false, dryRun: false, diff --git a/pkgs/native_assets_cli/test/example/local_asset_test.dart b/pkgs/native_assets_cli/test/example/local_asset_test.dart index 591d6a3e3..96207c559 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -45,7 +45,7 @@ void main() async { packageRoot: testPackageUri, packageName: name, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/example/native_add_library_test.dart b/pkgs/native_assets_cli/test/example/native_add_library_test.dart index 3e85e84db..c2df4cea6 100644 --- a/pkgs/native_assets_cli/test/example/native_add_library_test.dart +++ b/pkgs/native_assets_cli/test/example/native_add_library_test.dart @@ -45,7 +45,7 @@ void main() async { packageRoot: testPackageUri, packageName: name, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index a20306a4f..a721b058f 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -54,7 +54,7 @@ void main() async { packageRoot: testPackageUri, packageName: name, targetOS: OS.current, - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], buildMode: dryRun ? null : BuildMode.debug) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/link_config_test.dart b/pkgs/native_assets_cli/test/link_config_test.dart index 16d394d32..7ce676bc0 100644 --- a/pkgs/native_assets_cli/test/link_config_test.dart +++ b/pkgs/native_assets_cli/test/link_config_test.dart @@ -35,7 +35,7 @@ void main() async { packageRoot: packageRootUri, targetOS: OS.android, buildMode: BuildMode.release, - supportedAssetTypes: ['asset-type-1', 'asset-type-2'], + buildAssetTypes: ['asset-type-1', 'asset-type-2'], ) ..setupLinkConfig(assets: assets) ..setupLinkRunConfig( @@ -46,15 +46,16 @@ void main() async { final config = LinkConfig(configBuilder.json); final expectedConfigJson = { + 'assets': [for (final asset in assets) asset.toJson()], + 'build_asset_types': ['asset-type-1', 'asset-type-2'], 'build_mode': 'release', - 'supported_asset_types': ['asset-type-1', 'asset-type-2'], - 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), + 'out_dir': outDirUri.toFilePath(), 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), + 'supported_asset_types': ['asset-type-1', 'asset-type-2'], 'target_os': 'android', 'version': latestVersion.toString(), - 'assets': [for (final asset in assets) asset.toJson()], }; expect(config.json, expectedConfigJson); expect(json.decode(config.toString()), expectedConfigJson); @@ -66,7 +67,7 @@ void main() async { expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); expect(config.buildMode, BuildMode.release); - expect(config.supportedAssetTypes, ['asset-type-1', 'asset-type-2']); + expect(config.buildAssetTypes, ['asset-type-1', 'asset-type-2']); expect(config.encodedAssets, assets); }); @@ -82,7 +83,7 @@ void main() async { 'target_os': 'linux', 'version': version, 'package_name': packageName, - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'dry_run': true, }; expect( @@ -108,7 +109,7 @@ void main() async { expect( () => LinkConfig({ 'version': latestVersion.toString(), - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', @@ -125,7 +126,7 @@ void main() async { expect( () => LinkConfig({ 'version': latestVersion.toString(), - 'supported_asset_types': ['my-asset-type'], + 'build_asset_types': ['my-asset-type'], 'out_dir': outDirUri.toFilePath(), 'out_dir_shared': outputDirectoryShared.toFilePath(), 'package_name': packageName, diff --git a/pkgs/native_assets_cli/test/link_output_test.dart b/pkgs/native_assets_cli/test/link_output_test.dart index adb5e80a3..5d3a7d74d 100644 --- a/pkgs/native_assets_cli/test/link_output_test.dart +++ b/pkgs/native_assets_cli/test/link_output_test.dart @@ -35,7 +35,7 @@ void main() { // The JSON format of the link output. { - 'version': '1.5.0', + 'version': '1.6.0', 'dependencies': ['path0', 'path1', 'path2'], 'assets': [ {'a-0': 'v-0', 'type': 'my-asset-type'}, diff --git a/pkgs/native_assets_cli/test/validation_test.dart b/pkgs/native_assets_cli/test/validation_test.dart index aa291d020..a64e2f635 100644 --- a/pkgs/native_assets_cli/test/validation_test.dart +++ b/pkgs/native_assets_cli/test/validation_test.dart @@ -36,7 +36,7 @@ void main() { packageRoot: tempUri, targetOS: OS.iOS, buildMode: BuildMode.release, - supportedAssetTypes: ['my-asset-type'], + buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index 778471a6e..f9648e9f4 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -31,7 +31,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index f785bbfbc..a2c64cbda 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -146,7 +146,7 @@ Future buildLib( await Directory.fromUri(tempUriShared).create(); final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.android, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index ad765d690..7456f37d2 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -72,7 +72,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.iOS, @@ -230,7 +230,7 @@ Future buildLib( final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.iOS, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index 5e2e4a74a..7b58957eb 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -44,7 +44,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.linux, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index a698efb0d..5e89ca115 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -59,7 +59,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.macOS, @@ -160,7 +160,7 @@ Future buildLib( final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.macOS, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index 6058db4e5..b256b9c5a 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -63,7 +63,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.windows, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index 1b5630650..3906383e7 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -45,7 +45,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -127,7 +127,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -228,7 +228,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -295,7 +295,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -351,7 +351,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -419,7 +419,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -492,7 +492,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, @@ -573,7 +573,7 @@ Future testDefines({ final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index bac97bd79..1ee88a7ac 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -43,7 +43,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'dummy', packageRoot: tempUri, targetOS: OS.current, @@ -83,7 +83,7 @@ void main() { final tempUri2 = await tempDirForTest(); final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'dummy', packageRoot: tempUri, targetOS: OS.windows, diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index c6ebc852e..0027cbd93 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -37,7 +37,7 @@ void main() { final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: OS.current, diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index c9eb1ee86..a01c949b8 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -27,7 +27,7 @@ Future buildTestArchive( final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, targetOS: os, diff --git a/pkgs/native_toolchain_c/test/clinker/objects_test.dart b/pkgs/native_toolchain_c/test/clinker/objects_test.dart index ff98f7009..b4f17841f 100644 --- a/pkgs/native_toolchain_c/test/clinker/objects_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/objects_test.dart @@ -33,7 +33,7 @@ Future main() async { final linkConfigBuilder = LinkConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, targetOS: os, diff --git a/pkgs/native_toolchain_c/test/clinker/throws_test.dart b/pkgs/native_toolchain_c/test/clinker/throws_test.dart index e6aa79d0f..7370cbe91 100644 --- a/pkgs/native_toolchain_c/test/clinker/throws_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/throws_test.dart @@ -24,7 +24,7 @@ Future main() async { final linkConfigBuilder = LinkConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, targetOS: os, diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart index 945940166..7862b4ff1 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart @@ -63,7 +63,7 @@ Future runTests(List architectures) async { final linkConfigBuilder = LinkConfigBuilder() ..setupHookConfig( - supportedAssetTypes: [CodeAsset.type], + buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, targetOS: os, From 3aba894cf9c8f160f9dda60b79700b53cfc5545b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Fri, 6 Dec 2024 12:52:07 +0100 Subject: [PATCH 32/50] [native_assets_builder] Report dart sources as dependencies of hooks (#1780) Closes: https://github.com/dart-lang/native/issues/1770 This PR adds the Dart sources to the dependencies in `HookResult`. It also fixes the dep-file parsing w.r.t. to escapes. ### Implementation details We're passing around `HookOutput`s which is the deserialized `output.json`. We could add the Dart sources as dependencies to it _after_ deserializing, but then the correspondence to the json is lost. So instead I've added an extra return value to the places where we pass `HookOutput` around. --- .github/workflows/native.yaml | 2 +- .../lib/src/build_runner/build_runner.dart | 124 ++++++++++++------ .../dependencies_hash_file.dart | 14 +- .../lib/src/model/hook_result.dart | 3 +- .../build_runner/build_dependencies_test.dart | 27 +++- .../build_runner_caching_test.dart | 8 +- .../build_runner_failure_test.dart | 8 +- .../build_runner_non_root_package_test.dart | 4 +- .../build_runner/parse_dep_file_test.dart | 20 +++ 9 files changed, 146 insertions(+), 64 deletions(-) create mode 100644 pkgs/native_assets_builder/test/build_runner/parse_dep_file_test.dart diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 26eb0676d..2aab3d265 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -7,7 +7,7 @@ permissions: read-all on: pull_request: - branches: [main] + # No `branches:` to enable stacked PRs on GitHub. paths: - ".github/workflows/native.yaml" - "pkgs/native_assets_builder/**" diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index b139f5861..ef524724e 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -157,7 +157,7 @@ class NativeAssetsBuildRunner { 'Build configuration for ${package.name} contains errors', errors); } - final hookOutput = await _runHookForPackageCached( + final result = await _runHookForPackageCached( Hook.build, config, (config, output) => @@ -167,8 +167,9 @@ class NativeAssetsBuildRunner { null, packageLayout, ); - if (hookOutput == null) return null; - hookResult = hookResult.copyAdd(hookOutput); + if (result == null) return null; + final (hookOutput, hookDeps) = result; + hookResult = hookResult.copyAdd(hookOutput, hookDeps); globalMetadata[package.name] = (hookOutput as BuildOutput).metadata; } @@ -259,7 +260,7 @@ class NativeAssetsBuildRunner { 'Link configuration for ${package.name} contains errors', errors); } - final hookOutput = await _runHookForPackageCached( + final result = await _runHookForPackageCached( Hook.link, config, (config, output) => @@ -269,8 +270,9 @@ class NativeAssetsBuildRunner { resourceIdentifiers, packageLayout, ); - if (hookOutput == null) return null; - hookResult = hookResult.copyAdd(hookOutput); + if (result == null) return null; + final (hookOutput, hookDeps) = result; + hookResult = hookResult.copyAdd(hookOutput, hookDeps); } final errors = await applicationAssetValidator(hookResult.encodedAssets); @@ -403,18 +405,15 @@ class NativeAssetsBuildRunner { final config = BuildConfig(configBuilder.json); final packageConfigUri = packageLayout.packageConfigUri; - final ( - compileSuccess, - hookKernelFile, - _, - ) = await _compileHookForPackageCached( + final hookCompileResult = await _compileHookForPackageCached( config.packageName, config.outputDirectory, config.packageRoot.resolve('hook/${hook.scriptName}'), packageConfigUri, workingDirectory, ); - if (!compileSuccess) return null; + if (hookCompileResult == null) return null; + final (hookKernelFile, _) = hookCompileResult; // TODO(https://github.com/dart-lang/native/issues/1321): Should dry runs be cached? final buildOutput = await runUnderDirectoriesLock( @@ -437,12 +436,12 @@ class NativeAssetsBuildRunner { ), ); if (buildOutput == null) return null; - hookResult = hookResult.copyAdd(buildOutput); + hookResult = hookResult.copyAdd(buildOutput, [/*dry run is not cached*/]); } return hookResult; } - Future _runHookForPackageCached( + Future<(HookOutput, List)?> _runHookForPackageCached( Hook hook, HookConfig config, _HookValidator validator, @@ -461,20 +460,17 @@ class NativeAssetsBuildRunner { timeout: singleHookTimeout, logger: logger, () async { - final ( - compileSuccess, - hookKernelFile, - hookHashesFile, - ) = await _compileHookForPackageCached( + final hookCompileResult = await _compileHookForPackageCached( config.packageName, config.outputDirectory, config.packageRoot.resolve('hook/${hook.scriptName}'), packageConfigUri, workingDirectory, ); - if (!compileSuccess) { + if (hookCompileResult == null) { return null; } + final (hookKernelFile, hookHashes) = hookCompileResult; final buildOutputFile = File.fromUri(config.outputDirectory.resolve(hook.outputName)); @@ -510,7 +506,7 @@ ${e.message} ); // All build flags go into [outDir]. Therefore we do not have to // check here whether the config is equal. - return output; + return (output, hookHashes.fileSystemEntities); } logger.info( 'Rerunning ${hook.name} for ${config.packageName}' @@ -533,12 +529,13 @@ ${e.message} if (await dependenciesHashFile.exists()) { await dependenciesHashFile.delete(); } + return null; } else { final modifiedDuringBuild = await dependenciesHashes.hashDependencies( [ ...result.dependencies, // Also depend on the hook source code. - hookHashesFile.uri, + hookHashes.file.uri, ], lastModifiedCutoffTime, environment, @@ -547,7 +544,7 @@ ${e.message} logger.severe('File modified during build. Build must be rerun.'); } } - return result; + return (result, hookHashes.fileSystemEntities); }, ); } @@ -685,7 +682,7 @@ ${e.message} /// /// TODO(https://github.com/dart-lang/native/issues/1578): Compile only once /// instead of per config. This requires more locking. - Future<(bool success, File kernelFile, File cacheFile)> + Future<(File kernelFile, DependenciesHashFile cacheFile)?> _compileHookForPackageCached( String packageName, Uri outputDirectory, @@ -721,7 +718,7 @@ ${e.message} } if (!mustCompile) { - return (true, kernelFile, dependenciesHashFile); + return (kernelFile, dependenciesHashes); } final success = await _compileHookForPackage( @@ -733,8 +730,7 @@ ${e.message} depFile, ); if (!success) { - await dependenciesHashFile.delete(); - return (success, kernelFile, dependenciesHashFile); + return null; } final dartSources = await _readDepFile(depFile); @@ -751,19 +747,7 @@ ${e.message} logger.severe('File modified during build. Build must be rerun.'); } - return (success, kernelFile, dependenciesHashFile); - } - - Future> _readDepFile(File depFile) async { - // Format: `path/to/my.dill: path/to/my.dart, path/to/more.dart` - final depFileContents = await depFile.readAsString(); - final dartSources = depFileContents - .trim() - .split(' ') - .skip(1) // ':' - .map(Uri.file) - .toList(); - return dartSources; + return (kernelFile, dependenciesHashes); } Future _compileHookForPackage( @@ -811,6 +795,12 @@ ${compileResult.stdout} ''', ); success = false; + if (await depFile.exists()) { + await depFile.delete(); + } + if (await kernelFile.exists()) { + await kernelFile.delete(); + } } return success; } @@ -927,3 +917,57 @@ ${compileResult.stdout} extension on Uri { Uri get parent => File(toFilePath()).parent.uri; } + +/// Parses depfile contents. +/// +/// Format: `path/to/my.dill: path/to/my.dart, path/to/more.dart` +/// +/// However, the spaces in paths are escaped with backslashes, and the +/// backslashes are escaped with backslashes: +/// +/// ```dart +/// String _escapePath(String path) { +/// return path.replaceAll('\\', '\\\\').replaceAll(' ', '\\ '); +/// } +/// ``` +List parseDepFileInputs(String contents) { + final output = contents.substring(0, contents.indexOf(': ')); + contents = contents.substring(output.length + ': '.length).trim(); + final pathsEscaped = _splitOnNonEscapedSpaces(contents); + return pathsEscaped.map(_unescapeDepsPath).toList(); +} + +String _unescapeDepsPath(String path) => + path.replaceAll(r'\ ', ' ').replaceAll(r'\\', r'\'); + +List _splitOnNonEscapedSpaces(String contents) { + var index = 0; + final result = []; + while (index < contents.length) { + final start = index; + while (index < contents.length) { + final u = contents.codeUnitAt(index); + if (u == ' '.codeUnitAt(0)) { + break; + } + if (u == r'\'.codeUnitAt(0)) { + index++; + if (index == contents.length) { + throw const FormatException('malformed, ending with backslash'); + } + final v = contents.codeUnitAt(index); + assert(v == ' '.codeUnitAt(0) || v == r'\'.codeUnitAt(0)); + } + index++; + } + result.add(contents.substring(start, index)); + index++; + } + return result; +} + +Future> _readDepFile(File depFile) async { + final depFileContents = await depFile.readAsString(); + final dartSources = parseDepFileInputs(depFileContents); + return dartSources.map(Uri.file).toList(); +} diff --git a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart index 2b1c49259..94449bf04 100644 --- a/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart +++ b/pkgs/native_assets_builder/lib/src/dependencies_hash_file/dependencies_hash_file.dart @@ -13,19 +13,21 @@ import '../utils/uri.dart'; class DependenciesHashFile { DependenciesHashFile({ - required File file, - }) : _file = file; + required this.file, + }); - final File _file; + final File file; FileSystemHashes _hashes = FileSystemHashes(); + List get fileSystemEntities => _hashes.files.map((e) => e.path).toList(); + Future _readFile() async { - if (!await _file.exists()) { + if (!await file.exists()) { _hashes = FileSystemHashes(); return; } final jsonObject = - (json.decode(utf8.decode(await _file.readAsBytes())) as Map) + (json.decode(utf8.decode(await file.readAsBytes())) as Map) .cast(); _hashes = FileSystemHashes.fromJson(jsonObject); } @@ -70,7 +72,7 @@ class DependenciesHashFile { return modifiedAfterTimeStamp; } - Future _persist() => _file.writeAsString(json.encode(_hashes.toJson())); + Future _persist() => file.writeAsString(json.encode(_hashes.toJson())); /// Reads the file with hashes and reports if there is an outdated file, /// directory or environment variable. diff --git a/pkgs/native_assets_builder/lib/src/model/hook_result.dart b/pkgs/native_assets_builder/lib/src/model/hook_result.dart index 033d635db..655688a19 100644 --- a/pkgs/native_assets_builder/lib/src/model/hook_result.dart +++ b/pkgs/native_assets_builder/lib/src/model/hook_result.dart @@ -39,7 +39,7 @@ final class HookResult implements BuildResult, BuildDryRunResult, LinkResult { dependencies: dependencies ?? [], ); - HookResult copyAdd(HookOutput hookOutput) { + HookResult copyAdd(HookOutput hookOutput, List hookDependencies) { final mergedMaps = mergeMaps( encodedAssetsForLinking, hookOutput is BuildOutput @@ -61,6 +61,7 @@ final class HookResult implements BuildResult, BuildDryRunResult, LinkResult { dependencies: [ ...dependencies, ...hookOutput.dependencies, + ...hookDependencies, ]..sort(_uriCompare), ); } diff --git a/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart b/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart index bd8ec20ae..a9cce0ba3 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_dependencies_test.dart @@ -50,13 +50,28 @@ void main() async { expect(result.encodedAssets.length, 2); expect( result.dependencies, - [ - tempUri.resolve('native_add/').resolve('src/native_add.c'), - tempUri - .resolve('native_subtract/') - .resolve('src/native_subtract.c'), - ], + containsAll([ + tempUri.resolve('native_add/src/native_add.c'), + tempUri.resolve('native_subtract/src/native_subtract.c'), + if (!Platform.isWindows) ...[ + tempUri.resolve('native_add/hook/build.dart'), + tempUri.resolve('native_subtract/hook/build.dart'), + ], + ]), ); + if (Platform.isWindows) { + expect( + // https://github.com/dart-lang/sdk/issues/59657 + // Deps file on windows sometimes have lowercase drive letters. + // File.exists will work, but Uri equality doesn't. + result.dependencies + .map((e) => Uri.file(e.toFilePath().toLowerCase())), + containsAll([ + tempUri.resolve('native_add/hook/build.dart'), + tempUri.resolve('native_subtract/hook/build.dart'), + ].map((e) => Uri.file(e.toFilePath().toLowerCase()))), + ); + } } }); }); diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart index ed891573f..37055392c 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_caching_test.dart @@ -44,9 +44,9 @@ void main() async { ); expect( result.dependencies, - [ + contains( packageUri.resolve('src/native_add.c'), - ], + ), ); } @@ -80,9 +80,9 @@ void main() async { ); expect( result.dependencies, - [ + contains( packageUri.resolve('src/native_add.c'), - ], + ), ); } }); diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart index 1c5bd9e40..26059a5a1 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_failure_test.dart @@ -39,9 +39,9 @@ void main() async { symbols: ['add']); expect( result.dependencies, - [ + contains( packageUri.resolve('src/native_add.c'), - ], + ), ); } @@ -95,9 +95,9 @@ void main() async { symbols: ['add']); expect( result.dependencies, - [ + contains( packageUri.resolve('src/native_add.c'), - ], + ), ); } }); diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart index 662ad2235..29381b67c 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_non_root_package_test.dart @@ -55,9 +55,9 @@ void main() async { expect(result.encodedAssets, isNotEmpty); expect( result.dependencies, - [ + contains( packageUri.resolve('src/native_add.c'), - ], + ), ); expect( logMessages.join('\n'), diff --git a/pkgs/native_assets_builder/test/build_runner/parse_dep_file_test.dart b/pkgs/native_assets_builder/test/build_runner/parse_dep_file_test.dart new file mode 100644 index 000000000..02897123e --- /dev/null +++ b/pkgs/native_assets_builder/test/build_runner/parse_dep_file_test.dart @@ -0,0 +1,20 @@ +// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:native_assets_builder/src/build_runner/build_runner.dart'; +import 'package:test/test.dart'; + +void main() { + test('parseDepFileInputs', () { + expect( + parseDepFileInputs( + r'C:\\Program\ Files\\foo.dill: C:\\Program\ Files\\foo.dart C:\\Program\ Files\\bar.dart', + ), + [ + r'C:\Program Files\foo.dart', + r'C:\Program Files\bar.dart', + ], + ); + }); +} From acb973c0d887097cf0098423c913f99177ac8d17 Mon Sep 17 00:00:00 2001 From: Marshelino Maged <78962756+marshelino-maged@users.noreply.github.com> Date: Sun, 8 Dec 2024 05:31:28 +0200 Subject: [PATCH 33/50] [jnigen] User-defined visitors (#1755) Config now accepts a list of user-defined visitors. For now the only the they do is excluding classes, methods, and fields. --- pkgs/jnigen/CHANGELOG.md | 2 + pkgs/jnigen/lib/src/bindings/excluder.dart | 14 +++- pkgs/jnigen/lib/src/config/config_types.dart | 40 +++++---- pkgs/jnigen/lib/src/elements/elements.dart | 9 ++ pkgs/jnigen/lib/src/elements/j_elements.dart | 85 +++++++++++++++++++ pkgs/jnigen/lib/src/generate_bindings.dart | 4 + pkgs/jnigen/test/user_excluder.dart | 86 ++++++++++++++++++++ 7 files changed, 218 insertions(+), 22 deletions(-) create mode 100644 pkgs/jnigen/lib/src/elements/j_elements.dart create mode 100644 pkgs/jnigen/test/user_excluder.dart diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index f8408ec7c..3c074d4aa 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -2,6 +2,8 @@ - **Breaking Change**([#1644](https://github.com/dart-lang/native/issues/1644)): Generate null-safe Dart bindings for Java and Kotlin. +- Add a simple AST and update `excluder.dart` to support user-defined exclusions for classes, methods, and fields. + ## 0.12.2 diff --git a/pkgs/jnigen/lib/src/bindings/excluder.dart b/pkgs/jnigen/lib/src/bindings/excluder.dart index c9fba9ab5..85f4a681c 100644 --- a/pkgs/jnigen/lib/src/bindings/excluder.dart +++ b/pkgs/jnigen/lib/src/bindings/excluder.dart @@ -35,6 +35,7 @@ class Excluder extends Visitor { void visit(Classes node) { node.decls.removeWhere((_, classDecl) { final excluded = classDecl.isPrivate || + classDecl.isExcluded || !(config.exclude?.classes?.included(classDecl) ?? true); if (excluded) { log.fine('Excluded class ${classDecl.binaryName}'); @@ -61,13 +62,17 @@ class _ClassExcluder extends Visitor { @override void visit(ClassDecl node) { node.methods = node.methods.where((method) { + final isExcluded = method.isExcluded; final isPrivate = method.isPrivate; final isAbstractCtor = method.isConstructor && node.isAbstract; final isBridgeMethod = method.isSynthetic && method.isBridge; final isExcludedInConfig = config.exclude?.methods?.included(node, method) ?? false; - final excluded = - isPrivate || isAbstractCtor || isBridgeMethod || isExcludedInConfig; + final excluded = isPrivate || + isAbstractCtor || + isBridgeMethod || + isExcludedInConfig || + isExcluded; if (excluded) { log.fine('Excluded method ${node.binaryName}#${method.name}'); } @@ -80,8 +85,9 @@ class _ClassExcluder extends Visitor { return !excluded; }).toList(); node.fields = node.fields.where((field) { - final excluded = field.isPrivate && - (config.exclude?.fields?.included(node, field) ?? true); + final excluded = field.isExcluded || + (field.isPrivate && + (config.exclude?.fields?.included(node, field) ?? true)); if (excluded) { log.fine('Excluded field ${node.binaryName}#${field.name}'); } diff --git a/pkgs/jnigen/lib/src/config/config_types.dart b/pkgs/jnigen/lib/src/config/config_types.dart index f5bd848fd..bead7f371 100644 --- a/pkgs/jnigen/lib/src/config/config_types.dart +++ b/pkgs/jnigen/lib/src/config/config_types.dart @@ -10,6 +10,7 @@ import 'package:pub_semver/pub_semver.dart'; import 'package:yaml/yaml.dart'; import '../elements/elements.dart'; +import '../elements/j_elements.dart' as j_ast; import '../logging/logging.dart'; import '../util/find_package.dart'; import 'config_exception.dart'; @@ -265,24 +266,24 @@ void _validateClassName(String className) { /// Configuration for jnigen binding generation. class Config { - Config({ - required this.outputConfig, - required this.classes, - this.experiments, - this.exclude, - this.sourcePath, - this.classPath, - this.preamble, - this.customClassBody, - this.androidSdkConfig, - this.mavenDownloads, - this.summarizerOptions, - this.nonNullAnnotations, - this.nullableAnnotations, - this.logLevel = Level.INFO, - this.dumpJsonTo, - this.imports, - }) { + Config( + {required this.outputConfig, + required this.classes, + this.experiments, + this.exclude, + this.sourcePath, + this.classPath, + this.preamble, + this.customClassBody, + this.androidSdkConfig, + this.mavenDownloads, + this.summarizerOptions, + this.nonNullAnnotations, + this.nullableAnnotations, + this.logLevel = Level.INFO, + this.dumpJsonTo, + this.imports, + this.visitors}) { for (final className in classes) { _validateClassName(className); } @@ -349,6 +350,9 @@ class Config { /// Used for testing package:jnigen. final Map? customClassBody; + // User custom visitors. + List? visitors; + Future importClasses() async { importedClasses = {}; for (final import in [ diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart index cbdbea653..970c6bfa3 100644 --- a/pkgs/jnigen/lib/src/elements/elements.dart +++ b/pkgs/jnigen/lib/src/elements/elements.dart @@ -59,6 +59,7 @@ class Classes implements Element { @JsonSerializable(createToJson: false) class ClassDecl with ClassMember, Annotated implements Element { ClassDecl({ + this.isExcluded = false, this.annotations, this.javadoc, required this.declKind, @@ -77,6 +78,8 @@ class ClassDecl with ClassMember, Annotated implements Element { this.kotlinPackage, }); + bool isExcluded; + @override final Set modifiers; @@ -602,6 +605,7 @@ mixin ClassMember { @JsonSerializable(createToJson: false) class Method with ClassMember, Annotated implements Element { Method({ + this.isExcluded = false, this.annotations, this.javadoc, this.modifiers = const {}, @@ -612,6 +616,8 @@ class Method with ClassMember, Annotated implements Element { required this.returnType, }); + bool isExcluded; + @override final String name; @override @@ -704,6 +710,7 @@ class Param with Annotated implements Element { @JsonSerializable(createToJson: false) class Field with ClassMember, Annotated implements Element { Field({ + this.isExcluded = false, this.annotations, this.javadoc, this.modifiers = const {}, @@ -712,6 +719,8 @@ class Field with ClassMember, Annotated implements Element { this.defaultValue, }); + bool isExcluded; + @override final String name; @override diff --git a/pkgs/jnigen/lib/src/elements/j_elements.dart b/pkgs/jnigen/lib/src/elements/j_elements.dart new file mode 100644 index 000000000..883786aea --- /dev/null +++ b/pkgs/jnigen/lib/src/elements/j_elements.dart @@ -0,0 +1,85 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'elements.dart' as ast; + +abstract class Element { + void accept(Visitor visitor); +} + +abstract class Visitor { + void visitClass(ClassDecl c) {} + void visitMethod(Method method) {} + void visitField(Field field) {} +} + +class Classes implements Element { + Classes(this._classes); + final ast.Classes _classes; + + @override + void accept(Visitor visitor) { + for (final value in _classes.decls.values) { + final classDecl = ClassDecl(value); + classDecl.accept(visitor); + } + } + + void let(void Function(dynamic userClasses) param0) {} +} + +class ClassDecl implements Element { + ClassDecl(this._classDecl) : binaryName = _classDecl.binaryName; + final ast.ClassDecl _classDecl; + + // Ex: com.x.Foo. + final String binaryName; + + bool get isExcluded => _classDecl.isExcluded; + set isExcluded(bool value) => _classDecl.isExcluded = value; + + @override + void accept(Visitor visitor) { + visitor.visitClass(this); + if (_classDecl.isExcluded) return; + for (final method in _classDecl.methods) { + Method(method).accept(visitor); + } + for (var field in _classDecl.fields) { + Field(field).accept(visitor); + } + } +} + +class Method implements Element { + Method(this._method); + + final ast.Method _method; + + String get name => _method.name; + + bool get isExcluded => _method.isExcluded; + set isExcluded(bool value) => _method.isExcluded = value; + + @override + void accept(Visitor visitor) { + visitor.visitMethod(this); + } +} + +class Field implements Element { + Field(this._field); + + final ast.Field _field; + + String get name => _field.name; + + bool get isExcluded => _field.isExcluded; + set isExcluded(bool value) => _field.isExcluded = value; + + @override + void accept(Visitor visitor) { + visitor.visitField(this); + } +} diff --git a/pkgs/jnigen/lib/src/generate_bindings.dart b/pkgs/jnigen/lib/src/generate_bindings.dart index 2e237f211..6d185f242 100644 --- a/pkgs/jnigen/lib/src/generate_bindings.dart +++ b/pkgs/jnigen/lib/src/generate_bindings.dart @@ -13,6 +13,7 @@ import 'bindings/linker.dart'; import 'bindings/renamer.dart'; import 'config/config.dart'; import 'elements/elements.dart'; +import 'elements/j_elements.dart' as j_ast; import 'logging/logging.dart'; import 'summary/summary.dart'; import 'tools/tools.dart'; @@ -38,6 +39,9 @@ Future generateJniBindings(Config config) async { log.fatal(e.message); } + final userClasses = j_ast.Classes(classes); + config.visitors?.forEach(userClasses.accept); + classes.accept(Excluder(config)); classes.accept(KotlinProcessor()); await classes.accept(Linker(config)); diff --git a/pkgs/jnigen/test/user_excluder.dart b/pkgs/jnigen/test/user_excluder.dart new file mode 100644 index 000000000..f13adcda4 --- /dev/null +++ b/pkgs/jnigen/test/user_excluder.dart @@ -0,0 +1,86 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'package:jnigen/src/elements/elements.dart' as ast; +import 'package:jnigen/src/elements/j_elements.dart'; +import 'package:test/test.dart'; + +extension on Iterable { + List get isExcludedValues => map((c) => c.isExcluded).toList(); +} + +extension on Iterable { + List get isExcludedValues => map((c) => c.isExcluded).toList(); +} + +// This is customizable by the user +class UserExcluder extends Visitor { + @override + void visitClass(ClassDecl c) { + if (c.binaryName.contains('y')) { + c.isExcluded = true; + } + } + + @override + void visitMethod(Method method) { + if (method.name == 'Bar') { + method.isExcluded = true; + } + } + + @override + void visitField(Field field) { + if (field.name == 'Bar') { + field.isExcluded = true; + } + } +} + +void main() { + test('Exclude something using the user excluder, Simple AST', () async { + final classes = ast.Classes({ + 'Foo': ast.ClassDecl( + binaryName: 'Foo', + declKind: ast.DeclKind.classKind, + superclass: ast.TypeUsage.object, + methods: [ + ast.Method(name: 'foo', returnType: ast.TypeUsage.object), + ast.Method(name: 'Bar', returnType: ast.TypeUsage.object), + ast.Method(name: 'foo1', returnType: ast.TypeUsage.object), + ast.Method(name: 'Bar', returnType: ast.TypeUsage.object), + ], + fields: [ + ast.Field(name: 'foo', type: ast.TypeUsage.object), + ast.Field(name: 'Bar', type: ast.TypeUsage.object), + ast.Field(name: 'foo1', type: ast.TypeUsage.object), + ast.Field(name: 'Bar', type: ast.TypeUsage.object), + ], + ), + 'y.Foo': ast.ClassDecl( + binaryName: 'y.Foo', + declKind: ast.DeclKind.classKind, + superclass: ast.TypeUsage.object, + methods: [ + ast.Method(name: 'foo', returnType: ast.TypeUsage.object), + ast.Method(name: 'Bar', returnType: ast.TypeUsage.object), + ], + fields: [ + ast.Field(name: 'foo', type: ast.TypeUsage.object), + ast.Field(name: 'Bar', type: ast.TypeUsage.object), + ]), + }); + + final simpleClasses = Classes(classes); + simpleClasses.accept(UserExcluder()); + + expect(classes.decls['y.Foo']?.isExcluded, true); + expect(classes.decls['Foo']?.isExcluded, false); + + expect(classes.decls['Foo']?.fields.isExcludedValues, + [false, true, false, true]); + expect(classes.decls['Foo']?.methods.isExcludedValues, + [false, true, false, true]); + }); +} From 8ea1a9db0af42933eb22334c4506ca464d7237e9 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Mon, 9 Dec 2024 07:06:36 +0100 Subject: [PATCH 34/50] [jnigen] Use dollar sign in import prefixes to avoid name collision (#1785) --- pkgs/jnigen/CHANGELOG.md | 5 +- .../in_app_java/lib/android_utils.dart | 5056 ++++----- .../kotlin_plugin/lib/kotlin_bindings.dart | 140 +- .../lib/notifications.dart | 152 +- .../org/apache/pdfbox/pdmodel/PDDocument.dart | 1855 ++-- .../pdfbox/pdmodel/PDDocumentInformation.dart | 660 +- .../apache/pdfbox/text/PDFTextStripper.dart | 988 +- .../lib/src/bindings/dart_generator.dart | 4 +- pkgs/jnigen/lib/src/bindings/resolver.dart | 17 +- .../fasterxml/jackson/core/JsonFactory.dart | 2078 ++-- .../fasterxml/jackson/core/JsonParser.dart | 2634 ++--- .../com/fasterxml/jackson/core/JsonToken.dart | 312 +- .../test/kotlin_test/bindings/kotlin.dart | 1924 ++-- pkgs/jnigen/test/package_resolver_test.dart | 19 +- .../bindings/simple_package.dart | 9350 ++++++++--------- .../test/simple_package_test/generate.dart | 4 +- 16 files changed, 12600 insertions(+), 12598 deletions(-) diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 3c074d4aa..d6d7ee1a0 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -2,8 +2,9 @@ - **Breaking Change**([#1644](https://github.com/dart-lang/native/issues/1644)): Generate null-safe Dart bindings for Java and Kotlin. -- Add a simple AST and update `excluder.dart` to support user-defined exclusions for classes, methods, and fields. - +- Fixed a potential name collision when generating in multi-file mode. +- Added the ability to add user-defined visitors to config. Currently only + capable of excluding classes, methods, and fields. ## 0.12.2 diff --git a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart index 62bc1d88d..0a94169a3 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -30,25 +30,25 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `com.example.in_app_java.R$drawable` -class R_drawable extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class R_drawable extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal R_drawable.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/example/in_app_java/R$drawable'); + jni$_.JClass.forName(r'com/example/in_app_java/R$drawable'); /// The type which includes information such as the signature of this class. static const nullableType = $R_drawable$NullableType(); @@ -60,100 +60,100 @@ class R_drawable extends _$jni.JObject { /// from: `static public int launch_background` static int get launch_background => - _id_launch_background.get(_class, const _$jni.jintType()); + _id_launch_background.get(_class, const jni$_.jintType()); /// from: `static public int launch_background` static set launch_background(int value) => - _id_launch_background.set(_class, const _$jni.jintType(), value); + _id_launch_background.set(_class, const jni$_.jintType(), value); } -final class $R_drawable$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $R_drawable$NullableType extends jni$_.JObjType { + @jni$_.internal const $R_drawable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R$drawable;'; - @_$jni.internal - @_$core.override - R_drawable? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + R_drawable? fromReference(jni$_.JReference reference) => reference.isNull ? null : R_drawable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R_drawable$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R_drawable$NullableType) && other is $R_drawable$NullableType; } } -final class $R_drawable$Type extends _$jni.JObjType { - @_$jni.internal +final class $R_drawable$Type extends jni$_.JObjType { + @jni$_.internal const $R_drawable$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R$drawable;'; - @_$jni.internal - @_$core.override - R_drawable fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + R_drawable fromReference(jni$_.JReference reference) => R_drawable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $R_drawable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R_drawable$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R_drawable$Type) && other is $R_drawable$Type; } } /// from: `com.example.in_app_java.R$mipmap` -class R_mipmap extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class R_mipmap extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal R_mipmap.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/example/in_app_java/R$mipmap'); + jni$_.JClass.forName(r'com/example/in_app_java/R$mipmap'); /// The type which includes information such as the signature of this class. static const nullableType = $R_mipmap$NullableType(); @@ -165,98 +165,98 @@ class R_mipmap extends _$jni.JObject { /// from: `static public int ic_launcher` static int get ic_launcher => - _id_ic_launcher.get(_class, const _$jni.jintType()); + _id_ic_launcher.get(_class, const jni$_.jintType()); /// from: `static public int ic_launcher` static set ic_launcher(int value) => - _id_ic_launcher.set(_class, const _$jni.jintType(), value); + _id_ic_launcher.set(_class, const jni$_.jintType(), value); } -final class $R_mipmap$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $R_mipmap$NullableType extends jni$_.JObjType { + @jni$_.internal const $R_mipmap$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R$mipmap;'; - @_$jni.internal - @_$core.override - R_mipmap? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + R_mipmap? fromReference(jni$_.JReference reference) => reference.isNull ? null : R_mipmap.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R_mipmap$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R_mipmap$NullableType) && other is $R_mipmap$NullableType; } } -final class $R_mipmap$Type extends _$jni.JObjType { - @_$jni.internal +final class $R_mipmap$Type extends jni$_.JObjType { + @jni$_.internal const $R_mipmap$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R$mipmap;'; - @_$jni.internal - @_$core.override - R_mipmap fromReference(_$jni.JReference reference) => R_mipmap.fromReference( + @jni$_.internal + @core$_.override + R_mipmap fromReference(jni$_.JReference reference) => R_mipmap.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $R_mipmap$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $R_mipmap$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R_mipmap$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R_mipmap$Type) && other is $R_mipmap$Type; } } /// from: `com.example.in_app_java.R$style` -class R_style extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class R_style extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal R_style.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/example/in_app_java/R$style'); + jni$_.JClass.forName(r'com/example/in_app_java/R$style'); /// The type which includes information such as the signature of this class. static const nullableType = $R_style$NullableType(); @@ -268,11 +268,11 @@ class R_style extends _$jni.JObject { /// from: `static public int LaunchTheme` static int get LaunchTheme => - _id_LaunchTheme.get(_class, const _$jni.jintType()); + _id_LaunchTheme.get(_class, const jni$_.jintType()); /// from: `static public int LaunchTheme` static set LaunchTheme(int value) => - _id_LaunchTheme.set(_class, const _$jni.jintType(), value); + _id_LaunchTheme.set(_class, const jni$_.jintType(), value); static final _id_NormalTheme = _class.staticFieldId( r'NormalTheme', @@ -281,186 +281,186 @@ class R_style extends _$jni.JObject { /// from: `static public int NormalTheme` static int get NormalTheme => - _id_NormalTheme.get(_class, const _$jni.jintType()); + _id_NormalTheme.get(_class, const jni$_.jintType()); /// from: `static public int NormalTheme` static set NormalTheme(int value) => - _id_NormalTheme.set(_class, const _$jni.jintType(), value); + _id_NormalTheme.set(_class, const jni$_.jintType(), value); } -final class $R_style$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $R_style$NullableType extends jni$_.JObjType { + @jni$_.internal const $R_style$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R$style;'; - @_$jni.internal - @_$core.override - R_style? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + R_style? fromReference(jni$_.JReference reference) => reference.isNull ? null : R_style.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R_style$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R_style$NullableType) && other is $R_style$NullableType; } } -final class $R_style$Type extends _$jni.JObjType { - @_$jni.internal +final class $R_style$Type extends jni$_.JObjType { + @jni$_.internal const $R_style$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R$style;'; - @_$jni.internal - @_$core.override - R_style fromReference(_$jni.JReference reference) => R_style.fromReference( + @jni$_.internal + @core$_.override + R_style fromReference(jni$_.JReference reference) => R_style.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $R_style$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $R_style$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R_style$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R_style$Type) && other is $R_style$Type; } } /// from: `com.example.in_app_java.R` -class R extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class R extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal R.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'com/example/in_app_java/R'); + static final _class = jni$_.JClass.forName(r'com/example/in_app_java/R'); /// The type which includes information such as the signature of this class. static const nullableType = $R$NullableType(); static const type = $R$Type(); } -final class $R$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $R$NullableType extends jni$_.JObjType { + @jni$_.internal const $R$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R;'; - @_$jni.internal - @_$core.override - R? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + R? fromReference(jni$_.JReference reference) => reference.isNull ? null : R.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R$NullableType) && other is $R$NullableType; } } -final class $R$Type extends _$jni.JObjType { - @_$jni.internal +final class $R$Type extends jni$_.JObjType { + @jni$_.internal const $R$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/R;'; - @_$jni.internal - @_$core.override - R fromReference(_$jni.JReference reference) => R.fromReference( + @jni$_.internal + @core$_.override + R fromReference(jni$_.JReference reference) => R.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $R$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $R$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($R$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($R$Type) && other is $R$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult` -class EmojiCompat_CodepointSequenceMatchResult extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_CodepointSequenceMatchResult extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_CodepointSequenceMatchResult.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult'); /// The type which includes information such as the signature of this class. @@ -469,16 +469,16 @@ class EmojiCompat_CodepointSequenceMatchResult extends _$jni.JObject { static const type = $EmojiCompat_CodepointSequenceMatchResult$Type(); /// Maps a specific port to the implemented interface. - static final _$core.Map + static final core$_.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -486,39 +486,39 @@ class EmojiCompat_CodepointSequenceMatchResult extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $EmojiCompat_CodepointSequenceMatchResult $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult', @@ -533,7 +533,7 @@ class EmojiCompat_CodepointSequenceMatchResult extends _$jni.JObject { factory EmojiCompat_CodepointSequenceMatchResult.implement( $EmojiCompat_CodepointSequenceMatchResult $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return EmojiCompat_CodepointSequenceMatchResult.fromReference( $i.implementReference(), @@ -552,42 +552,42 @@ final class _$EmojiCompat_CodepointSequenceMatchResult } final class $EmojiCompat_CodepointSequenceMatchResult$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_CodepointSequenceMatchResult$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override EmojiCompat_CodepointSequenceMatchResult? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_CodepointSequenceMatchResult.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_CodepointSequenceMatchResult$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_CodepointSequenceMatchResult$NullableType) && @@ -596,39 +596,39 @@ final class $EmojiCompat_CodepointSequenceMatchResult$NullableType } final class $EmojiCompat_CodepointSequenceMatchResult$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_CodepointSequenceMatchResult$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$CodepointSequenceMatchResult;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override EmojiCompat_CodepointSequenceMatchResult fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => EmojiCompat_CodepointSequenceMatchResult.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_CodepointSequenceMatchResult$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_CodepointSequenceMatchResult$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_CodepointSequenceMatchResult$Type) && @@ -637,19 +637,19 @@ final class $EmojiCompat_CodepointSequenceMatchResult$Type } /// from: `androidx.emoji2.text.EmojiCompat$Config` -class EmojiCompat_Config extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_Config extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_Config.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$Config'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$Config'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat_Config$NullableType(); @@ -659,26 +659,26 @@ class EmojiCompat_Config extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _registerInitCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _registerInitCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config? registerInitCallback( EmojiCompat_InitCallback? initCallback, ) { - final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; + final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; return _registerInitCallback( reference.pointer, - _id_registerInitCallback as _$jni.JMethodIDPtr, + _id_registerInitCallback as jni$_.JMethodIDPtr, _$initCallback.pointer) .object(const $EmojiCompat_Config$NullableType()); } @@ -688,26 +688,26 @@ class EmojiCompat_Config extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _unregisterInitCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _unregisterInitCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config? unregisterInitCallback( EmojiCompat_InitCallback? initCallback, ) { - final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; + final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; return _unregisterInitCallback( reference.pointer, - _id_unregisterInitCallback as _$jni.JMethodIDPtr, + _id_unregisterInitCallback as jni$_.JMethodIDPtr, _$initCallback.pointer) .object(const $EmojiCompat_Config$NullableType()); } @@ -717,15 +717,15 @@ class EmojiCompat_Config extends _$jni.JObject { r'(Z)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setReplaceAll = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setReplaceAll = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setReplaceAll(boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -733,7 +733,7 @@ class EmojiCompat_Config extends _$jni.JObject { bool z, ) { return _setReplaceAll(reference.pointer, - _id_setReplaceAll as _$jni.JMethodIDPtr, z ? 1 : 0) + _id_setReplaceAll as jni$_.JMethodIDPtr, z ? 1 : 0) .object(const $EmojiCompat_Config$NullableType()); } @@ -742,15 +742,15 @@ class EmojiCompat_Config extends _$jni.JObject { r'(Z)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setUseEmojiAsDefaultStyle = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setUseEmojiAsDefaultStyle = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -758,7 +758,7 @@ class EmojiCompat_Config extends _$jni.JObject { bool z, ) { return _setUseEmojiAsDefaultStyle(reference.pointer, - _id_setUseEmojiAsDefaultStyle as _$jni.JMethodIDPtr, z ? 1 : 0) + _id_setUseEmojiAsDefaultStyle as jni$_.JMethodIDPtr, z ? 1 : 0) .object(const $EmojiCompat_Config$NullableType()); } @@ -768,30 +768,30 @@ class EmojiCompat_Config extends _$jni.JObject { ); static final _setUseEmojiAsDefaultStyle$1 = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Pointer<_$jni.Void> + jni$_.Int32, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z, java.util.List list)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config? setUseEmojiAsDefaultStyle$1( bool z, - _$jni.JList<_$jni.JInteger?>? list, + jni$_.JList? list, ) { - final _$list = list?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; return _setUseEmojiAsDefaultStyle$1( reference.pointer, - _id_setUseEmojiAsDefaultStyle$1 as _$jni.JMethodIDPtr, + _id_setUseEmojiAsDefaultStyle$1 as jni$_.JMethodIDPtr, z ? 1 : 0, _$list.pointer) .object(const $EmojiCompat_Config$NullableType()); @@ -803,14 +803,14 @@ class EmojiCompat_Config extends _$jni.JObject { ); static final _setEmojiSpanIndicatorEnabled = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorEnabled(boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -818,7 +818,7 @@ class EmojiCompat_Config extends _$jni.JObject { bool z, ) { return _setEmojiSpanIndicatorEnabled(reference.pointer, - _id_setEmojiSpanIndicatorEnabled as _$jni.JMethodIDPtr, z ? 1 : 0) + _id_setEmojiSpanIndicatorEnabled as jni$_.JMethodIDPtr, z ? 1 : 0) .object(const $EmojiCompat_Config$NullableType()); } @@ -828,14 +828,14 @@ class EmojiCompat_Config extends _$jni.JObject { ); static final _setEmojiSpanIndicatorColor = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorColor(int i)` /// The returned object must be released after use, by calling the [release] method. @@ -843,7 +843,7 @@ class EmojiCompat_Config extends _$jni.JObject { int i, ) { return _setEmojiSpanIndicatorColor(reference.pointer, - _id_setEmojiSpanIndicatorColor as _$jni.JMethodIDPtr, i) + _id_setEmojiSpanIndicatorColor as jni$_.JMethodIDPtr, i) .object(const $EmojiCompat_Config$NullableType()); } @@ -852,15 +852,15 @@ class EmojiCompat_Config extends _$jni.JObject { r'(I)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setMetadataLoadStrategy = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setMetadataLoadStrategy = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setMetadataLoadStrategy(int i)` /// The returned object must be released after use, by calling the [release] method. @@ -868,7 +868,7 @@ class EmojiCompat_Config extends _$jni.JObject { int i, ) { return _setMetadataLoadStrategy(reference.pointer, - _id_setMetadataLoadStrategy as _$jni.JMethodIDPtr, i) + _id_setMetadataLoadStrategy as jni$_.JMethodIDPtr, i) .object(const $EmojiCompat_Config$NullableType()); } @@ -877,25 +877,25 @@ class EmojiCompat_Config extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$SpanFactory;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setSpanFactory = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setSpanFactory = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setSpanFactory(androidx.emoji2.text.EmojiCompat$SpanFactory spanFactory)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config? setSpanFactory( EmojiCompat_SpanFactory? spanFactory, ) { - final _$spanFactory = spanFactory?.reference ?? _$jni.jNullReference; + final _$spanFactory = spanFactory?.reference ?? jni$_.jNullReference; return _setSpanFactory(reference.pointer, - _id_setSpanFactory as _$jni.JMethodIDPtr, _$spanFactory.pointer) + _id_setSpanFactory as jni$_.JMethodIDPtr, _$spanFactory.pointer) .object(const $EmojiCompat_Config$NullableType()); } @@ -904,62 +904,62 @@ class EmojiCompat_Config extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$GlyphChecker;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _setGlyphChecker = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setGlyphChecker = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config setGlyphChecker(androidx.emoji2.text.EmojiCompat$GlyphChecker glyphChecker)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config? setGlyphChecker( EmojiCompat_GlyphChecker? glyphChecker, ) { - final _$glyphChecker = glyphChecker?.reference ?? _$jni.jNullReference; + final _$glyphChecker = glyphChecker?.reference ?? jni$_.jNullReference; return _setGlyphChecker(reference.pointer, - _id_setGlyphChecker as _$jni.JMethodIDPtr, _$glyphChecker.pointer) + _id_setGlyphChecker as jni$_.JMethodIDPtr, _$glyphChecker.pointer) .object(const $EmojiCompat_Config$NullableType()); } } final class $EmojiCompat_Config$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_Config$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$Config;'; - @_$jni.internal - @_$core.override - EmojiCompat_Config? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_Config? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_Config.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_Config$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_Config$NullableType) && other is $EmojiCompat_Config$NullableType; @@ -967,37 +967,37 @@ final class $EmojiCompat_Config$NullableType } final class $EmojiCompat_Config$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_Config$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$Config;'; - @_$jni.internal - @_$core.override - EmojiCompat_Config fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_Config fromReference(jni$_.JReference reference) => EmojiCompat_Config.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_Config$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_Config$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_Config$Type) && other is $EmojiCompat_Config$Type; @@ -1005,18 +1005,18 @@ final class $EmojiCompat_Config$Type } /// from: `androidx.emoji2.text.EmojiCompat$DefaultSpanFactory` -class EmojiCompat_DefaultSpanFactory extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_DefaultSpanFactory extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_DefaultSpanFactory.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/EmojiCompat$DefaultSpanFactory'); /// The type which includes information such as the signature of this class. @@ -1026,23 +1026,23 @@ class EmojiCompat_DefaultSpanFactory extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_DefaultSpanFactory() { return EmojiCompat_DefaultSpanFactory.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -1051,64 +1051,64 @@ class EmojiCompat_DefaultSpanFactory extends _$jni.JObject { r'(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;', ); - static final _createSpan = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createSpan = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer typefaceEmojiRasterizer)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? createSpan( - _$jni.JObject? typefaceEmojiRasterizer, + jni$_.JObject? createSpan( + jni$_.JObject? typefaceEmojiRasterizer, ) { final _$typefaceEmojiRasterizer = - typefaceEmojiRasterizer?.reference ?? _$jni.jNullReference; - return _createSpan(reference.pointer, _id_createSpan as _$jni.JMethodIDPtr, + typefaceEmojiRasterizer?.reference ?? jni$_.jNullReference; + return _createSpan(reference.pointer, _id_createSpan as jni$_.JMethodIDPtr, _$typefaceEmojiRasterizer.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } } final class $EmojiCompat_DefaultSpanFactory$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_DefaultSpanFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$DefaultSpanFactory;'; - @_$jni.internal - @_$core.override - EmojiCompat_DefaultSpanFactory? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_DefaultSpanFactory? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_DefaultSpanFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_DefaultSpanFactory$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_DefaultSpanFactory$NullableType) && @@ -1117,38 +1117,38 @@ final class $EmojiCompat_DefaultSpanFactory$NullableType } final class $EmojiCompat_DefaultSpanFactory$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_DefaultSpanFactory$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$DefaultSpanFactory;'; - @_$jni.internal - @_$core.override - EmojiCompat_DefaultSpanFactory fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_DefaultSpanFactory fromReference(jni$_.JReference reference) => EmojiCompat_DefaultSpanFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_DefaultSpanFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_DefaultSpanFactory$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_DefaultSpanFactory$Type) && other is $EmojiCompat_DefaultSpanFactory$Type; @@ -1156,19 +1156,19 @@ final class $EmojiCompat_DefaultSpanFactory$Type } /// from: `androidx.emoji2.text.EmojiCompat$GlyphChecker` -class EmojiCompat_GlyphChecker extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_GlyphChecker extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_GlyphChecker.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$GlyphChecker'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$GlyphChecker'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat_GlyphChecker$NullableType(); @@ -1178,45 +1178,45 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { r'(Ljava/lang/CharSequence;III)Z', ); - static final _hasGlyph = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _hasGlyph = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int, int)>(); /// from: `public abstract boolean hasGlyph(java.lang.CharSequence charSequence, int i, int i1, int i2)` bool hasGlyph( - _$jni.JObject? charSequence, + jni$_.JObject? charSequence, int i, int i1, int i2, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; - return _hasGlyph(reference.pointer, _id_hasGlyph as _$jni.JMethodIDPtr, + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; + return _hasGlyph(reference.pointer, _id_hasGlyph as jni$_.JMethodIDPtr, _$charSequence.pointer, i, i1, i2) .boolean; } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -1224,54 +1224,54 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r'hasGlyph(Ljava/lang/CharSequence;III)Z') { final $r = _$impls[$p]!.hasGlyph( - $a![0]?.as(const _$jni.JObjectType(), releaseOriginal: true), + $a![0]?.as(const jni$_.JObjectType(), releaseOriginal: true), $a![1]! - .as(const _$jni.JIntegerType(), releaseOriginal: true) + .as(const jni$_.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), $a![2]! - .as(const _$jni.JIntegerType(), releaseOriginal: true) + .as(const jni$_.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), $a![3]! - .as(const _$jni.JIntegerType(), releaseOriginal: true) + .as(const jni$_.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), ); - return _$jni.JBoolean($r).reference.toPointer(); + return jni$_.JBoolean($r).reference.toPointer(); } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $EmojiCompat_GlyphChecker $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'androidx.emoji2.text.EmojiCompat$GlyphChecker', @@ -1286,7 +1286,7 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { factory EmojiCompat_GlyphChecker.implement( $EmojiCompat_GlyphChecker $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return EmojiCompat_GlyphChecker.fromReference( $i.implementReference(), @@ -1296,60 +1296,60 @@ class EmojiCompat_GlyphChecker extends _$jni.JObject { abstract base mixin class $EmojiCompat_GlyphChecker { factory $EmojiCompat_GlyphChecker({ - required bool Function(_$jni.JObject? charSequence, int i, int i1, int i2) + required bool Function(jni$_.JObject? charSequence, int i, int i1, int i2) hasGlyph, }) = _$EmojiCompat_GlyphChecker; - bool hasGlyph(_$jni.JObject? charSequence, int i, int i1, int i2); + bool hasGlyph(jni$_.JObject? charSequence, int i, int i1, int i2); } final class _$EmojiCompat_GlyphChecker with $EmojiCompat_GlyphChecker { _$EmojiCompat_GlyphChecker({ - required bool Function(_$jni.JObject? charSequence, int i, int i1, int i2) + required bool Function(jni$_.JObject? charSequence, int i, int i1, int i2) hasGlyph, }) : _hasGlyph = hasGlyph; - final bool Function(_$jni.JObject? charSequence, int i, int i1, int i2) + final bool Function(jni$_.JObject? charSequence, int i, int i1, int i2) _hasGlyph; - bool hasGlyph(_$jni.JObject? charSequence, int i, int i1, int i2) { + bool hasGlyph(jni$_.JObject? charSequence, int i, int i1, int i2) { return _hasGlyph(charSequence, i, i1, i2); } } final class $EmojiCompat_GlyphChecker$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_GlyphChecker$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$GlyphChecker;'; - @_$jni.internal - @_$core.override - EmojiCompat_GlyphChecker? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_GlyphChecker? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_GlyphChecker.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_GlyphChecker$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_GlyphChecker$NullableType) && other is $EmojiCompat_GlyphChecker$NullableType; @@ -1357,37 +1357,37 @@ final class $EmojiCompat_GlyphChecker$NullableType } final class $EmojiCompat_GlyphChecker$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_GlyphChecker$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$GlyphChecker;'; - @_$jni.internal - @_$core.override - EmojiCompat_GlyphChecker fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_GlyphChecker fromReference(jni$_.JReference reference) => EmojiCompat_GlyphChecker.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_GlyphChecker$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_GlyphChecker$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_GlyphChecker$Type) && other is $EmojiCompat_GlyphChecker$Type; @@ -1395,19 +1395,19 @@ final class $EmojiCompat_GlyphChecker$Type } /// from: `androidx.emoji2.text.EmojiCompat$InitCallback` -class EmojiCompat_InitCallback extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_InitCallback extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_InitCallback.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$InitCallback'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$InitCallback'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat_InitCallback$NullableType(); @@ -1417,21 +1417,21 @@ class EmojiCompat_InitCallback extends _$jni.JObject { r'()V', ); - static final _onInitialized = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _onInitialized = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void onInitialized()` void onInitialized() { - _onInitialized(reference.pointer, _id_onInitialized as _$jni.JMethodIDPtr) + _onInitialized(reference.pointer, _id_onInitialized as jni$_.JMethodIDPtr) .check(); } @@ -1440,61 +1440,61 @@ class EmojiCompat_InitCallback extends _$jni.JObject { r'(Ljava/lang/Throwable;)V', ); - static final _onFailed = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _onFailed = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void onFailed(java.lang.Throwable throwable)` void onFailed( - _$jni.JObject? throwable, + jni$_.JObject? throwable, ) { - final _$throwable = throwable?.reference ?? _$jni.jNullReference; - _onFailed(reference.pointer, _id_onFailed as _$jni.JMethodIDPtr, + final _$throwable = throwable?.reference ?? jni$_.jNullReference; + _onFailed(reference.pointer, _id_onFailed as jni$_.JMethodIDPtr, _$throwable.pointer) .check(); } } final class $EmojiCompat_InitCallback$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_InitCallback$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$InitCallback;'; - @_$jni.internal - @_$core.override - EmojiCompat_InitCallback? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_InitCallback? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_InitCallback.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_InitCallback$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_InitCallback$NullableType) && other is $EmojiCompat_InitCallback$NullableType; @@ -1502,37 +1502,37 @@ final class $EmojiCompat_InitCallback$NullableType } final class $EmojiCompat_InitCallback$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_InitCallback$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$InitCallback;'; - @_$jni.internal - @_$core.override - EmojiCompat_InitCallback fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_InitCallback fromReference(jni$_.JReference reference) => EmojiCompat_InitCallback.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_InitCallback$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_InitCallback$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_InitCallback$Type) && other is $EmojiCompat_InitCallback$Type; @@ -1540,34 +1540,34 @@ final class $EmojiCompat_InitCallback$Type } /// from: `androidx.emoji2.text.EmojiCompat$LoadStrategy` -class EmojiCompat_LoadStrategy extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_LoadStrategy extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_LoadStrategy.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$LoadStrategy'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$LoadStrategy'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat_LoadStrategy$NullableType(); static const type = $EmojiCompat_LoadStrategy$Type(); /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -1575,39 +1575,39 @@ class EmojiCompat_LoadStrategy extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $EmojiCompat_LoadStrategy $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'androidx.emoji2.text.EmojiCompat$LoadStrategy', @@ -1622,7 +1622,7 @@ class EmojiCompat_LoadStrategy extends _$jni.JObject { factory EmojiCompat_LoadStrategy.implement( $EmojiCompat_LoadStrategy $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return EmojiCompat_LoadStrategy.fromReference( $i.implementReference(), @@ -1639,38 +1639,38 @@ final class _$EmojiCompat_LoadStrategy with $EmojiCompat_LoadStrategy { } final class $EmojiCompat_LoadStrategy$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_LoadStrategy$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$LoadStrategy;'; - @_$jni.internal - @_$core.override - EmojiCompat_LoadStrategy? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_LoadStrategy? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_LoadStrategy.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_LoadStrategy$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_LoadStrategy$NullableType) && other is $EmojiCompat_LoadStrategy$NullableType; @@ -1678,37 +1678,37 @@ final class $EmojiCompat_LoadStrategy$NullableType } final class $EmojiCompat_LoadStrategy$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_LoadStrategy$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$LoadStrategy;'; - @_$jni.internal - @_$core.override - EmojiCompat_LoadStrategy fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_LoadStrategy fromReference(jni$_.JReference reference) => EmojiCompat_LoadStrategy.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_LoadStrategy$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_LoadStrategy$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_LoadStrategy$Type) && other is $EmojiCompat_LoadStrategy$Type; @@ -1716,18 +1716,18 @@ final class $EmojiCompat_LoadStrategy$Type } /// from: `androidx.emoji2.text.EmojiCompat$MetadataRepoLoader` -class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_MetadataRepoLoader.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoader'); /// The type which includes information such as the signature of this class. @@ -1738,38 +1738,38 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V', ); - static final _load = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _load = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract void load(androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback metadataRepoLoaderCallback)` void load( EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback, ) { final _$metadataRepoLoaderCallback = - metadataRepoLoaderCallback?.reference ?? _$jni.jNullReference; - _load(reference.pointer, _id_load as _$jni.JMethodIDPtr, + metadataRepoLoaderCallback?.reference ?? jni$_.jNullReference; + _load(reference.pointer, _id_load as jni$_.JMethodIDPtr, _$metadataRepoLoaderCallback.pointer) .check(); } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -1777,15 +1777,15 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); @@ -1796,28 +1796,28 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { $a![0]?.as(const $EmojiCompat_MetadataRepoLoaderCallback$Type(), releaseOriginal: true), ); - return _$jni.nullptr; + return jni$_.nullptr; } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $EmojiCompat_MetadataRepoLoader $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'androidx.emoji2.text.EmojiCompat$MetadataRepoLoader', @@ -1835,7 +1835,7 @@ class EmojiCompat_MetadataRepoLoader extends _$jni.JObject { factory EmojiCompat_MetadataRepoLoader.implement( $EmojiCompat_MetadataRepoLoader $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return EmojiCompat_MetadataRepoLoader.fromReference( $i.implementReference(), @@ -1875,39 +1875,39 @@ final class _$EmojiCompat_MetadataRepoLoader } final class $EmojiCompat_MetadataRepoLoader$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_MetadataRepoLoader$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;'; - @_$jni.internal - @_$core.override - EmojiCompat_MetadataRepoLoader? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_MetadataRepoLoader? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_MetadataRepoLoader.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_MetadataRepoLoader$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_MetadataRepoLoader$NullableType) && @@ -1916,38 +1916,38 @@ final class $EmojiCompat_MetadataRepoLoader$NullableType } final class $EmojiCompat_MetadataRepoLoader$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_MetadataRepoLoader$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;'; - @_$jni.internal - @_$core.override - EmojiCompat_MetadataRepoLoader fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_MetadataRepoLoader fromReference(jni$_.JReference reference) => EmojiCompat_MetadataRepoLoader.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_MetadataRepoLoader$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_MetadataRepoLoader$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_MetadataRepoLoader$Type) && other is $EmojiCompat_MetadataRepoLoader$Type; @@ -1955,18 +1955,18 @@ final class $EmojiCompat_MetadataRepoLoader$Type } /// from: `androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback` -class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_MetadataRepoLoaderCallback extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_MetadataRepoLoaderCallback.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback'); /// The type which includes information such as the signature of this class. @@ -1978,23 +1978,23 @@ class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { r'(Landroidx/emoji2/text/MetadataRepo;)V', ); - static final _onLoaded = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _onLoaded = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract void onLoaded(androidx.emoji2.text.MetadataRepo metadataRepo)` void onLoaded( - _$jni.JObject? metadataRepo, + jni$_.JObject? metadataRepo, ) { - final _$metadataRepo = metadataRepo?.reference ?? _$jni.jNullReference; - _onLoaded(reference.pointer, _id_onLoaded as _$jni.JMethodIDPtr, + final _$metadataRepo = metadataRepo?.reference ?? jni$_.jNullReference; + _onLoaded(reference.pointer, _id_onLoaded as jni$_.JMethodIDPtr, _$metadataRepo.pointer) .check(); } @@ -2004,65 +2004,65 @@ class EmojiCompat_MetadataRepoLoaderCallback extends _$jni.JObject { r'(Ljava/lang/Throwable;)V', ); - static final _onFailed = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _onFailed = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract void onFailed(java.lang.Throwable throwable)` void onFailed( - _$jni.JObject? throwable, + jni$_.JObject? throwable, ) { - final _$throwable = throwable?.reference ?? _$jni.jNullReference; - _onFailed(reference.pointer, _id_onFailed as _$jni.JMethodIDPtr, + final _$throwable = throwable?.reference ?? jni$_.jNullReference; + _onFailed(reference.pointer, _id_onFailed as jni$_.JMethodIDPtr, _$throwable.pointer) .check(); } } final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override EmojiCompat_MetadataRepoLoaderCallback? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_MetadataRepoLoaderCallback.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallback$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderCallback$NullableType) && @@ -2071,39 +2071,39 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType } final class $EmojiCompat_MetadataRepoLoaderCallback$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_MetadataRepoLoaderCallback$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override EmojiCompat_MetadataRepoLoaderCallback fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => EmojiCompat_MetadataRepoLoaderCallback.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallback$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_MetadataRepoLoaderCallback$Type) && @@ -2112,34 +2112,34 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$Type } /// from: `androidx.emoji2.text.EmojiCompat$ReplaceStrategy` -class EmojiCompat_ReplaceStrategy extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_ReplaceStrategy extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_ReplaceStrategy.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$ReplaceStrategy'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$ReplaceStrategy'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat_ReplaceStrategy$NullableType(); static const type = $EmojiCompat_ReplaceStrategy$Type(); /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -2147,39 +2147,39 @@ class EmojiCompat_ReplaceStrategy extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $EmojiCompat_ReplaceStrategy $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'androidx.emoji2.text.EmojiCompat$ReplaceStrategy', @@ -2194,7 +2194,7 @@ class EmojiCompat_ReplaceStrategy extends _$jni.JObject { factory EmojiCompat_ReplaceStrategy.implement( $EmojiCompat_ReplaceStrategy $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return EmojiCompat_ReplaceStrategy.fromReference( $i.implementReference(), @@ -2211,38 +2211,38 @@ final class _$EmojiCompat_ReplaceStrategy with $EmojiCompat_ReplaceStrategy { } final class $EmojiCompat_ReplaceStrategy$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_ReplaceStrategy$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$ReplaceStrategy;'; - @_$jni.internal - @_$core.override - EmojiCompat_ReplaceStrategy? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_ReplaceStrategy? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_ReplaceStrategy.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_ReplaceStrategy$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_ReplaceStrategy$NullableType) && other is $EmojiCompat_ReplaceStrategy$NullableType; @@ -2250,37 +2250,37 @@ final class $EmojiCompat_ReplaceStrategy$NullableType } final class $EmojiCompat_ReplaceStrategy$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_ReplaceStrategy$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$ReplaceStrategy;'; - @_$jni.internal - @_$core.override - EmojiCompat_ReplaceStrategy fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_ReplaceStrategy fromReference(jni$_.JReference reference) => EmojiCompat_ReplaceStrategy.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_ReplaceStrategy$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_ReplaceStrategy$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_ReplaceStrategy$Type) && other is $EmojiCompat_ReplaceStrategy$Type; @@ -2288,19 +2288,19 @@ final class $EmojiCompat_ReplaceStrategy$Type } /// from: `androidx.emoji2.text.EmojiCompat$SpanFactory` -class EmojiCompat_SpanFactory extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat_SpanFactory extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat_SpanFactory.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat$SpanFactory'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$SpanFactory'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat_SpanFactory$NullableType(); @@ -2310,39 +2310,39 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { r'(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;', ); - static final _createSpan = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createSpan = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer typefaceEmojiRasterizer)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? createSpan( - _$jni.JObject? typefaceEmojiRasterizer, + jni$_.JObject? createSpan( + jni$_.JObject? typefaceEmojiRasterizer, ) { final _$typefaceEmojiRasterizer = - typefaceEmojiRasterizer?.reference ?? _$jni.jNullReference; - return _createSpan(reference.pointer, _id_createSpan as _$jni.JMethodIDPtr, + typefaceEmojiRasterizer?.reference ?? jni$_.jNullReference; + return _createSpan(reference.pointer, _id_createSpan as jni$_.JMethodIDPtr, _$typefaceEmojiRasterizer.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -2350,15 +2350,15 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); @@ -2366,34 +2366,34 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { if ($d == r'createSpan(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;') { final $r = _$impls[$p]!.createSpan( - $a![0]?.as(const _$jni.JObjectType(), releaseOriginal: true), + $a![0]?.as(const jni$_.JObjectType(), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $EmojiCompat_SpanFactory $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'androidx.emoji2.text.EmojiCompat$SpanFactory', @@ -2408,7 +2408,7 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { factory EmojiCompat_SpanFactory.implement( $EmojiCompat_SpanFactory $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return EmojiCompat_SpanFactory.fromReference( $i.implementReference(), @@ -2418,60 +2418,60 @@ class EmojiCompat_SpanFactory extends _$jni.JObject { abstract base mixin class $EmojiCompat_SpanFactory { factory $EmojiCompat_SpanFactory({ - required _$jni.JObject? Function(_$jni.JObject? typefaceEmojiRasterizer) + required jni$_.JObject? Function(jni$_.JObject? typefaceEmojiRasterizer) createSpan, }) = _$EmojiCompat_SpanFactory; - _$jni.JObject? createSpan(_$jni.JObject? typefaceEmojiRasterizer); + jni$_.JObject? createSpan(jni$_.JObject? typefaceEmojiRasterizer); } final class _$EmojiCompat_SpanFactory with $EmojiCompat_SpanFactory { _$EmojiCompat_SpanFactory({ - required _$jni.JObject? Function(_$jni.JObject? typefaceEmojiRasterizer) + required jni$_.JObject? Function(jni$_.JObject? typefaceEmojiRasterizer) createSpan, }) : _createSpan = createSpan; - final _$jni.JObject? Function(_$jni.JObject? typefaceEmojiRasterizer) + final jni$_.JObject? Function(jni$_.JObject? typefaceEmojiRasterizer) _createSpan; - _$jni.JObject? createSpan(_$jni.JObject? typefaceEmojiRasterizer) { + jni$_.JObject? createSpan(jni$_.JObject? typefaceEmojiRasterizer) { return _createSpan(typefaceEmojiRasterizer); } } final class $EmojiCompat_SpanFactory$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_SpanFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$SpanFactory;'; - @_$jni.internal - @_$core.override - EmojiCompat_SpanFactory? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_SpanFactory? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat_SpanFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_SpanFactory$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_SpanFactory$NullableType) && other is $EmojiCompat_SpanFactory$NullableType; @@ -2479,37 +2479,37 @@ final class $EmojiCompat_SpanFactory$NullableType } final class $EmojiCompat_SpanFactory$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat_SpanFactory$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat$SpanFactory;'; - @_$jni.internal - @_$core.override - EmojiCompat_SpanFactory fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat_SpanFactory fromReference(jni$_.JReference reference) => EmojiCompat_SpanFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat_SpanFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat_SpanFactory$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat_SpanFactory$Type) && other is $EmojiCompat_SpanFactory$Type; @@ -2517,19 +2517,19 @@ final class $EmojiCompat_SpanFactory$Type } /// from: `androidx.emoji2.text.EmojiCompat` -class EmojiCompat extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class EmojiCompat extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal EmojiCompat.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/EmojiCompat'); + jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat'); /// The type which includes information such as the signature of this class. static const nullableType = $EmojiCompat$NullableType(); @@ -2541,9 +2541,9 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public final java.lang.String EDITOR_INFO_METAVERSION_KEY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get EDITOR_INFO_METAVERSION_KEY => + static jni$_.JString? get EDITOR_INFO_METAVERSION_KEY => _id_EDITOR_INFO_METAVERSION_KEY.get( - _class, const _$jni.JStringNullableType()); + _class, const jni$_.JStringNullableType()); static final _id_EDITOR_INFO_REPLACE_ALL_KEY = _class.staticFieldId( r'EDITOR_INFO_REPLACE_ALL_KEY', @@ -2552,9 +2552,9 @@ class EmojiCompat extends _$jni.JObject { /// from: `static public final java.lang.String EDITOR_INFO_REPLACE_ALL_KEY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get EDITOR_INFO_REPLACE_ALL_KEY => + static jni$_.JString? get EDITOR_INFO_REPLACE_ALL_KEY => _id_EDITOR_INFO_REPLACE_ALL_KEY.get( - _class, const _$jni.JStringNullableType()); + _class, const jni$_.JStringNullableType()); /// from: `static public final int LOAD_STATE_DEFAULT` static const LOAD_STATE_DEFAULT = 3; @@ -2596,24 +2596,24 @@ class EmojiCompat extends _$jni.JObject { r'(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _init = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _init = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public androidx.emoji2.text.EmojiCompat init(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? init( - _$jni.JObject? context, + jni$_.JObject? context, ) { - final _$context = context?.reference ?? _$jni.jNullReference; - return _init(_class.reference.pointer, _id_init as _$jni.JMethodIDPtr, + final _$context = context?.reference ?? jni$_.jNullReference; + return _init(_class.reference.pointer, _id_init as jni$_.JMethodIDPtr, _$context.pointer) .object(const $EmojiCompat$NullableType()); } @@ -2623,34 +2623,34 @@ class EmojiCompat extends _$jni.JObject { r'(Landroid/content/Context;Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _init$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _init$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory defaultEmojiCompatConfigFactory)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? init$1( - _$jni.JObject? context, + jni$_.JObject? context, DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory? defaultEmojiCompatConfigFactory, ) { - final _$context = context?.reference ?? _$jni.jNullReference; + final _$context = context?.reference ?? jni$_.jNullReference; final _$defaultEmojiCompatConfigFactory = - defaultEmojiCompatConfigFactory?.reference ?? _$jni.jNullReference; - return _init$1(_class.reference.pointer, _id_init$1 as _$jni.JMethodIDPtr, + defaultEmojiCompatConfigFactory?.reference ?? jni$_.jNullReference; + return _init$1(_class.reference.pointer, _id_init$1 as jni$_.JMethodIDPtr, _$context.pointer, _$defaultEmojiCompatConfigFactory.pointer) .object(const $EmojiCompat$NullableType()); } @@ -2660,24 +2660,24 @@ class EmojiCompat extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _init$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _init$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public androidx.emoji2.text.EmojiCompat init(androidx.emoji2.text.EmojiCompat$Config config)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? init$2( EmojiCompat_Config? config, ) { - final _$config = config?.reference ?? _$jni.jNullReference; - return _init$2(_class.reference.pointer, _id_init$2 as _$jni.JMethodIDPtr, + final _$config = config?.reference ?? jni$_.jNullReference; + return _init$2(_class.reference.pointer, _id_init$2 as jni$_.JMethodIDPtr, _$config.pointer) .object(const $EmojiCompat$NullableType()); } @@ -2687,22 +2687,22 @@ class EmojiCompat extends _$jni.JObject { r'()Z', ); - static final _isConfigured = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isConfigured = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public boolean isConfigured()` static bool isConfigured() { return _isConfigured( - _class.reference.pointer, _id_isConfigured as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_isConfigured as jni$_.JMethodIDPtr) .boolean; } @@ -2711,24 +2711,24 @@ class EmojiCompat extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$Config;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _reset = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _reset = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat$Config config)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? reset( EmojiCompat_Config? config, ) { - final _$config = config?.reference ?? _$jni.jNullReference; - return _reset(_class.reference.pointer, _id_reset as _$jni.JMethodIDPtr, + final _$config = config?.reference ?? jni$_.jNullReference; + return _reset(_class.reference.pointer, _id_reset as jni$_.JMethodIDPtr, _$config.pointer) .object(const $EmojiCompat$NullableType()); } @@ -2738,24 +2738,24 @@ class EmojiCompat extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat;)Landroidx/emoji2/text/EmojiCompat;', ); - static final _reset$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _reset$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat emojiCompat)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? reset$1( EmojiCompat? emojiCompat, ) { - final _$emojiCompat = emojiCompat?.reference ?? _$jni.jNullReference; - return _reset$1(_class.reference.pointer, _id_reset$1 as _$jni.JMethodIDPtr, + final _$emojiCompat = emojiCompat?.reference ?? jni$_.jNullReference; + return _reset$1(_class.reference.pointer, _id_reset$1 as jni$_.JMethodIDPtr, _$emojiCompat.pointer) .object(const $EmojiCompat$NullableType()); } @@ -2766,21 +2766,21 @@ class EmojiCompat extends _$jni.JObject { ); static final _skipDefaultConfigurationLookup = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `static public void skipDefaultConfigurationLookup(boolean z)` static void skipDefaultConfigurationLookup( bool z, ) { _skipDefaultConfigurationLookup(_class.reference.pointer, - _id_skipDefaultConfigurationLookup as _$jni.JMethodIDPtr, z ? 1 : 0) + _id_skipDefaultConfigurationLookup as jni$_.JMethodIDPtr, z ? 1 : 0) .check(); } @@ -2789,22 +2789,22 @@ class EmojiCompat extends _$jni.JObject { r'()Landroidx/emoji2/text/EmojiCompat;', ); - static final _get = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _get = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public androidx.emoji2.text.EmojiCompat get()` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? get() { - return _get(_class.reference.pointer, _id_get as _$jni.JMethodIDPtr) + return _get(_class.reference.pointer, _id_get as jni$_.JMethodIDPtr) .object(const $EmojiCompat$NullableType()); } @@ -2813,21 +2813,21 @@ class EmojiCompat extends _$jni.JObject { r'()V', ); - static final _load = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _load = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void load()` void load() { - _load(reference.pointer, _id_load as _$jni.JMethodIDPtr).check(); + _load(reference.pointer, _id_load as jni$_.JMethodIDPtr).check(); } static final _id_registerInitCallback = _class.instanceMethodId( @@ -2835,25 +2835,25 @@ class EmojiCompat extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V', ); - static final _registerInitCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _registerInitCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void registerInitCallback( EmojiCompat_InitCallback? initCallback, ) { - final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; + final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; _registerInitCallback( reference.pointer, - _id_registerInitCallback as _$jni.JMethodIDPtr, + _id_registerInitCallback as jni$_.JMethodIDPtr, _$initCallback.pointer) .check(); } @@ -2863,25 +2863,25 @@ class EmojiCompat extends _$jni.JObject { r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)V', ); - static final _unregisterInitCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _unregisterInitCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void unregisterInitCallback( EmojiCompat_InitCallback? initCallback, ) { - final _$initCallback = initCallback?.reference ?? _$jni.jNullReference; + final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; _unregisterInitCallback( reference.pointer, - _id_unregisterInitCallback as _$jni.JMethodIDPtr, + _id_unregisterInitCallback as jni$_.JMethodIDPtr, _$initCallback.pointer) .check(); } @@ -2891,22 +2891,22 @@ class EmojiCompat extends _$jni.JObject { r'()I', ); - static final _getLoadState = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getLoadState = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getLoadState()` int getLoadState() { return _getLoadState( - reference.pointer, _id_getLoadState as _$jni.JMethodIDPtr) + reference.pointer, _id_getLoadState as jni$_.JMethodIDPtr) .integer; } @@ -2916,22 +2916,22 @@ class EmojiCompat extends _$jni.JObject { ); static final _isEmojiSpanIndicatorEnabled = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isEmojiSpanIndicatorEnabled()` bool isEmojiSpanIndicatorEnabled() { return _isEmojiSpanIndicatorEnabled(reference.pointer, - _id_isEmojiSpanIndicatorEnabled as _$jni.JMethodIDPtr) + _id_isEmojiSpanIndicatorEnabled as jni$_.JMethodIDPtr) .boolean; } @@ -2941,22 +2941,22 @@ class EmojiCompat extends _$jni.JObject { ); static final _getEmojiSpanIndicatorColor = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getEmojiSpanIndicatorColor()` int getEmojiSpanIndicatorColor() { return _getEmojiSpanIndicatorColor(reference.pointer, - _id_getEmojiSpanIndicatorColor as _$jni.JMethodIDPtr) + _id_getEmojiSpanIndicatorColor as jni$_.JMethodIDPtr) .integer; } @@ -2965,26 +2965,26 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;I)I', ); - static final _getEmojiStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _getEmojiStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public int getEmojiStart(java.lang.CharSequence charSequence, int i)` int getEmojiStart( - _$jni.JObject? charSequence, + jni$_.JObject? charSequence, int i, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; return _getEmojiStart(reference.pointer, - _id_getEmojiStart as _$jni.JMethodIDPtr, _$charSequence.pointer, i) + _id_getEmojiStart as jni$_.JMethodIDPtr, _$charSequence.pointer, i) .integer; } @@ -2993,26 +2993,26 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;I)I', ); - static final _getEmojiEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _getEmojiEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public int getEmojiEnd(java.lang.CharSequence charSequence, int i)` int getEmojiEnd( - _$jni.JObject? charSequence, + jni$_.JObject? charSequence, int i, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; return _getEmojiEnd(reference.pointer, - _id_getEmojiEnd as _$jni.JMethodIDPtr, _$charSequence.pointer, i) + _id_getEmojiEnd as jni$_.JMethodIDPtr, _$charSequence.pointer, i) .integer; } @@ -3021,36 +3021,36 @@ class EmojiCompat extends _$jni.JObject { r'(Landroid/text/Editable;ILandroid/view/KeyEvent;)Z', ); - static final _handleOnKeyDown = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _handleOnKeyDown = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer )>)>>('globalEnv_CallStaticBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, int, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.Pointer)>(); /// from: `static public boolean handleOnKeyDown(android.text.Editable editable, int i, android.view.KeyEvent keyEvent)` static bool handleOnKeyDown( - _$jni.JObject? editable, + jni$_.JObject? editable, int i, - _$jni.JObject? keyEvent, + jni$_.JObject? keyEvent, ) { - final _$editable = editable?.reference ?? _$jni.jNullReference; - final _$keyEvent = keyEvent?.reference ?? _$jni.jNullReference; + final _$editable = editable?.reference ?? jni$_.jNullReference; + final _$keyEvent = keyEvent?.reference ?? jni$_.jNullReference; return _handleOnKeyDown( _class.reference.pointer, - _id_handleOnKeyDown as _$jni.JMethodIDPtr, + _id_handleOnKeyDown as jni$_.JMethodIDPtr, _$editable.pointer, i, _$keyEvent.pointer) @@ -3063,43 +3063,43 @@ class EmojiCompat extends _$jni.JObject { ); static final _handleDeleteSurroundingText = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallStaticBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, int, int, int)>(); /// from: `static public boolean handleDeleteSurroundingText(android.view.inputmethod.InputConnection inputConnection, android.text.Editable editable, int i, int i1, boolean z)` static bool handleDeleteSurroundingText( - _$jni.JObject? inputConnection, - _$jni.JObject? editable, + jni$_.JObject? inputConnection, + jni$_.JObject? editable, int i, int i1, bool z, ) { final _$inputConnection = - inputConnection?.reference ?? _$jni.jNullReference; - final _$editable = editable?.reference ?? _$jni.jNullReference; + inputConnection?.reference ?? jni$_.jNullReference; + final _$editable = editable?.reference ?? jni$_.jNullReference; return _handleDeleteSurroundingText( _class.reference.pointer, - _id_handleDeleteSurroundingText as _$jni.JMethodIDPtr, + _id_handleDeleteSurroundingText as jni$_.JMethodIDPtr, _$inputConnection.pointer, _$editable.pointer, i, @@ -3113,24 +3113,24 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;)Z', ); - static final _hasEmojiGlyph = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _hasEmojiGlyph = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean hasEmojiGlyph(java.lang.CharSequence charSequence)` bool hasEmojiGlyph( - _$jni.JObject? charSequence, + jni$_.JObject? charSequence, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; return _hasEmojiGlyph(reference.pointer, - _id_hasEmojiGlyph as _$jni.JMethodIDPtr, _$charSequence.pointer) + _id_hasEmojiGlyph as jni$_.JMethodIDPtr, _$charSequence.pointer) .boolean; } @@ -3139,27 +3139,27 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;I)Z', ); - static final _hasEmojiGlyph$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _hasEmojiGlyph$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public boolean hasEmojiGlyph(java.lang.CharSequence charSequence, int i)` bool hasEmojiGlyph$1( - _$jni.JObject? charSequence, + jni$_.JObject? charSequence, int i, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; return _hasEmojiGlyph$1( reference.pointer, - _id_hasEmojiGlyph$1 as _$jni.JMethodIDPtr, + _id_hasEmojiGlyph$1 as jni$_.JMethodIDPtr, _$charSequence.pointer, i) .boolean; @@ -3170,26 +3170,26 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;I)I', ); - static final _getEmojiMatch = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _getEmojiMatch = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public int getEmojiMatch(java.lang.CharSequence charSequence, int i)` int getEmojiMatch( - _$jni.JObject? charSequence, + jni$_.JObject? charSequence, int i, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; return _getEmojiMatch(reference.pointer, - _id_getEmojiMatch as _$jni.JMethodIDPtr, _$charSequence.pointer, i) + _id_getEmojiMatch as jni$_.JMethodIDPtr, _$charSequence.pointer, i) .integer; } @@ -3198,26 +3198,26 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;', ); - static final _process = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _process = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? process( - _$jni.JObject? charSequence, + jni$_.JObject? process( + jni$_.JObject? charSequence, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; - return _process(reference.pointer, _id_process as _$jni.JMethodIDPtr, + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; + return _process(reference.pointer, _id_process as jni$_.JMethodIDPtr, _$charSequence.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_process$1 = _class.instanceMethodId( @@ -3225,32 +3225,32 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;II)Ljava/lang/CharSequence;', ); - static final _process$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _process$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? process$1( - _$jni.JObject? charSequence, + jni$_.JObject? process$1( + jni$_.JObject? charSequence, int i, int i1, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; - return _process$1(reference.pointer, _id_process$1 as _$jni.JMethodIDPtr, + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; + return _process$1(reference.pointer, _id_process$1 as jni$_.JMethodIDPtr, _$charSequence.pointer, i, i1) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_process$2 = _class.instanceMethodId( @@ -3258,34 +3258,34 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;III)Ljava/lang/CharSequence;', ); - static final _process$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _process$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int, int)>(); /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1, int i2)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? process$2( - _$jni.JObject? charSequence, + jni$_.JObject? process$2( + jni$_.JObject? charSequence, int i, int i1, int i2, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; - return _process$2(reference.pointer, _id_process$2 as _$jni.JMethodIDPtr, + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; + return _process$2(reference.pointer, _id_process$2 as jni$_.JMethodIDPtr, _$charSequence.pointer, i, i1, i2) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_process$3 = _class.instanceMethodId( @@ -3293,24 +3293,24 @@ class EmojiCompat extends _$jni.JObject { r'(Ljava/lang/CharSequence;IIII)Ljava/lang/CharSequence;', ); - static final _process$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _process$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, int, int, int, @@ -3318,17 +3318,17 @@ class EmojiCompat extends _$jni.JObject { /// from: `public java.lang.CharSequence process(java.lang.CharSequence charSequence, int i, int i1, int i2, int i3)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? process$3( - _$jni.JObject? charSequence, + jni$_.JObject? process$3( + jni$_.JObject? charSequence, int i, int i1, int i2, int i3, ) { - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; - return _process$3(reference.pointer, _id_process$3 as _$jni.JMethodIDPtr, + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; + return _process$3(reference.pointer, _id_process$3 as jni$_.JMethodIDPtr, _$charSequence.pointer, i, i1, i2, i3) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_getAssetSignature = _class.instanceMethodId( @@ -3336,24 +3336,24 @@ class EmojiCompat extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getAssetSignature = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getAssetSignature = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getAssetSignature()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getAssetSignature() { + jni$_.JString? getAssetSignature() { return _getAssetSignature( - reference.pointer, _id_getAssetSignature as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getAssetSignature as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_updateEditorInfo = _class.instanceMethodId( @@ -3361,96 +3361,96 @@ class EmojiCompat extends _$jni.JObject { r'(Landroid/view/inputmethod/EditorInfo;)V', ); - static final _updateEditorInfo = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _updateEditorInfo = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void updateEditorInfo(android.view.inputmethod.EditorInfo editorInfo)` void updateEditorInfo( - _$jni.JObject? editorInfo, + jni$_.JObject? editorInfo, ) { - final _$editorInfo = editorInfo?.reference ?? _$jni.jNullReference; + final _$editorInfo = editorInfo?.reference ?? jni$_.jNullReference; _updateEditorInfo(reference.pointer, - _id_updateEditorInfo as _$jni.JMethodIDPtr, _$editorInfo.pointer) + _id_updateEditorInfo as jni$_.JMethodIDPtr, _$editorInfo.pointer) .check(); } } -final class $EmojiCompat$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $EmojiCompat$NullableType extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat;'; - @_$jni.internal - @_$core.override - EmojiCompat? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + EmojiCompat? fromReference(jni$_.JReference reference) => reference.isNull ? null : EmojiCompat.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat$NullableType) && other is $EmojiCompat$NullableType; } } -final class $EmojiCompat$Type extends _$jni.JObjType { - @_$jni.internal +final class $EmojiCompat$Type extends jni$_.JObjType { + @jni$_.internal const $EmojiCompat$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/EmojiCompat;'; - @_$jni.internal - @_$core.override - EmojiCompat fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + EmojiCompat fromReference(jni$_.JReference reference) => EmojiCompat.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $EmojiCompat$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($EmojiCompat$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($EmojiCompat$Type) && other is $EmojiCompat$Type; @@ -3459,19 +3459,19 @@ final class $EmojiCompat$Type extends _$jni.JObjType { /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory'); /// The type which includes information such as the signature of this class. @@ -3483,16 +3483,16 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory r'(Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper defaultEmojiCompatConfigHelper)` /// The returned object must be released after use, by calling the [release] method. @@ -3501,11 +3501,11 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory defaultEmojiCompatConfigHelper, ) { final _$defaultEmojiCompatConfigHelper = - defaultEmojiCompatConfigHelper?.reference ?? _$jni.jNullReference; + defaultEmojiCompatConfigHelper?.reference ?? jni$_.jNullReference; return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory .fromReference(_new$( _class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, + _id_new$ as jni$_.JMethodIDPtr, _$defaultEmojiCompatConfigHelper.pointer) .reference); } @@ -3515,69 +3515,69 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory r'(Landroid/content/Context;)Landroidx/emoji2/text/EmojiCompat$Config;', ); - static final _create = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _create = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public androidx.emoji2.text.EmojiCompat$Config create(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat_Config? create( - _$jni.JObject? context, + jni$_.JObject? context, ) { - final _$context = context?.reference ?? _$jni.jNullReference; - return _create(reference.pointer, _id_create as _$jni.JMethodIDPtr, + final _$context = context?.reference ?? jni$_.jNullReference; + return _create(reference.pointer, _id_create as jni$_.JMethodIDPtr, _$context.pointer) .object(const $EmojiCompat_Config$NullableType()); } } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory .fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType) .hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType) && @@ -3587,42 +3587,42 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableTy } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type) && @@ -3632,19 +3632,19 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper'); /// The type which includes information such as the signature of this class. @@ -3656,16 +3656,16 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -3673,7 +3673,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper .fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -3682,39 +3682,39 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/content/pm/Signature;', ); - static final _getSigningSignatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _getSigningSignatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JObject?>? getSigningSignatures( - _$jni.JObject? packageManager, - _$jni.JString? string, + jni$_.JArray? getSigningSignatures( + jni$_.JObject? packageManager, + jni$_.JString? string, ) { - final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; + final _$packageManager = packageManager?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _getSigningSignatures( reference.pointer, - _id_getSigningSignatures as _$jni.JMethodIDPtr, + _id_getSigningSignatures as jni$_.JMethodIDPtr, _$packageManager.pointer, _$string.pointer) - .object<_$jni.JArray<_$jni.JObject?>?>( - const _$jni.JArrayNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + .object?>( + const jni$_.JArrayNullableType( + jni$_.JObjectNullableType())); } static final _id_queryIntentContentProviders = _class.instanceMethodId( @@ -3723,43 +3723,43 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper ); static final _queryIntentContentProviders = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Int32 + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, int)>(); /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JObject?>? queryIntentContentProviders( - _$jni.JObject? packageManager, - _$jni.JObject? intent, + jni$_.JList? queryIntentContentProviders( + jni$_.JObject? packageManager, + jni$_.JObject? intent, int i, ) { - final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; - final _$intent = intent?.reference ?? _$jni.jNullReference; + final _$packageManager = packageManager?.reference ?? jni$_.jNullReference; + final _$intent = intent?.reference ?? jni$_.jNullReference; return _queryIntentContentProviders( reference.pointer, - _id_queryIntentContentProviders as _$jni.JMethodIDPtr, + _id_queryIntentContentProviders as jni$_.JMethodIDPtr, _$packageManager.pointer, _$intent.pointer, i) - .object<_$jni.JList<_$jni.JObject?>?>( - const _$jni.JListNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + .object?>( + const jni$_.JListNullableType( + jni$_.JObjectNullableType())); } static final _id_getProviderInfo = _class.instanceMethodId( @@ -3767,69 +3767,69 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper r'(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;', ); - static final _getProviderInfo = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getProviderInfo = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? getProviderInfo( - _$jni.JObject? resolveInfo, + jni$_.JObject? getProviderInfo( + jni$_.JObject? resolveInfo, ) { - final _$resolveInfo = resolveInfo?.reference ?? _$jni.jNullReference; + final _$resolveInfo = resolveInfo?.reference ?? jni$_.jNullReference; return _getProviderInfo(reference.pointer, - _id_getProviderInfo as _$jni.JMethodIDPtr, _$resolveInfo.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getProviderInfo as jni$_.JMethodIDPtr, _$resolveInfo.pointer) + .object(const jni$_.JObjectNullableType()); } } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper .fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType) .hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType) && @@ -3839,42 +3839,42 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableTyp } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type) && @@ -3885,19 +3885,19 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper { - @_$jni.internal - @_$core.override - final _$jni + @jni$_.internal + @core$_.override + final jni$_ .JObjType $type; - @_$jni.internal + @jni$_.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19'); /// The type which includes information such as the signature of this class. @@ -3909,16 +3909,16 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -3926,7 +3926,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 .fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -3936,43 +3936,43 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 ); static final _queryIntentContentProviders = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Int32 + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, int)>(); /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JObject?>? queryIntentContentProviders( - _$jni.JObject? packageManager, - _$jni.JObject? intent, + jni$_.JList? queryIntentContentProviders( + jni$_.JObject? packageManager, + jni$_.JObject? intent, int i, ) { - final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; - final _$intent = intent?.reference ?? _$jni.jNullReference; + final _$packageManager = packageManager?.reference ?? jni$_.jNullReference; + final _$intent = intent?.reference ?? jni$_.jNullReference; return _queryIntentContentProviders( reference.pointer, - _id_queryIntentContentProviders as _$jni.JMethodIDPtr, + _id_queryIntentContentProviders as jni$_.JMethodIDPtr, _$packageManager.pointer, _$intent.pointer, i) - .object<_$jni.JList<_$jni.JObject?>?>( - const _$jni.JListNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + .object?>( + const jni$_.JListNullableType( + jni$_.JObjectNullableType())); } static final _id_getProviderInfo = _class.instanceMethodId( @@ -3980,70 +3980,70 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 r'(Landroid/content/pm/ResolveInfo;)Landroid/content/pm/ProviderInfo;', ); - static final _getProviderInfo = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getProviderInfo = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? getProviderInfo( - _$jni.JObject? resolveInfo, + jni$_.JObject? getProviderInfo( + jni$_.JObject? resolveInfo, ) { - final _$resolveInfo = resolveInfo?.reference ?? _$jni.jNullReference; + final _$resolveInfo = resolveInfo?.reference ?? jni$_.jNullReference; return _getProviderInfo(reference.pointer, - _id_getProviderInfo as _$jni.JMethodIDPtr, _$resolveInfo.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getProviderInfo as jni$_.JMethodIDPtr, _$resolveInfo.pointer) + .object(const jni$_.JObjectNullableType()); } } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 .fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType) .hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType) && @@ -4053,45 +4053,45 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Nulla } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 .fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type) .hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type) && @@ -4103,19 +4103,19 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28` class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 { - @_$jni.internal - @_$core.override - final _$jni + @jni$_.internal + @core$_.override + final jni$_ .JObjType $type; - @_$jni.internal + @jni$_.internal DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'androidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28'); /// The type which includes information such as the signature of this class. @@ -4127,16 +4127,16 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -4144,7 +4144,7 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 .fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -4153,83 +4153,83 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 r'(Landroid/content/pm/PackageManager;Ljava/lang/String;)[Landroid/content/pm/Signature;', ); - static final _getSigningSignatures$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _getSigningSignatures$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JObject?>? getSigningSignatures$1( - _$jni.JObject? packageManager, - _$jni.JString? string, + jni$_.JArray? getSigningSignatures$1( + jni$_.JObject? packageManager, + jni$_.JString? string, ) { - final _$packageManager = packageManager?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; + final _$packageManager = packageManager?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _getSigningSignatures$1( reference.pointer, - _id_getSigningSignatures$1 as _$jni.JMethodIDPtr, + _id_getSigningSignatures$1 as jni$_.JMethodIDPtr, _$packageManager.pointer, _$string.pointer) - .object<_$jni.JArray<_$jni.JObject?>?>( - const _$jni.JArrayNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + .object?>( + const jni$_.JArrayNullableType( + jni$_.JObjectNullableType())); } } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 .fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 3; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType) .hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType) && @@ -4239,45 +4239,45 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Nulla } final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type - extends _$jni + extends jni$_ .JObjType { - @_$jni.internal + @jni$_.internal const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 .fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 3; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type) .hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type) && @@ -4287,19 +4287,19 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig` -class DefaultEmojiCompatConfig extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class DefaultEmojiCompatConfig extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal DefaultEmojiCompatConfig.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'androidx/emoji2/text/DefaultEmojiCompatConfig'); + jni$_.JClass.forName(r'androidx/emoji2/text/DefaultEmojiCompatConfig'); /// The type which includes information such as the signature of this class. static const nullableType = $DefaultEmojiCompatConfig$NullableType(); @@ -4309,62 +4309,62 @@ class DefaultEmojiCompatConfig extends _$jni.JObject { r'(Landroid/content/Context;)Landroidx/emoji2/text/FontRequestEmojiCompatConfig;', ); - static final _create = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _create = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public androidx.emoji2.text.FontRequestEmojiCompatConfig create(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject? create( - _$jni.JObject? context, + static jni$_.JObject? create( + jni$_.JObject? context, ) { - final _$context = context?.reference ?? _$jni.jNullReference; - return _create(_class.reference.pointer, _id_create as _$jni.JMethodIDPtr, + final _$context = context?.reference ?? jni$_.jNullReference; + return _create(_class.reference.pointer, _id_create as jni$_.JMethodIDPtr, _$context.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } } final class $DefaultEmojiCompatConfig$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $DefaultEmojiCompatConfig$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig;'; - @_$jni.internal - @_$core.override - DefaultEmojiCompatConfig? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + DefaultEmojiCompatConfig? fromReference(jni$_.JReference reference) => reference.isNull ? null : DefaultEmojiCompatConfig.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig$NullableType) && other is $DefaultEmojiCompatConfig$NullableType; @@ -4372,37 +4372,37 @@ final class $DefaultEmojiCompatConfig$NullableType } final class $DefaultEmojiCompatConfig$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $DefaultEmojiCompatConfig$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroidx/emoji2/text/DefaultEmojiCompatConfig;'; - @_$jni.internal - @_$core.override - DefaultEmojiCompatConfig fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + DefaultEmojiCompatConfig fromReference(jni$_.JReference reference) => DefaultEmojiCompatConfig.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $DefaultEmojiCompatConfig$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($DefaultEmojiCompatConfig$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($DefaultEmojiCompatConfig$Type) && other is $DefaultEmojiCompatConfig$Type; @@ -4410,18 +4410,18 @@ final class $DefaultEmojiCompatConfig$Type } /// from: `android.os.Build$Partition` -class Build_Partition extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Build_Partition extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Build_Partition.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'android/os/Build$Partition'); + static final _class = jni$_.JClass.forName(r'android/os/Build$Partition'); /// The type which includes information such as the signature of this class. static const nullableType = $Build_Partition$NullableType(); @@ -4433,31 +4433,31 @@ class Build_Partition extends _$jni.JObject { /// from: `static public final java.lang.String PARTITION_NAME_SYSTEM` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get PARTITION_NAME_SYSTEM => - _id_PARTITION_NAME_SYSTEM.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get PARTITION_NAME_SYSTEM => + _id_PARTITION_NAME_SYSTEM.get(_class, const jni$_.JStringNullableType()); static final _id_getName = _class.instanceMethodId( r'getName', r'()Ljava/lang/String;', ); - static final _getName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getName()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getName() { - return _getName(reference.pointer, _id_getName as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getName() { + return _getName(reference.pointer, _id_getName as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getFingerprint = _class.instanceMethodId( @@ -4465,24 +4465,24 @@ class Build_Partition extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getFingerprint = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFingerprint = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getFingerprint()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getFingerprint() { + jni$_.JString? getFingerprint() { return _getFingerprint( - reference.pointer, _id_getFingerprint as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getFingerprint as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getBuildTimeMillis = _class.instanceMethodId( @@ -4490,22 +4490,22 @@ class Build_Partition extends _$jni.JObject { r'()J', ); - static final _getBuildTimeMillis = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getBuildTimeMillis = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public long getBuildTimeMillis()` int getBuildTimeMillis() { return _getBuildTimeMillis( - reference.pointer, _id_getBuildTimeMillis as _$jni.JMethodIDPtr) + reference.pointer, _id_getBuildTimeMillis as jni$_.JMethodIDPtr) .long; } @@ -4514,23 +4514,23 @@ class Build_Partition extends _$jni.JObject { r'(Ljava/lang/Object;)Z', ); - static final _equals = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _equals = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean equals(java.lang.Object object)` bool equals( - _$jni.JObject? object, + jni$_.JObject? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - return _equals(reference.pointer, _id_equals as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + return _equals(reference.pointer, _id_equals as jni$_.JMethodIDPtr, _$object.pointer) .boolean; } @@ -4540,94 +4540,94 @@ class Build_Partition extends _$jni.JObject { r'()I', ); - static final _hashCode$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _hashCode$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int hashCode()` int hashCode$1() { - return _hashCode$1(reference.pointer, _id_hashCode$1 as _$jni.JMethodIDPtr) + return _hashCode$1(reference.pointer, _id_hashCode$1 as jni$_.JMethodIDPtr) .integer; } } final class $Build_Partition$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Build_Partition$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build$Partition;'; - @_$jni.internal - @_$core.override - Build_Partition? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Build_Partition? fromReference(jni$_.JReference reference) => reference.isNull ? null : Build_Partition.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build_Partition$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build_Partition$NullableType) && other is $Build_Partition$NullableType; } } -final class $Build_Partition$Type extends _$jni.JObjType { - @_$jni.internal +final class $Build_Partition$Type extends jni$_.JObjType { + @jni$_.internal const $Build_Partition$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build$Partition;'; - @_$jni.internal - @_$core.override - Build_Partition fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Build_Partition fromReference(jni$_.JReference reference) => Build_Partition.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Build_Partition$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build_Partition$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build_Partition$Type) && other is $Build_Partition$Type; @@ -4635,18 +4635,18 @@ final class $Build_Partition$Type extends _$jni.JObjType { } /// from: `android.os.Build$VERSION` -class Build_VERSION extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Build_VERSION extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Build_VERSION.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'android/os/Build$VERSION'); + static final _class = jni$_.JClass.forName(r'android/os/Build$VERSION'); /// The type which includes information such as the signature of this class. static const nullableType = $Build_VERSION$NullableType(); @@ -4658,8 +4658,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String BASE_OS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get BASE_OS => - _id_BASE_OS.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get BASE_OS => + _id_BASE_OS.get(_class, const jni$_.JStringNullableType()); static final _id_CODENAME = _class.staticFieldId( r'CODENAME', @@ -4668,8 +4668,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String CODENAME` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get CODENAME => - _id_CODENAME.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get CODENAME => + _id_CODENAME.get(_class, const jni$_.JStringNullableType()); static final _id_INCREMENTAL = _class.staticFieldId( r'INCREMENTAL', @@ -4678,8 +4678,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String INCREMENTAL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get INCREMENTAL => - _id_INCREMENTAL.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get INCREMENTAL => + _id_INCREMENTAL.get(_class, const jni$_.JStringNullableType()); static final _id_MEDIA_PERFORMANCE_CLASS = _class.staticFieldId( r'MEDIA_PERFORMANCE_CLASS', @@ -4688,7 +4688,7 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final int MEDIA_PERFORMANCE_CLASS` static int get MEDIA_PERFORMANCE_CLASS => - _id_MEDIA_PERFORMANCE_CLASS.get(_class, const _$jni.jintType()); + _id_MEDIA_PERFORMANCE_CLASS.get(_class, const jni$_.jintType()); static final _id_PREVIEW_SDK_INT = _class.staticFieldId( r'PREVIEW_SDK_INT', @@ -4697,7 +4697,7 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final int PREVIEW_SDK_INT` static int get PREVIEW_SDK_INT => - _id_PREVIEW_SDK_INT.get(_class, const _$jni.jintType()); + _id_PREVIEW_SDK_INT.get(_class, const jni$_.jintType()); static final _id_RELEASE = _class.staticFieldId( r'RELEASE', @@ -4706,8 +4706,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String RELEASE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get RELEASE => - _id_RELEASE.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get RELEASE => + _id_RELEASE.get(_class, const jni$_.JStringNullableType()); static final _id_RELEASE_OR_CODENAME = _class.staticFieldId( r'RELEASE_OR_CODENAME', @@ -4716,8 +4716,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String RELEASE_OR_CODENAME` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get RELEASE_OR_CODENAME => - _id_RELEASE_OR_CODENAME.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get RELEASE_OR_CODENAME => + _id_RELEASE_OR_CODENAME.get(_class, const jni$_.JStringNullableType()); static final _id_RELEASE_OR_PREVIEW_DISPLAY = _class.staticFieldId( r'RELEASE_OR_PREVIEW_DISPLAY', @@ -4726,9 +4726,9 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String RELEASE_OR_PREVIEW_DISPLAY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get RELEASE_OR_PREVIEW_DISPLAY => + static jni$_.JString? get RELEASE_OR_PREVIEW_DISPLAY => _id_RELEASE_OR_PREVIEW_DISPLAY.get( - _class, const _$jni.JStringNullableType()); + _class, const jni$_.JStringNullableType()); static final _id_SDK = _class.staticFieldId( r'SDK', @@ -4737,8 +4737,8 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String SDK` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SDK => - _id_SDK.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SDK => + _id_SDK.get(_class, const jni$_.JStringNullableType()); static final _id_SDK_INT = _class.staticFieldId( r'SDK_INT', @@ -4746,7 +4746,7 @@ class Build_VERSION extends _$jni.JObject { ); /// from: `static public final int SDK_INT` - static int get SDK_INT => _id_SDK_INT.get(_class, const _$jni.jintType()); + static int get SDK_INT => _id_SDK_INT.get(_class, const jni$_.jintType()); static final _id_SECURITY_PATCH = _class.staticFieldId( r'SECURITY_PATCH', @@ -4755,102 +4755,102 @@ class Build_VERSION extends _$jni.JObject { /// from: `static public final java.lang.String SECURITY_PATCH` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SECURITY_PATCH => - _id_SECURITY_PATCH.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SECURITY_PATCH => + _id_SECURITY_PATCH.get(_class, const jni$_.JStringNullableType()); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION() { return Build_VERSION.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Build_VERSION$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Build_VERSION$NullableType extends jni$_.JObjType { + @jni$_.internal const $Build_VERSION$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build$VERSION;'; - @_$jni.internal - @_$core.override - Build_VERSION? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Build_VERSION? fromReference(jni$_.JReference reference) => reference.isNull ? null : Build_VERSION.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build_VERSION$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build_VERSION$NullableType) && other is $Build_VERSION$NullableType; } } -final class $Build_VERSION$Type extends _$jni.JObjType { - @_$jni.internal +final class $Build_VERSION$Type extends jni$_.JObjType { + @jni$_.internal const $Build_VERSION$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build$VERSION;'; - @_$jni.internal - @_$core.override - Build_VERSION fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Build_VERSION fromReference(jni$_.JReference reference) => Build_VERSION.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Build_VERSION$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build_VERSION$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build_VERSION$Type) && other is $Build_VERSION$Type; @@ -4858,18 +4858,18 @@ final class $Build_VERSION$Type extends _$jni.JObjType { } /// from: `android.os.Build$VERSION_CODES` -class Build_VERSION_CODES extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Build_VERSION_CODES extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Build_VERSION_CODES.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'android/os/Build$VERSION_CODES'); + static final _class = jni$_.JClass.forName(r'android/os/Build$VERSION_CODES'); /// The type which includes information such as the signature of this class. static const nullableType = $Build_VERSION_CODES$NullableType(); @@ -4986,60 +4986,60 @@ class Build_VERSION_CODES extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION_CODES() { return Build_VERSION_CODES.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } final class $Build_VERSION_CODES$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Build_VERSION_CODES$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build$VERSION_CODES;'; - @_$jni.internal - @_$core.override - Build_VERSION_CODES? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Build_VERSION_CODES? fromReference(jni$_.JReference reference) => reference.isNull ? null : Build_VERSION_CODES.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build_VERSION_CODES$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build_VERSION_CODES$NullableType) && other is $Build_VERSION_CODES$NullableType; @@ -5047,37 +5047,37 @@ final class $Build_VERSION_CODES$NullableType } final class $Build_VERSION_CODES$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Build_VERSION_CODES$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build$VERSION_CODES;'; - @_$jni.internal - @_$core.override - Build_VERSION_CODES fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Build_VERSION_CODES fromReference(jni$_.JReference reference) => Build_VERSION_CODES.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Build_VERSION_CODES$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build_VERSION_CODES$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build_VERSION_CODES$Type) && other is $Build_VERSION_CODES$Type; @@ -5085,18 +5085,18 @@ final class $Build_VERSION_CODES$Type } /// from: `android.os.Build` -class Build extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Build extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Build.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'android/os/Build'); + static final _class = jni$_.JClass.forName(r'android/os/Build'); /// The type which includes information such as the signature of this class. static const nullableType = $Build$NullableType(); @@ -5108,8 +5108,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String BOARD` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get BOARD => - _id_BOARD.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get BOARD => + _id_BOARD.get(_class, const jni$_.JStringNullableType()); static final _id_BOOTLOADER = _class.staticFieldId( r'BOOTLOADER', @@ -5118,8 +5118,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String BOOTLOADER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get BOOTLOADER => - _id_BOOTLOADER.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get BOOTLOADER => + _id_BOOTLOADER.get(_class, const jni$_.JStringNullableType()); static final _id_BRAND = _class.staticFieldId( r'BRAND', @@ -5128,8 +5128,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String BRAND` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get BRAND => - _id_BRAND.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get BRAND => + _id_BRAND.get(_class, const jni$_.JStringNullableType()); static final _id_CPU_ABI = _class.staticFieldId( r'CPU_ABI', @@ -5138,8 +5138,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String CPU_ABI` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get CPU_ABI => - _id_CPU_ABI.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get CPU_ABI => + _id_CPU_ABI.get(_class, const jni$_.JStringNullableType()); static final _id_CPU_ABI2 = _class.staticFieldId( r'CPU_ABI2', @@ -5148,8 +5148,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String CPU_ABI2` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get CPU_ABI2 => - _id_CPU_ABI2.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get CPU_ABI2 => + _id_CPU_ABI2.get(_class, const jni$_.JStringNullableType()); static final _id_DEVICE = _class.staticFieldId( r'DEVICE', @@ -5158,8 +5158,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String DEVICE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get DEVICE => - _id_DEVICE.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get DEVICE => + _id_DEVICE.get(_class, const jni$_.JStringNullableType()); static final _id_DISPLAY = _class.staticFieldId( r'DISPLAY', @@ -5168,8 +5168,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String DISPLAY` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get DISPLAY => - _id_DISPLAY.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get DISPLAY => + _id_DISPLAY.get(_class, const jni$_.JStringNullableType()); static final _id_FINGERPRINT = _class.staticFieldId( r'FINGERPRINT', @@ -5178,8 +5178,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String FINGERPRINT` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get FINGERPRINT => - _id_FINGERPRINT.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get FINGERPRINT => + _id_FINGERPRINT.get(_class, const jni$_.JStringNullableType()); static final _id_HARDWARE = _class.staticFieldId( r'HARDWARE', @@ -5188,8 +5188,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String HARDWARE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get HARDWARE => - _id_HARDWARE.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get HARDWARE => + _id_HARDWARE.get(_class, const jni$_.JStringNullableType()); static final _id_HOST = _class.staticFieldId( r'HOST', @@ -5198,8 +5198,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String HOST` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get HOST => - _id_HOST.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get HOST => + _id_HOST.get(_class, const jni$_.JStringNullableType()); static final _id_ID = _class.staticFieldId( r'ID', @@ -5208,8 +5208,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String ID` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get ID => - _id_ID.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get ID => + _id_ID.get(_class, const jni$_.JStringNullableType()); static final _id_MANUFACTURER = _class.staticFieldId( r'MANUFACTURER', @@ -5218,8 +5218,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String MANUFACTURER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get MANUFACTURER => - _id_MANUFACTURER.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get MANUFACTURER => + _id_MANUFACTURER.get(_class, const jni$_.JStringNullableType()); static final _id_MODEL = _class.staticFieldId( r'MODEL', @@ -5228,8 +5228,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String MODEL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get MODEL => - _id_MODEL.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get MODEL => + _id_MODEL.get(_class, const jni$_.JStringNullableType()); static final _id_ODM_SKU = _class.staticFieldId( r'ODM_SKU', @@ -5238,8 +5238,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String ODM_SKU` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get ODM_SKU => - _id_ODM_SKU.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get ODM_SKU => + _id_ODM_SKU.get(_class, const jni$_.JStringNullableType()); static final _id_PRODUCT = _class.staticFieldId( r'PRODUCT', @@ -5248,8 +5248,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String PRODUCT` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get PRODUCT => - _id_PRODUCT.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get PRODUCT => + _id_PRODUCT.get(_class, const jni$_.JStringNullableType()); static final _id_RADIO = _class.staticFieldId( r'RADIO', @@ -5258,8 +5258,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String RADIO` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get RADIO => - _id_RADIO.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get RADIO => + _id_RADIO.get(_class, const jni$_.JStringNullableType()); static final _id_SERIAL = _class.staticFieldId( r'SERIAL', @@ -5268,8 +5268,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SERIAL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SERIAL => - _id_SERIAL.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SERIAL => + _id_SERIAL.get(_class, const jni$_.JStringNullableType()); static final _id_SKU = _class.staticFieldId( r'SKU', @@ -5278,8 +5278,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SKU` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SKU => - _id_SKU.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SKU => + _id_SKU.get(_class, const jni$_.JStringNullableType()); static final _id_SOC_MANUFACTURER = _class.staticFieldId( r'SOC_MANUFACTURER', @@ -5288,8 +5288,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SOC_MANUFACTURER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SOC_MANUFACTURER => - _id_SOC_MANUFACTURER.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SOC_MANUFACTURER => + _id_SOC_MANUFACTURER.get(_class, const jni$_.JStringNullableType()); static final _id_SOC_MODEL = _class.staticFieldId( r'SOC_MODEL', @@ -5298,8 +5298,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String SOC_MODEL` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SOC_MODEL => - _id_SOC_MODEL.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SOC_MODEL => + _id_SOC_MODEL.get(_class, const jni$_.JStringNullableType()); static final _id_SUPPORTED_32_BIT_ABIS = _class.staticFieldId( r'SUPPORTED_32_BIT_ABIS', @@ -5308,11 +5308,11 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_32_BIT_ABIS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JString?>? get SUPPORTED_32_BIT_ABIS => + static jni$_.JArray? get SUPPORTED_32_BIT_ABIS => _id_SUPPORTED_32_BIT_ABIS.get( _class, - const _$jni.JArrayNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + const jni$_.JArrayNullableType( + jni$_.JStringNullableType())); static final _id_SUPPORTED_64_BIT_ABIS = _class.staticFieldId( r'SUPPORTED_64_BIT_ABIS', @@ -5321,11 +5321,11 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_64_BIT_ABIS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JString?>? get SUPPORTED_64_BIT_ABIS => + static jni$_.JArray? get SUPPORTED_64_BIT_ABIS => _id_SUPPORTED_64_BIT_ABIS.get( _class, - const _$jni.JArrayNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + const jni$_.JArrayNullableType( + jni$_.JStringNullableType())); static final _id_SUPPORTED_ABIS = _class.staticFieldId( r'SUPPORTED_ABIS', @@ -5334,11 +5334,11 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String[] SUPPORTED_ABIS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JString?>? get SUPPORTED_ABIS => _id_SUPPORTED_ABIS + static jni$_.JArray? get SUPPORTED_ABIS => _id_SUPPORTED_ABIS .get( _class, - const _$jni.JArrayNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + const jni$_.JArrayNullableType( + jni$_.JStringNullableType())); static final _id_TAGS = _class.staticFieldId( r'TAGS', @@ -5347,8 +5347,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String TAGS` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get TAGS => - _id_TAGS.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get TAGS => + _id_TAGS.get(_class, const jni$_.JStringNullableType()); static final _id_TIME = _class.staticFieldId( r'TIME', @@ -5356,7 +5356,7 @@ class Build extends _$jni.JObject { ); /// from: `static public final long TIME` - static int get TIME => _id_TIME.get(_class, const _$jni.jlongType()); + static int get TIME => _id_TIME.get(_class, const jni$_.jlongType()); static final _id_TYPE = _class.staticFieldId( r'TYPE', @@ -5365,8 +5365,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String TYPE` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get TYPE => - _id_TYPE.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get TYPE => + _id_TYPE.get(_class, const jni$_.JStringNullableType()); static final _id_UNKNOWN = _class.staticFieldId( r'UNKNOWN', @@ -5375,8 +5375,8 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String UNKNOWN` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get UNKNOWN => - _id_UNKNOWN.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get UNKNOWN => + _id_UNKNOWN.get(_class, const jni$_.JStringNullableType()); static final _id_USER = _class.staticFieldId( r'USER', @@ -5385,30 +5385,30 @@ class Build extends _$jni.JObject { /// from: `static public final java.lang.String USER` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get USER => - _id_USER.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get USER => + _id_USER.get(_class, const jni$_.JStringNullableType()); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Build() { return Build.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -5417,24 +5417,24 @@ class Build extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getSerial = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSerial = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public java.lang.String getSerial()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? getSerial() { + static jni$_.JString? getSerial() { return _getSerial( - _class.reference.pointer, _id_getSerial as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _class.reference.pointer, _id_getSerial as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getFingerprintedPartitions = _class.staticMethodId( @@ -5443,25 +5443,25 @@ class Build extends _$jni.JObject { ); static final _getFingerprintedPartitions = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public java.util.List getFingerprintedPartitions()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JList? getFingerprintedPartitions() { + static jni$_.JList? getFingerprintedPartitions() { return _getFingerprintedPartitions(_class.reference.pointer, - _id_getFingerprintedPartitions as _$jni.JMethodIDPtr) - .object<_$jni.JList?>( - const _$jni.JListNullableType( + _id_getFingerprintedPartitions as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JListNullableType( $Build_Partition$NullableType())); } @@ -5470,126 +5470,126 @@ class Build extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getRadioVersion = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getRadioVersion = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public java.lang.String getRadioVersion()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? getRadioVersion() { + static jni$_.JString? getRadioVersion() { return _getRadioVersion( - _class.reference.pointer, _id_getRadioVersion as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _class.reference.pointer, _id_getRadioVersion as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } } -final class $Build$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Build$NullableType extends jni$_.JObjType { + @jni$_.internal const $Build$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build;'; - @_$jni.internal - @_$core.override - Build? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Build? fromReference(jni$_.JReference reference) => reference.isNull ? null : Build.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build$NullableType) && other is $Build$NullableType; } } -final class $Build$Type extends _$jni.JObjType { - @_$jni.internal +final class $Build$Type extends jni$_.JObjType { + @jni$_.internal const $Build$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Landroid/os/Build;'; - @_$jni.internal - @_$core.override - Build fromReference(_$jni.JReference reference) => Build.fromReference( + @jni$_.internal + @core$_.override + Build fromReference(jni$_.JReference reference) => Build.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Build$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Build$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Build$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Build$Type) && other is $Build$Type; } } /// from: `java.util.HashMap` -class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal HashMap.fromReference( this.K, this.V, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$K, $V>(K, V), super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'java/util/HashMap'); + static final _class = jni$_.JClass.forName(r'java/util/HashMap'); /// The type which includes information such as the signature of this class. static $HashMap$NullableType<$K, $V> - nullableType<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( - _$jni.JObjType<$K> K, - _$jni.JObjType<$V> V, + nullableType<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( + jni$_.JObjType<$K> K, + jni$_.JObjType<$V> V, ) { return $HashMap$NullableType<$K, $V>( K, @@ -5598,9 +5598,9 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> } static $HashMap$Type<$K, $V> - type<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( - _$jni.JObjType<$K> K, - _$jni.JObjType<$V> V, + type<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( + jni$_.JObjType<$K> K, + jni$_.JObjType<$V> V, ) { return $HashMap$Type<$K, $V>( K, @@ -5612,29 +5612,29 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(IF)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32, _$jni.Double)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Double)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, double)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, double)>(); /// from: `public void (int i, float f)` /// The returned object must be released after use, by calling the [release] method. factory HashMap( int i, double f, { - required _$jni.JObjType<$K> K, - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$K> K, + required jni$_.JObjType<$V> V, }) { return HashMap<$K, $V>.fromReference( K, V, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, i, f) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, i, f) .reference); } @@ -5642,27 +5642,27 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(I)V', ); - static final _new$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_NewObject') + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void (int i)` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$1( int i, { - required _$jni.JObjType<$K> K, - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$K> K, + required jni$_.JObjType<$V> V, }) { return HashMap<$K, $V>.fromReference( K, V, - _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, i) + _new$1(_class.reference.pointer, _id_new$1 as jni$_.JMethodIDPtr, i) .reference); } @@ -5670,28 +5670,28 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()V', ); - static final _new$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$2({ - required _$jni.JObjType<$K> K, - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$K> K, + required jni$_.JObjType<$V> V, }) { return HashMap<$K, $V>.fromReference( K, V, - _new$2(_class.reference.pointer, _id_new$2 as _$jni.JMethodIDPtr) + _new$2(_class.reference.pointer, _id_new$2 as jni$_.JMethodIDPtr) .reference); } @@ -5699,29 +5699,29 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/util/Map;)V', ); - static final _new$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$3( - _$jni.JMap<$K?, $V?>? map, { - required _$jni.JObjType<$K> K, - required _$jni.JObjType<$V> V, + jni$_.JMap<$K?, $V?>? map, { + required jni$_.JObjType<$K> K, + required jni$_.JObjType<$V> V, }) { - final _$map = map?.reference ?? _$jni.jNullReference; + final _$map = map?.reference ?? jni$_.jNullReference; return HashMap<$K, $V>.fromReference( K, V, - _new$3(_class.reference.pointer, _id_new$3 as _$jni.JMethodIDPtr, + _new$3(_class.reference.pointer, _id_new$3 as jni$_.JMethodIDPtr, _$map.pointer) .reference); } @@ -5731,21 +5731,21 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()I', ); - static final _size = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _size = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int size()` int size() { - return _size(reference.pointer, _id_size as _$jni.JMethodIDPtr).integer; + return _size(reference.pointer, _id_size as jni$_.JMethodIDPtr).integer; } static final _id_isEmpty = _class.instanceMethodId( @@ -5753,21 +5753,21 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()Z', ); - static final _isEmpty = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isEmpty = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isEmpty()` bool isEmpty() { - return _isEmpty(reference.pointer, _id_isEmpty as _$jni.JMethodIDPtr) + return _isEmpty(reference.pointer, _id_isEmpty as jni$_.JMethodIDPtr) .boolean; } @@ -5776,25 +5776,25 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _get = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _get = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V get(java.lang.Object object)` /// The returned object must be released after use, by calling the [release] method. $V? get( - _$jni.JObject? object, + jni$_.JObject? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _get( - reference.pointer, _id_get as _$jni.JMethodIDPtr, _$object.pointer) + reference.pointer, _id_get as jni$_.JMethodIDPtr, _$object.pointer) .object<$V?>(V.nullableType); } @@ -5803,24 +5803,24 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;)Z', ); - static final _containsKey = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _containsKey = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean containsKey(java.lang.Object object)` bool containsKey( - _$jni.JObject? object, + jni$_.JObject? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _containsKey(reference.pointer, - _id_containsKey as _$jni.JMethodIDPtr, _$object.pointer) + _id_containsKey as jni$_.JMethodIDPtr, _$object.pointer) .boolean; } @@ -5829,22 +5829,22 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _put = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _put = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V put(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -5852,9 +5852,9 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> $K? object, $V? object1, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - return _put(reference.pointer, _id_put as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + return _put(reference.pointer, _id_put as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .object<$V?>(V.nullableType); } @@ -5864,23 +5864,23 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/util/Map;)V', ); - static final _putAll = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _putAll = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void putAll(java.util.Map map)` void putAll( - _$jni.JMap<$K?, $V?>? map, + jni$_.JMap<$K?, $V?>? map, ) { - final _$map = map?.reference ?? _$jni.jNullReference; - _putAll(reference.pointer, _id_putAll as _$jni.JMethodIDPtr, _$map.pointer) + final _$map = map?.reference ?? jni$_.jNullReference; + _putAll(reference.pointer, _id_putAll as jni$_.JMethodIDPtr, _$map.pointer) .check(); } @@ -5889,24 +5889,24 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _remove = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _remove = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V remove(java.lang.Object object)` /// The returned object must be released after use, by calling the [release] method. $V? remove( - _$jni.JObject? object, + jni$_.JObject? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - return _remove(reference.pointer, _id_remove as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + return _remove(reference.pointer, _id_remove as jni$_.JMethodIDPtr, _$object.pointer) .object<$V?>(V.nullableType); } @@ -5916,21 +5916,21 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()V', ); - static final _clear = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _clear = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void clear()` void clear() { - _clear(reference.pointer, _id_clear as _$jni.JMethodIDPtr).check(); + _clear(reference.pointer, _id_clear as jni$_.JMethodIDPtr).check(); } static final _id_containsValue = _class.instanceMethodId( @@ -5938,24 +5938,24 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;)Z', ); - static final _containsValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _containsValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean containsValue(java.lang.Object object)` bool containsValue( - _$jni.JObject? object, + jni$_.JObject? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _containsValue(reference.pointer, - _id_containsValue as _$jni.JMethodIDPtr, _$object.pointer) + _id_containsValue as jni$_.JMethodIDPtr, _$object.pointer) .boolean; } @@ -5964,23 +5964,23 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()Ljava/util/Set;', ); - static final _keySet = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _keySet = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Set keySet()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JSet<$K?>? keySet() { - return _keySet(reference.pointer, _id_keySet as _$jni.JMethodIDPtr) - .object<_$jni.JSet<$K?>?>(_$jni.JSetNullableType<$K?>(K.nullableType)); + jni$_.JSet<$K?>? keySet() { + return _keySet(reference.pointer, _id_keySet as jni$_.JMethodIDPtr) + .object?>(jni$_.JSetNullableType<$K?>(K.nullableType)); } static final _id_values = _class.instanceMethodId( @@ -5988,23 +5988,23 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()Ljava/util/Collection;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Collection values()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? values() { - return _values(reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? values() { + return _values(reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_entrySet = _class.instanceMethodId( @@ -6012,25 +6012,25 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()Ljava/util/Set;', ); - static final _entrySet = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _entrySet = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Set entrySet()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JSet<_$jni.JObject?>? entrySet() { - return _entrySet(reference.pointer, _id_entrySet as _$jni.JMethodIDPtr) - .object<_$jni.JSet<_$jni.JObject?>?>( - const _$jni.JSetNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + jni$_.JSet? entrySet() { + return _entrySet(reference.pointer, _id_entrySet as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JSetNullableType( + jni$_.JObjectNullableType())); } static final _id_getOrDefault = _class.instanceMethodId( @@ -6038,34 +6038,34 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _getOrDefault = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _getOrDefault = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V getOrDefault(java.lang.Object object, V object1)` /// The returned object must be released after use, by calling the [release] method. $V? getOrDefault( - _$jni.JObject? object, + jni$_.JObject? object, $V? object1, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; return _getOrDefault( reference.pointer, - _id_getOrDefault as _$jni.JMethodIDPtr, + _id_getOrDefault as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .object<$V?>(V.nullableType); @@ -6076,22 +6076,22 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _putIfAbsent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _putIfAbsent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V putIfAbsent(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -6099,11 +6099,11 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> $K? object, $V? object1, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; return _putIfAbsent( reference.pointer, - _id_putIfAbsent as _$jni.JMethodIDPtr, + _id_putIfAbsent as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .object<$V?>(V.nullableType); @@ -6114,31 +6114,31 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;)Z', ); - static final _remove$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _remove$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public boolean remove(java.lang.Object object, java.lang.Object object1)` bool remove$1( - _$jni.JObject? object, - _$jni.JObject? object1, + jni$_.JObject? object, + jni$_.JObject? object1, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - return _remove$1(reference.pointer, _id_remove$1 as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + return _remove$1(reference.pointer, _id_remove$1 as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .boolean; } @@ -6148,24 +6148,24 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z', ); - static final _replace = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _replace = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public boolean replace(K object, V object1, V object2)` bool replace( @@ -6173,10 +6173,10 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> $V? object1, $V? object2, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - final _$object2 = object2?.reference ?? _$jni.jNullReference; - return _replace(reference.pointer, _id_replace as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + final _$object2 = object2?.reference ?? jni$_.jNullReference; + return _replace(reference.pointer, _id_replace as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer, _$object2.pointer) .boolean; } @@ -6186,22 +6186,22 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _replace$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _replace$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V replace(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -6209,9 +6209,9 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> $K? object, $V? object1, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - return _replace$1(reference.pointer, _id_replace$1 as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + return _replace$1(reference.pointer, _id_replace$1 as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .object<$V?>(V.nullableType); } @@ -6221,34 +6221,34 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;', ); - static final _computeIfAbsent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _computeIfAbsent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V computeIfAbsent(K object, java.util.function.Function function)` /// The returned object must be released after use, by calling the [release] method. $V? computeIfAbsent( $K? object, - _$jni.JObject? function, + jni$_.JObject? function, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$function = function?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + final _$function = function?.reference ?? jni$_.jNullReference; return _computeIfAbsent( reference.pointer, - _id_computeIfAbsent as _$jni.JMethodIDPtr, + _id_computeIfAbsent as jni$_.JMethodIDPtr, _$object.pointer, _$function.pointer) .object<$V?>(V.nullableType); @@ -6259,34 +6259,34 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;', ); - static final _computeIfPresent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _computeIfPresent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V computeIfPresent(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V? computeIfPresent( $K? object, - _$jni.JObject? biFunction, + jni$_.JObject? biFunction, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + final _$biFunction = biFunction?.reference ?? jni$_.jNullReference; return _computeIfPresent( reference.pointer, - _id_computeIfPresent as _$jni.JMethodIDPtr, + _id_computeIfPresent as jni$_.JMethodIDPtr, _$object.pointer, _$biFunction.pointer) .object<$V?>(V.nullableType); @@ -6297,32 +6297,32 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;', ); - static final _compute = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _compute = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V compute(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V? compute( $K? object, - _$jni.JObject? biFunction, + jni$_.JObject? biFunction, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; - return _compute(reference.pointer, _id_compute as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$biFunction = biFunction?.reference ?? jni$_.jNullReference; + return _compute(reference.pointer, _id_compute as jni$_.JMethodIDPtr, _$object.pointer, _$biFunction.pointer) .object<$V?>(V.nullableType); } @@ -6332,36 +6332,36 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;', ); - static final _merge = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _merge = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V merge(K object, V object1, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V? merge( $K? object, $V? object1, - _$jni.JObject? biFunction, + jni$_.JObject? biFunction, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; - return _merge(reference.pointer, _id_merge as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + final _$biFunction = biFunction?.reference ?? jni$_.jNullReference; + return _merge(reference.pointer, _id_merge as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer, _$biFunction.pointer) .object<$V?>(V.nullableType); } @@ -6371,23 +6371,23 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/util/function/BiConsumer;)V', ); - static final _forEach = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _forEach = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void forEach(java.util.function.BiConsumer biConsumer)` void forEach( - _$jni.JObject? biConsumer, + jni$_.JObject? biConsumer, ) { - final _$biConsumer = biConsumer?.reference ?? _$jni.jNullReference; - _forEach(reference.pointer, _id_forEach as _$jni.JMethodIDPtr, + final _$biConsumer = biConsumer?.reference ?? jni$_.jNullReference; + _forEach(reference.pointer, _id_forEach as jni$_.JMethodIDPtr, _$biConsumer.pointer) .check(); } @@ -6397,23 +6397,23 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/util/function/BiFunction;)V', ); - static final _replaceAll = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _replaceAll = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void replaceAll(java.util.function.BiFunction biFunction)` void replaceAll( - _$jni.JObject? biFunction, + jni$_.JObject? biFunction, ) { - final _$biFunction = biFunction?.reference ?? _$jni.jNullReference; - _replaceAll(reference.pointer, _id_replaceAll as _$jni.JMethodIDPtr, + final _$biFunction = biFunction?.reference ?? jni$_.jNullReference; + _replaceAll(reference.pointer, _id_replaceAll as jni$_.JMethodIDPtr, _$biFunction.pointer) .check(); } @@ -6423,23 +6423,23 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()Ljava/lang/Object;', ); - static final _clone = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _clone = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object clone()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? clone() { - return _clone(reference.pointer, _id_clone as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? clone() { + return _clone(reference.pointer, _id_clone as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_newHashMap = _class.staticMethodId( @@ -6447,73 +6447,73 @@ class HashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(I)Ljava/util/HashMap;', ); - static final _newHashMap = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + static final _newHashMap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `static public java.util.HashMap newHashMap(int i)` /// The returned object must be released after use, by calling the [release] method. static HashMap<$K?, $V?>? - newHashMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( + newHashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( int i, { - required _$jni.JObjType<$K> K, - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$K> K, + required jni$_.JObjType<$V> V, }) { return _newHashMap( - _class.reference.pointer, _id_newHashMap as _$jni.JMethodIDPtr, i) + _class.reference.pointer, _id_newHashMap as jni$_.JMethodIDPtr, i) .object?>( $HashMap$NullableType<$K?, $V?>(K.nullableType, V.nullableType)); } } -final class $HashMap$NullableType<$K extends _$jni.JObject?, - $V extends _$jni.JObject?> extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $HashMap$NullableType<$K extends jni$_.JObject?, + $V extends jni$_.JObject?> extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $HashMap$NullableType( this.K, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Ljava/util/HashMap;'; - @_$jni.internal - @_$core.override - HashMap<$K, $V>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + HashMap<$K, $V>? fromReference(jni$_.JReference reference) => reference.isNull ? null : HashMap<$K, $V>.fromReference( K, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($HashMap$NullableType, K, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($HashMap$NullableType<$K, $V>) && other is $HashMap$NullableType<$K, $V> && @@ -6522,49 +6522,49 @@ final class $HashMap$NullableType<$K extends _$jni.JObject?, } } -final class $HashMap$Type<$K extends _$jni.JObject?, $V extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $HashMap$Type<$K extends jni$_.JObject?, $V extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $HashMap$Type( this.K, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Ljava/util/HashMap;'; - @_$jni.internal - @_$core.override - HashMap<$K, $V> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + HashMap<$K, $V> fromReference(jni$_.JReference reference) => HashMap<$K, $V>.fromReference( K, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $HashMap$NullableType<$K, $V>(K, V); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($HashMap$Type, K, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($HashMap$Type<$K, $V>) && other is $HashMap$Type<$K, $V> && @@ -6574,19 +6574,19 @@ final class $HashMap$Type<$K extends _$jni.JObject?, $V extends _$jni.JObject?> } /// from: `com.example.in_app_java.AndroidUtils` -class AndroidUtils extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class AndroidUtils extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal AndroidUtils.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/example/in_app_java/AndroidUtils'); + jni$_.JClass.forName(r'com/example/in_app_java/AndroidUtils'); /// The type which includes information such as the signature of this class. static const nullableType = $AndroidUtils$NullableType(); @@ -6596,107 +6596,107 @@ class AndroidUtils extends _$jni.JObject { r'(Landroid/app/Activity;Ljava/lang/CharSequence;I)V', ); - static final _showToast = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _showToast = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Int32 + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32 )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, int)>(); /// from: `static public void showToast(android.app.Activity mainActivity, java.lang.CharSequence text, int duration)` static void showToast( - _$jni.JObject? mainActivity, - _$jni.JObject? text, + jni$_.JObject? mainActivity, + jni$_.JObject? text, int duration, ) { - final _$mainActivity = mainActivity?.reference ?? _$jni.jNullReference; - final _$text = text?.reference ?? _$jni.jNullReference; - _showToast(_class.reference.pointer, _id_showToast as _$jni.JMethodIDPtr, + final _$mainActivity = mainActivity?.reference ?? jni$_.jNullReference; + final _$text = text?.reference ?? jni$_.jNullReference; + _showToast(_class.reference.pointer, _id_showToast as jni$_.JMethodIDPtr, _$mainActivity.pointer, _$text.pointer, duration) .check(); } } -final class $AndroidUtils$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $AndroidUtils$NullableType extends jni$_.JObjType { + @jni$_.internal const $AndroidUtils$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/AndroidUtils;'; - @_$jni.internal - @_$core.override - AndroidUtils? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + AndroidUtils? fromReference(jni$_.JReference reference) => reference.isNull ? null : AndroidUtils.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($AndroidUtils$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($AndroidUtils$NullableType) && other is $AndroidUtils$NullableType; } } -final class $AndroidUtils$Type extends _$jni.JObjType { - @_$jni.internal +final class $AndroidUtils$Type extends jni$_.JObjType { + @jni$_.internal const $AndroidUtils$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/in_app_java/AndroidUtils;'; - @_$jni.internal - @_$core.override - AndroidUtils fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + AndroidUtils fromReference(jni$_.JReference reference) => AndroidUtils.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $AndroidUtils$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($AndroidUtils$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($AndroidUtils$Type) && other is $AndroidUtils$Type; diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index fceb46300..90448602e 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart @@ -30,24 +30,24 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `Example` -class Example extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Example extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Example.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName(r'Example'); + static final _class = jni$_.JClass.forName(r'Example'); /// The type which includes information such as the signature of this class. static const nullableType = $Example$NullableType(); @@ -56,23 +56,23 @@ class Example extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -81,107 +81,107 @@ class Example extends _$jni.JObject { r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;', ); - static final _thinkBeforeAnswering = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _thinkBeforeAnswering = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString> thinkBeforeAnswering() async { - final $p = _$jni.ReceivePort(); - final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); + core$_.Future thinkBeforeAnswering() async { + final $p = jni$_.ReceivePort(); + final _$continuation = jni$_.ProtectedJniExtensions.newPortContinuation($p); _thinkBeforeAnswering( reference.pointer, - _id_thinkBeforeAnswering as _$jni.JMethodIDPtr, + _id_thinkBeforeAnswering as jni$_.JMethodIDPtr, _$continuation.pointer) - .object<_$jni.JObject>(const _$jni.JObjectType()); + .object(const jni$_.JObjectType()); _$continuation.release(); final $o = - _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringType().jClass.reference; - if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { + jni$_.JGlobalReference(jni$_.JObjectPtr.fromAddress(await $p.first)); + final $k = const jni$_.JStringType().jClass.reference; + if (!jni$_.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { $k.release(); throw 'Failed'; } $k.release(); - return const _$jni.JStringType().fromReference($o); + return const jni$_.JStringType().fromReference($o); } } -final class $Example$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Example$NullableType extends jni$_.JObjType { + @jni$_.internal const $Example$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'LExample;'; - @_$jni.internal - @_$core.override - Example? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Example? fromReference(jni$_.JReference reference) => reference.isNull ? null : Example.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example$NullableType) && other is $Example$NullableType; } } -final class $Example$Type extends _$jni.JObjType { - @_$jni.internal +final class $Example$Type extends jni$_.JObjType { + @jni$_.internal const $Example$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'LExample;'; - @_$jni.internal - @_$core.override - Example fromReference(_$jni.JReference reference) => Example.fromReference( + @jni$_.internal + @core$_.override + Example fromReference(jni$_.JReference reference) => Example.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Example$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Example$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example$Type) && other is $Example$Type; } diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index bd8455af5..ea874e1da 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart @@ -34,25 +34,25 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `com.example.notification_plugin.Notifications` -class Notifications extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Notifications extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Notifications.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/example/notification_plugin/Notifications'); + jni$_.JClass.forName(r'com/example/notification_plugin/Notifications'); /// The type which includes information such as the signature of this class. static const nullableType = $Notifications$NullableType(); @@ -61,23 +61,23 @@ class Notifications extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Notifications() { return Notifications.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -86,40 +86,40 @@ class Notifications extends _$jni.JObject { r'(Landroid/content/Context;ILjava/lang/String;Ljava/lang/String;)V', ); - static final _showNotification = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _showNotification = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, int, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public void showNotification(android.content.Context context, int notificationID, java.lang.String title, java.lang.String text)` static void showNotification( - _$jni.JObject? context, + jni$_.JObject? context, int notificationID, - _$jni.JString? title, - _$jni.JString? text, + jni$_.JString? title, + jni$_.JString? text, ) { - final _$context = context?.reference ?? _$jni.jNullReference; - final _$title = title?.reference ?? _$jni.jNullReference; - final _$text = text?.reference ?? _$jni.jNullReference; + final _$context = context?.reference ?? jni$_.jNullReference; + final _$title = title?.reference ?? jni$_.jNullReference; + final _$text = text?.reference ?? jni$_.jNullReference; _showNotification( _class.reference.pointer, - _id_showNotification as _$jni.JMethodIDPtr, + _id_showNotification as jni$_.JMethodIDPtr, _$context.pointer, notificationID, _$title.pointer, @@ -128,74 +128,74 @@ class Notifications extends _$jni.JObject { } } -final class $Notifications$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Notifications$NullableType extends jni$_.JObjType { + @jni$_.internal const $Notifications$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/notification_plugin/Notifications;'; - @_$jni.internal - @_$core.override - Notifications? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Notifications? fromReference(jni$_.JReference reference) => reference.isNull ? null : Notifications.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Notifications$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Notifications$NullableType) && other is $Notifications$NullableType; } } -final class $Notifications$Type extends _$jni.JObjType { - @_$jni.internal +final class $Notifications$Type extends jni$_.JObjType { + @jni$_.internal const $Notifications$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/example/notification_plugin/Notifications;'; - @_$jni.internal - @_$core.override - Notifications fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Notifications fromReference(jni$_.JReference reference) => Notifications.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Notifications$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Notifications$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Notifications$Type) && other is $Notifications$Type; diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart index 908e5c0e7..0a3c445e2 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart @@ -48,31 +48,31 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; -import 'PDDocumentInformation.dart' as pddocumentinformation_; +import 'PDDocumentInformation.dart' as pddocumentinformation$_; /// from: `org.apache.pdfbox.pdmodel.PDDocument` /// /// This is the in-memory representation of the PDF document. /// The \#close() method must be called once the document is no longer needed. ///@author Ben Litchfield -class PDDocument extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class PDDocument extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal PDDocument.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocument'); + jni$_.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocument'); /// The type which includes information such as the signature of this class. static const nullableType = $PDDocument$NullableType(); @@ -81,16 +81,16 @@ class PDDocument extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -100,7 +100,7 @@ class PDDocument extends _$jni.JObject { /// You need to add at least one page for the document to be valid. factory PDDocument() { return PDDocument.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -108,16 +108,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/io/MemoryUsageSetting;)V', ); - static final _new$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -126,12 +126,12 @@ class PDDocument extends _$jni.JObject { /// You need to add at least one page for the document to be valid. ///@param memUsageSetting defines how memory is used for buffering PDF streams factory PDDocument.new$1( - _$jni.JObject? memUsageSetting, + jni$_.JObject? memUsageSetting, ) { final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; + memUsageSetting?.reference ?? jni$_.jNullReference; return PDDocument.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as _$jni.JMethodIDPtr, _$memUsageSetting.pointer) + _id_new$1 as jni$_.JMethodIDPtr, _$memUsageSetting.pointer) .reference); } @@ -139,16 +139,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDocument;)V', ); - static final _new$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (org.apache.pdfbox.cos.COSDocument doc)` /// The returned object must be released after use, by calling the [release] method. @@ -156,11 +156,11 @@ class PDDocument extends _$jni.JObject { /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. factory PDDocument.new$2( - _$jni.JObject? doc, + jni$_.JObject? doc, ) { - final _$doc = doc?.reference ?? _$jni.jNullReference; + final _$doc = doc?.reference ?? jni$_.jNullReference; return PDDocument.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, _$doc.pointer) + _id_new$2 as jni$_.JMethodIDPtr, _$doc.pointer) .reference); } @@ -168,22 +168,22 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/RandomAccessRead;)V', ); - static final _new$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source)` /// The returned object must be released after use, by calling the [release] method. @@ -192,13 +192,13 @@ class PDDocument extends _$jni.JObject { ///@param doc The COSDocument that this document wraps. ///@param source the parser which is used to read the pdf factory PDDocument.new$3( - _$jni.JObject? doc, - _$jni.JObject? source, + jni$_.JObject? doc, + jni$_.JObject? source, ) { - final _$doc = doc?.reference ?? _$jni.jNullReference; - final _$source = source?.reference ?? _$jni.jNullReference; + final _$doc = doc?.reference ?? jni$_.jNullReference; + final _$source = source?.reference ?? jni$_.jNullReference; return PDDocument.fromReference(_new$3(_class.reference.pointer, - _id_new$3 as _$jni.JMethodIDPtr, _$doc.pointer, _$source.pointer) + _id_new$3 as jni$_.JMethodIDPtr, _$doc.pointer, _$source.pointer) .reference); } @@ -206,24 +206,24 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/RandomAccessRead;Lorg/apache/pdfbox/pdmodel/encryption/AccessPermission;)V', ); - static final _new$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source, org.apache.pdfbox.pdmodel.encryption.AccessPermission permission)` /// The returned object must be released after use, by calling the [release] method. @@ -233,16 +233,16 @@ class PDDocument extends _$jni.JObject { ///@param source the parser which is used to read the pdf ///@param permission he access permissions of the pdf factory PDDocument.new$4( - _$jni.JObject? doc, - _$jni.JObject? source, - _$jni.JObject? permission, + jni$_.JObject? doc, + jni$_.JObject? source, + jni$_.JObject? permission, ) { - final _$doc = doc?.reference ?? _$jni.jNullReference; - final _$source = source?.reference ?? _$jni.jNullReference; - final _$permission = permission?.reference ?? _$jni.jNullReference; + final _$doc = doc?.reference ?? jni$_.jNullReference; + final _$source = source?.reference ?? jni$_.jNullReference; + final _$permission = permission?.reference ?? jni$_.jNullReference; return PDDocument.fromReference(_new$4( _class.reference.pointer, - _id_new$4 as _$jni.JMethodIDPtr, + _id_new$4 as jni$_.JMethodIDPtr, _$doc.pointer, _$source.pointer, _$permission.pointer) @@ -254,16 +254,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)V', ); - static final _addPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _addPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void addPage(org.apache.pdfbox.pdmodel.PDPage page)` /// @@ -271,10 +271,10 @@ class PDDocument extends _$jni.JObject { /// hierarchy and set the parent of the page to the root. ///@param page The page to add to the document. void addPage( - _$jni.JObject? page, + jni$_.JObject? page, ) { - final _$page = page?.reference ?? _$jni.jNullReference; - _addPage(reference.pointer, _id_addPage as _$jni.JMethodIDPtr, + final _$page = page?.reference ?? jni$_.jNullReference; + _addPage(reference.pointer, _id_addPage as jni$_.JMethodIDPtr, _$page.pointer) .check(); } @@ -284,16 +284,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;)V', ); - static final _addSignature = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _addSignature = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject)` /// @@ -308,10 +308,10 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature( - _$jni.JObject? sigObject, + jni$_.JObject? sigObject, ) { - final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; - _addSignature(reference.pointer, _id_addSignature as _$jni.JMethodIDPtr, + final _$sigObject = sigObject?.reference ?? jni$_.jNullReference; + _addSignature(reference.pointer, _id_addSignature as jni$_.JMethodIDPtr, _$sigObject.pointer) .check(); } @@ -321,22 +321,22 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V', ); - static final _addSignature$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _addSignature$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options)` /// @@ -352,12 +352,12 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$1( - _$jni.JObject? sigObject, - _$jni.JObject? options, + jni$_.JObject? sigObject, + jni$_.JObject? options, ) { - final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; - final _$options = options?.reference ?? _$jni.jNullReference; - _addSignature$1(reference.pointer, _id_addSignature$1 as _$jni.JMethodIDPtr, + final _$sigObject = sigObject?.reference ?? jni$_.jNullReference; + final _$options = options?.reference ?? jni$_.jNullReference; + _addSignature$1(reference.pointer, _id_addSignature$1 as jni$_.JMethodIDPtr, _$sigObject.pointer, _$options.pointer) .check(); } @@ -367,22 +367,22 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;)V', ); - static final _addSignature$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _addSignature$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface)` /// @@ -397,13 +397,13 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$2( - _$jni.JObject? sigObject, - _$jni.JObject? signatureInterface, + jni$_.JObject? sigObject, + jni$_.JObject? signatureInterface, ) { - final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; + final _$sigObject = sigObject?.reference ?? jni$_.jNullReference; final _$signatureInterface = - signatureInterface?.reference ?? _$jni.jNullReference; - _addSignature$2(reference.pointer, _id_addSignature$2 as _$jni.JMethodIDPtr, + signatureInterface?.reference ?? jni$_.jNullReference; + _addSignature$2(reference.pointer, _id_addSignature$2 as jni$_.JMethodIDPtr, _$sigObject.pointer, _$signatureInterface.pointer) .check(); } @@ -413,24 +413,24 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/PDSignature;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V', ); - static final _addSignature$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _addSignature$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void addSignature(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sigObject, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options)` /// @@ -448,17 +448,17 @@ class PDDocument extends _$jni.JObject { ///@throws IllegalStateException if one attempts to add several signature /// fields. void addSignature$3( - _$jni.JObject? sigObject, - _$jni.JObject? signatureInterface, - _$jni.JObject? options, + jni$_.JObject? sigObject, + jni$_.JObject? signatureInterface, + jni$_.JObject? options, ) { - final _$sigObject = sigObject?.reference ?? _$jni.jNullReference; + final _$sigObject = sigObject?.reference ?? jni$_.jNullReference; final _$signatureInterface = - signatureInterface?.reference ?? _$jni.jNullReference; - final _$options = options?.reference ?? _$jni.jNullReference; + signatureInterface?.reference ?? jni$_.jNullReference; + final _$options = options?.reference ?? jni$_.jNullReference; _addSignature$3( reference.pointer, - _id_addSignature$3 as _$jni.JMethodIDPtr, + _id_addSignature$3 as jni$_.JMethodIDPtr, _$sigObject.pointer, _$signatureInterface.pointer, _$options.pointer) @@ -470,24 +470,24 @@ class PDDocument extends _$jni.JObject { r'(Ljava/util/List;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureInterface;Lorg/apache/pdfbox/pdmodel/interactive/digitalsignature/SignatureOptions;)V', ); - static final _addSignatureField = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _addSignatureField = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void addSignatureField(java.util.List sigFields, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface signatureInterface, org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions options)` /// @@ -500,17 +500,17 @@ class PDDocument extends _$jni.JObject { ///@deprecated The method is misleading, because only one signature may be /// added in a document. The method will be removed in the future. void addSignatureField( - _$jni.JList<_$jni.JObject?>? sigFields, - _$jni.JObject? signatureInterface, - _$jni.JObject? options, + jni$_.JList? sigFields, + jni$_.JObject? signatureInterface, + jni$_.JObject? options, ) { - final _$sigFields = sigFields?.reference ?? _$jni.jNullReference; + final _$sigFields = sigFields?.reference ?? jni$_.jNullReference; final _$signatureInterface = - signatureInterface?.reference ?? _$jni.jNullReference; - final _$options = options?.reference ?? _$jni.jNullReference; + signatureInterface?.reference ?? jni$_.jNullReference; + final _$options = options?.reference ?? jni$_.jNullReference; _addSignatureField( reference.pointer, - _id_addSignatureField as _$jni.JMethodIDPtr, + _id_addSignatureField as jni$_.JMethodIDPtr, _$sigFields.pointer, _$signatureInterface.pointer, _$options.pointer) @@ -522,26 +522,26 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)V', ); - static final _removePage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _removePage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void removePage(org.apache.pdfbox.pdmodel.PDPage page)` /// /// Remove the page from the document. ///@param page The page to remove from the document. void removePage( - _$jni.JObject? page, + jni$_.JObject? page, ) { - final _$page = page?.reference ?? _$jni.jNullReference; - _removePage(reference.pointer, _id_removePage as _$jni.JMethodIDPtr, + final _$page = page?.reference ?? jni$_.jNullReference; + _removePage(reference.pointer, _id_removePage as jni$_.JMethodIDPtr, _$page.pointer) .check(); } @@ -551,15 +551,15 @@ class PDDocument extends _$jni.JObject { r'(I)V', ); - static final _removePage$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _removePage$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void removePage(int pageNumber)` /// @@ -568,7 +568,7 @@ class PDDocument extends _$jni.JObject { void removePage$1( int pageNumber, ) { - _removePage$1(reference.pointer, _id_removePage$1 as _$jni.JMethodIDPtr, + _removePage$1(reference.pointer, _id_removePage$1 as jni$_.JMethodIDPtr, pageNumber) .check(); } @@ -578,16 +578,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)Lorg/apache/pdfbox/pdmodel/PDPage;', ); - static final _importPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _importPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public org.apache.pdfbox.pdmodel.PDPage importPage(org.apache.pdfbox.pdmodel.PDPage page)` /// The returned object must be released after use, by calling the [release] method. @@ -613,13 +613,13 @@ class PDDocument extends _$jni.JObject { ///@param page The page to import. ///@return The page that was imported. ///@throws IOException If there is an error copying the page. - _$jni.JObject? importPage( - _$jni.JObject? page, + jni$_.JObject? importPage( + jni$_.JObject? page, ) { - final _$page = page?.reference ?? _$jni.jNullReference; - return _importPage(reference.pointer, _id_importPage as _$jni.JMethodIDPtr, + final _$page = page?.reference ?? jni$_.jNullReference; + return _importPage(reference.pointer, _id_importPage as jni$_.JMethodIDPtr, _$page.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_getDocument = _class.instanceMethodId( @@ -627,16 +627,16 @@ class PDDocument extends _$jni.JObject { r'()Lorg/apache/pdfbox/cos/COSDocument;', ); - static final _getDocument = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDocument = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.cos.COSDocument getDocument()` @@ -644,10 +644,10 @@ class PDDocument extends _$jni.JObject { /// /// This will get the low level document. ///@return The document that this layer sits on top of. - _$jni.JObject? getDocument() { + jni$_.JObject? getDocument() { return _getDocument( - reference.pointer, _id_getDocument as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getDocument as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getDocumentInformation = _class.instanceMethodId( @@ -655,16 +655,16 @@ class PDDocument extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;', ); - static final _getDocumentInformation = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDocumentInformation = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.PDDocumentInformation getDocumentInformation()` @@ -677,11 +677,12 @@ class PDDocument extends _$jni.JObject { /// document level metadata, a metadata stream should be used instead, see /// PDDocumentCatalog\#getMetadata(). ///@return The documents /Info dictionary, never null. - pddocumentinformation_.PDDocumentInformation? getDocumentInformation() { + pddocumentinformation$_.PDDocumentInformation? getDocumentInformation() { return _getDocumentInformation( - reference.pointer, _id_getDocumentInformation as _$jni.JMethodIDPtr) - .object( - const pddocumentinformation_.$PDDocumentInformation$NullableType()); + reference.pointer, _id_getDocumentInformation as jni$_.JMethodIDPtr) + .object( + const pddocumentinformation$_ + .$PDDocumentInformation$NullableType()); } static final _id_setDocumentInformation = _class.instanceMethodId( @@ -689,16 +690,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;)V', ); - static final _setDocumentInformation = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setDocumentInformation = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setDocumentInformation(org.apache.pdfbox.pdmodel.PDDocumentInformation info)` /// @@ -709,11 +710,11 @@ class PDDocument extends _$jni.JObject { /// PDDocumentCatalog\#setMetadata(org.apache.pdfbox.pdmodel.common.PDMetadata) PDDocumentCatalog\#setMetadata(PDMetadata). ///@param info The updated document information. void setDocumentInformation( - pddocumentinformation_.PDDocumentInformation? info, + pddocumentinformation$_.PDDocumentInformation? info, ) { - final _$info = info?.reference ?? _$jni.jNullReference; + final _$info = info?.reference ?? jni$_.jNullReference; _setDocumentInformation(reference.pointer, - _id_setDocumentInformation as _$jni.JMethodIDPtr, _$info.pointer) + _id_setDocumentInformation as jni$_.JMethodIDPtr, _$info.pointer) .check(); } @@ -722,16 +723,16 @@ class PDDocument extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/PDDocumentCatalog;', ); - static final _getDocumentCatalog = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDocumentCatalog = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.PDDocumentCatalog getDocumentCatalog()` @@ -739,10 +740,10 @@ class PDDocument extends _$jni.JObject { /// /// This will get the document CATALOG. This is guaranteed to not return null. ///@return The documents /Root dictionary - _$jni.JObject? getDocumentCatalog() { + jni$_.JObject? getDocumentCatalog() { return _getDocumentCatalog( - reference.pointer, _id_getDocumentCatalog as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getDocumentCatalog as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_isEncrypted = _class.instanceMethodId( @@ -750,16 +751,16 @@ class PDDocument extends _$jni.JObject { r'()Z', ); - static final _isEncrypted = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isEncrypted = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isEncrypted()` @@ -768,7 +769,7 @@ class PDDocument extends _$jni.JObject { ///@return true If this document is encrypted. bool isEncrypted() { return _isEncrypted( - reference.pointer, _id_isEncrypted as _$jni.JMethodIDPtr) + reference.pointer, _id_isEncrypted as jni$_.JMethodIDPtr) .boolean; } @@ -777,16 +778,16 @@ class PDDocument extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;', ); - static final _getEncryption = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getEncryption = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.encryption.PDEncryption getEncryption()` @@ -797,10 +798,10 @@ class PDDocument extends _$jni.JObject { /// but the only supported subclass at this time is a /// PDStandardEncryption object. ///@return The encryption dictionary(most likely a PDStandardEncryption object) - _$jni.JObject? getEncryption() { + jni$_.JObject? getEncryption() { return _getEncryption( - reference.pointer, _id_getEncryption as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getEncryption as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setEncryptionDictionary = _class.instanceMethodId( @@ -808,16 +809,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/encryption/PDEncryption;)V', ); - static final _setEncryptionDictionary = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setEncryptionDictionary = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setEncryptionDictionary(org.apache.pdfbox.pdmodel.encryption.PDEncryption encryption)` /// @@ -825,12 +826,12 @@ class PDDocument extends _$jni.JObject { ///@param encryption The encryption dictionary(most likely a PDStandardEncryption object) ///@throws IOException If there is an error determining which security handler to use. void setEncryptionDictionary( - _$jni.JObject? encryption, + jni$_.JObject? encryption, ) { - final _$encryption = encryption?.reference ?? _$jni.jNullReference; + final _$encryption = encryption?.reference ?? jni$_.jNullReference; _setEncryptionDictionary( reference.pointer, - _id_setEncryptionDictionary as _$jni.JMethodIDPtr, + _id_setEncryptionDictionary as jni$_.JMethodIDPtr, _$encryption.pointer) .check(); } @@ -841,16 +842,16 @@ class PDDocument extends _$jni.JObject { ); static final _getLastSignatureDictionary = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getLastSignatureDictionary()` @@ -860,10 +861,10 @@ class PDDocument extends _$jni.JObject { /// last in time when empty signature fields are created first but signed after other fields. ///@return the last signature as PDSignatureField. ///@throws IOException if no document catalog can be found. - _$jni.JObject? getLastSignatureDictionary() { + jni$_.JObject? getLastSignatureDictionary() { return _getLastSignatureDictionary(reference.pointer, - _id_getLastSignatureDictionary as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getLastSignatureDictionary as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getSignatureFields = _class.instanceMethodId( @@ -871,16 +872,16 @@ class PDDocument extends _$jni.JObject { r'()Ljava/util/List;', ); - static final _getSignatureFields = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSignatureFields = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List getSignatureFields()` @@ -889,12 +890,12 @@ class PDDocument extends _$jni.JObject { /// Retrieve all signature fields from the document. ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. - _$jni.JList<_$jni.JObject?>? getSignatureFields() { + jni$_.JList? getSignatureFields() { return _getSignatureFields( - reference.pointer, _id_getSignatureFields as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JObject?>?>( - const _$jni.JListNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + reference.pointer, _id_getSignatureFields as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JListNullableType( + jni$_.JObjectNullableType())); } static final _id_getSignatureDictionaries = _class.instanceMethodId( @@ -902,16 +903,16 @@ class PDDocument extends _$jni.JObject { r'()Ljava/util/List;', ); - static final _getSignatureDictionaries = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSignatureDictionaries = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List getSignatureDictionaries()` @@ -920,12 +921,12 @@ class PDDocument extends _$jni.JObject { /// Retrieve all signature dictionaries from the document. ///@return a List of PDSignatureFields ///@throws IOException if no document catalog can be found. - _$jni.JList<_$jni.JObject?>? getSignatureDictionaries() { + jni$_.JList? getSignatureDictionaries() { return _getSignatureDictionaries(reference.pointer, - _id_getSignatureDictionaries as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JObject?>?>( - const _$jni.JListNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + _id_getSignatureDictionaries as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JListNullableType( + jni$_.JObjectNullableType())); } static final _id_registerTrueTypeFontForClosing = _class.instanceMethodId( @@ -934,16 +935,16 @@ class PDDocument extends _$jni.JObject { ); static final _registerTrueTypeFontForClosing = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void registerTrueTypeFontForClosing(org.apache.fontbox.ttf.TrueTypeFont ttf)` /// @@ -952,12 +953,12 @@ class PDDocument extends _$jni.JObject { /// method, it is done by the appropriate PDFont classes. ///@param ttf void registerTrueTypeFontForClosing( - _$jni.JObject? ttf, + jni$_.JObject? ttf, ) { - final _$ttf = ttf?.reference ?? _$jni.jNullReference; + final _$ttf = ttf?.reference ?? jni$_.jNullReference; _registerTrueTypeFontForClosing( reference.pointer, - _id_registerTrueTypeFontForClosing as _$jni.JMethodIDPtr, + _id_registerTrueTypeFontForClosing as jni$_.JMethodIDPtr, _$ttf.pointer) .check(); } @@ -967,16 +968,16 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _load = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file)` /// The returned object must be released after use, by calling the [release] method. @@ -987,10 +988,10 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the file required a non-empty password. ///@throws IOException in case of a file reading or parsing error static PDDocument? load( - _$jni.JObject? file, + jni$_.JObject? file, ) { - final _$file = file?.reference ?? _$jni.jNullReference; - return _load(_class.reference.pointer, _id_load as _$jni.JMethodIDPtr, + final _$file = file?.reference ?? jni$_.jNullReference; + return _load(_class.reference.pointer, _id_load as jni$_.JMethodIDPtr, _$file.pointer) .object(const $PDDocument$NullableType()); } @@ -1000,22 +1001,22 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1027,13 +1028,13 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the file required a non-empty password. ///@throws IOException in case of a file reading or parsing error static PDDocument? load$1( - _$jni.JObject? file, - _$jni.JObject? memUsageSetting, + jni$_.JObject? file, + jni$_.JObject? memUsageSetting, ) { - final _$file = file?.reference ?? _$jni.jNullReference; + final _$file = file?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; - return _load$1(_class.reference.pointer, _id_load$1 as _$jni.JMethodIDPtr, + memUsageSetting?.reference ?? jni$_.jNullReference; + return _load$1(_class.reference.pointer, _id_load$1 as jni$_.JMethodIDPtr, _$file.pointer, _$memUsageSetting.pointer) .object(const $PDDocument$NullableType()); } @@ -1043,22 +1044,22 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password)` /// The returned object must be released after use, by calling the [release] method. @@ -1070,12 +1071,12 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException in case of a file reading or parsing error static PDDocument? load$2( - _$jni.JObject? file, - _$jni.JString? password, + jni$_.JObject? file, + jni$_.JString? password, ) { - final _$file = file?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - return _load$2(_class.reference.pointer, _id_load$2 as _$jni.JMethodIDPtr, + final _$file = file?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + return _load$2(_class.reference.pointer, _id_load$2 as jni$_.JMethodIDPtr, _$file.pointer, _$password.pointer) .object(const $PDDocument$NullableType()); } @@ -1085,24 +1086,24 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1115,15 +1116,15 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException in case of a file reading or parsing error static PDDocument? load$3( - _$jni.JObject? file, - _$jni.JString? password, - _$jni.JObject? memUsageSetting, + jni$_.JObject? file, + jni$_.JString? password, + jni$_.JObject? memUsageSetting, ) { - final _$file = file?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; + final _$file = file?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; - return _load$3(_class.reference.pointer, _id_load$3 as _$jni.JMethodIDPtr, + memUsageSetting?.reference ?? jni$_.jNullReference; + return _load$3(_class.reference.pointer, _id_load$3 as jni$_.JMethodIDPtr, _$file.pointer, _$password.pointer, _$memUsageSetting.pointer) .object(const $PDDocument$NullableType()); } @@ -1133,26 +1134,26 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias)` /// The returned object must be released after use, by calling the [release] method. @@ -1165,18 +1166,18 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws IOException in case of a file reading or parsing error static PDDocument? load$4( - _$jni.JObject? file, - _$jni.JString? password, - _$jni.JObject? keyStore, - _$jni.JString? alias, + jni$_.JObject? file, + jni$_.JString? password, + jni$_.JObject? keyStore, + jni$_.JString? alias, ) { - final _$file = file?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; - final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$file = file?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + final _$keyStore = keyStore?.reference ?? jni$_.jNullReference; + final _$alias = alias?.reference ?? jni$_.jNullReference; return _load$4( _class.reference.pointer, - _id_load$4 as _$jni.JMethodIDPtr, + _id_load$4 as jni$_.JMethodIDPtr, _$file.pointer, _$password.pointer, _$keyStore.pointer, @@ -1189,28 +1190,28 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$5 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$5 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1224,21 +1225,21 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws IOException in case of a file reading or parsing error static PDDocument? load$5( - _$jni.JObject? file, - _$jni.JString? password, - _$jni.JObject? keyStore, - _$jni.JString? alias, - _$jni.JObject? memUsageSetting, + jni$_.JObject? file, + jni$_.JString? password, + jni$_.JObject? keyStore, + jni$_.JString? alias, + jni$_.JObject? memUsageSetting, ) { - final _$file = file?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; - final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$file = file?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + final _$keyStore = keyStore?.reference ?? jni$_.jNullReference; + final _$alias = alias?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; + memUsageSetting?.reference ?? jni$_.jNullReference; return _load$5( _class.reference.pointer, - _id_load$5 as _$jni.JMethodIDPtr, + _id_load$5 as jni$_.JMethodIDPtr, _$file.pointer, _$password.pointer, _$keyStore.pointer, @@ -1252,16 +1253,16 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/InputStream;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$6 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _load$6 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input)` /// The returned object must be released after use, by calling the [release] method. @@ -1273,10 +1274,10 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$6( - _$jni.JObject? input, + jni$_.JObject? input, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - return _load$6(_class.reference.pointer, _id_load$6 as _$jni.JMethodIDPtr, + final _$input = input?.reference ?? jni$_.jNullReference; + return _load$6(_class.reference.pointer, _id_load$6 as jni$_.JMethodIDPtr, _$input.pointer) .object(const $PDDocument$NullableType()); } @@ -1286,22 +1287,22 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/InputStream;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$7 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$7 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1314,13 +1315,13 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$7( - _$jni.JObject? input, - _$jni.JObject? memUsageSetting, + jni$_.JObject? input, + jni$_.JObject? memUsageSetting, ) { - final _$input = input?.reference ?? _$jni.jNullReference; + final _$input = input?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; - return _load$7(_class.reference.pointer, _id_load$7 as _$jni.JMethodIDPtr, + memUsageSetting?.reference ?? jni$_.jNullReference; + return _load$7(_class.reference.pointer, _id_load$7 as jni$_.JMethodIDPtr, _$input.pointer, _$memUsageSetting.pointer) .object(const $PDDocument$NullableType()); } @@ -1330,22 +1331,22 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$8 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$8 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password)` /// The returned object must be released after use, by calling the [release] method. @@ -1358,12 +1359,12 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$8( - _$jni.JObject? input, - _$jni.JString? password, + jni$_.JObject? input, + jni$_.JString? password, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - return _load$8(_class.reference.pointer, _id_load$8 as _$jni.JMethodIDPtr, + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + return _load$8(_class.reference.pointer, _id_load$8 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer) .object(const $PDDocument$NullableType()); } @@ -1373,26 +1374,26 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$9 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$9 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias)` /// The returned object must be released after use, by calling the [release] method. @@ -1406,18 +1407,18 @@ class PDDocument extends _$jni.JObject { ///@return loaded document ///@throws IOException In case of a reading or parsing error. static PDDocument? load$9( - _$jni.JObject? input, - _$jni.JString? password, - _$jni.JObject? keyStore, - _$jni.JString? alias, + jni$_.JObject? input, + jni$_.JString? password, + jni$_.JObject? keyStore, + jni$_.JString? alias, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; - final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + final _$keyStore = keyStore?.reference ?? jni$_.jNullReference; + final _$alias = alias?.reference ?? jni$_.jNullReference; return _load$9( _class.reference.pointer, - _id_load$9 as _$jni.JMethodIDPtr, + _id_load$9 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer, _$keyStore.pointer, @@ -1430,24 +1431,24 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$10 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$10 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1461,15 +1462,15 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$10( - _$jni.JObject? input, - _$jni.JString? password, - _$jni.JObject? memUsageSetting, + jni$_.JObject? input, + jni$_.JString? password, + jni$_.JObject? memUsageSetting, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; - return _load$10(_class.reference.pointer, _id_load$10 as _$jni.JMethodIDPtr, + memUsageSetting?.reference ?? jni$_.jNullReference; + return _load$10(_class.reference.pointer, _id_load$10 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer, _$memUsageSetting.pointer) .object(const $PDDocument$NullableType()); } @@ -1479,28 +1480,28 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/InputStream;Ljava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$11 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$11 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1516,21 +1517,21 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$11( - _$jni.JObject? input, - _$jni.JString? password, - _$jni.JObject? keyStore, - _$jni.JString? alias, - _$jni.JObject? memUsageSetting, + jni$_.JObject? input, + jni$_.JString? password, + jni$_.JObject? keyStore, + jni$_.JString? alias, + jni$_.JObject? memUsageSetting, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; - final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + final _$keyStore = keyStore?.reference ?? jni$_.jNullReference; + final _$alias = alias?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; + memUsageSetting?.reference ?? jni$_.jNullReference; return _load$11( _class.reference.pointer, - _id_load$11 as _$jni.JMethodIDPtr, + _id_load$11 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer, _$keyStore.pointer, @@ -1544,16 +1545,16 @@ class PDDocument extends _$jni.JObject { r'([B)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$12 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _load$12 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input)` /// The returned object must be released after use, by calling the [release] method. @@ -1564,10 +1565,10 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$12( - _$jni.JArray<_$jni.jbyte>? input, + jni$_.JArray? input, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - return _load$12(_class.reference.pointer, _id_load$12 as _$jni.JMethodIDPtr, + final _$input = input?.reference ?? jni$_.jNullReference; + return _load$12(_class.reference.pointer, _id_load$12 as jni$_.JMethodIDPtr, _$input.pointer) .object(const $PDDocument$NullableType()); } @@ -1577,22 +1578,22 @@ class PDDocument extends _$jni.JObject { r'([BLjava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$13 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$13 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password)` /// The returned object must be released after use, by calling the [release] method. @@ -1604,12 +1605,12 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$13( - _$jni.JArray<_$jni.jbyte>? input, - _$jni.JString? password, + jni$_.JArray? input, + jni$_.JString? password, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - return _load$13(_class.reference.pointer, _id_load$13 as _$jni.JMethodIDPtr, + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + return _load$13(_class.reference.pointer, _id_load$13 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer) .object(const $PDDocument$NullableType()); } @@ -1619,26 +1620,26 @@ class PDDocument extends _$jni.JObject { r'([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$14 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$14 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias)` /// The returned object must be released after use, by calling the [release] method. @@ -1652,18 +1653,18 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$14( - _$jni.JArray<_$jni.jbyte>? input, - _$jni.JString? password, - _$jni.JObject? keyStore, - _$jni.JString? alias, + jni$_.JArray? input, + jni$_.JString? password, + jni$_.JObject? keyStore, + jni$_.JString? alias, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; - final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + final _$keyStore = keyStore?.reference ?? jni$_.jNullReference; + final _$alias = alias?.reference ?? jni$_.jNullReference; return _load$14( _class.reference.pointer, - _id_load$14 as _$jni.JMethodIDPtr, + _id_load$14 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer, _$keyStore.pointer, @@ -1676,28 +1677,28 @@ class PDDocument extends _$jni.JObject { r'([BLjava/lang/String;Ljava/io/InputStream;Ljava/lang/String;Lorg/apache/pdfbox/io/MemoryUsageSetting;)Lorg/apache/pdfbox/pdmodel/PDDocument;', ); - static final _load$15 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _load$15 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting)` /// The returned object must be released after use, by calling the [release] method. @@ -1712,21 +1713,21 @@ class PDDocument extends _$jni.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$15( - _$jni.JArray<_$jni.jbyte>? input, - _$jni.JString? password, - _$jni.JObject? keyStore, - _$jni.JString? alias, - _$jni.JObject? memUsageSetting, + jni$_.JArray? input, + jni$_.JString? password, + jni$_.JObject? keyStore, + jni$_.JString? alias, + jni$_.JObject? memUsageSetting, ) { - final _$input = input?.reference ?? _$jni.jNullReference; - final _$password = password?.reference ?? _$jni.jNullReference; - final _$keyStore = keyStore?.reference ?? _$jni.jNullReference; - final _$alias = alias?.reference ?? _$jni.jNullReference; + final _$input = input?.reference ?? jni$_.jNullReference; + final _$password = password?.reference ?? jni$_.jNullReference; + final _$keyStore = keyStore?.reference ?? jni$_.jNullReference; + final _$alias = alias?.reference ?? jni$_.jNullReference; final _$memUsageSetting = - memUsageSetting?.reference ?? _$jni.jNullReference; + memUsageSetting?.reference ?? jni$_.jNullReference; return _load$15( _class.reference.pointer, - _id_load$15 as _$jni.JMethodIDPtr, + _id_load$15 as jni$_.JMethodIDPtr, _$input.pointer, _$password.pointer, _$keyStore.pointer, @@ -1740,16 +1741,16 @@ class PDDocument extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _save = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _save = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void save(java.lang.String fileName)` /// @@ -1761,10 +1762,10 @@ class PDDocument extends _$jni.JObject { ///@param fileName The file to save as. ///@throws IOException if the output could not be written void save( - _$jni.JString? fileName, + jni$_.JString? fileName, ) { - final _$fileName = fileName?.reference ?? _$jni.jNullReference; - _save(reference.pointer, _id_save as _$jni.JMethodIDPtr, _$fileName.pointer) + final _$fileName = fileName?.reference ?? jni$_.jNullReference; + _save(reference.pointer, _id_save as jni$_.JMethodIDPtr, _$fileName.pointer) .check(); } @@ -1773,16 +1774,16 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/File;)V', ); - static final _save$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _save$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void save(java.io.File file)` /// @@ -1794,10 +1795,10 @@ class PDDocument extends _$jni.JObject { ///@param file The file to save as. ///@throws IOException if the output could not be written void save$1( - _$jni.JObject? file, + jni$_.JObject? file, ) { - final _$file = file?.reference ?? _$jni.jNullReference; - _save$1(reference.pointer, _id_save$1 as _$jni.JMethodIDPtr, _$file.pointer) + final _$file = file?.reference ?? jni$_.jNullReference; + _save$1(reference.pointer, _id_save$1 as jni$_.JMethodIDPtr, _$file.pointer) .check(); } @@ -1806,16 +1807,16 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/OutputStream;)V', ); - static final _save$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _save$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void save(java.io.OutputStream output)` /// @@ -1828,10 +1829,10 @@ class PDDocument extends _$jni.JObject { /// it in a java.io.BufferedOutputStream, unless it is already buffered. ///@throws IOException if the output could not be written void save$2( - _$jni.JObject? output, + jni$_.JObject? output, ) { - final _$output = output?.reference ?? _$jni.jNullReference; - _save$2(reference.pointer, _id_save$2 as _$jni.JMethodIDPtr, + final _$output = output?.reference ?? jni$_.jNullReference; + _save$2(reference.pointer, _id_save$2 as jni$_.JMethodIDPtr, _$output.pointer) .check(); } @@ -1841,16 +1842,16 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/OutputStream;)V', ); - static final _saveIncremental = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _saveIncremental = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void saveIncremental(java.io.OutputStream output)` /// @@ -1868,11 +1869,11 @@ class PDDocument extends _$jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream. void saveIncremental( - _$jni.JObject? output, + jni$_.JObject? output, ) { - final _$output = output?.reference ?? _$jni.jNullReference; + final _$output = output?.reference ?? jni$_.jNullReference; _saveIncremental(reference.pointer, - _id_saveIncremental as _$jni.JMethodIDPtr, _$output.pointer) + _id_saveIncremental as jni$_.JMethodIDPtr, _$output.pointer) .check(); } @@ -1881,22 +1882,22 @@ class PDDocument extends _$jni.JObject { r'(Ljava/io/OutputStream;Ljava/util/Set;)V', ); - static final _saveIncremental$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _saveIncremental$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void saveIncremental(java.io.OutputStream output, java.util.Set objectsToWrite)` /// @@ -1919,14 +1920,14 @@ class PDDocument extends _$jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream. void saveIncremental$1( - _$jni.JObject? output, - _$jni.JSet<_$jni.JObject?>? objectsToWrite, + jni$_.JObject? output, + jni$_.JSet? objectsToWrite, ) { - final _$output = output?.reference ?? _$jni.jNullReference; - final _$objectsToWrite = objectsToWrite?.reference ?? _$jni.jNullReference; + final _$output = output?.reference ?? jni$_.jNullReference; + final _$objectsToWrite = objectsToWrite?.reference ?? jni$_.jNullReference; _saveIncremental$1( reference.pointer, - _id_saveIncremental$1 as _$jni.JMethodIDPtr, + _id_saveIncremental$1 as jni$_.JMethodIDPtr, _$output.pointer, _$objectsToWrite.pointer) .check(); @@ -1938,16 +1939,16 @@ class PDDocument extends _$jni.JObject { ); static final _saveIncrementalForExternalSigning = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.digitalsignature.ExternalSigningSupport saveIncrementalForExternalSigning(java.io.OutputStream output)` /// The returned object must be released after use, by calling the [release] method. @@ -1989,15 +1990,15 @@ class PDDocument extends _$jni.JObject { ///@throws IOException if the output could not be written ///@throws IllegalStateException if the document was not loaded from a file or a stream or /// signature options were not set. - _$jni.JObject? saveIncrementalForExternalSigning( - _$jni.JObject? output, + jni$_.JObject? saveIncrementalForExternalSigning( + jni$_.JObject? output, ) { - final _$output = output?.reference ?? _$jni.jNullReference; + final _$output = output?.reference ?? jni$_.jNullReference; return _saveIncrementalForExternalSigning( reference.pointer, - _id_saveIncrementalForExternalSigning as _$jni.JMethodIDPtr, + _id_saveIncrementalForExternalSigning as jni$_.JMethodIDPtr, _$output.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_getPage = _class.instanceMethodId( @@ -2005,15 +2006,15 @@ class PDDocument extends _$jni.JObject { r'(I)Lorg/apache/pdfbox/pdmodel/PDPage;', ); - static final _getPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _getPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public org.apache.pdfbox.pdmodel.PDPage getPage(int pageIndex)` /// The returned object must be released after use, by calling the [release] method. @@ -2025,12 +2026,12 @@ class PDDocument extends _$jni.JObject { /// PDDocument\#getPages() instead. ///@param pageIndex the 0-based page index ///@return the page at the given index. - _$jni.JObject? getPage( + jni$_.JObject? getPage( int pageIndex, ) { return _getPage( - reference.pointer, _id_getPage as _$jni.JMethodIDPtr, pageIndex) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getPage as jni$_.JMethodIDPtr, pageIndex) + .object(const jni$_.JObjectNullableType()); } static final _id_getPages = _class.instanceMethodId( @@ -2038,16 +2039,16 @@ class PDDocument extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/PDPageTree;', ); - static final _getPages = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getPages = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.PDPageTree getPages()` @@ -2055,9 +2056,9 @@ class PDDocument extends _$jni.JObject { /// /// Returns the page tree. ///@return the page tree - _$jni.JObject? getPages() { - return _getPages(reference.pointer, _id_getPages as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? getPages() { + return _getPages(reference.pointer, _id_getPages as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getNumberOfPages = _class.instanceMethodId( @@ -2065,16 +2066,16 @@ class PDDocument extends _$jni.JObject { r'()I', ); - static final _getNumberOfPages = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNumberOfPages = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getNumberOfPages()` @@ -2083,7 +2084,7 @@ class PDDocument extends _$jni.JObject { ///@return The total number of pages in the PDF document. int getNumberOfPages() { return _getNumberOfPages( - reference.pointer, _id_getNumberOfPages as _$jni.JMethodIDPtr) + reference.pointer, _id_getNumberOfPages as jni$_.JMethodIDPtr) .integer; } @@ -2092,16 +2093,16 @@ class PDDocument extends _$jni.JObject { r'()V', ); - static final _close = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _close = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void close()` @@ -2109,7 +2110,7 @@ class PDDocument extends _$jni.JObject { /// This will close the underlying COSDocument object. ///@throws IOException If there is an error releasing resources. void close() { - _close(reference.pointer, _id_close as _$jni.JMethodIDPtr).check(); + _close(reference.pointer, _id_close as jni$_.JMethodIDPtr).check(); } static final _id_protect = _class.instanceMethodId( @@ -2117,16 +2118,16 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/encryption/ProtectionPolicy;)V', ); - static final _protect = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _protect = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void protect(org.apache.pdfbox.pdmodel.encryption.ProtectionPolicy policy)` /// @@ -2141,10 +2142,10 @@ class PDDocument extends _$jni.JObject { ///@param policy The protection policy. ///@throws IOException if there isn't any suitable security handler. void protect( - _$jni.JObject? policy, + jni$_.JObject? policy, ) { - final _$policy = policy?.reference ?? _$jni.jNullReference; - _protect(reference.pointer, _id_protect as _$jni.JMethodIDPtr, + final _$policy = policy?.reference ?? jni$_.jNullReference; + _protect(reference.pointer, _id_protect as jni$_.JMethodIDPtr, _$policy.pointer) .check(); } @@ -2155,16 +2156,16 @@ class PDDocument extends _$jni.JObject { ); static final _getCurrentAccessPermission = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.encryption.AccessPermission getCurrentAccessPermission()` @@ -2175,10 +2176,10 @@ class PDDocument extends _$jni.JObject { /// only mode so that permissions cannot be changed. Methods providing access to content should rely on this object /// to verify if the current user is allowed to proceed. ///@return the access permissions for the current user on the document. - _$jni.JObject? getCurrentAccessPermission() { + jni$_.JObject? getCurrentAccessPermission() { return _getCurrentAccessPermission(reference.pointer, - _id_getCurrentAccessPermission as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getCurrentAccessPermission as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_isAllSecurityToBeRemoved = _class.instanceMethodId( @@ -2186,16 +2187,16 @@ class PDDocument extends _$jni.JObject { r'()Z', ); - static final _isAllSecurityToBeRemoved = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isAllSecurityToBeRemoved = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isAllSecurityToBeRemoved()` @@ -2204,7 +2205,7 @@ class PDDocument extends _$jni.JObject { ///@return returns true if all security shall be removed otherwise false bool isAllSecurityToBeRemoved() { return _isAllSecurityToBeRemoved(reference.pointer, - _id_isAllSecurityToBeRemoved as _$jni.JMethodIDPtr) + _id_isAllSecurityToBeRemoved as jni$_.JMethodIDPtr) .boolean; } @@ -2213,15 +2214,15 @@ class PDDocument extends _$jni.JObject { r'(Z)V', ); - static final _setAllSecurityToBeRemoved = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setAllSecurityToBeRemoved = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setAllSecurityToBeRemoved(boolean removeAllSecurity)` /// @@ -2232,7 +2233,7 @@ class PDDocument extends _$jni.JObject { ) { _setAllSecurityToBeRemoved( reference.pointer, - _id_setAllSecurityToBeRemoved as _$jni.JMethodIDPtr, + _id_setAllSecurityToBeRemoved as jni$_.JMethodIDPtr, removeAllSecurity ? 1 : 0) .check(); } @@ -2242,16 +2243,16 @@ class PDDocument extends _$jni.JObject { r'()Ljava/lang/Long;', ); - static final _getDocumentId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDocumentId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Long getDocumentId()` @@ -2259,10 +2260,10 @@ class PDDocument extends _$jni.JObject { /// /// Provides the document ID. ///@return the document ID - _$jni.JLong? getDocumentId() { + jni$_.JLong? getDocumentId() { return _getDocumentId( - reference.pointer, _id_getDocumentId as _$jni.JMethodIDPtr) - .object<_$jni.JLong?>(const _$jni.JLongNullableType()); + reference.pointer, _id_getDocumentId as jni$_.JMethodIDPtr) + .object(const jni$_.JLongNullableType()); } static final _id_setDocumentId = _class.instanceMethodId( @@ -2270,26 +2271,26 @@ class PDDocument extends _$jni.JObject { r'(Ljava/lang/Long;)V', ); - static final _setDocumentId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setDocumentId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setDocumentId(java.lang.Long docId)` /// /// Sets the document ID to the given value. ///@param docId the new document ID void setDocumentId( - _$jni.JLong? docId, + jni$_.JLong? docId, ) { - final _$docId = docId?.reference ?? _$jni.jNullReference; - _setDocumentId(reference.pointer, _id_setDocumentId as _$jni.JMethodIDPtr, + final _$docId = docId?.reference ?? jni$_.jNullReference; + _setDocumentId(reference.pointer, _id_setDocumentId as jni$_.JMethodIDPtr, _$docId.pointer) .check(); } @@ -2299,16 +2300,16 @@ class PDDocument extends _$jni.JObject { r'()F', ); - static final _getVersion = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getVersion = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getVersion()` @@ -2316,7 +2317,7 @@ class PDDocument extends _$jni.JObject { /// Returns the PDF specification version this document conforms to. ///@return the PDF version (e.g. 1.4f) double getVersion() { - return _getVersion(reference.pointer, _id_getVersion as _$jni.JMethodIDPtr) + return _getVersion(reference.pointer, _id_getVersion as jni$_.JMethodIDPtr) .float; } @@ -2325,15 +2326,15 @@ class PDDocument extends _$jni.JObject { r'(F)V', ); - static final _setVersion = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setVersion = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public void setVersion(float newVersion)` /// @@ -2343,7 +2344,7 @@ class PDDocument extends _$jni.JObject { double newVersion, ) { _setVersion( - reference.pointer, _id_setVersion as _$jni.JMethodIDPtr, newVersion) + reference.pointer, _id_setVersion as jni$_.JMethodIDPtr, newVersion) .check(); } @@ -2352,16 +2353,16 @@ class PDDocument extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/ResourceCache;', ); - static final _getResourceCache = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getResourceCache = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.ResourceCache getResourceCache()` @@ -2369,10 +2370,10 @@ class PDDocument extends _$jni.JObject { /// /// Returns the resource cache associated with this document, or null if there is none. ///@return the resource cache or null. - _$jni.JObject? getResourceCache() { + jni$_.JObject? getResourceCache() { return _getResourceCache( - reference.pointer, _id_getResourceCache as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getResourceCache as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setResourceCache = _class.instanceMethodId( @@ -2380,99 +2381,99 @@ class PDDocument extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/ResourceCache;)V', ); - static final _setResourceCache = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setResourceCache = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setResourceCache(org.apache.pdfbox.pdmodel.ResourceCache resourceCache)` /// /// Sets the resource cache associated with this document. ///@param resourceCache A resource cache, or null. void setResourceCache( - _$jni.JObject? resourceCache, + jni$_.JObject? resourceCache, ) { - final _$resourceCache = resourceCache?.reference ?? _$jni.jNullReference; + final _$resourceCache = resourceCache?.reference ?? jni$_.jNullReference; _setResourceCache(reference.pointer, - _id_setResourceCache as _$jni.JMethodIDPtr, _$resourceCache.pointer) + _id_setResourceCache as jni$_.JMethodIDPtr, _$resourceCache.pointer) .check(); } } -final class $PDDocument$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $PDDocument$NullableType extends jni$_.JObjType { + @jni$_.internal const $PDDocument$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocument;'; - @_$jni.internal - @_$core.override - PDDocument? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + PDDocument? fromReference(jni$_.JReference reference) => reference.isNull ? null : PDDocument.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($PDDocument$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($PDDocument$NullableType) && other is $PDDocument$NullableType; } } -final class $PDDocument$Type extends _$jni.JObjType { - @_$jni.internal +final class $PDDocument$Type extends jni$_.JObjType { + @jni$_.internal const $PDDocument$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocument;'; - @_$jni.internal - @_$core.override - PDDocument fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + PDDocument fromReference(jni$_.JReference reference) => PDDocument.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $PDDocument$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($PDDocument$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($PDDocument$Type) && other is $PDDocument$Type; } diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart index cb1573df3..568c1f850 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocumentInformation.dart @@ -48,10 +48,10 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `org.apache.pdfbox.pdmodel.PDDocumentInformation` /// @@ -60,19 +60,19 @@ import 'package:jni/jni.dart' as _$jni; /// method then it will clear the value. ///@author Ben Litchfield ///@author Gerardo Ortiz -class PDDocumentInformation extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class PDDocumentInformation extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal PDDocumentInformation.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocumentInformation'); + jni$_.JClass.forName(r'org/apache/pdfbox/pdmodel/PDDocumentInformation'); /// The type which includes information such as the signature of this class. static const nullableType = $PDDocumentInformation$NullableType(); @@ -81,16 +81,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -99,7 +99,7 @@ class PDDocumentInformation extends _$jni.JObject { /// Default Constructor. factory PDDocumentInformation() { return PDDocumentInformation.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -107,16 +107,16 @@ class PDDocumentInformation extends _$jni.JObject { r'(Lorg/apache/pdfbox/cos/COSDictionary;)V', ); - static final _new$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (org.apache.pdfbox.cos.COSDictionary dic)` /// The returned object must be released after use, by calling the [release] method. @@ -124,11 +124,11 @@ class PDDocumentInformation extends _$jni.JObject { /// Constructor that is used for a preexisting dictionary. ///@param dic The underlying dictionary. factory PDDocumentInformation.new$1( - _$jni.JObject? dic, + jni$_.JObject? dic, ) { - final _$dic = dic?.reference ?? _$jni.jNullReference; + final _$dic = dic?.reference ?? jni$_.jNullReference; return PDDocumentInformation.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as _$jni.JMethodIDPtr, _$dic.pointer) + _id_new$1 as jni$_.JMethodIDPtr, _$dic.pointer) .reference); } @@ -137,16 +137,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Lorg/apache/pdfbox/cos/COSDictionary;', ); - static final _getCOSObject = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCOSObject = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.cos.COSDictionary getCOSObject()` @@ -154,10 +154,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the underlying dictionary that this object wraps. ///@return The underlying info dictionary. - _$jni.JObject? getCOSObject() { + jni$_.JObject? getCOSObject() { return _getCOSObject( - reference.pointer, _id_getCOSObject as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getCOSObject as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getPropertyStringValue = _class.instanceMethodId( @@ -165,16 +165,16 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)Ljava/lang/Object;', ); - static final _getPropertyStringValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getPropertyStringValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.Object getPropertyStringValue(java.lang.String propertyKey)` /// The returned object must be released after use, by calling the [release] method. @@ -187,15 +187,15 @@ class PDDocumentInformation extends _$jni.JObject { /// ///@param propertyKey the dictionaries key ///@return the properties value - _$jni.JObject? getPropertyStringValue( - _$jni.JString? propertyKey, + jni$_.JObject? getPropertyStringValue( + jni$_.JString? propertyKey, ) { - final _$propertyKey = propertyKey?.reference ?? _$jni.jNullReference; + final _$propertyKey = propertyKey?.reference ?? jni$_.jNullReference; return _getPropertyStringValue( reference.pointer, - _id_getPropertyStringValue as _$jni.JMethodIDPtr, + _id_getPropertyStringValue as jni$_.JMethodIDPtr, _$propertyKey.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_getTitle = _class.instanceMethodId( @@ -203,16 +203,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getTitle = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTitle = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getTitle()` @@ -220,9 +220,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the title of the document. This will return null if no title exists. ///@return The title of the document. - _$jni.JString? getTitle() { - return _getTitle(reference.pointer, _id_getTitle as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getTitle() { + return _getTitle(reference.pointer, _id_getTitle as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setTitle = _class.instanceMethodId( @@ -230,26 +230,26 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setTitle = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setTitle = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setTitle(java.lang.String title)` /// /// This will set the title of the document. ///@param title The new title for the document. void setTitle( - _$jni.JString? title, + jni$_.JString? title, ) { - final _$title = title?.reference ?? _$jni.jNullReference; - _setTitle(reference.pointer, _id_setTitle as _$jni.JMethodIDPtr, + final _$title = title?.reference ?? jni$_.jNullReference; + _setTitle(reference.pointer, _id_setTitle as jni$_.JMethodIDPtr, _$title.pointer) .check(); } @@ -259,16 +259,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getAuthor = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getAuthor = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getAuthor()` @@ -276,9 +276,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the author of the document. This will return null if no author exists. ///@return The author of the document. - _$jni.JString? getAuthor() { - return _getAuthor(reference.pointer, _id_getAuthor as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getAuthor() { + return _getAuthor(reference.pointer, _id_getAuthor as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setAuthor = _class.instanceMethodId( @@ -286,26 +286,26 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setAuthor = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setAuthor = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setAuthor(java.lang.String author)` /// /// This will set the author of the document. ///@param author The new author for the document. void setAuthor( - _$jni.JString? author, + jni$_.JString? author, ) { - final _$author = author?.reference ?? _$jni.jNullReference; - _setAuthor(reference.pointer, _id_setAuthor as _$jni.JMethodIDPtr, + final _$author = author?.reference ?? jni$_.jNullReference; + _setAuthor(reference.pointer, _id_setAuthor as jni$_.JMethodIDPtr, _$author.pointer) .check(); } @@ -315,16 +315,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getSubject = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSubject = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getSubject()` @@ -332,9 +332,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the subject of the document. This will return null if no subject exists. ///@return The subject of the document. - _$jni.JString? getSubject() { - return _getSubject(reference.pointer, _id_getSubject as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getSubject() { + return _getSubject(reference.pointer, _id_getSubject as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setSubject = _class.instanceMethodId( @@ -342,26 +342,26 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setSubject = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setSubject = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setSubject(java.lang.String subject)` /// /// This will set the subject of the document. ///@param subject The new subject for the document. void setSubject( - _$jni.JString? subject, + jni$_.JString? subject, ) { - final _$subject = subject?.reference ?? _$jni.jNullReference; - _setSubject(reference.pointer, _id_setSubject as _$jni.JMethodIDPtr, + final _$subject = subject?.reference ?? jni$_.jNullReference; + _setSubject(reference.pointer, _id_setSubject as jni$_.JMethodIDPtr, _$subject.pointer) .check(); } @@ -371,16 +371,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getKeywords = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getKeywords = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getKeywords()` @@ -388,10 +388,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the keywords of the document. This will return null if no keywords exists. ///@return The keywords of the document. - _$jni.JString? getKeywords() { + jni$_.JString? getKeywords() { return _getKeywords( - reference.pointer, _id_getKeywords as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getKeywords as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setKeywords = _class.instanceMethodId( @@ -399,26 +399,26 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setKeywords = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setKeywords = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setKeywords(java.lang.String keywords)` /// /// This will set the keywords of the document. ///@param keywords The new keywords for the document. void setKeywords( - _$jni.JString? keywords, + jni$_.JString? keywords, ) { - final _$keywords = keywords?.reference ?? _$jni.jNullReference; - _setKeywords(reference.pointer, _id_setKeywords as _$jni.JMethodIDPtr, + final _$keywords = keywords?.reference ?? jni$_.jNullReference; + _setKeywords(reference.pointer, _id_setKeywords as jni$_.JMethodIDPtr, _$keywords.pointer) .check(); } @@ -428,16 +428,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getCreator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCreator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getCreator()` @@ -445,9 +445,9 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the creator of the document. This will return null if no creator exists. ///@return The creator of the document. - _$jni.JString? getCreator() { - return _getCreator(reference.pointer, _id_getCreator as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getCreator() { + return _getCreator(reference.pointer, _id_getCreator as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setCreator = _class.instanceMethodId( @@ -455,26 +455,26 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setCreator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCreator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setCreator(java.lang.String creator)` /// /// This will set the creator of the document. ///@param creator The new creator for the document. void setCreator( - _$jni.JString? creator, + jni$_.JString? creator, ) { - final _$creator = creator?.reference ?? _$jni.jNullReference; - _setCreator(reference.pointer, _id_setCreator as _$jni.JMethodIDPtr, + final _$creator = creator?.reference ?? jni$_.jNullReference; + _setCreator(reference.pointer, _id_setCreator as jni$_.JMethodIDPtr, _$creator.pointer) .check(); } @@ -484,16 +484,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getProducer = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getProducer = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getProducer()` @@ -501,10 +501,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the producer of the document. This will return null if no producer exists. ///@return The producer of the document. - _$jni.JString? getProducer() { + jni$_.JString? getProducer() { return _getProducer( - reference.pointer, _id_getProducer as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getProducer as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setProducer = _class.instanceMethodId( @@ -512,26 +512,26 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setProducer = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setProducer = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setProducer(java.lang.String producer)` /// /// This will set the producer of the document. ///@param producer The new producer for the document. void setProducer( - _$jni.JString? producer, + jni$_.JString? producer, ) { - final _$producer = producer?.reference ?? _$jni.jNullReference; - _setProducer(reference.pointer, _id_setProducer as _$jni.JMethodIDPtr, + final _$producer = producer?.reference ?? jni$_.jNullReference; + _setProducer(reference.pointer, _id_setProducer as jni$_.JMethodIDPtr, _$producer.pointer) .check(); } @@ -541,16 +541,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/util/Calendar;', ); - static final _getCreationDate = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCreationDate = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Calendar getCreationDate()` @@ -558,10 +558,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the creation date of the document. This will return null if no creation date exists. ///@return The creation date of the document. - _$jni.JObject? getCreationDate() { + jni$_.JObject? getCreationDate() { return _getCreationDate( - reference.pointer, _id_getCreationDate as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getCreationDate as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setCreationDate = _class.instanceMethodId( @@ -569,27 +569,27 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/util/Calendar;)V', ); - static final _setCreationDate = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCreationDate = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setCreationDate(java.util.Calendar date)` /// /// This will set the creation date of the document. ///@param date The new creation date for the document. void setCreationDate( - _$jni.JObject? date, + jni$_.JObject? date, ) { - final _$date = date?.reference ?? _$jni.jNullReference; + final _$date = date?.reference ?? jni$_.jNullReference; _setCreationDate(reference.pointer, - _id_setCreationDate as _$jni.JMethodIDPtr, _$date.pointer) + _id_setCreationDate as jni$_.JMethodIDPtr, _$date.pointer) .check(); } @@ -598,16 +598,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/util/Calendar;', ); - static final _getModificationDate = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getModificationDate = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Calendar getModificationDate()` @@ -615,10 +615,10 @@ class PDDocumentInformation extends _$jni.JObject { /// /// This will get the modification date of the document. This will return null if no modification date exists. ///@return The modification date of the document. - _$jni.JObject? getModificationDate() { + jni$_.JObject? getModificationDate() { return _getModificationDate( - reference.pointer, _id_getModificationDate as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getModificationDate as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setModificationDate = _class.instanceMethodId( @@ -626,27 +626,27 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/util/Calendar;)V', ); - static final _setModificationDate = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setModificationDate = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setModificationDate(java.util.Calendar date)` /// /// This will set the modification date of the document. ///@param date The new modification date for the document. void setModificationDate( - _$jni.JObject? date, + jni$_.JObject? date, ) { - final _$date = date?.reference ?? _$jni.jNullReference; + final _$date = date?.reference ?? jni$_.jNullReference; _setModificationDate(reference.pointer, - _id_setModificationDate as _$jni.JMethodIDPtr, _$date.pointer) + _id_setModificationDate as jni$_.JMethodIDPtr, _$date.pointer) .check(); } @@ -655,16 +655,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getTrapped = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTrapped = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getTrapped()` @@ -673,9 +673,9 @@ class PDDocumentInformation extends _$jni.JObject { /// This will get the trapped value for the document. /// This will return null if one is not found. ///@return The trapped value for the document. - _$jni.JString? getTrapped() { - return _getTrapped(reference.pointer, _id_getTrapped as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getTrapped() { + return _getTrapped(reference.pointer, _id_getTrapped as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getMetadataKeys = _class.instanceMethodId( @@ -683,16 +683,16 @@ class PDDocumentInformation extends _$jni.JObject { r'()Ljava/util/Set;', ); - static final _getMetadataKeys = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getMetadataKeys = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Set getMetadataKeys()` @@ -701,12 +701,12 @@ class PDDocumentInformation extends _$jni.JObject { /// This will get the keys of all metadata information fields for the document. ///@return all metadata key strings. ///@since Apache PDFBox 1.3.0 - _$jni.JSet<_$jni.JString?>? getMetadataKeys() { + jni$_.JSet? getMetadataKeys() { return _getMetadataKeys( - reference.pointer, _id_getMetadataKeys as _$jni.JMethodIDPtr) - .object<_$jni.JSet<_$jni.JString?>?>( - const _$jni.JSetNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + reference.pointer, _id_getMetadataKeys as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JSetNullableType( + jni$_.JStringNullableType())); } static final _id_getCustomMetadataValue = _class.instanceMethodId( @@ -714,16 +714,16 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _getCustomMetadataValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getCustomMetadataValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.String getCustomMetadataValue(java.lang.String fieldName)` /// The returned object must be released after use, by calling the [release] method. @@ -732,15 +732,15 @@ class PDDocumentInformation extends _$jni.JObject { /// This will return null if one is not found. ///@param fieldName Name of custom metadata field from pdf document. ///@return String Value of metadata field - _$jni.JString? getCustomMetadataValue( - _$jni.JString? fieldName, + jni$_.JString? getCustomMetadataValue( + jni$_.JString? fieldName, ) { - final _$fieldName = fieldName?.reference ?? _$jni.jNullReference; + final _$fieldName = fieldName?.reference ?? jni$_.jNullReference; return _getCustomMetadataValue( reference.pointer, - _id_getCustomMetadataValue as _$jni.JMethodIDPtr, + _id_getCustomMetadataValue as jni$_.JMethodIDPtr, _$fieldName.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + .object(const jni$_.JStringNullableType()); } static final _id_setCustomMetadataValue = _class.instanceMethodId( @@ -748,22 +748,22 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;Ljava/lang/String;)V', ); - static final _setCustomMetadataValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _setCustomMetadataValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void setCustomMetadataValue(java.lang.String fieldName, java.lang.String fieldValue)` /// @@ -771,14 +771,14 @@ class PDDocumentInformation extends _$jni.JObject { ///@param fieldName The name of the custom metadata field. ///@param fieldValue The value to the custom metadata field. void setCustomMetadataValue( - _$jni.JString? fieldName, - _$jni.JString? fieldValue, + jni$_.JString? fieldName, + jni$_.JString? fieldValue, ) { - final _$fieldName = fieldName?.reference ?? _$jni.jNullReference; - final _$fieldValue = fieldValue?.reference ?? _$jni.jNullReference; + final _$fieldName = fieldName?.reference ?? jni$_.jNullReference; + final _$fieldValue = fieldValue?.reference ?? jni$_.jNullReference; _setCustomMetadataValue( reference.pointer, - _id_setCustomMetadataValue as _$jni.JMethodIDPtr, + _id_setCustomMetadataValue as jni$_.JMethodIDPtr, _$fieldName.pointer, _$fieldValue.pointer) .check(); @@ -789,16 +789,16 @@ class PDDocumentInformation extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setTrapped = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setTrapped = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setTrapped(java.lang.String value)` /// @@ -807,48 +807,48 @@ class PDDocumentInformation extends _$jni.JObject { ///@param value The new trapped value for the document. ///@throws IllegalArgumentException if the parameter is invalid. void setTrapped( - _$jni.JString? value, + jni$_.JString? value, ) { - final _$value = value?.reference ?? _$jni.jNullReference; - _setTrapped(reference.pointer, _id_setTrapped as _$jni.JMethodIDPtr, + final _$value = value?.reference ?? jni$_.jNullReference; + _setTrapped(reference.pointer, _id_setTrapped as jni$_.JMethodIDPtr, _$value.pointer) .check(); } } final class $PDDocumentInformation$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $PDDocumentInformation$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;'; - @_$jni.internal - @_$core.override - PDDocumentInformation? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + PDDocumentInformation? fromReference(jni$_.JReference reference) => reference.isNull ? null : PDDocumentInformation.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($PDDocumentInformation$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($PDDocumentInformation$NullableType) && other is $PDDocumentInformation$NullableType; @@ -856,37 +856,37 @@ final class $PDDocumentInformation$NullableType } final class $PDDocumentInformation$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $PDDocumentInformation$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lorg/apache/pdfbox/pdmodel/PDDocumentInformation;'; - @_$jni.internal - @_$core.override - PDDocumentInformation fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + PDDocumentInformation fromReference(jni$_.JReference reference) => PDDocumentInformation.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $PDDocumentInformation$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($PDDocumentInformation$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($PDDocumentInformation$Type) && other is $PDDocumentInformation$Type; diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart index 74bf44b24..929c1b63c 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/text/PDFTextStripper.dart @@ -48,12 +48,12 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; -import '../pdmodel/PDDocument.dart' as pddocument_; +import '../pdmodel/PDDocument.dart' as pddocument$_; /// from: `org.apache.pdfbox.text.PDFTextStripper` /// @@ -64,19 +64,19 @@ import '../pdmodel/PDDocument.dart' as pddocument_; /// The basic flow of this process is that we get a document and use a series of processXXX() functions that work on /// smaller and smaller chunks of the page. Eventually, we fully process each page and then print it. ///@author Ben Litchfield -class PDFTextStripper extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class PDFTextStripper extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal PDFTextStripper.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'org/apache/pdfbox/text/PDFTextStripper'); + jni$_.JClass.forName(r'org/apache/pdfbox/text/PDFTextStripper'); /// The type which includes information such as the signature of this class. static const nullableType = $PDFTextStripper$NullableType(); @@ -85,16 +85,16 @@ class PDFTextStripper extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -104,7 +104,7 @@ class PDFTextStripper extends _$jni.JObject { ///@throws IOException If there is an error loading the properties. factory PDFTextStripper() { return PDFTextStripper.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -113,16 +113,16 @@ class PDFTextStripper extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDDocument;)Ljava/lang/String;', ); - static final _getText = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getText = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.String getText(org.apache.pdfbox.pdmodel.PDDocument doc)` /// The returned object must be released after use, by calling the [release] method. @@ -137,13 +137,13 @@ class PDFTextStripper extends _$jni.JObject { ///@param doc The document to get the text from. ///@return The text of the PDF document. ///@throws IOException if the doc state is invalid or it is encrypted. - _$jni.JString? getText( - pddocument_.PDDocument? doc, + jni$_.JString? getText( + pddocument$_.PDDocument? doc, ) { - final _$doc = doc?.reference ?? _$jni.jNullReference; + final _$doc = doc?.reference ?? jni$_.jNullReference; return _getText( - reference.pointer, _id_getText as _$jni.JMethodIDPtr, _$doc.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getText as jni$_.JMethodIDPtr, _$doc.pointer) + .object(const jni$_.JStringNullableType()); } static final _id_writeText = _class.instanceMethodId( @@ -151,22 +151,22 @@ class PDFTextStripper extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDDocument;Ljava/io/Writer;)V', ); - static final _writeText = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _writeText = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void writeText(org.apache.pdfbox.pdmodel.PDDocument doc, java.io.Writer outputStream)` /// @@ -175,12 +175,12 @@ class PDFTextStripper extends _$jni.JObject { ///@param outputStream The location to put the text. ///@throws IOException If the doc is in an invalid state. void writeText( - pddocument_.PDDocument? doc, - _$jni.JObject? outputStream, + pddocument$_.PDDocument? doc, + jni$_.JObject? outputStream, ) { - final _$doc = doc?.reference ?? _$jni.jNullReference; - final _$outputStream = outputStream?.reference ?? _$jni.jNullReference; - _writeText(reference.pointer, _id_writeText as _$jni.JMethodIDPtr, + final _$doc = doc?.reference ?? jni$_.jNullReference; + final _$outputStream = outputStream?.reference ?? jni$_.jNullReference; + _writeText(reference.pointer, _id_writeText as jni$_.JMethodIDPtr, _$doc.pointer, _$outputStream.pointer) .check(); } @@ -190,16 +190,16 @@ class PDFTextStripper extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/PDPage;)V', ); - static final _processPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _processPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void processPage(org.apache.pdfbox.pdmodel.PDPage page)` /// @@ -207,10 +207,10 @@ class PDFTextStripper extends _$jni.JObject { ///@param page The page to process. ///@throws IOException If there is an error processing the page. void processPage( - _$jni.JObject? page, + jni$_.JObject? page, ) { - final _$page = page?.reference ?? _$jni.jNullReference; - _processPage(reference.pointer, _id_processPage as _$jni.JMethodIDPtr, + final _$page = page?.reference ?? jni$_.jNullReference; + _processPage(reference.pointer, _id_processPage as jni$_.JMethodIDPtr, _$page.pointer) .check(); } @@ -220,16 +220,16 @@ class PDFTextStripper extends _$jni.JObject { r'()I', ); - static final _getStartPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getStartPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getStartPage()` @@ -240,7 +240,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return Value of property startPage. int getStartPage() { return _getStartPage( - reference.pointer, _id_getStartPage as _$jni.JMethodIDPtr) + reference.pointer, _id_getStartPage as jni$_.JMethodIDPtr) .integer; } @@ -249,15 +249,15 @@ class PDFTextStripper extends _$jni.JObject { r'(I)V', ); - static final _setStartPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setStartPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setStartPage(int startPageValue)` /// @@ -266,7 +266,7 @@ class PDFTextStripper extends _$jni.JObject { void setStartPage( int startPageValue, ) { - _setStartPage(reference.pointer, _id_setStartPage as _$jni.JMethodIDPtr, + _setStartPage(reference.pointer, _id_setStartPage as jni$_.JMethodIDPtr, startPageValue) .check(); } @@ -276,16 +276,16 @@ class PDFTextStripper extends _$jni.JObject { r'()I', ); - static final _getEndPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getEndPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getEndPage()` @@ -295,7 +295,7 @@ class PDFTextStripper extends _$jni.JObject { /// Integer.MAX_VALUE such that all pages of the pdf will be extracted. ///@return Value of property endPage. int getEndPage() { - return _getEndPage(reference.pointer, _id_getEndPage as _$jni.JMethodIDPtr) + return _getEndPage(reference.pointer, _id_getEndPage as jni$_.JMethodIDPtr) .integer; } @@ -304,15 +304,15 @@ class PDFTextStripper extends _$jni.JObject { r'(I)V', ); - static final _setEndPage = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setEndPage = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setEndPage(int endPageValue)` /// @@ -321,7 +321,7 @@ class PDFTextStripper extends _$jni.JObject { void setEndPage( int endPageValue, ) { - _setEndPage(reference.pointer, _id_setEndPage as _$jni.JMethodIDPtr, + _setEndPage(reference.pointer, _id_setEndPage as jni$_.JMethodIDPtr, endPageValue) .check(); } @@ -331,16 +331,16 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setLineSeparator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setLineSeparator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setLineSeparator(java.lang.String separator)` /// @@ -348,11 +348,11 @@ class PDFTextStripper extends _$jni.JObject { /// preference is not set explicitly using this method. ///@param separator The desired line separator string. void setLineSeparator( - _$jni.JString? separator, + jni$_.JString? separator, ) { - final _$separator = separator?.reference ?? _$jni.jNullReference; + final _$separator = separator?.reference ?? jni$_.jNullReference; _setLineSeparator(reference.pointer, - _id_setLineSeparator as _$jni.JMethodIDPtr, _$separator.pointer) + _id_setLineSeparator as jni$_.JMethodIDPtr, _$separator.pointer) .check(); } @@ -361,16 +361,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getLineSeparator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getLineSeparator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getLineSeparator()` @@ -378,10 +378,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// This will get the line separator. ///@return The desired line separator string. - _$jni.JString? getLineSeparator() { + jni$_.JString? getLineSeparator() { return _getLineSeparator( - reference.pointer, _id_getLineSeparator as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getLineSeparator as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getWordSeparator = _class.instanceMethodId( @@ -389,16 +389,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getWordSeparator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getWordSeparator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getWordSeparator()` @@ -406,10 +406,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// This will get the word separator. ///@return The desired word separator string. - _$jni.JString? getWordSeparator() { + jni$_.JString? getWordSeparator() { return _getWordSeparator( - reference.pointer, _id_getWordSeparator as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getWordSeparator as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setWordSeparator = _class.instanceMethodId( @@ -417,16 +417,16 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setWordSeparator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setWordSeparator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setWordSeparator(java.lang.String separator)` /// @@ -436,11 +436,11 @@ class PDFTextStripper extends _$jni.JObject { /// the empty string. ///@param separator The desired page separator string. void setWordSeparator( - _$jni.JString? separator, + jni$_.JString? separator, ) { - final _$separator = separator?.reference ?? _$jni.jNullReference; + final _$separator = separator?.reference ?? jni$_.jNullReference; _setWordSeparator(reference.pointer, - _id_setWordSeparator as _$jni.JMethodIDPtr, _$separator.pointer) + _id_setWordSeparator as jni$_.JMethodIDPtr, _$separator.pointer) .check(); } @@ -451,16 +451,16 @@ class PDFTextStripper extends _$jni.JObject { ); static final _getSuppressDuplicateOverlappingText = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getSuppressDuplicateOverlappingText()` @@ -468,7 +468,7 @@ class PDFTextStripper extends _$jni.JObject { /// @return Returns the suppressDuplicateOverlappingText. bool getSuppressDuplicateOverlappingText() { return _getSuppressDuplicateOverlappingText(reference.pointer, - _id_getSuppressDuplicateOverlappingText as _$jni.JMethodIDPtr) + _id_getSuppressDuplicateOverlappingText as jni$_.JMethodIDPtr) .boolean; } @@ -479,14 +479,14 @@ class PDFTextStripper extends _$jni.JObject { ); static final _setSuppressDuplicateOverlappingText = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setSuppressDuplicateOverlappingText(boolean suppressDuplicateOverlappingTextValue)` /// @@ -499,7 +499,7 @@ class PDFTextStripper extends _$jni.JObject { ) { _setSuppressDuplicateOverlappingText( reference.pointer, - _id_setSuppressDuplicateOverlappingText as _$jni.JMethodIDPtr, + _id_setSuppressDuplicateOverlappingText as jni$_.JMethodIDPtr, suppressDuplicateOverlappingTextValue ? 1 : 0) .check(); } @@ -509,16 +509,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Z', ); - static final _getSeparateByBeads = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSeparateByBeads = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getSeparateByBeads()` @@ -527,7 +527,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return If the text will be grouped by beads. bool getSeparateByBeads() { return _getSeparateByBeads( - reference.pointer, _id_getSeparateByBeads as _$jni.JMethodIDPtr) + reference.pointer, _id_getSeparateByBeads as jni$_.JMethodIDPtr) .boolean; } @@ -536,15 +536,15 @@ class PDFTextStripper extends _$jni.JObject { r'(Z)V', ); - static final _setShouldSeparateByBeads = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setShouldSeparateByBeads = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setShouldSeparateByBeads(boolean aShouldSeparateByBeads)` /// @@ -555,7 +555,7 @@ class PDFTextStripper extends _$jni.JObject { ) { _setShouldSeparateByBeads( reference.pointer, - _id_setShouldSeparateByBeads as _$jni.JMethodIDPtr, + _id_setShouldSeparateByBeads as jni$_.JMethodIDPtr, aShouldSeparateByBeads ? 1 : 0) .check(); } @@ -565,16 +565,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;', ); - static final _getEndBookmark = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getEndBookmark = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getEndBookmark()` @@ -582,10 +582,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Get the bookmark where text extraction should end, inclusive. Default is null. ///@return The ending bookmark. - _$jni.JObject? getEndBookmark() { + jni$_.JObject? getEndBookmark() { return _getEndBookmark( - reference.pointer, _id_getEndBookmark as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getEndBookmark as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setEndBookmark = _class.instanceMethodId( @@ -593,26 +593,26 @@ class PDFTextStripper extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;)V', ); - static final _setEndBookmark = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setEndBookmark = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setEndBookmark(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem aEndBookmark)` /// /// Set the bookmark where the text extraction should stop. ///@param aEndBookmark The ending bookmark. void setEndBookmark( - _$jni.JObject? aEndBookmark, + jni$_.JObject? aEndBookmark, ) { - final _$aEndBookmark = aEndBookmark?.reference ?? _$jni.jNullReference; - _setEndBookmark(reference.pointer, _id_setEndBookmark as _$jni.JMethodIDPtr, + final _$aEndBookmark = aEndBookmark?.reference ?? jni$_.jNullReference; + _setEndBookmark(reference.pointer, _id_setEndBookmark as jni$_.JMethodIDPtr, _$aEndBookmark.pointer) .check(); } @@ -622,16 +622,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;', ); - static final _getStartBookmark = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getStartBookmark = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getStartBookmark()` @@ -639,10 +639,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Get the bookmark where text extraction should start, inclusive. Default is null. ///@return The starting bookmark. - _$jni.JObject? getStartBookmark() { + jni$_.JObject? getStartBookmark() { return _getStartBookmark( - reference.pointer, _id_getStartBookmark as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getStartBookmark as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setStartBookmark = _class.instanceMethodId( @@ -650,28 +650,28 @@ class PDFTextStripper extends _$jni.JObject { r'(Lorg/apache/pdfbox/pdmodel/interactive/documentnavigation/outline/PDOutlineItem;)V', ); - static final _setStartBookmark = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setStartBookmark = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setStartBookmark(org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem aStartBookmark)` /// /// Set the bookmark where text extraction should start, inclusive. ///@param aStartBookmark The starting bookmark. void setStartBookmark( - _$jni.JObject? aStartBookmark, + jni$_.JObject? aStartBookmark, ) { - final _$aStartBookmark = aStartBookmark?.reference ?? _$jni.jNullReference; + final _$aStartBookmark = aStartBookmark?.reference ?? jni$_.jNullReference; _setStartBookmark( reference.pointer, - _id_setStartBookmark as _$jni.JMethodIDPtr, + _id_setStartBookmark as jni$_.JMethodIDPtr, _$aStartBookmark.pointer) .check(); } @@ -681,16 +681,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Z', ); - static final _getAddMoreFormatting = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getAddMoreFormatting = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getAddMoreFormatting()` @@ -699,7 +699,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return true if some more text formatting will be added bool getAddMoreFormatting() { return _getAddMoreFormatting( - reference.pointer, _id_getAddMoreFormatting as _$jni.JMethodIDPtr) + reference.pointer, _id_getAddMoreFormatting as jni$_.JMethodIDPtr) .boolean; } @@ -708,15 +708,15 @@ class PDFTextStripper extends _$jni.JObject { r'(Z)V', ); - static final _setAddMoreFormatting = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setAddMoreFormatting = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setAddMoreFormatting(boolean newAddMoreFormatting)` /// @@ -727,7 +727,7 @@ class PDFTextStripper extends _$jni.JObject { ) { _setAddMoreFormatting( reference.pointer, - _id_setAddMoreFormatting as _$jni.JMethodIDPtr, + _id_setAddMoreFormatting as jni$_.JMethodIDPtr, newAddMoreFormatting ? 1 : 0) .check(); } @@ -737,16 +737,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Z', ); - static final _getSortByPosition = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSortByPosition = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getSortByPosition()` @@ -755,7 +755,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return true If the text tokens will be sorted before being written. bool getSortByPosition() { return _getSortByPosition( - reference.pointer, _id_getSortByPosition as _$jni.JMethodIDPtr) + reference.pointer, _id_getSortByPosition as jni$_.JMethodIDPtr) .boolean; } @@ -764,15 +764,15 @@ class PDFTextStripper extends _$jni.JObject { r'(Z)V', ); - static final _setSortByPosition = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setSortByPosition = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setSortByPosition(boolean newSortByPosition)` /// @@ -789,7 +789,7 @@ class PDFTextStripper extends _$jni.JObject { ) { _setSortByPosition( reference.pointer, - _id_setSortByPosition as _$jni.JMethodIDPtr, + _id_setSortByPosition as jni$_.JMethodIDPtr, newSortByPosition ? 1 : 0) .check(); } @@ -799,16 +799,16 @@ class PDFTextStripper extends _$jni.JObject { r'()F', ); - static final _getSpacingTolerance = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSpacingTolerance = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getSpacingTolerance()` @@ -818,7 +818,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return The current tolerance / scaling factor double getSpacingTolerance() { return _getSpacingTolerance( - reference.pointer, _id_getSpacingTolerance as _$jni.JMethodIDPtr) + reference.pointer, _id_getSpacingTolerance as jni$_.JMethodIDPtr) .float; } @@ -827,15 +827,15 @@ class PDFTextStripper extends _$jni.JObject { r'(F)V', ); - static final _setSpacingTolerance = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setSpacingTolerance = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public void setSpacingTolerance(float spacingToleranceValue)` /// @@ -848,7 +848,7 @@ class PDFTextStripper extends _$jni.JObject { ) { _setSpacingTolerance( reference.pointer, - _id_setSpacingTolerance as _$jni.JMethodIDPtr, + _id_setSpacingTolerance as jni$_.JMethodIDPtr, spacingToleranceValue) .check(); } @@ -858,16 +858,16 @@ class PDFTextStripper extends _$jni.JObject { r'()F', ); - static final _getAverageCharTolerance = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getAverageCharTolerance = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getAverageCharTolerance()` @@ -877,7 +877,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return The current tolerance / scaling factor double getAverageCharTolerance() { return _getAverageCharTolerance(reference.pointer, - _id_getAverageCharTolerance as _$jni.JMethodIDPtr) + _id_getAverageCharTolerance as jni$_.JMethodIDPtr) .float; } @@ -886,15 +886,15 @@ class PDFTextStripper extends _$jni.JObject { r'(F)V', ); - static final _setAverageCharTolerance = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setAverageCharTolerance = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public void setAverageCharTolerance(float averageCharToleranceValue)` /// @@ -907,7 +907,7 @@ class PDFTextStripper extends _$jni.JObject { ) { _setAverageCharTolerance( reference.pointer, - _id_setAverageCharTolerance as _$jni.JMethodIDPtr, + _id_setAverageCharTolerance as jni$_.JMethodIDPtr, averageCharToleranceValue) .check(); } @@ -917,16 +917,16 @@ class PDFTextStripper extends _$jni.JObject { r'()F', ); - static final _getIndentThreshold = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getIndentThreshold = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getIndentThreshold()` @@ -936,7 +936,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return the number of whitespace character widths to use when detecting paragraph indents. double getIndentThreshold() { return _getIndentThreshold( - reference.pointer, _id_getIndentThreshold as _$jni.JMethodIDPtr) + reference.pointer, _id_getIndentThreshold as jni$_.JMethodIDPtr) .float; } @@ -945,15 +945,15 @@ class PDFTextStripper extends _$jni.JObject { r'(F)V', ); - static final _setIndentThreshold = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setIndentThreshold = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public void setIndentThreshold(float indentThresholdValue)` /// @@ -965,7 +965,7 @@ class PDFTextStripper extends _$jni.JObject { double indentThresholdValue, ) { _setIndentThreshold(reference.pointer, - _id_setIndentThreshold as _$jni.JMethodIDPtr, indentThresholdValue) + _id_setIndentThreshold as jni$_.JMethodIDPtr, indentThresholdValue) .check(); } @@ -974,16 +974,16 @@ class PDFTextStripper extends _$jni.JObject { r'()F', ); - static final _getDropThreshold = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDropThreshold = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getDropThreshold()` @@ -993,7 +993,7 @@ class PDFTextStripper extends _$jni.JObject { ///@return the character height multiple for max allowed whitespace between lines in the same paragraph. double getDropThreshold() { return _getDropThreshold( - reference.pointer, _id_getDropThreshold as _$jni.JMethodIDPtr) + reference.pointer, _id_getDropThreshold as jni$_.JMethodIDPtr) .float; } @@ -1002,15 +1002,15 @@ class PDFTextStripper extends _$jni.JObject { r'(F)V', ); - static final _setDropThreshold = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_CallVoidMethod') + static final _setDropThreshold = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Double,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public void setDropThreshold(float dropThresholdValue)` /// @@ -1022,7 +1022,7 @@ class PDFTextStripper extends _$jni.JObject { double dropThresholdValue, ) { _setDropThreshold(reference.pointer, - _id_setDropThreshold as _$jni.JMethodIDPtr, dropThresholdValue) + _id_setDropThreshold as jni$_.JMethodIDPtr, dropThresholdValue) .check(); } @@ -1031,16 +1031,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getParagraphStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getParagraphStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getParagraphStart()` @@ -1048,10 +1048,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the beginning of a paragraph. ///@return the paragraph start string - _$jni.JString? getParagraphStart() { + jni$_.JString? getParagraphStart() { return _getParagraphStart( - reference.pointer, _id_getParagraphStart as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getParagraphStart as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setParagraphStart = _class.instanceMethodId( @@ -1059,27 +1059,27 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setParagraphStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setParagraphStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setParagraphStart(java.lang.String s)` /// /// Sets the string which will be used at the beginning of a paragraph. ///@param s the paragraph start string void setParagraphStart( - _$jni.JString? s, + jni$_.JString? s, ) { - final _$s = s?.reference ?? _$jni.jNullReference; + final _$s = s?.reference ?? jni$_.jNullReference; _setParagraphStart(reference.pointer, - _id_setParagraphStart as _$jni.JMethodIDPtr, _$s.pointer) + _id_setParagraphStart as jni$_.JMethodIDPtr, _$s.pointer) .check(); } @@ -1088,16 +1088,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getParagraphEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getParagraphEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getParagraphEnd()` @@ -1105,10 +1105,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the end of a paragraph. ///@return the paragraph end string - _$jni.JString? getParagraphEnd() { + jni$_.JString? getParagraphEnd() { return _getParagraphEnd( - reference.pointer, _id_getParagraphEnd as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getParagraphEnd as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setParagraphEnd = _class.instanceMethodId( @@ -1116,27 +1116,27 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setParagraphEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setParagraphEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setParagraphEnd(java.lang.String s)` /// /// Sets the string which will be used at the end of a paragraph. ///@param s the paragraph end string void setParagraphEnd( - _$jni.JString? s, + jni$_.JString? s, ) { - final _$s = s?.reference ?? _$jni.jNullReference; + final _$s = s?.reference ?? jni$_.jNullReference; _setParagraphEnd(reference.pointer, - _id_setParagraphEnd as _$jni.JMethodIDPtr, _$s.pointer) + _id_setParagraphEnd as jni$_.JMethodIDPtr, _$s.pointer) .check(); } @@ -1145,16 +1145,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getPageStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getPageStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getPageStart()` @@ -1162,10 +1162,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the beginning of a page. ///@return the page start string - _$jni.JString? getPageStart() { + jni$_.JString? getPageStart() { return _getPageStart( - reference.pointer, _id_getPageStart as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getPageStart as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setPageStart = _class.instanceMethodId( @@ -1173,26 +1173,26 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setPageStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setPageStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setPageStart(java.lang.String pageStartValue)` /// /// Sets the string which will be used at the beginning of a page. ///@param pageStartValue the page start string void setPageStart( - _$jni.JString? pageStartValue, + jni$_.JString? pageStartValue, ) { - final _$pageStartValue = pageStartValue?.reference ?? _$jni.jNullReference; - _setPageStart(reference.pointer, _id_setPageStart as _$jni.JMethodIDPtr, + final _$pageStartValue = pageStartValue?.reference ?? jni$_.jNullReference; + _setPageStart(reference.pointer, _id_setPageStart as jni$_.JMethodIDPtr, _$pageStartValue.pointer) .check(); } @@ -1202,16 +1202,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getPageEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getPageEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getPageEnd()` @@ -1219,9 +1219,9 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the end of a page. ///@return the page end string - _$jni.JString? getPageEnd() { - return _getPageEnd(reference.pointer, _id_getPageEnd as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getPageEnd() { + return _getPageEnd(reference.pointer, _id_getPageEnd as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setPageEnd = _class.instanceMethodId( @@ -1229,26 +1229,26 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setPageEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setPageEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setPageEnd(java.lang.String pageEndValue)` /// /// Sets the string which will be used at the end of a page. ///@param pageEndValue the page end string void setPageEnd( - _$jni.JString? pageEndValue, + jni$_.JString? pageEndValue, ) { - final _$pageEndValue = pageEndValue?.reference ?? _$jni.jNullReference; - _setPageEnd(reference.pointer, _id_setPageEnd as _$jni.JMethodIDPtr, + final _$pageEndValue = pageEndValue?.reference ?? jni$_.jNullReference; + _setPageEnd(reference.pointer, _id_setPageEnd as jni$_.JMethodIDPtr, _$pageEndValue.pointer) .check(); } @@ -1258,16 +1258,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getArticleStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getArticleStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getArticleStart()` @@ -1275,10 +1275,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the beginning of an article. ///@return the article start string - _$jni.JString? getArticleStart() { + jni$_.JString? getArticleStart() { return _getArticleStart( - reference.pointer, _id_getArticleStart as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getArticleStart as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setArticleStart = _class.instanceMethodId( @@ -1286,29 +1286,29 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setArticleStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setArticleStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setArticleStart(java.lang.String articleStartValue)` /// /// Sets the string which will be used at the beginning of an article. ///@param articleStartValue the article start string void setArticleStart( - _$jni.JString? articleStartValue, + jni$_.JString? articleStartValue, ) { final _$articleStartValue = - articleStartValue?.reference ?? _$jni.jNullReference; + articleStartValue?.reference ?? jni$_.jNullReference; _setArticleStart( reference.pointer, - _id_setArticleStart as _$jni.JMethodIDPtr, + _id_setArticleStart as jni$_.JMethodIDPtr, _$articleStartValue.pointer) .check(); } @@ -1318,16 +1318,16 @@ class PDFTextStripper extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getArticleEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getArticleEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getArticleEnd()` @@ -1335,10 +1335,10 @@ class PDFTextStripper extends _$jni.JObject { /// /// Returns the string which will be used at the end of an article. ///@return the article end string - _$jni.JString? getArticleEnd() { + jni$_.JString? getArticleEnd() { return _getArticleEnd( - reference.pointer, _id_getArticleEnd as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getArticleEnd as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setArticleEnd = _class.instanceMethodId( @@ -1346,101 +1346,101 @@ class PDFTextStripper extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setArticleEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setArticleEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setArticleEnd(java.lang.String articleEndValue)` /// /// Sets the string which will be used at the end of an article. ///@param articleEndValue the article end string void setArticleEnd( - _$jni.JString? articleEndValue, + jni$_.JString? articleEndValue, ) { final _$articleEndValue = - articleEndValue?.reference ?? _$jni.jNullReference; - _setArticleEnd(reference.pointer, _id_setArticleEnd as _$jni.JMethodIDPtr, + articleEndValue?.reference ?? jni$_.jNullReference; + _setArticleEnd(reference.pointer, _id_setArticleEnd as jni$_.JMethodIDPtr, _$articleEndValue.pointer) .check(); } } final class $PDFTextStripper$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $PDFTextStripper$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lorg/apache/pdfbox/text/PDFTextStripper;'; - @_$jni.internal - @_$core.override - PDFTextStripper? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + PDFTextStripper? fromReference(jni$_.JReference reference) => reference.isNull ? null : PDFTextStripper.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($PDFTextStripper$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($PDFTextStripper$NullableType) && other is $PDFTextStripper$NullableType; } } -final class $PDFTextStripper$Type extends _$jni.JObjType { - @_$jni.internal +final class $PDFTextStripper$Type extends jni$_.JObjType { + @jni$_.internal const $PDFTextStripper$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lorg/apache/pdfbox/text/PDFTextStripper;'; - @_$jni.internal - @_$core.override - PDFTextStripper fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + PDFTextStripper fromReference(jni$_.JReference reference) => PDFTextStripper.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $PDFTextStripper$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($PDFTextStripper$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($PDFTextStripper$Type) && other is $PDFTextStripper$Type; diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index 97f73a861..afa9d7363 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart @@ -14,8 +14,8 @@ import 'resolver.dart'; import 'visitor.dart'; // Import prefixes. -const _jni = '_\$jni'; -const _core = '_\$core'; +const _jni = r'jni$_'; +const _core = r'core$_'; // dart:core types const _override = '@$_core.override'; diff --git a/pkgs/jnigen/lib/src/bindings/resolver.dart b/pkgs/jnigen/lib/src/bindings/resolver.dart index a6805237c..25ba34ded 100644 --- a/pkgs/jnigen/lib/src/bindings/resolver.dart +++ b/pkgs/jnigen/lib/src/bindings/resolver.dart @@ -22,7 +22,10 @@ class Resolver { final List _importStrings = []; final Set _relativeImportedClasses = {}; - final Map _importedNameToClass = {}; + final Map _importedNameToClass = { + r'_$core': '', + r'_$jni': '', + }; final Map _classToImportedName = {}; Resolver({ @@ -51,7 +54,7 @@ class Resolver { /// Get the prefix for the class String resolvePrefix(ClassDecl classDecl) { if (classDecl.path == 'package:jni/jni.dart') { - return '_\$jni.'; + return r'jni$_.'; } final binaryName = classDecl.binaryName; final target = getFileClassName(binaryName); @@ -83,18 +86,14 @@ class Resolver { } final pkgName = cutFromLast(target, '.')[1].toLowerCase(); - if (pkgName.isEmpty) { - throw UnsupportedError('No package could be deduced from ' - 'qualified binaryName'); - } // We always name imports with an underscore suffix, so that they can be // never shadowed by a parameter or local variable. - var importedName = '${pkgName}_'; + var importedName = '$pkgName\$_'; var suffix = 0; while (_importedNameToClass.containsKey(importedName)) { - suffix++; - importedName = '$pkgName${suffix}_'; + ++suffix; + importedName = '$pkgName\$_$suffix'; } _importedNameToClass[importedName] = target; diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart index dbcb9aeb3..a9b078db9 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -47,30 +47,30 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; -import 'JsonParser.dart' as jsonparser_; +import 'JsonParser.dart' as jsonparser$_; /// from: `com.fasterxml.jackson.core.JsonFactory$Feature` /// /// Enumeration that defines all on/off features that can only be /// changed for JsonFactory. -class JsonFactory_Feature extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonFactory_Feature extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonFactory_Feature.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory$Feature'); + jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory$Feature'); /// The type which includes information such as the signature of this class. static const nullableType = $JsonFactory_Feature$NullableType(); @@ -80,24 +80,24 @@ class JsonFactory_Feature extends _$jni.JObject { r'()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType( + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( $JsonFactory_Feature$NullableType())); } @@ -106,24 +106,24 @@ class JsonFactory_Feature extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonFactory_Feature? valueOf( - _$jni.JString? name, + jni$_.JString? name, ) { - final _$name = name?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$name = name?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) .object( const $JsonFactory_Feature$NullableType()); @@ -134,16 +134,16 @@ class JsonFactory_Feature extends _$jni.JObject { r'()I', ); - static final _collectDefaults = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _collectDefaults = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public int collectDefaults()` @@ -153,7 +153,7 @@ class JsonFactory_Feature extends _$jni.JObject { ///@return Bit field of features enabled by default static int collectDefaults() { return _collectDefaults( - _class.reference.pointer, _id_collectDefaults as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_collectDefaults as jni$_.JMethodIDPtr) .integer; } @@ -162,22 +162,22 @@ class JsonFactory_Feature extends _$jni.JObject { r'()Z', ); - static final _enabledByDefault = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _enabledByDefault = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean enabledByDefault()` bool enabledByDefault() { return _enabledByDefault( - reference.pointer, _id_enabledByDefault as _$jni.JMethodIDPtr) + reference.pointer, _id_enabledByDefault as jni$_.JMethodIDPtr) .boolean; } @@ -186,23 +186,23 @@ class JsonFactory_Feature extends _$jni.JObject { r'(I)Z', ); - static final _enabledIn = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _enabledIn = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public boolean enabledIn(int flags)` bool enabledIn( int flags, ) { return _enabledIn( - reference.pointer, _id_enabledIn as _$jni.JMethodIDPtr, flags) + reference.pointer, _id_enabledIn as jni$_.JMethodIDPtr, flags) .boolean; } @@ -211,58 +211,58 @@ class JsonFactory_Feature extends _$jni.JObject { r'()I', ); - static final _getMask = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getMask = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getMask()` int getMask() { - return _getMask(reference.pointer, _id_getMask as _$jni.JMethodIDPtr) + return _getMask(reference.pointer, _id_getMask as jni$_.JMethodIDPtr) .integer; } } final class $JsonFactory_Feature$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonFactory_Feature$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;'; - @_$jni.internal - @_$core.override - JsonFactory_Feature? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonFactory_Feature? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonFactory_Feature.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonFactory_Feature$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonFactory_Feature$NullableType) && other is $JsonFactory_Feature$NullableType; @@ -270,37 +270,37 @@ final class $JsonFactory_Feature$NullableType } final class $JsonFactory_Feature$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonFactory_Feature$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;'; - @_$jni.internal - @_$core.override - JsonFactory_Feature fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonFactory_Feature fromReference(jni$_.JReference reference) => JsonFactory_Feature.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonFactory_Feature$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonFactory_Feature$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonFactory_Feature$Type) && other is $JsonFactory_Feature$Type; @@ -326,19 +326,19 @@ final class $JsonFactory_Feature$Type /// the default constructor is used for constructing factory /// instances. ///@author Tatu Saloranta -class JsonFactory extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonFactory extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonFactory.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory'); + jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory'); /// The type which includes information such as the signature of this class. static const nullableType = $JsonFactory$NullableType(); @@ -353,8 +353,8 @@ class JsonFactory extends _$jni.JObject { /// /// Name used to identify JSON format /// (and returned by \#getFormatName() - static _$jni.JString? get FORMAT_NAME_JSON => - _id_FORMAT_NAME_JSON.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get FORMAT_NAME_JSON => + _id_FORMAT_NAME_JSON.get(_class, const jni$_.JStringNullableType()); static final _id_DEFAULT_ROOT_VALUE_SEPARATOR = _class.staticFieldId( r'DEFAULT_ROOT_VALUE_SEPARATOR', @@ -363,9 +363,9 @@ class JsonFactory extends _$jni.JObject { /// from: `static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject? get DEFAULT_ROOT_VALUE_SEPARATOR => + static jni$_.JObject? get DEFAULT_ROOT_VALUE_SEPARATOR => _id_DEFAULT_ROOT_VALUE_SEPARATOR.get( - _class, const _$jni.JObjectNullableType()); + _class, const jni$_.JObjectNullableType()); /// from: `static public final char DEFAULT_QUOTE_CHAR` /// @@ -375,16 +375,16 @@ class JsonFactory extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` @@ -400,7 +400,7 @@ class JsonFactory extends _$jni.JObject { /// factory instance. factory JsonFactory() { return JsonFactory.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -408,25 +408,25 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/ObjectCodec;)V', ); - static final _new$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (com.fasterxml.jackson.core.ObjectCodec oc)` /// The returned object must be released after use, by calling the [release] method. factory JsonFactory.new$1( - _$jni.JObject? oc, + jni$_.JObject? oc, ) { - final _$oc = oc?.reference ?? _$jni.jNullReference; + final _$oc = oc?.reference ?? jni$_.jNullReference; return JsonFactory.fromReference(_new$1(_class.reference.pointer, - _id_new$1 as _$jni.JMethodIDPtr, _$oc.pointer) + _id_new$1 as jni$_.JMethodIDPtr, _$oc.pointer) .reference); } @@ -434,16 +434,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactoryBuilder;)V', ); - static final _new$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (com.fasterxml.jackson.core.JsonFactoryBuilder b)` /// The returned object must be released after use, by calling the [release] method. @@ -452,11 +452,11 @@ class JsonFactory extends _$jni.JObject { ///@param b Builder that contains settings to use ///@since 2.10 factory JsonFactory.new$2( - _$jni.JObject? b, + jni$_.JObject? b, ) { - final _$b = b?.reference ?? _$jni.jNullReference; + final _$b = b?.reference ?? jni$_.jNullReference; return JsonFactory.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, _$b.pointer) + _id_new$2 as jni$_.JMethodIDPtr, _$b.pointer) .reference); } @@ -465,16 +465,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/TSFBuilder;', ); - static final _rebuild = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _rebuild = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.TSFBuilder rebuild()` @@ -484,9 +484,9 @@ class JsonFactory extends _$jni.JObject { /// with settings of this factory. ///@return Builder instance to use ///@since 2.10 - _$jni.JObject? rebuild() { - return _rebuild(reference.pointer, _id_rebuild as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? rebuild() { + return _rebuild(reference.pointer, _id_rebuild as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_builder = _class.staticMethodId( @@ -494,16 +494,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/TSFBuilder;', ); - static final _builder = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _builder = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.TSFBuilder builder()` @@ -517,9 +517,9 @@ class JsonFactory extends _$jni.JObject { /// NOTE: signature unfortunately does not expose true implementation type; this /// will be fixed in 3.0. ///@return Builder instance to use - static _$jni.JObject? builder() { - return _builder(_class.reference.pointer, _id_builder as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + static jni$_.JObject? builder() { + return _builder(_class.reference.pointer, _id_builder as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_copy = _class.instanceMethodId( @@ -527,16 +527,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _copy = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _copy = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonFactory copy()` @@ -555,7 +555,7 @@ class JsonFactory extends _$jni.JObject { ///@return Copy of this factory instance ///@since 2.1 JsonFactory? copy() { - return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr) + return _copy(reference.pointer, _id_copy as jni$_.JMethodIDPtr) .object(const $JsonFactory$NullableType()); } @@ -564,16 +564,16 @@ class JsonFactory extends _$jni.JObject { r'()Z', ); - static final _requiresPropertyOrdering = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _requiresPropertyOrdering = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean requiresPropertyOrdering()` @@ -594,7 +594,7 @@ class JsonFactory extends _$jni.JObject { ///@since 2.3 bool requiresPropertyOrdering() { return _requiresPropertyOrdering(reference.pointer, - _id_requiresPropertyOrdering as _$jni.JMethodIDPtr) + _id_requiresPropertyOrdering as jni$_.JMethodIDPtr) .boolean; } @@ -603,16 +603,16 @@ class JsonFactory extends _$jni.JObject { r'()Z', ); - static final _canHandleBinaryNatively = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _canHandleBinaryNatively = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean canHandleBinaryNatively()` @@ -630,7 +630,7 @@ class JsonFactory extends _$jni.JObject { ///@since 2.3 bool canHandleBinaryNatively() { return _canHandleBinaryNatively(reference.pointer, - _id_canHandleBinaryNatively as _$jni.JMethodIDPtr) + _id_canHandleBinaryNatively as jni$_.JMethodIDPtr) .boolean; } @@ -639,16 +639,16 @@ class JsonFactory extends _$jni.JObject { r'()Z', ); - static final _canUseCharArrays = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _canUseCharArrays = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean canUseCharArrays()` @@ -666,7 +666,7 @@ class JsonFactory extends _$jni.JObject { ///@since 2.4 bool canUseCharArrays() { return _canUseCharArrays( - reference.pointer, _id_canUseCharArrays as _$jni.JMethodIDPtr) + reference.pointer, _id_canUseCharArrays as jni$_.JMethodIDPtr) .boolean; } @@ -675,16 +675,16 @@ class JsonFactory extends _$jni.JObject { r'()Z', ); - static final _canParseAsync = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _canParseAsync = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean canParseAsync()` @@ -698,7 +698,7 @@ class JsonFactory extends _$jni.JObject { ///@since 2.9 bool canParseAsync() { return _canParseAsync( - reference.pointer, _id_canParseAsync as _$jni.JMethodIDPtr) + reference.pointer, _id_canParseAsync as jni$_.JMethodIDPtr) .boolean; } @@ -707,24 +707,24 @@ class JsonFactory extends _$jni.JObject { r'()Ljava/lang/Class;', ); - static final _getFormatReadFeatureType = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFormatReadFeatureType = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Class getFormatReadFeatureType()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? getFormatReadFeatureType() { + jni$_.JObject? getFormatReadFeatureType() { return _getFormatReadFeatureType(reference.pointer, - _id_getFormatReadFeatureType as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getFormatReadFeatureType as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getFormatWriteFeatureType = _class.instanceMethodId( @@ -732,24 +732,24 @@ class JsonFactory extends _$jni.JObject { r'()Ljava/lang/Class;', ); - static final _getFormatWriteFeatureType = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFormatWriteFeatureType = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Class getFormatWriteFeatureType()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? getFormatWriteFeatureType() { + jni$_.JObject? getFormatWriteFeatureType() { return _getFormatWriteFeatureType(reference.pointer, - _id_getFormatWriteFeatureType as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getFormatWriteFeatureType as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_canUseSchema = _class.instanceMethodId( @@ -757,16 +757,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/FormatSchema;)Z', ); - static final _canUseSchema = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _canUseSchema = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)` /// @@ -780,11 +780,11 @@ class JsonFactory extends _$jni.JObject { ///@return Whether parsers and generators constructed by this factory /// can use specified format schema instance bool canUseSchema( - _$jni.JObject? schema, + jni$_.JObject? schema, ) { - final _$schema = schema?.reference ?? _$jni.jNullReference; + final _$schema = schema?.reference ?? jni$_.jNullReference; return _canUseSchema(reference.pointer, - _id_canUseSchema as _$jni.JMethodIDPtr, _$schema.pointer) + _id_canUseSchema as jni$_.JMethodIDPtr, _$schema.pointer) .boolean; } @@ -793,16 +793,16 @@ class JsonFactory extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getFormatName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFormatName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getFormatName()` @@ -814,10 +814,10 @@ class JsonFactory extends _$jni.JObject { /// Note: sub-classes should override this method; default /// implementation will return null for all sub-classes ///@return Name of the format handled by parsers, generators this factory creates - _$jni.JString? getFormatName() { + jni$_.JString? getFormatName() { return _getFormatName( - reference.pointer, _id_getFormatName as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getFormatName as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_hasFormat = _class.instanceMethodId( @@ -825,26 +825,26 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/format/InputAccessor;)Lcom/fasterxml/jackson/core/format/MatchStrength;', ); - static final _hasFormat = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _hasFormat = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? hasFormat( - _$jni.JObject? acc, + jni$_.JObject? hasFormat( + jni$_.JObject? acc, ) { - final _$acc = acc?.reference ?? _$jni.jNullReference; - return _hasFormat(reference.pointer, _id_hasFormat as _$jni.JMethodIDPtr, + final _$acc = acc?.reference ?? jni$_.jNullReference; + return _hasFormat(reference.pointer, _id_hasFormat as jni$_.JMethodIDPtr, _$acc.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_requiresCustomCodec = _class.instanceMethodId( @@ -852,16 +852,16 @@ class JsonFactory extends _$jni.JObject { r'()Z', ); - static final _requiresCustomCodec = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _requiresCustomCodec = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean requiresCustomCodec()` @@ -877,7 +877,7 @@ class JsonFactory extends _$jni.JObject { ///@since 2.1 bool requiresCustomCodec() { return _requiresCustomCodec( - reference.pointer, _id_requiresCustomCodec as _$jni.JMethodIDPtr) + reference.pointer, _id_requiresCustomCodec as jni$_.JMethodIDPtr) .boolean; } @@ -886,23 +886,23 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/Version;', ); - static final _version = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _version = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.Version version()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? version() { - return _version(reference.pointer, _id_version as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? version() { + return _version(reference.pointer, _id_version as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_configure = _class.instanceMethodId( @@ -910,17 +910,17 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _configure = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _configure = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -935,8 +935,8 @@ class JsonFactory extends _$jni.JObject { JsonFactory_Feature? f, bool state, ) { - final _$f = f?.reference ?? _$jni.jNullReference; - return _configure(reference.pointer, _id_configure as _$jni.JMethodIDPtr, + final _$f = f?.reference ?? jni$_.jNullReference; + return _configure(reference.pointer, _id_configure as jni$_.JMethodIDPtr, _$f.pointer, state ? 1 : 0) .object(const $JsonFactory$NullableType()); } @@ -946,16 +946,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _enable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _enable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -968,9 +968,9 @@ class JsonFactory extends _$jni.JObject { JsonFactory? enable( JsonFactory_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _enable( - reference.pointer, _id_enable as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_enable as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonFactory$NullableType()); } @@ -979,16 +979,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _disable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _disable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1001,9 +1001,9 @@ class JsonFactory extends _$jni.JObject { JsonFactory? disable( JsonFactory_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _disable( - reference.pointer, _id_disable as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_disable as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonFactory$NullableType()); } @@ -1012,16 +1012,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Z', ); - static final _isEnabled = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonFactory.Feature f)` /// @@ -1031,9 +1031,9 @@ class JsonFactory extends _$jni.JObject { bool isEnabled( JsonFactory_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled( - reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_isEnabled as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1042,22 +1042,22 @@ class JsonFactory extends _$jni.JObject { r'()I', ); - static final _getParserFeatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getParserFeatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final int getParserFeatures()` int getParserFeatures() { return _getParserFeatures( - reference.pointer, _id_getParserFeatures as _$jni.JMethodIDPtr) + reference.pointer, _id_getParserFeatures as jni$_.JMethodIDPtr) .integer; } @@ -1066,22 +1066,22 @@ class JsonFactory extends _$jni.JObject { r'()I', ); - static final _getGeneratorFeatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getGeneratorFeatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final int getGeneratorFeatures()` int getGeneratorFeatures() { return _getGeneratorFeatures( - reference.pointer, _id_getGeneratorFeatures as _$jni.JMethodIDPtr) + reference.pointer, _id_getGeneratorFeatures as jni$_.JMethodIDPtr) .integer; } @@ -1090,22 +1090,22 @@ class JsonFactory extends _$jni.JObject { r'()I', ); - static final _getFormatParserFeatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFormatParserFeatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getFormatParserFeatures()` int getFormatParserFeatures() { return _getFormatParserFeatures(reference.pointer, - _id_getFormatParserFeatures as _$jni.JMethodIDPtr) + _id_getFormatParserFeatures as jni$_.JMethodIDPtr) .integer; } @@ -1115,22 +1115,22 @@ class JsonFactory extends _$jni.JObject { ); static final _getFormatGeneratorFeatures = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getFormatGeneratorFeatures()` int getFormatGeneratorFeatures() { return _getFormatGeneratorFeatures(reference.pointer, - _id_getFormatGeneratorFeatures as _$jni.JMethodIDPtr) + _id_getFormatGeneratorFeatures as jni$_.JMethodIDPtr) .integer; } @@ -1139,17 +1139,17 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _configure$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _configure$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -1160,12 +1160,12 @@ class JsonFactory extends _$jni.JObject { ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) JsonFactory? configure$1( - jsonparser_.JsonParser_Feature? f, + jsonparser$_.JsonParser_Feature? f, bool state, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _configure$1(reference.pointer, - _id_configure$1 as _$jni.JMethodIDPtr, _$f.pointer, state ? 1 : 0) + _id_configure$1 as jni$_.JMethodIDPtr, _$f.pointer, state ? 1 : 0) .object(const $JsonFactory$NullableType()); } @@ -1174,16 +1174,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _enable$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _enable$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1193,11 +1193,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to enable ///@return This factory instance (to allow call chaining) JsonFactory? enable$1( - jsonparser_.JsonParser_Feature? f, + jsonparser$_.JsonParser_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _enable$1( - reference.pointer, _id_enable$1 as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_enable$1 as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonFactory$NullableType()); } @@ -1206,16 +1206,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _disable$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _disable$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1225,11 +1225,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to disable ///@return This factory instance (to allow call chaining) JsonFactory? disable$1( - jsonparser_.JsonParser_Feature? f, + jsonparser$_.JsonParser_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _disable$1( - reference.pointer, _id_disable$1 as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_disable$1 as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonFactory$NullableType()); } @@ -1238,16 +1238,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Z', ); - static final _isEnabled$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)` /// @@ -1255,11 +1255,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to check ///@return True if specified feature is enabled bool isEnabled$1( - jsonparser_.JsonParser_Feature? f, + jsonparser$_.JsonParser_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled$1(reference.pointer, - _id_isEnabled$1 as _$jni.JMethodIDPtr, _$f.pointer) + _id_isEnabled$1 as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1268,16 +1268,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/StreamReadFeature;)Z', ); - static final _isEnabled$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.StreamReadFeature f)` /// @@ -1286,11 +1286,11 @@ class JsonFactory extends _$jni.JObject { ///@return True if specified feature is enabled ///@since 2.10 bool isEnabled$2( - _$jni.JObject? f, + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled$2(reference.pointer, - _id_isEnabled$2 as _$jni.JMethodIDPtr, _$f.pointer) + _id_isEnabled$2 as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1299,16 +1299,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/io/InputDecorator;', ); - static final _getInputDecorator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getInputDecorator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.io.InputDecorator getInputDecorator()` @@ -1317,10 +1317,10 @@ class JsonFactory extends _$jni.JObject { /// Method for getting currently configured input decorator (if any; /// there is no default decorator). ///@return InputDecorator configured, if any - _$jni.JObject? getInputDecorator() { + jni$_.JObject? getInputDecorator() { return _getInputDecorator( - reference.pointer, _id_getInputDecorator as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getInputDecorator as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setInputDecorator = _class.instanceMethodId( @@ -1328,16 +1328,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/io/InputDecorator;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setInputDecorator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setInputDecorator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setInputDecorator(com.fasterxml.jackson.core.io.InputDecorator d)` /// The returned object must be released after use, by calling the [release] method. @@ -1347,11 +1347,11 @@ class JsonFactory extends _$jni.JObject { ///@return This factory instance (to allow call chaining) ///@deprecated Since 2.10 use JsonFactoryBuilder\#inputDecorator(InputDecorator) instead JsonFactory? setInputDecorator( - _$jni.JObject? d, + jni$_.JObject? d, ) { - final _$d = d?.reference ?? _$jni.jNullReference; + final _$d = d?.reference ?? jni$_.jNullReference; return _setInputDecorator(reference.pointer, - _id_setInputDecorator as _$jni.JMethodIDPtr, _$d.pointer) + _id_setInputDecorator as jni$_.JMethodIDPtr, _$d.pointer) .object(const $JsonFactory$NullableType()); } @@ -1360,17 +1360,17 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _configure$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _configure$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -1381,12 +1381,12 @@ class JsonFactory extends _$jni.JObject { ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) JsonFactory? configure$2( - _$jni.JObject? f, + jni$_.JObject? f, bool state, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _configure$2(reference.pointer, - _id_configure$2 as _$jni.JMethodIDPtr, _$f.pointer, state ? 1 : 0) + _id_configure$2 as jni$_.JMethodIDPtr, _$f.pointer, state ? 1 : 0) .object(const $JsonFactory$NullableType()); } @@ -1395,16 +1395,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _enable$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _enable$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1414,11 +1414,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to enable ///@return This factory instance (to allow call chaining) JsonFactory? enable$2( - _$jni.JObject? f, + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _enable$2( - reference.pointer, _id_enable$2 as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_enable$2 as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonFactory$NullableType()); } @@ -1427,16 +1427,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _disable$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _disable$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1446,11 +1446,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to disable ///@return This factory instance (to allow call chaining) JsonFactory? disable$2( - _$jni.JObject? f, + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _disable$2( - reference.pointer, _id_disable$2 as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_disable$2 as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonFactory$NullableType()); } @@ -1459,16 +1459,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Z', ); - static final _isEnabled$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator.Feature f)` /// @@ -1476,11 +1476,11 @@ class JsonFactory extends _$jni.JObject { ///@param f Feature to check ///@return Whether specified feature is enabled bool isEnabled$3( - _$jni.JObject? f, + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled$3(reference.pointer, - _id_isEnabled$3 as _$jni.JMethodIDPtr, _$f.pointer) + _id_isEnabled$3 as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1489,16 +1489,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/StreamWriteFeature;)Z', ); - static final _isEnabled$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.StreamWriteFeature f)` /// @@ -1507,11 +1507,11 @@ class JsonFactory extends _$jni.JObject { ///@return Whether specified feature is enabled ///@since 2.10 bool isEnabled$4( - _$jni.JObject? f, + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled$4(reference.pointer, - _id_isEnabled$4 as _$jni.JMethodIDPtr, _$f.pointer) + _id_isEnabled$4 as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1520,16 +1520,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/io/CharacterEscapes;', ); - static final _getCharacterEscapes = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCharacterEscapes = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.io.CharacterEscapes getCharacterEscapes()` @@ -1538,10 +1538,10 @@ class JsonFactory extends _$jni.JObject { /// Method for accessing custom escapes factory uses for JsonGenerators /// it creates. ///@return Configured {@code CharacterEscapes}, if any; {@code null} if none - _$jni.JObject? getCharacterEscapes() { + jni$_.JObject? getCharacterEscapes() { return _getCharacterEscapes( - reference.pointer, _id_getCharacterEscapes as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getCharacterEscapes as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setCharacterEscapes = _class.instanceMethodId( @@ -1549,16 +1549,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/io/CharacterEscapes;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setCharacterEscapes = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCharacterEscapes = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setCharacterEscapes(com.fasterxml.jackson.core.io.CharacterEscapes esc)` /// The returned object must be released after use, by calling the [release] method. @@ -1568,11 +1568,11 @@ class JsonFactory extends _$jni.JObject { ///@param esc CharaterEscapes to set (or {@code null} for "none") ///@return This factory instance (to allow call chaining) JsonFactory? setCharacterEscapes( - _$jni.JObject? esc, + jni$_.JObject? esc, ) { - final _$esc = esc?.reference ?? _$jni.jNullReference; + final _$esc = esc?.reference ?? jni$_.jNullReference; return _setCharacterEscapes(reference.pointer, - _id_setCharacterEscapes as _$jni.JMethodIDPtr, _$esc.pointer) + _id_setCharacterEscapes as jni$_.JMethodIDPtr, _$esc.pointer) .object(const $JsonFactory$NullableType()); } @@ -1581,16 +1581,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/io/OutputDecorator;', ); - static final _getOutputDecorator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getOutputDecorator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.io.OutputDecorator getOutputDecorator()` @@ -1600,10 +1600,10 @@ class JsonFactory extends _$jni.JObject { /// there is no default decorator). ///@return OutputDecorator configured for generators factory creates, if any; /// {@code null} if none. - _$jni.JObject? getOutputDecorator() { + jni$_.JObject? getOutputDecorator() { return _getOutputDecorator( - reference.pointer, _id_getOutputDecorator as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getOutputDecorator as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setOutputDecorator = _class.instanceMethodId( @@ -1611,16 +1611,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/io/OutputDecorator;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setOutputDecorator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setOutputDecorator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setOutputDecorator(com.fasterxml.jackson.core.io.OutputDecorator d)` /// The returned object must be released after use, by calling the [release] method. @@ -1630,11 +1630,11 @@ class JsonFactory extends _$jni.JObject { ///@param d Output decorator to use, if any ///@deprecated Since 2.10 use JsonFactoryBuilder\#outputDecorator(OutputDecorator) instead JsonFactory? setOutputDecorator( - _$jni.JObject? d, + jni$_.JObject? d, ) { - final _$d = d?.reference ?? _$jni.jNullReference; + final _$d = d?.reference ?? jni$_.jNullReference; return _setOutputDecorator(reference.pointer, - _id_setOutputDecorator as _$jni.JMethodIDPtr, _$d.pointer) + _id_setOutputDecorator as jni$_.JMethodIDPtr, _$d.pointer) .object(const $JsonFactory$NullableType()); } @@ -1643,16 +1643,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setRootValueSeparator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setRootValueSeparator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setRootValueSeparator(java.lang.String sep)` /// The returned object must be released after use, by calling the [release] method. @@ -1663,11 +1663,11 @@ class JsonFactory extends _$jni.JObject { /// automatically added ///@return This factory instance (to allow call chaining) JsonFactory? setRootValueSeparator( - _$jni.JString? sep, + jni$_.JString? sep, ) { - final _$sep = sep?.reference ?? _$jni.jNullReference; + final _$sep = sep?.reference ?? jni$_.jNullReference; return _setRootValueSeparator(reference.pointer, - _id_setRootValueSeparator as _$jni.JMethodIDPtr, _$sep.pointer) + _id_setRootValueSeparator as jni$_.JMethodIDPtr, _$sep.pointer) .object(const $JsonFactory$NullableType()); } @@ -1676,26 +1676,26 @@ class JsonFactory extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getRootValueSeparator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getRootValueSeparator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getRootValueSeparator()` /// The returned object must be released after use, by calling the [release] method. /// /// @return Root value separator configured, if any - _$jni.JString? getRootValueSeparator() { + jni$_.JString? getRootValueSeparator() { return _getRootValueSeparator( - reference.pointer, _id_getRootValueSeparator as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getRootValueSeparator as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setCodec = _class.instanceMethodId( @@ -1703,16 +1703,16 @@ class JsonFactory extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/ObjectCodec;)Lcom/fasterxml/jackson/core/JsonFactory;', ); - static final _setCodec = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCodec = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonFactory setCodec(com.fasterxml.jackson.core.ObjectCodec oc)` /// The returned object must be released after use, by calling the [release] method. @@ -1725,11 +1725,11 @@ class JsonFactory extends _$jni.JObject { ///@param oc Codec to use ///@return This factory instance (to allow call chaining) JsonFactory? setCodec( - _$jni.JObject? oc, + jni$_.JObject? oc, ) { - final _$oc = oc?.reference ?? _$jni.jNullReference; + final _$oc = oc?.reference ?? jni$_.jNullReference; return _setCodec( - reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, _$oc.pointer) + reference.pointer, _id_setCodec as jni$_.JMethodIDPtr, _$oc.pointer) .object(const $JsonFactory$NullableType()); } @@ -1738,23 +1738,23 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/ObjectCodec;', ); - static final _getCodec = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCodec = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.ObjectCodec getCodec()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? getCodec() { - return _getCodec(reference.pointer, _id_getCodec as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? getCodec() { + return _getCodec(reference.pointer, _id_getCodec as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_createParser = _class.instanceMethodId( @@ -1762,16 +1762,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.File f)` /// The returned object must be released after use, by calling the [release] method. @@ -1792,14 +1792,14 @@ class JsonFactory extends _$jni.JObject { /// the parser, since caller has no access to it. ///@param f File that contains JSON content to parse ///@since 2.1 - jsonparser_.JsonParser? createParser( - _$jni.JObject? f, + jsonparser$_.JsonParser? createParser( + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _createParser(reference.pointer, - _id_createParser as _$jni.JMethodIDPtr, _$f.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser as jni$_.JMethodIDPtr, _$f.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$1 = _class.instanceMethodId( @@ -1807,16 +1807,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.net.URL url)` /// The returned object must be released after use, by calling the [release] method. @@ -1835,14 +1835,14 @@ class JsonFactory extends _$jni.JObject { /// the parser, since caller has no access to it. ///@param url URL pointing to resource that contains JSON content to parse ///@since 2.1 - jsonparser_.JsonParser? createParser$1( - _$jni.JObject? url, + jsonparser$_.JsonParser? createParser$1( + jni$_.JObject? url, ) { - final _$url = url?.reference ?? _$jni.jNullReference; + final _$url = url?.reference ?? jni$_.jNullReference; return _createParser$1(reference.pointer, - _id_createParser$1 as _$jni.JMethodIDPtr, _$url.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$1 as jni$_.JMethodIDPtr, _$url.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$2 = _class.instanceMethodId( @@ -1850,16 +1850,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.InputStream in)` /// The returned object must be released after use, by calling the [release] method. @@ -1881,14 +1881,14 @@ class JsonFactory extends _$jni.JObject { /// For other charsets use \#createParser(java.io.Reader). ///@param in InputStream to use for reading JSON content to parse ///@since 2.1 - jsonparser_.JsonParser? createParser$2( - _$jni.JObject? in$, + jsonparser$_.JsonParser? createParser$2( + jni$_.JObject? in$, ) { - final _$in$ = in$?.reference ?? _$jni.jNullReference; + final _$in$ = in$?.reference ?? jni$_.jNullReference; return _createParser$2(reference.pointer, - _id_createParser$2 as _$jni.JMethodIDPtr, _$in$.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$2 as jni$_.JMethodIDPtr, _$in$.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$3 = _class.instanceMethodId( @@ -1896,16 +1896,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.Reader r)` /// The returned object must be released after use, by calling the [release] method. @@ -1920,14 +1920,14 @@ class JsonFactory extends _$jni.JObject { /// is enabled. ///@param r Reader to use for reading JSON content to parse ///@since 2.1 - jsonparser_.JsonParser? createParser$3( - _$jni.JObject? r, + jsonparser$_.JsonParser? createParser$3( + jni$_.JObject? r, ) { - final _$r = r?.reference ?? _$jni.jNullReference; + final _$r = r?.reference ?? jni$_.jNullReference; return _createParser$3(reference.pointer, - _id_createParser$3 as _$jni.JMethodIDPtr, _$r.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$3 as jni$_.JMethodIDPtr, _$r.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$4 = _class.instanceMethodId( @@ -1935,16 +1935,16 @@ class JsonFactory extends _$jni.JObject { r'([B)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(byte[] data)` /// The returned object must be released after use, by calling the [release] method. @@ -1952,14 +1952,14 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing parser for parsing /// the contents of given byte array. ///@since 2.1 - jsonparser_.JsonParser? createParser$4( - _$jni.JArray<_$jni.jbyte>? data, + jsonparser$_.JsonParser? createParser$4( + jni$_.JArray? data, ) { - final _$data = data?.reference ?? _$jni.jNullReference; + final _$data = data?.reference ?? jni$_.jNullReference; return _createParser$4(reference.pointer, - _id_createParser$4 as _$jni.JMethodIDPtr, _$data.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$4 as jni$_.JMethodIDPtr, _$data.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$5 = _class.instanceMethodId( @@ -1967,20 +1967,20 @@ class JsonFactory extends _$jni.JObject { r'([BII)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$5 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createParser$5 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(byte[] data, int offset, int len)` /// The returned object must be released after use, by calling the [release] method. @@ -1991,20 +1991,20 @@ class JsonFactory extends _$jni.JObject { ///@param offset Offset of the first data byte within buffer ///@param len Length of contents to parse within buffer ///@since 2.1 - jsonparser_.JsonParser? createParser$5( - _$jni.JArray<_$jni.jbyte>? data, + jsonparser$_.JsonParser? createParser$5( + jni$_.JArray? data, int offset, int len, ) { - final _$data = data?.reference ?? _$jni.jNullReference; + final _$data = data?.reference ?? jni$_.jNullReference; return _createParser$5( reference.pointer, - _id_createParser$5 as _$jni.JMethodIDPtr, + _id_createParser$5 as jni$_.JMethodIDPtr, _$data.pointer, offset, len) - .object( - const jsonparser_.$JsonParser$NullableType()); + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$6 = _class.instanceMethodId( @@ -2012,16 +2012,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$6 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$6 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.lang.String content)` /// The returned object must be released after use, by calling the [release] method. @@ -2029,14 +2029,14 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing parser for parsing /// contents of given String. ///@since 2.1 - jsonparser_.JsonParser? createParser$6( - _$jni.JString? content, + jsonparser$_.JsonParser? createParser$6( + jni$_.JString? content, ) { - final _$content = content?.reference ?? _$jni.jNullReference; + final _$content = content?.reference ?? jni$_.jNullReference; return _createParser$6(reference.pointer, - _id_createParser$6 as _$jni.JMethodIDPtr, _$content.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$6 as jni$_.JMethodIDPtr, _$content.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$7 = _class.instanceMethodId( @@ -2044,16 +2044,16 @@ class JsonFactory extends _$jni.JObject { r'([C)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$7 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$7 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(char[] content)` /// The returned object must be released after use, by calling the [release] method. @@ -2061,14 +2061,14 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing parser for parsing /// contents of given char array. ///@since 2.4 - jsonparser_.JsonParser? createParser$7( - _$jni.JArray<_$jni.jchar>? content, + jsonparser$_.JsonParser? createParser$7( + jni$_.JArray? content, ) { - final _$content = content?.reference ?? _$jni.jNullReference; + final _$content = content?.reference ?? jni$_.jNullReference; return _createParser$7(reference.pointer, - _id_createParser$7 as _$jni.JMethodIDPtr, _$content.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$7 as jni$_.JMethodIDPtr, _$content.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$8 = _class.instanceMethodId( @@ -2076,40 +2076,40 @@ class JsonFactory extends _$jni.JObject { r'([CII)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$8 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createParser$8 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(char[] content, int offset, int len)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing contents of given char array. ///@since 2.4 - jsonparser_.JsonParser? createParser$8( - _$jni.JArray<_$jni.jchar>? content, + jsonparser$_.JsonParser? createParser$8( + jni$_.JArray? content, int offset, int len, ) { - final _$content = content?.reference ?? _$jni.jNullReference; + final _$content = content?.reference ?? jni$_.jNullReference; return _createParser$8( reference.pointer, - _id_createParser$8 as _$jni.JMethodIDPtr, + _id_createParser$8 as jni$_.JMethodIDPtr, _$content.pointer, offset, len) - .object( - const jsonparser_.$JsonParser$NullableType()); + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createParser$9 = _class.instanceMethodId( @@ -2117,16 +2117,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/DataInput;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createParser$9 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createParser$9 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createParser(java.io.DataInput in)` /// The returned object must be released after use, by calling the [release] method. @@ -2137,14 +2137,14 @@ class JsonFactory extends _$jni.JObject { /// If this factory does not support DataInput as source, /// will throw UnsupportedOperationException ///@since 2.8 - jsonparser_.JsonParser? createParser$9( - _$jni.JObject? in$, + jsonparser$_.JsonParser? createParser$9( + jni$_.JObject? in$, ) { - final _$in$ = in$?.reference ?? _$jni.jNullReference; + final _$in$ = in$?.reference ?? jni$_.jNullReference; return _createParser$9(reference.pointer, - _id_createParser$9 as _$jni.JMethodIDPtr, _$in$.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createParser$9 as jni$_.JMethodIDPtr, _$in$.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createNonBlockingByteArrayParser = _class.instanceMethodId( @@ -2153,16 +2153,16 @@ class JsonFactory extends _$jni.JObject { ); static final _createNonBlockingByteArrayParser = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonParser createNonBlockingByteArrayParser()` @@ -2181,11 +2181,11 @@ class JsonFactory extends _$jni.JObject { /// (and US-ASCII since it is proper subset); other encodings are not supported /// at this point. ///@since 2.9 - jsonparser_.JsonParser? createNonBlockingByteArrayParser() { + jsonparser$_.JsonParser? createNonBlockingByteArrayParser() { return _createNonBlockingByteArrayParser(reference.pointer, - _id_createNonBlockingByteArrayParser as _$jni.JMethodIDPtr) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createNonBlockingByteArrayParser as jni$_.JMethodIDPtr) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createGenerator = _class.instanceMethodId( @@ -2193,22 +2193,22 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createGenerator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2231,18 +2231,18 @@ class JsonFactory extends _$jni.JObject { ///@param out OutputStream to use for writing JSON content ///@param enc Character encoding to use ///@since 2.1 - _$jni.JObject? createGenerator( - _$jni.JObject? out, - _$jni.JObject? enc, + jni$_.JObject? createGenerator( + jni$_.JObject? out, + jni$_.JObject? enc, ) { - final _$out = out?.reference ?? _$jni.jNullReference; - final _$enc = enc?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; + final _$enc = enc?.reference ?? jni$_.jNullReference; return _createGenerator( reference.pointer, - _id_createGenerator as _$jni.JMethodIDPtr, + _id_createGenerator as jni$_.JMethodIDPtr, _$out.pointer, _$enc.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_createGenerator$1 = _class.instanceMethodId( @@ -2250,16 +2250,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createGenerator$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out)` /// The returned object must be released after use, by calling the [release] method. @@ -2269,13 +2269,13 @@ class JsonFactory extends _$jni.JObject { /// /// Note: there are formats that use fixed encoding (like most binary data formats). ///@since 2.1 - _$jni.JObject? createGenerator$1( - _$jni.JObject? out, + jni$_.JObject? createGenerator$1( + jni$_.JObject? out, ) { - final _$out = out?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _createGenerator$1(reference.pointer, - _id_createGenerator$1 as _$jni.JMethodIDPtr, _$out.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_createGenerator$1 as jni$_.JMethodIDPtr, _$out.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_createGenerator$2 = _class.instanceMethodId( @@ -2283,16 +2283,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createGenerator$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.Writer w)` /// The returned object must be released after use, by calling the [release] method. @@ -2308,13 +2308,13 @@ class JsonFactory extends _$jni.JObject { /// Using application needs to close it explicitly. ///@since 2.1 ///@param w Writer to use for writing JSON content - _$jni.JObject? createGenerator$2( - _$jni.JObject? w, + jni$_.JObject? createGenerator$2( + jni$_.JObject? w, ) { - final _$w = w?.reference ?? _$jni.jNullReference; + final _$w = w?.reference ?? jni$_.jNullReference; return _createGenerator$2(reference.pointer, - _id_createGenerator$2 as _$jni.JMethodIDPtr, _$w.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_createGenerator$2 as jni$_.JMethodIDPtr, _$w.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_createGenerator$3 = _class.instanceMethodId( @@ -2322,22 +2322,22 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/File;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createGenerator$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.File f, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2354,18 +2354,18 @@ class JsonFactory extends _$jni.JObject { ///@param f File to write contents to ///@param enc Character encoding to use ///@since 2.1 - _$jni.JObject? createGenerator$3( - _$jni.JObject? f, - _$jni.JObject? enc, + jni$_.JObject? createGenerator$3( + jni$_.JObject? f, + jni$_.JObject? enc, ) { - final _$f = f?.reference ?? _$jni.jNullReference; - final _$enc = enc?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; + final _$enc = enc?.reference ?? jni$_.jNullReference; return _createGenerator$3( reference.pointer, - _id_createGenerator$3 as _$jni.JMethodIDPtr, + _id_createGenerator$3 as jni$_.JMethodIDPtr, _$f.pointer, _$enc.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_createGenerator$4 = _class.instanceMethodId( @@ -2373,22 +2373,22 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/DataOutput;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createGenerator$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2396,18 +2396,18 @@ class JsonFactory extends _$jni.JObject { /// Method for constructing generator for writing content using specified /// DataOutput instance. ///@since 2.8 - _$jni.JObject? createGenerator$4( - _$jni.JObject? out, - _$jni.JObject? enc, + jni$_.JObject? createGenerator$4( + jni$_.JObject? out, + jni$_.JObject? enc, ) { - final _$out = out?.reference ?? _$jni.jNullReference; - final _$enc = enc?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; + final _$enc = enc?.reference ?? jni$_.jNullReference; return _createGenerator$4( reference.pointer, - _id_createGenerator$4 as _$jni.JMethodIDPtr, + _id_createGenerator$4 as jni$_.JMethodIDPtr, _$out.pointer, _$enc.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_createGenerator$5 = _class.instanceMethodId( @@ -2415,16 +2415,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/DataOutput;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createGenerator$5 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createGenerator$5 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out)` /// The returned object must be released after use, by calling the [release] method. @@ -2434,13 +2434,13 @@ class JsonFactory extends _$jni.JObject { /// /// Note: there are formats that use fixed encoding (like most binary data formats). ///@since 2.8 - _$jni.JObject? createGenerator$5( - _$jni.JObject? out, + jni$_.JObject? createGenerator$5( + jni$_.JObject? out, ) { - final _$out = out?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _createGenerator$5(reference.pointer, - _id_createGenerator$5 as _$jni.JMethodIDPtr, _$out.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_createGenerator$5 as jni$_.JMethodIDPtr, _$out.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_createJsonParser = _class.instanceMethodId( @@ -2448,16 +2448,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonParser = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.File f)` /// The returned object must be released after use, by calling the [release] method. @@ -2480,14 +2480,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(File) instead. - jsonparser_.JsonParser? createJsonParser( - _$jni.JObject? f, + jsonparser$_.JsonParser? createJsonParser( + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _createJsonParser(reference.pointer, - _id_createJsonParser as _$jni.JMethodIDPtr, _$f.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createJsonParser as jni$_.JMethodIDPtr, _$f.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonParser$1 = _class.instanceMethodId( @@ -2495,16 +2495,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonParser$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.net.URL url)` /// The returned object must be released after use, by calling the [release] method. @@ -2526,14 +2526,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(URL) instead. - jsonparser_.JsonParser? createJsonParser$1( - _$jni.JObject? url, + jsonparser$_.JsonParser? createJsonParser$1( + jni$_.JObject? url, ) { - final _$url = url?.reference ?? _$jni.jNullReference; + final _$url = url?.reference ?? jni$_.jNullReference; return _createJsonParser$1(reference.pointer, - _id_createJsonParser$1 as _$jni.JMethodIDPtr, _$url.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createJsonParser$1 as jni$_.JMethodIDPtr, _$url.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonParser$2 = _class.instanceMethodId( @@ -2541,16 +2541,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonParser$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.InputStream in)` /// The returned object must be released after use, by calling the [release] method. @@ -2575,14 +2575,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(InputStream) instead. - jsonparser_.JsonParser? createJsonParser$2( - _$jni.JObject? in$, + jsonparser$_.JsonParser? createJsonParser$2( + jni$_.JObject? in$, ) { - final _$in$ = in$?.reference ?? _$jni.jNullReference; + final _$in$ = in$?.reference ?? jni$_.jNullReference; return _createJsonParser$2(reference.pointer, - _id_createJsonParser$2 as _$jni.JMethodIDPtr, _$in$.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createJsonParser$2 as jni$_.JMethodIDPtr, _$in$.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonParser$3 = _class.instanceMethodId( @@ -2590,16 +2590,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonParser$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.Reader r)` /// The returned object must be released after use, by calling the [release] method. @@ -2617,14 +2617,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(Reader) instead. - jsonparser_.JsonParser? createJsonParser$3( - _$jni.JObject? r, + jsonparser$_.JsonParser? createJsonParser$3( + jni$_.JObject? r, ) { - final _$r = r?.reference ?? _$jni.jNullReference; + final _$r = r?.reference ?? jni$_.jNullReference; return _createJsonParser$3(reference.pointer, - _id_createJsonParser$3 as _$jni.JMethodIDPtr, _$r.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createJsonParser$3 as jni$_.JMethodIDPtr, _$r.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonParser$4 = _class.instanceMethodId( @@ -2632,16 +2632,16 @@ class JsonFactory extends _$jni.JObject { r'([B)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonParser$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data)` /// The returned object must be released after use, by calling the [release] method. @@ -2652,14 +2652,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[]) instead. - jsonparser_.JsonParser? createJsonParser$4( - _$jni.JArray<_$jni.jbyte>? data, + jsonparser$_.JsonParser? createJsonParser$4( + jni$_.JArray? data, ) { - final _$data = data?.reference ?? _$jni.jNullReference; + final _$data = data?.reference ?? jni$_.jNullReference; return _createJsonParser$4(reference.pointer, - _id_createJsonParser$4 as _$jni.JMethodIDPtr, _$data.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createJsonParser$4 as jni$_.JMethodIDPtr, _$data.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonParser$5 = _class.instanceMethodId( @@ -2667,20 +2667,20 @@ class JsonFactory extends _$jni.JObject { r'([BII)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$5 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createJsonParser$5 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data, int offset, int len)` /// The returned object must be released after use, by calling the [release] method. @@ -2694,20 +2694,20 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[],int,int) instead. - jsonparser_.JsonParser? createJsonParser$5( - _$jni.JArray<_$jni.jbyte>? data, + jsonparser$_.JsonParser? createJsonParser$5( + jni$_.JArray? data, int offset, int len, ) { - final _$data = data?.reference ?? _$jni.jNullReference; + final _$data = data?.reference ?? jni$_.jNullReference; return _createJsonParser$5( reference.pointer, - _id_createJsonParser$5 as _$jni.JMethodIDPtr, + _id_createJsonParser$5 as jni$_.JMethodIDPtr, _$data.pointer, offset, len) - .object( - const jsonparser_.$JsonParser$NullableType()); + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonParser$6 = _class.instanceMethodId( @@ -2715,16 +2715,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _createJsonParser$6 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonParser$6 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser createJsonParser(java.lang.String content)` /// The returned object must be released after use, by calling the [release] method. @@ -2736,14 +2736,14 @@ class JsonFactory extends _$jni.JObject { ///@throws IOException if parser initialization fails due to I/O (read) problem ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(String) instead. - jsonparser_.JsonParser? createJsonParser$6( - _$jni.JString? content, + jsonparser$_.JsonParser? createJsonParser$6( + jni$_.JString? content, ) { - final _$content = content?.reference ?? _$jni.jNullReference; + final _$content = content?.reference ?? jni$_.jNullReference; return _createJsonParser$6(reference.pointer, - _id_createJsonParser$6 as _$jni.JMethodIDPtr, _$content.pointer) - .object( - const jsonparser_.$JsonParser$NullableType()); + _id_createJsonParser$6 as jni$_.JMethodIDPtr, _$content.pointer) + .object( + const jsonparser$_.$JsonParser$NullableType()); } static final _id_createJsonGenerator = _class.instanceMethodId( @@ -2751,22 +2751,22 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createJsonGenerator = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _createJsonGenerator = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc)` /// The returned object must be released after use, by calling the [release] method. @@ -2791,18 +2791,18 @@ class JsonFactory extends _$jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(OutputStream, JsonEncoding) instead. - _$jni.JObject? createJsonGenerator( - _$jni.JObject? out, - _$jni.JObject? enc, + jni$_.JObject? createJsonGenerator( + jni$_.JObject? out, + jni$_.JObject? enc, ) { - final _$out = out?.reference ?? _$jni.jNullReference; - final _$enc = enc?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; + final _$enc = enc?.reference ?? jni$_.jNullReference; return _createJsonGenerator( reference.pointer, - _id_createJsonGenerator as _$jni.JMethodIDPtr, + _id_createJsonGenerator as jni$_.JMethodIDPtr, _$out.pointer, _$enc.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } static final _id_createJsonGenerator$1 = _class.instanceMethodId( @@ -2810,16 +2810,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createJsonGenerator$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonGenerator$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.Writer out)` /// The returned object must be released after use, by calling the [release] method. @@ -2837,13 +2837,13 @@ class JsonFactory extends _$jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(Writer) instead. - _$jni.JObject? createJsonGenerator$1( - _$jni.JObject? out, + jni$_.JObject? createJsonGenerator$1( + jni$_.JObject? out, ) { - final _$out = out?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _createJsonGenerator$1(reference.pointer, - _id_createJsonGenerator$1 as _$jni.JMethodIDPtr, _$out.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_createJsonGenerator$1 as jni$_.JMethodIDPtr, _$out.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_createJsonGenerator$2 = _class.instanceMethodId( @@ -2851,16 +2851,16 @@ class JsonFactory extends _$jni.JObject { r'(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;', ); - static final _createJsonGenerator$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _createJsonGenerator$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out)` /// The returned object must be released after use, by calling the [release] method. @@ -2873,13 +2873,13 @@ class JsonFactory extends _$jni.JObject { ///@return Generator constructed ///@throws IOException if parser initialization fails due to I/O (write) problem ///@deprecated Since 2.2, use \#createGenerator(OutputStream) instead. - _$jni.JObject? createJsonGenerator$2( - _$jni.JObject? out, + jni$_.JObject? createJsonGenerator$2( + jni$_.JObject? out, ) { - final _$out = out?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _createJsonGenerator$2(reference.pointer, - _id_createJsonGenerator$2 as _$jni.JMethodIDPtr, _$out.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_createJsonGenerator$2 as jni$_.JMethodIDPtr, _$out.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_$_getBufferRecycler = _class.instanceMethodId( @@ -2887,16 +2887,16 @@ class JsonFactory extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/util/BufferRecycler;', ); - static final _$_getBufferRecycler = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _$_getBufferRecycler = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.util.BufferRecycler _getBufferRecycler()` @@ -2907,81 +2907,81 @@ class JsonFactory extends _$jni.JObject { /// /// Note: only public to give access for {@code ObjectMapper} ///@return Buffer recycler instance to use - _$jni.JObject? $_getBufferRecycler() { + jni$_.JObject? $_getBufferRecycler() { return _$_getBufferRecycler( - reference.pointer, _id_$_getBufferRecycler as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_$_getBufferRecycler as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } } -final class $JsonFactory$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $JsonFactory$NullableType extends jni$_.JObjType { + @jni$_.internal const $JsonFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory;'; - @_$jni.internal - @_$core.override - JsonFactory? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + JsonFactory? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonFactory$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonFactory$NullableType) && other is $JsonFactory$NullableType; } } -final class $JsonFactory$Type extends _$jni.JObjType { - @_$jni.internal +final class $JsonFactory$Type extends jni$_.JObjType { + @jni$_.internal const $JsonFactory$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonFactory;'; - @_$jni.internal - @_$core.override - JsonFactory fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonFactory fromReference(jni$_.JReference reference) => JsonFactory.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonFactory$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonFactory$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonFactory$Type) && other is $JsonFactory$Type; diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart index 9b6ad37ff..cedb7cc97 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -47,29 +47,29 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; -import 'JsonToken.dart' as jsontoken_; +import 'JsonToken.dart' as jsontoken$_; /// from: `com.fasterxml.jackson.core.JsonParser$Feature` /// /// Enumeration that defines all on/off features for parsers. -class JsonParser_Feature extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonParser_Feature extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonParser_Feature.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$Feature'); + jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$Feature'); /// The type which includes information such as the signature of this class. static const nullableType = $JsonParser_Feature$NullableType(); @@ -79,24 +79,24 @@ class JsonParser_Feature extends _$jni.JObject { r'()[Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType( + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( $JsonParser_Feature$NullableType())); } @@ -105,24 +105,24 @@ class JsonParser_Feature extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonParser_Feature? valueOf( - _$jni.JString? name, + jni$_.JString? name, ) { - final _$name = name?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$name = name?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) .object(const $JsonParser_Feature$NullableType()); } @@ -132,16 +132,16 @@ class JsonParser_Feature extends _$jni.JObject { r'()I', ); - static final _collectDefaults = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _collectDefaults = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public int collectDefaults()` @@ -151,7 +151,7 @@ class JsonParser_Feature extends _$jni.JObject { ///@return Bit mask of all features that are enabled by default static int collectDefaults() { return _collectDefaults( - _class.reference.pointer, _id_collectDefaults as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_collectDefaults as jni$_.JMethodIDPtr) .integer; } @@ -160,22 +160,22 @@ class JsonParser_Feature extends _$jni.JObject { r'()Z', ); - static final _enabledByDefault = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _enabledByDefault = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean enabledByDefault()` bool enabledByDefault() { return _enabledByDefault( - reference.pointer, _id_enabledByDefault as _$jni.JMethodIDPtr) + reference.pointer, _id_enabledByDefault as jni$_.JMethodIDPtr) .boolean; } @@ -184,23 +184,23 @@ class JsonParser_Feature extends _$jni.JObject { r'(I)Z', ); - static final _enabledIn = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _enabledIn = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public boolean enabledIn(int flags)` bool enabledIn( int flags, ) { return _enabledIn( - reference.pointer, _id_enabledIn as _$jni.JMethodIDPtr, flags) + reference.pointer, _id_enabledIn as jni$_.JMethodIDPtr, flags) .boolean; } @@ -209,58 +209,58 @@ class JsonParser_Feature extends _$jni.JObject { r'()I', ); - static final _getMask = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getMask = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getMask()` int getMask() { - return _getMask(reference.pointer, _id_getMask as _$jni.JMethodIDPtr) + return _getMask(reference.pointer, _id_getMask as jni$_.JMethodIDPtr) .integer; } } final class $JsonParser_Feature$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonParser_Feature$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$Feature;'; - @_$jni.internal - @_$core.override - JsonParser_Feature? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonParser_Feature? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonParser_Feature.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonParser_Feature$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonParser_Feature$NullableType) && other is $JsonParser_Feature$NullableType; @@ -268,37 +268,37 @@ final class $JsonParser_Feature$NullableType } final class $JsonParser_Feature$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonParser_Feature$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$Feature;'; - @_$jni.internal - @_$core.override - JsonParser_Feature fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonParser_Feature fromReference(jni$_.JReference reference) => JsonParser_Feature.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonParser_Feature$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonParser_Feature$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonParser_Feature$Type) && other is $JsonParser_Feature$Type; @@ -309,19 +309,19 @@ final class $JsonParser_Feature$Type /// /// Enumeration of possible "native" (optimal) types that can be /// used for numbers. -class JsonParser_NumberType extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonParser_NumberType extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonParser_NumberType.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$NumberType'); + jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$NumberType'); /// The type which includes information such as the signature of this class. static const nullableType = $JsonParser_NumberType$NullableType(); @@ -331,24 +331,24 @@ class JsonParser_NumberType extends _$jni.JObject { r'()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType( + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( $JsonParser_NumberType$NullableType())); } @@ -357,24 +357,24 @@ class JsonParser_NumberType extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonParser_NumberType? valueOf( - _$jni.JString? name, + jni$_.JString? name, ) { - final _$name = name?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$name = name?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) .object( const $JsonParser_NumberType$NullableType()); @@ -382,38 +382,38 @@ class JsonParser_NumberType extends _$jni.JObject { } final class $JsonParser_NumberType$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonParser_NumberType$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;'; - @_$jni.internal - @_$core.override - JsonParser_NumberType? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonParser_NumberType? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonParser_NumberType.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonParser_NumberType$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonParser_NumberType$NullableType) && other is $JsonParser_NumberType$NullableType; @@ -421,37 +421,37 @@ final class $JsonParser_NumberType$NullableType } final class $JsonParser_NumberType$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonParser_NumberType$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;'; - @_$jni.internal - @_$core.override - JsonParser_NumberType fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonParser_NumberType fromReference(jni$_.JReference reference) => JsonParser_NumberType.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonParser_NumberType$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonParser_NumberType$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonParser_NumberType$Type) && other is $JsonParser_NumberType$Type; @@ -464,19 +464,19 @@ final class $JsonParser_NumberType$Type /// Instances are created using factory methods of /// a JsonFactory instance. ///@author Tatu Saloranta -class JsonParser extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonParser extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonParser.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonParser'); + jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonParser'); /// The type which includes information such as the signature of this class. static const nullableType = $JsonParser$NullableType(); @@ -486,16 +486,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/ObjectCodec;', ); - static final _getCodec = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCodec = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.ObjectCodec getCodec()` @@ -505,9 +505,9 @@ class JsonParser extends _$jni.JObject { /// parser, if any. Codec is used by \#readValueAs(Class) /// method (and its variants). ///@return Codec assigned to this parser, if any; {@code null} if none - _$jni.JObject? getCodec() { - return _getCodec(reference.pointer, _id_getCodec as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? getCodec() { + return _getCodec(reference.pointer, _id_getCodec as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setCodec = _class.instanceMethodId( @@ -515,16 +515,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/ObjectCodec;)V', ); - static final _setCodec = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCodec = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract void setCodec(com.fasterxml.jackson.core.ObjectCodec oc)` /// @@ -533,11 +533,11 @@ class JsonParser extends _$jni.JObject { /// method (and its variants). ///@param oc Codec to assign, if any; {@code null} if none void setCodec( - _$jni.JObject? oc, + jni$_.JObject? oc, ) { - final _$oc = oc?.reference ?? _$jni.jNullReference; + final _$oc = oc?.reference ?? jni$_.jNullReference; _setCodec( - reference.pointer, _id_setCodec as _$jni.JMethodIDPtr, _$oc.pointer) + reference.pointer, _id_setCodec as jni$_.JMethodIDPtr, _$oc.pointer) .check(); } @@ -546,16 +546,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _getInputSource = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getInputSource = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object getInputSource()` @@ -575,10 +575,10 @@ class JsonParser extends _$jni.JObject { /// In general use of this accessor should be considered as /// "last effort", i.e. only used if no other mechanism is applicable. ///@return Input source this parser was configured with - _$jni.JObject? getInputSource() { + jni$_.JObject? getInputSource() { return _getInputSource( - reference.pointer, _id_getInputSource as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getInputSource as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setRequestPayloadOnError = _class.instanceMethodId( @@ -586,16 +586,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/util/RequestPayload;)V', ); - static final _setRequestPayloadOnError = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setRequestPayloadOnError = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setRequestPayloadOnError(com.fasterxml.jackson.core.util.RequestPayload payload)` /// @@ -603,12 +603,12 @@ class JsonParser extends _$jni.JObject { ///@param payload Payload to pass ///@since 2.8 void setRequestPayloadOnError( - _$jni.JObject? payload, + jni$_.JObject? payload, ) { - final _$payload = payload?.reference ?? _$jni.jNullReference; + final _$payload = payload?.reference ?? jni$_.jNullReference; _setRequestPayloadOnError( reference.pointer, - _id_setRequestPayloadOnError as _$jni.JMethodIDPtr, + _id_setRequestPayloadOnError as jni$_.JMethodIDPtr, _$payload.pointer) .check(); } @@ -619,22 +619,22 @@ class JsonParser extends _$jni.JObject { ); static final _setRequestPayloadOnError$1 = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void setRequestPayloadOnError(byte[] payload, java.lang.String charset)` /// @@ -643,14 +643,14 @@ class JsonParser extends _$jni.JObject { ///@param charset Character encoding for (lazily) decoding payload ///@since 2.8 void setRequestPayloadOnError$1( - _$jni.JArray<_$jni.jbyte>? payload, - _$jni.JString? charset, + jni$_.JArray? payload, + jni$_.JString? charset, ) { - final _$payload = payload?.reference ?? _$jni.jNullReference; - final _$charset = charset?.reference ?? _$jni.jNullReference; + final _$payload = payload?.reference ?? jni$_.jNullReference; + final _$charset = charset?.reference ?? jni$_.jNullReference; _setRequestPayloadOnError$1( reference.pointer, - _id_setRequestPayloadOnError$1 as _$jni.JMethodIDPtr, + _id_setRequestPayloadOnError$1 as jni$_.JMethodIDPtr, _$payload.pointer, _$charset.pointer) .check(); @@ -662,16 +662,16 @@ class JsonParser extends _$jni.JObject { ); static final _setRequestPayloadOnError$2 = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setRequestPayloadOnError(java.lang.String payload)` /// @@ -679,12 +679,12 @@ class JsonParser extends _$jni.JObject { ///@param payload Payload to pass ///@since 2.8 void setRequestPayloadOnError$2( - _$jni.JString? payload, + jni$_.JString? payload, ) { - final _$payload = payload?.reference ?? _$jni.jNullReference; + final _$payload = payload?.reference ?? jni$_.jNullReference; _setRequestPayloadOnError$2( reference.pointer, - _id_setRequestPayloadOnError$2 as _$jni.JMethodIDPtr, + _id_setRequestPayloadOnError$2 as jni$_.JMethodIDPtr, _$payload.pointer) .check(); } @@ -694,16 +694,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/FormatSchema;)V', ); - static final _setSchema = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setSchema = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setSchema(com.fasterxml.jackson.core.FormatSchema schema)` /// @@ -718,10 +718,10 @@ class JsonParser extends _$jni.JObject { ///@param schema Schema to use ///@throws UnsupportedOperationException if parser does not support schema void setSchema( - _$jni.JObject? schema, + jni$_.JObject? schema, ) { - final _$schema = schema?.reference ?? _$jni.jNullReference; - _setSchema(reference.pointer, _id_setSchema as _$jni.JMethodIDPtr, + final _$schema = schema?.reference ?? jni$_.jNullReference; + _setSchema(reference.pointer, _id_setSchema as jni$_.JMethodIDPtr, _$schema.pointer) .check(); } @@ -731,16 +731,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/FormatSchema;', ); - static final _getSchema = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSchema = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.FormatSchema getSchema()` @@ -750,9 +750,9 @@ class JsonParser extends _$jni.JObject { /// Default implementation returns null. ///@return Schema in use by this parser, if any; {@code null} if none ///@since 2.1 - _$jni.JObject? getSchema() { - return _getSchema(reference.pointer, _id_getSchema as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? getSchema() { + return _getSchema(reference.pointer, _id_getSchema as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_canUseSchema = _class.instanceMethodId( @@ -760,16 +760,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/FormatSchema;)Z', ); - static final _canUseSchema = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _canUseSchema = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean canUseSchema(com.fasterxml.jackson.core.FormatSchema schema)` /// @@ -778,11 +778,11 @@ class JsonParser extends _$jni.JObject { ///@param schema Schema to check ///@return True if this parser can use given schema; false if not bool canUseSchema( - _$jni.JObject? schema, + jni$_.JObject? schema, ) { - final _$schema = schema?.reference ?? _$jni.jNullReference; + final _$schema = schema?.reference ?? jni$_.jNullReference; return _canUseSchema(reference.pointer, - _id_canUseSchema as _$jni.JMethodIDPtr, _$schema.pointer) + _id_canUseSchema as jni$_.JMethodIDPtr, _$schema.pointer) .boolean; } @@ -791,16 +791,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _requiresCustomCodec = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _requiresCustomCodec = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean requiresCustomCodec()` @@ -815,7 +815,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.1 bool requiresCustomCodec() { return _requiresCustomCodec( - reference.pointer, _id_requiresCustomCodec as _$jni.JMethodIDPtr) + reference.pointer, _id_requiresCustomCodec as jni$_.JMethodIDPtr) .boolean; } @@ -824,16 +824,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _canParseAsync = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _canParseAsync = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean canParseAsync()` @@ -851,7 +851,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.9 bool canParseAsync() { return _canParseAsync( - reference.pointer, _id_canParseAsync as _$jni.JMethodIDPtr) + reference.pointer, _id_canParseAsync as jni$_.JMethodIDPtr) .boolean; } @@ -860,16 +860,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/async/NonBlockingInputFeeder;', ); - static final _getNonBlockingInputFeeder = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNonBlockingInputFeeder = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.async.NonBlockingInputFeeder getNonBlockingInputFeeder()` @@ -880,10 +880,10 @@ class JsonParser extends _$jni.JObject { /// parsers that use blocking I/O. ///@return Input feeder to use with non-blocking (async) parsing ///@since 2.9 - _$jni.JObject? getNonBlockingInputFeeder() { + jni$_.JObject? getNonBlockingInputFeeder() { return _getNonBlockingInputFeeder(reference.pointer, - _id_getNonBlockingInputFeeder as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_getNonBlockingInputFeeder as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getReadCapabilities = _class.instanceMethodId( @@ -891,16 +891,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;', ); - static final _getReadCapabilities = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getReadCapabilities = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.util.JacksonFeatureSet getReadCapabilities()` @@ -910,10 +910,10 @@ class JsonParser extends _$jni.JObject { /// underlying data format being read (directly or indirectly). ///@return Set of read capabilities for content to read via this parser ///@since 2.12 - _$jni.JObject? getReadCapabilities() { + jni$_.JObject? getReadCapabilities() { return _getReadCapabilities( - reference.pointer, _id_getReadCapabilities as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getReadCapabilities as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_version = _class.instanceMethodId( @@ -921,16 +921,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/Version;', ); - static final _version = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _version = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.Version version()` @@ -940,9 +940,9 @@ class JsonParser extends _$jni.JObject { /// Left for sub-classes to implement. ///@return Version of this generator (derived from version declared for /// {@code jackson-core} jar that contains the class - _$jni.JObject? version() { - return _version(reference.pointer, _id_version as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? version() { + return _version(reference.pointer, _id_version as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_close = _class.instanceMethodId( @@ -950,16 +950,16 @@ class JsonParser extends _$jni.JObject { r'()V', ); - static final _close = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _close = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract void close()` @@ -979,7 +979,7 @@ class JsonParser extends _$jni.JObject { /// stream or reader it does own them. ///@throws IOException if there is either an underlying I/O problem void close() { - _close(reference.pointer, _id_close as _$jni.JMethodIDPtr).check(); + _close(reference.pointer, _id_close as jni$_.JMethodIDPtr).check(); } static final _id_isClosed = _class.instanceMethodId( @@ -987,16 +987,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _isClosed = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isClosed = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract boolean isClosed()` @@ -1009,7 +1009,7 @@ class JsonParser extends _$jni.JObject { /// end of input. ///@return {@code True} if this parser instance has been closed bool isClosed() { - return _isClosed(reference.pointer, _id_isClosed as _$jni.JMethodIDPtr) + return _isClosed(reference.pointer, _id_isClosed as jni$_.JMethodIDPtr) .boolean; } @@ -1018,16 +1018,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonStreamContext;', ); - static final _getParsingContext = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getParsingContext = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonStreamContext getParsingContext()` @@ -1042,10 +1042,10 @@ class JsonParser extends _$jni.JObject { /// Contexts can also be used for simple xpath-like matching of /// input, if so desired. ///@return Stream input context (JsonStreamContext) associated with this parser - _$jni.JObject? getParsingContext() { + jni$_.JObject? getParsingContext() { return _getParsingContext( - reference.pointer, _id_getParsingContext as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getParsingContext as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_currentLocation = _class.instanceMethodId( @@ -1053,16 +1053,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _currentLocation = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _currentLocation = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonLocation currentLocation()` @@ -1080,10 +1080,10 @@ class JsonParser extends _$jni.JObject { /// to other library) ///@return Location of the last processed input unit (byte or character) ///@since 2.13 - _$jni.JObject? currentLocation() { + jni$_.JObject? currentLocation() { return _currentLocation( - reference.pointer, _id_currentLocation as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_currentLocation as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_currentTokenLocation = _class.instanceMethodId( @@ -1091,16 +1091,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _currentTokenLocation = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _currentTokenLocation = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonLocation currentTokenLocation()` @@ -1118,10 +1118,10 @@ class JsonParser extends _$jni.JObject { /// to other library) ///@return Starting location of the token parser currently points to ///@since 2.13 (will eventually replace \#getTokenLocation) - _$jni.JObject? currentTokenLocation() { + jni$_.JObject? currentTokenLocation() { return _currentTokenLocation( - reference.pointer, _id_currentTokenLocation as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_currentTokenLocation as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getCurrentLocation = _class.instanceMethodId( @@ -1129,16 +1129,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _getCurrentLocation = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCurrentLocation = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonLocation getCurrentLocation()` @@ -1147,10 +1147,10 @@ class JsonParser extends _$jni.JObject { /// Alias for \#currentLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Location of the last processed input unit (byte or character) - _$jni.JObject? getCurrentLocation() { + jni$_.JObject? getCurrentLocation() { return _getCurrentLocation( - reference.pointer, _id_getCurrentLocation as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getCurrentLocation as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getTokenLocation = _class.instanceMethodId( @@ -1158,16 +1158,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonLocation;', ); - static final _getTokenLocation = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTokenLocation = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonLocation getTokenLocation()` @@ -1176,10 +1176,10 @@ class JsonParser extends _$jni.JObject { /// Alias for \#currentTokenLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Starting location of the token parser currently points to - _$jni.JObject? getTokenLocation() { + jni$_.JObject? getTokenLocation() { return _getTokenLocation( - reference.pointer, _id_getTokenLocation as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getTokenLocation as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_currentValue = _class.instanceMethodId( @@ -1187,16 +1187,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _currentValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _currentValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object currentValue()` @@ -1213,10 +1213,10 @@ class JsonParser extends _$jni.JObject { /// and gets passed through data-binding. ///@return "Current value" associated with the current input context (state) of this parser ///@since 2.13 (added as replacement for older \#getCurrentValue() - _$jni.JObject? currentValue() { + jni$_.JObject? currentValue() { return _currentValue( - reference.pointer, _id_currentValue as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_currentValue as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_assignCurrentValue = _class.instanceMethodId( @@ -1224,16 +1224,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/lang/Object;)V', ); - static final _assignCurrentValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _assignCurrentValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void assignCurrentValue(java.lang.Object v)` /// @@ -1244,11 +1244,11 @@ class JsonParser extends _$jni.JObject { ///@param v Current value to assign for the current input context of this parser ///@since 2.13 (added as replacement for older \#setCurrentValue void assignCurrentValue( - _$jni.JObject? v, + jni$_.JObject? v, ) { - final _$v = v?.reference ?? _$jni.jNullReference; + final _$v = v?.reference ?? jni$_.jNullReference; _assignCurrentValue(reference.pointer, - _id_assignCurrentValue as _$jni.JMethodIDPtr, _$v.pointer) + _id_assignCurrentValue as jni$_.JMethodIDPtr, _$v.pointer) .check(); } @@ -1257,16 +1257,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _getCurrentValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCurrentValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object getCurrentValue()` @@ -1275,10 +1275,10 @@ class JsonParser extends _$jni.JObject { /// Alias for \#currentValue(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). ///@return Location of the last processed input unit (byte or character) - _$jni.JObject? getCurrentValue() { + jni$_.JObject? getCurrentValue() { return _getCurrentValue( - reference.pointer, _id_getCurrentValue as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getCurrentValue as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setCurrentValue = _class.instanceMethodId( @@ -1286,16 +1286,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/lang/Object;)V', ); - static final _setCurrentValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCurrentValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setCurrentValue(java.lang.Object v)` /// @@ -1303,11 +1303,11 @@ class JsonParser extends _$jni.JObject { /// Jackson 2.x versions (and removed from Jackson 3.0). ///@param v Current value to assign for the current input context of this parser void setCurrentValue( - _$jni.JObject? v, + jni$_.JObject? v, ) { - final _$v = v?.reference ?? _$jni.jNullReference; + final _$v = v?.reference ?? jni$_.jNullReference; _setCurrentValue(reference.pointer, - _id_setCurrentValue as _$jni.JMethodIDPtr, _$v.pointer) + _id_setCurrentValue as jni$_.JMethodIDPtr, _$v.pointer) .check(); } @@ -1316,16 +1316,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/io/OutputStream;)I', ); - static final _releaseBuffered = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _releaseBuffered = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public int releaseBuffered(java.io.OutputStream out)` /// @@ -1341,11 +1341,11 @@ class JsonParser extends _$jni.JObject { /// otherwise number of bytes released (0 if there was nothing to release) ///@throws IOException if write to stream threw exception int releaseBuffered( - _$jni.JObject? out, + jni$_.JObject? out, ) { - final _$out = out?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _releaseBuffered(reference.pointer, - _id_releaseBuffered as _$jni.JMethodIDPtr, _$out.pointer) + _id_releaseBuffered as jni$_.JMethodIDPtr, _$out.pointer) .integer; } @@ -1354,16 +1354,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/io/Writer;)I', ); - static final _releaseBuffered$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _releaseBuffered$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public int releaseBuffered(java.io.Writer w)` /// @@ -1380,11 +1380,11 @@ class JsonParser extends _$jni.JObject { /// otherwise number of chars released (0 if there was nothing to release) ///@throws IOException if write using Writer threw exception int releaseBuffered$1( - _$jni.JObject? w, + jni$_.JObject? w, ) { - final _$w = w?.reference ?? _$jni.jNullReference; + final _$w = w?.reference ?? jni$_.jNullReference; return _releaseBuffered$1(reference.pointer, - _id_releaseBuffered$1 as _$jni.JMethodIDPtr, _$w.pointer) + _id_releaseBuffered$1 as jni$_.JMethodIDPtr, _$w.pointer) .integer; } @@ -1393,16 +1393,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _enable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _enable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1414,9 +1414,9 @@ class JsonParser extends _$jni.JObject { JsonParser? enable( JsonParser_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _enable( - reference.pointer, _id_enable as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_enable as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonParser$NullableType()); } @@ -1425,16 +1425,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _disable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _disable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser.Feature f)` /// The returned object must be released after use, by calling the [release] method. @@ -1446,9 +1446,9 @@ class JsonParser extends _$jni.JObject { JsonParser? disable( JsonParser_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _disable( - reference.pointer, _id_disable as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_disable as jni$_.JMethodIDPtr, _$f.pointer) .object(const $JsonParser$NullableType()); } @@ -1457,17 +1457,17 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _configure = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _configure = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. @@ -1481,8 +1481,8 @@ class JsonParser extends _$jni.JObject { JsonParser_Feature? f, bool state, ) { - final _$f = f?.reference ?? _$jni.jNullReference; - return _configure(reference.pointer, _id_configure as _$jni.JMethodIDPtr, + final _$f = f?.reference ?? jni$_.jNullReference; + return _configure(reference.pointer, _id_configure as jni$_.JMethodIDPtr, _$f.pointer, state ? 1 : 0) .object(const $JsonParser$NullableType()); } @@ -1492,16 +1492,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Z', ); - static final _isEnabled = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)` /// @@ -1511,9 +1511,9 @@ class JsonParser extends _$jni.JObject { bool isEnabled( JsonParser_Feature? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled( - reference.pointer, _id_isEnabled as _$jni.JMethodIDPtr, _$f.pointer) + reference.pointer, _id_isEnabled as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1522,16 +1522,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/StreamReadFeature;)Z', ); - static final _isEnabled$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _isEnabled$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean isEnabled(com.fasterxml.jackson.core.StreamReadFeature f)` /// @@ -1540,11 +1540,11 @@ class JsonParser extends _$jni.JObject { ///@return {@code True} if feature is enabled; {@code false} otherwise ///@since 2.10 bool isEnabled$1( - _$jni.JObject? f, + jni$_.JObject? f, ) { - final _$f = f?.reference ?? _$jni.jNullReference; + final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled$1(reference.pointer, - _id_isEnabled$1 as _$jni.JMethodIDPtr, _$f.pointer) + _id_isEnabled$1 as jni$_.JMethodIDPtr, _$f.pointer) .boolean; } @@ -1553,16 +1553,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getFeatureMask = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFeatureMask = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getFeatureMask()` @@ -1572,7 +1572,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.3 int getFeatureMask() { return _getFeatureMask( - reference.pointer, _id_getFeatureMask as _$jni.JMethodIDPtr) + reference.pointer, _id_getFeatureMask as jni$_.JMethodIDPtr) .integer; } @@ -1581,15 +1581,15 @@ class JsonParser extends _$jni.JObject { r'(I)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _setFeatureMask = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _setFeatureMask = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser setFeatureMask(int mask)` /// The returned object must be released after use, by calling the [release] method. @@ -1603,7 +1603,7 @@ class JsonParser extends _$jni.JObject { int mask, ) { return _setFeatureMask( - reference.pointer, _id_setFeatureMask as _$jni.JMethodIDPtr, mask) + reference.pointer, _id_setFeatureMask as jni$_.JMethodIDPtr, mask) .object(const $JsonParser$NullableType()); } @@ -1612,16 +1612,16 @@ class JsonParser extends _$jni.JObject { r'(II)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _overrideStdFeatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + static final _overrideStdFeatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser overrideStdFeatures(int values, int mask)` /// The returned object must be released after use, by calling the [release] method. @@ -1643,7 +1643,7 @@ class JsonParser extends _$jni.JObject { int mask, ) { return _overrideStdFeatures(reference.pointer, - _id_overrideStdFeatures as _$jni.JMethodIDPtr, values, mask) + _id_overrideStdFeatures as jni$_.JMethodIDPtr, values, mask) .object(const $JsonParser$NullableType()); } @@ -1652,16 +1652,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getFormatFeatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFormatFeatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getFormatFeatures()` @@ -1672,7 +1672,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.6 int getFormatFeatures() { return _getFormatFeatures( - reference.pointer, _id_getFormatFeatures as _$jni.JMethodIDPtr) + reference.pointer, _id_getFormatFeatures as jni$_.JMethodIDPtr) .integer; } @@ -1681,16 +1681,16 @@ class JsonParser extends _$jni.JObject { r'(II)Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _overrideFormatFeatures = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + static final _overrideFormatFeatures = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); /// from: `public com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values, int mask)` /// The returned object must be released after use, by calling the [release] method. @@ -1710,7 +1710,7 @@ class JsonParser extends _$jni.JObject { int mask, ) { return _overrideFormatFeatures(reference.pointer, - _id_overrideFormatFeatures as _$jni.JMethodIDPtr, values, mask) + _id_overrideFormatFeatures as jni$_.JMethodIDPtr, values, mask) .object(const $JsonParser$NullableType()); } @@ -1719,16 +1719,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _nextToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _nextToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken nextToken()` @@ -1742,10 +1742,10 @@ class JsonParser extends _$jni.JObject { /// to indicate end-of-input ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jsontoken_.JsonToken? nextToken() { - return _nextToken(reference.pointer, _id_nextToken as _$jni.JMethodIDPtr) - .object( - const jsontoken_.$JsonToken$NullableType()); + jsontoken$_.JsonToken? nextToken() { + return _nextToken(reference.pointer, _id_nextToken as jni$_.JMethodIDPtr) + .object( + const jsontoken$_.$JsonToken$NullableType()); } static final _id_nextValue = _class.instanceMethodId( @@ -1753,16 +1753,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _nextValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _nextValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken nextValue()` @@ -1784,10 +1784,10 @@ class JsonParser extends _$jni.JObject { /// available yet) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jsontoken_.JsonToken? nextValue() { - return _nextValue(reference.pointer, _id_nextValue as _$jni.JMethodIDPtr) - .object( - const jsontoken_.$JsonToken$NullableType()); + jsontoken$_.JsonToken? nextValue() { + return _nextValue(reference.pointer, _id_nextValue as jni$_.JMethodIDPtr) + .object( + const jsontoken$_.$JsonToken$NullableType()); } static final _id_nextFieldName = _class.instanceMethodId( @@ -1795,16 +1795,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/SerializableString;)Z', ); - static final _nextFieldName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _nextFieldName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean nextFieldName(com.fasterxml.jackson.core.SerializableString str)` /// @@ -1824,11 +1824,11 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems bool nextFieldName( - _$jni.JObject? str, + jni$_.JObject? str, ) { - final _$str = str?.reference ?? _$jni.jNullReference; + final _$str = str?.reference ?? jni$_.jNullReference; return _nextFieldName(reference.pointer, - _id_nextFieldName as _$jni.JMethodIDPtr, _$str.pointer) + _id_nextFieldName as jni$_.JMethodIDPtr, _$str.pointer) .boolean; } @@ -1837,16 +1837,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _nextFieldName$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _nextFieldName$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String nextFieldName()` @@ -1860,10 +1860,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.5 - _$jni.JString? nextFieldName$1() { + jni$_.JString? nextFieldName$1() { return _nextFieldName$1( - reference.pointer, _id_nextFieldName$1 as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_nextFieldName$1 as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_nextTextValue = _class.instanceMethodId( @@ -1871,16 +1871,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _nextTextValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _nextTextValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String nextTextValue()` @@ -1899,10 +1899,10 @@ class JsonParser extends _$jni.JObject { /// to; or {@code null} if next token is of some other type ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JString? nextTextValue() { + jni$_.JString? nextTextValue() { return _nextTextValue( - reference.pointer, _id_nextTextValue as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_nextTextValue as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_nextIntValue = _class.instanceMethodId( @@ -1910,15 +1910,15 @@ class JsonParser extends _$jni.JObject { r'(I)I', ); - static final _nextIntValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallIntMethod') + static final _nextIntValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public int nextIntValue(int defaultValue)` /// @@ -1943,7 +1943,7 @@ class JsonParser extends _$jni.JObject { int defaultValue, ) { return _nextIntValue(reference.pointer, - _id_nextIntValue as _$jni.JMethodIDPtr, defaultValue) + _id_nextIntValue as jni$_.JMethodIDPtr, defaultValue) .integer; } @@ -1952,15 +1952,15 @@ class JsonParser extends _$jni.JObject { r'(J)J', ); - static final _nextLongValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int64,)>)>>('globalEnv_CallLongMethod') + static final _nextLongValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int64,)>)>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public long nextLongValue(long defaultValue)` /// @@ -1985,7 +1985,7 @@ class JsonParser extends _$jni.JObject { int defaultValue, ) { return _nextLongValue(reference.pointer, - _id_nextLongValue as _$jni.JMethodIDPtr, defaultValue) + _id_nextLongValue as jni$_.JMethodIDPtr, defaultValue) .long; } @@ -1994,16 +1994,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Boolean;', ); - static final _nextBooleanValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _nextBooleanValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Boolean nextBooleanValue()` @@ -2025,10 +2025,10 @@ class JsonParser extends _$jni.JObject { /// token parser advanced to; or {@code null} if next token is of some other type ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JBoolean? nextBooleanValue() { + jni$_.JBoolean? nextBooleanValue() { return _nextBooleanValue( - reference.pointer, _id_nextBooleanValue as _$jni.JMethodIDPtr) - .object<_$jni.JBoolean?>(const _$jni.JBooleanNullableType()); + reference.pointer, _id_nextBooleanValue as jni$_.JMethodIDPtr) + .object(const jni$_.JBooleanNullableType()); } static final _id_skipChildren = _class.instanceMethodId( @@ -2036,16 +2036,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonParser;', ); - static final _skipChildren = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _skipChildren = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonParser skipChildren()` @@ -2068,7 +2068,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems JsonParser? skipChildren() { return _skipChildren( - reference.pointer, _id_skipChildren as _$jni.JMethodIDPtr) + reference.pointer, _id_skipChildren as jni$_.JMethodIDPtr) .object(const $JsonParser$NullableType()); } @@ -2077,16 +2077,16 @@ class JsonParser extends _$jni.JObject { r'()V', ); - static final _finishToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _finishToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void finishToken()` @@ -2105,7 +2105,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.8 void finishToken() { - _finishToken(reference.pointer, _id_finishToken as _$jni.JMethodIDPtr) + _finishToken(reference.pointer, _id_finishToken as jni$_.JMethodIDPtr) .check(); } @@ -2114,16 +2114,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _currentToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _currentToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.fasterxml.jackson.core.JsonToken currentToken()` @@ -2138,11 +2138,11 @@ class JsonParser extends _$jni.JObject { /// after end-of-input has been encountered, as well as /// if the current token has been explicitly cleared. ///@since 2.8 - jsontoken_.JsonToken? currentToken() { + jsontoken$_.JsonToken? currentToken() { return _currentToken( - reference.pointer, _id_currentToken as _$jni.JMethodIDPtr) - .object( - const jsontoken_.$JsonToken$NullableType()); + reference.pointer, _id_currentToken as jni$_.JMethodIDPtr) + .object( + const jsontoken$_.$JsonToken$NullableType()); } static final _id_currentTokenId = _class.instanceMethodId( @@ -2150,16 +2150,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _currentTokenId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _currentTokenId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int currentTokenId()` @@ -2175,7 +2175,7 @@ class JsonParser extends _$jni.JObject { ///@return {@code int} matching one of constants from JsonTokenId. int currentTokenId() { return _currentTokenId( - reference.pointer, _id_currentTokenId as _$jni.JMethodIDPtr) + reference.pointer, _id_currentTokenId as jni$_.JMethodIDPtr) .integer; } @@ -2184,16 +2184,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _getCurrentToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCurrentToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken getCurrentToken()` @@ -2203,11 +2203,11 @@ class JsonParser extends _$jni.JObject { /// Jackson 2.13 (will be removed from 3.0). ///@return Type of the token this parser currently points to, /// if any: null before any tokens have been read, and - jsontoken_.JsonToken? getCurrentToken() { + jsontoken$_.JsonToken? getCurrentToken() { return _getCurrentToken( - reference.pointer, _id_getCurrentToken as _$jni.JMethodIDPtr) - .object( - const jsontoken_.$JsonToken$NullableType()); + reference.pointer, _id_getCurrentToken as jni$_.JMethodIDPtr) + .object( + const jsontoken$_.$JsonToken$NullableType()); } static final _id_getCurrentTokenId = _class.instanceMethodId( @@ -2215,16 +2215,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getCurrentTokenId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCurrentTokenId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract int getCurrentTokenId()` @@ -2234,7 +2234,7 @@ class JsonParser extends _$jni.JObject { ///@deprecated Since 2.12 use \#currentTokenId instead int getCurrentTokenId() { return _getCurrentTokenId( - reference.pointer, _id_getCurrentTokenId as _$jni.JMethodIDPtr) + reference.pointer, _id_getCurrentTokenId as jni$_.JMethodIDPtr) .integer; } @@ -2243,16 +2243,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _hasCurrentToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _hasCurrentToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract boolean hasCurrentToken()` @@ -2267,7 +2267,7 @@ class JsonParser extends _$jni.JObject { /// has been consumed) bool hasCurrentToken() { return _hasCurrentToken( - reference.pointer, _id_hasCurrentToken as _$jni.JMethodIDPtr) + reference.pointer, _id_hasCurrentToken as jni$_.JMethodIDPtr) .boolean; } @@ -2276,16 +2276,16 @@ class JsonParser extends _$jni.JObject { r'(I)Z', ); - static final _hasTokenId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _hasTokenId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public abstract boolean hasTokenId(int id)` /// @@ -2305,7 +2305,7 @@ class JsonParser extends _$jni.JObject { int id, ) { return _hasTokenId( - reference.pointer, _id_hasTokenId as _$jni.JMethodIDPtr, id) + reference.pointer, _id_hasTokenId as jni$_.JMethodIDPtr, id) .boolean; } @@ -2314,16 +2314,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/JsonToken;)Z', ); - static final _hasToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _hasToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract boolean hasToken(com.fasterxml.jackson.core.JsonToken t)` /// @@ -2340,11 +2340,11 @@ class JsonParser extends _$jni.JObject { ///@return {@code True} if the parser current points to specified token ///@since 2.6 bool hasToken( - jsontoken_.JsonToken? t, + jsontoken$_.JsonToken? t, ) { - final _$t = t?.reference ?? _$jni.jNullReference; + final _$t = t?.reference ?? jni$_.jNullReference; return _hasToken( - reference.pointer, _id_hasToken as _$jni.JMethodIDPtr, _$t.pointer) + reference.pointer, _id_hasToken as jni$_.JMethodIDPtr, _$t.pointer) .boolean; } @@ -2353,16 +2353,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _isExpectedStartArrayToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isExpectedStartArrayToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isExpectedStartArrayToken()` @@ -2385,7 +2385,7 @@ class JsonParser extends _$jni.JObject { /// {@code false} if not bool isExpectedStartArrayToken() { return _isExpectedStartArrayToken(reference.pointer, - _id_isExpectedStartArrayToken as _$jni.JMethodIDPtr) + _id_isExpectedStartArrayToken as jni$_.JMethodIDPtr) .boolean; } @@ -2395,16 +2395,16 @@ class JsonParser extends _$jni.JObject { ); static final _isExpectedStartObjectToken = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isExpectedStartObjectToken()` @@ -2417,7 +2417,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.5 bool isExpectedStartObjectToken() { return _isExpectedStartObjectToken(reference.pointer, - _id_isExpectedStartObjectToken as _$jni.JMethodIDPtr) + _id_isExpectedStartObjectToken as jni$_.JMethodIDPtr) .boolean; } @@ -2426,16 +2426,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _isExpectedNumberIntToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isExpectedNumberIntToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isExpectedNumberIntToken()` @@ -2451,7 +2451,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.12 bool isExpectedNumberIntToken() { return _isExpectedNumberIntToken(reference.pointer, - _id_isExpectedNumberIntToken as _$jni.JMethodIDPtr) + _id_isExpectedNumberIntToken as jni$_.JMethodIDPtr) .boolean; } @@ -2460,16 +2460,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _isNaN = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isNaN = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean isNaN()` @@ -2487,7 +2487,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.9 bool isNaN() { - return _isNaN(reference.pointer, _id_isNaN as _$jni.JMethodIDPtr).boolean; + return _isNaN(reference.pointer, _id_isNaN as jni$_.JMethodIDPtr).boolean; } static final _id_clearCurrentToken = _class.instanceMethodId( @@ -2495,16 +2495,16 @@ class JsonParser extends _$jni.JObject { r'()V', ); - static final _clearCurrentToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _clearCurrentToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract void clearCurrentToken()` @@ -2521,7 +2521,7 @@ class JsonParser extends _$jni.JObject { /// it will not be used again). void clearCurrentToken() { _clearCurrentToken( - reference.pointer, _id_clearCurrentToken as _$jni.JMethodIDPtr) + reference.pointer, _id_clearCurrentToken as jni$_.JMethodIDPtr) .check(); } @@ -2530,16 +2530,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _getLastClearedToken = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getLastClearedToken = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonToken getLastClearedToken()` @@ -2551,11 +2551,11 @@ class JsonParser extends _$jni.JObject { /// Will return null if no tokens have been cleared, /// or if parser has been closed. ///@return Last cleared token, if any; {@code null} otherwise - jsontoken_.JsonToken? getLastClearedToken() { + jsontoken$_.JsonToken? getLastClearedToken() { return _getLastClearedToken( - reference.pointer, _id_getLastClearedToken as _$jni.JMethodIDPtr) - .object( - const jsontoken_.$JsonToken$NullableType()); + reference.pointer, _id_getLastClearedToken as jni$_.JMethodIDPtr) + .object( + const jsontoken$_.$JsonToken$NullableType()); } static final _id_overrideCurrentName = _class.instanceMethodId( @@ -2563,16 +2563,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _overrideCurrentName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _overrideCurrentName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract void overrideCurrentName(java.lang.String name)` /// @@ -2585,11 +2585,11 @@ class JsonParser extends _$jni.JObject { /// resort, as it is a work-around for regular operation. ///@param name Name to use as the current name; may be null. void overrideCurrentName( - _$jni.JString? name, + jni$_.JString? name, ) { - final _$name = name?.reference ?? _$jni.jNullReference; + final _$name = name?.reference ?? jni$_.jNullReference; _overrideCurrentName(reference.pointer, - _id_overrideCurrentName as _$jni.JMethodIDPtr, _$name.pointer) + _id_overrideCurrentName as jni$_.JMethodIDPtr, _$name.pointer) .check(); } @@ -2598,16 +2598,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getCurrentName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCurrentName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract java.lang.String getCurrentName()` @@ -2617,10 +2617,10 @@ class JsonParser extends _$jni.JObject { ///@return Name of the current field in the parsing context ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JString? getCurrentName() { + jni$_.JString? getCurrentName() { return _getCurrentName( - reference.pointer, _id_getCurrentName as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getCurrentName as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_currentName = _class.instanceMethodId( @@ -2628,16 +2628,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _currentName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _currentName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String currentName()` @@ -2652,10 +2652,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.10 - _$jni.JString? currentName() { + jni$_.JString? currentName() { return _currentName( - reference.pointer, _id_currentName as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_currentName as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getText = _class.instanceMethodId( @@ -2663,16 +2663,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getText = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getText = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract java.lang.String getText()` @@ -2686,9 +2686,9 @@ class JsonParser extends _$jni.JObject { /// by \#nextToken() or other iteration methods) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JString? getText() { - return _getText(reference.pointer, _id_getText as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? getText() { + return _getText(reference.pointer, _id_getText as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getText$1 = _class.instanceMethodId( @@ -2696,16 +2696,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/io/Writer;)I', ); - static final _getText$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getText$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public int getText(java.io.Writer writer)` /// @@ -2725,10 +2725,10 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.8 int getText$1( - _$jni.JObject? writer, + jni$_.JObject? writer, ) { - final _$writer = writer?.reference ?? _$jni.jNullReference; - return _getText$1(reference.pointer, _id_getText$1 as _$jni.JMethodIDPtr, + final _$writer = writer?.reference ?? jni$_.jNullReference; + return _getText$1(reference.pointer, _id_getText$1 as jni$_.JMethodIDPtr, _$writer.pointer) .integer; } @@ -2738,16 +2738,16 @@ class JsonParser extends _$jni.JObject { r'()[C', ); - static final _getTextCharacters = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTextCharacters = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract char[] getTextCharacters()` @@ -2780,11 +2780,11 @@ class JsonParser extends _$jni.JObject { /// at offset 0, and not necessarily until the end of buffer) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JArray<_$jni.jchar>? getTextCharacters() { + jni$_.JArray? getTextCharacters() { return _getTextCharacters( - reference.pointer, _id_getTextCharacters as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jchar>?>( - const _$jni.JArrayNullableType<_$jni.jchar>(_$jni.jcharType())); + reference.pointer, _id_getTextCharacters as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jcharType())); } static final _id_getTextLength = _class.instanceMethodId( @@ -2792,16 +2792,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getTextLength = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTextLength = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract int getTextLength()` @@ -2815,7 +2815,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getTextLength() { return _getTextLength( - reference.pointer, _id_getTextLength as _$jni.JMethodIDPtr) + reference.pointer, _id_getTextLength as jni$_.JMethodIDPtr) .integer; } @@ -2824,16 +2824,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getTextOffset = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTextOffset = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract int getTextOffset()` @@ -2847,7 +2847,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getTextOffset() { return _getTextOffset( - reference.pointer, _id_getTextOffset as _$jni.JMethodIDPtr) + reference.pointer, _id_getTextOffset as jni$_.JMethodIDPtr) .integer; } @@ -2856,16 +2856,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _hasTextCharacters = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _hasTextCharacters = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract boolean hasTextCharacters()` @@ -2886,7 +2886,7 @@ class JsonParser extends _$jni.JObject { /// means that it may or may not exist bool hasTextCharacters() { return _hasTextCharacters( - reference.pointer, _id_hasTextCharacters as _$jni.JMethodIDPtr) + reference.pointer, _id_hasTextCharacters as jni$_.JMethodIDPtr) .boolean; } @@ -2895,16 +2895,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Number;', ); - static final _getNumberValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNumberValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract java.lang.Number getNumberValue()` @@ -2920,10 +2920,10 @@ class JsonParser extends _$jni.JObject { /// the current token is not numeric, or if decoding of the value fails /// (invalid format for numbers); plain IOException if underlying /// content read fails (possible if values are extracted lazily) - _$jni.JNumber? getNumberValue() { + jni$_.JNumber? getNumberValue() { return _getNumberValue( - reference.pointer, _id_getNumberValue as _$jni.JMethodIDPtr) - .object<_$jni.JNumber?>(const _$jni.JNumberNullableType()); + reference.pointer, _id_getNumberValue as jni$_.JMethodIDPtr) + .object(const jni$_.JNumberNullableType()); } static final _id_getNumberValueExact = _class.instanceMethodId( @@ -2931,16 +2931,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Number;', ); - static final _getNumberValueExact = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNumberValueExact = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Number getNumberValueExact()` @@ -2960,10 +2960,10 @@ class JsonParser extends _$jni.JObject { /// (invalid format for numbers); plain IOException if underlying /// content read fails (possible if values are extracted lazily) ///@since 2.12 - _$jni.JNumber? getNumberValueExact() { + jni$_.JNumber? getNumberValueExact() { return _getNumberValueExact( - reference.pointer, _id_getNumberValueExact as _$jni.JMethodIDPtr) - .object<_$jni.JNumber?>(const _$jni.JNumberNullableType()); + reference.pointer, _id_getNumberValueExact as jni$_.JMethodIDPtr) + .object(const jni$_.JNumberNullableType()); } static final _id_getNumberType = _class.instanceMethodId( @@ -2971,16 +2971,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - static final _getNumberType = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNumberType = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()` @@ -2995,7 +2995,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems JsonParser_NumberType? getNumberType() { return _getNumberType( - reference.pointer, _id_getNumberType as _$jni.JMethodIDPtr) + reference.pointer, _id_getNumberType as jni$_.JMethodIDPtr) .object( const $JsonParser_NumberType$NullableType()); } @@ -3005,16 +3005,16 @@ class JsonParser extends _$jni.JObject { r'()B', ); - static final _getByteValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getByteValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallByteMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public byte getByteValue()` @@ -3042,7 +3042,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getByteValue() { return _getByteValue( - reference.pointer, _id_getByteValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getByteValue as jni$_.JMethodIDPtr) .byte; } @@ -3051,16 +3051,16 @@ class JsonParser extends _$jni.JObject { r'()S', ); - static final _getShortValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getShortValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallShortMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public short getShortValue()` @@ -3082,7 +3082,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getShortValue() { return _getShortValue( - reference.pointer, _id_getShortValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getShortValue as jni$_.JMethodIDPtr) .short; } @@ -3091,16 +3091,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getIntValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getIntValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract int getIntValue()` @@ -3122,7 +3122,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getIntValue() { return _getIntValue( - reference.pointer, _id_getIntValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getIntValue as jni$_.JMethodIDPtr) .integer; } @@ -3131,16 +3131,16 @@ class JsonParser extends _$jni.JObject { r'()J', ); - static final _getLongValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getLongValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract long getLongValue()` @@ -3162,7 +3162,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getLongValue() { return _getLongValue( - reference.pointer, _id_getLongValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getLongValue as jni$_.JMethodIDPtr) .long; } @@ -3171,16 +3171,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/math/BigInteger;', ); - static final _getBigIntegerValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getBigIntegerValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract java.math.BigInteger getBigIntegerValue()` @@ -3197,10 +3197,10 @@ class JsonParser extends _$jni.JObject { /// otherwise exception thrown ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JObject? getBigIntegerValue() { + jni$_.JObject? getBigIntegerValue() { return _getBigIntegerValue( - reference.pointer, _id_getBigIntegerValue as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getBigIntegerValue as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getFloatValue = _class.instanceMethodId( @@ -3208,16 +3208,16 @@ class JsonParser extends _$jni.JObject { r'()F', ); - static final _getFloatValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getFloatValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract float getFloatValue()` @@ -3239,7 +3239,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems double getFloatValue() { return _getFloatValue( - reference.pointer, _id_getFloatValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getFloatValue as jni$_.JMethodIDPtr) .float; } @@ -3248,16 +3248,16 @@ class JsonParser extends _$jni.JObject { r'()D', ); - static final _getDoubleValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDoubleValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallDoubleMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract double getDoubleValue()` @@ -3279,7 +3279,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems double getDoubleValue() { return _getDoubleValue( - reference.pointer, _id_getDoubleValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getDoubleValue as jni$_.JMethodIDPtr) .doubleFloat; } @@ -3288,16 +3288,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/math/BigDecimal;', ); - static final _getDecimalValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getDecimalValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract java.math.BigDecimal getDecimalValue()` @@ -3311,10 +3311,10 @@ class JsonParser extends _$jni.JObject { /// otherwise exception thrown ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JObject? getDecimalValue() { + jni$_.JObject? getDecimalValue() { return _getDecimalValue( - reference.pointer, _id_getDecimalValue as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getDecimalValue as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getBooleanValue = _class.instanceMethodId( @@ -3322,16 +3322,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _getBooleanValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getBooleanValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getBooleanValue()` @@ -3349,7 +3349,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems bool getBooleanValue() { return _getBooleanValue( - reference.pointer, _id_getBooleanValue as _$jni.JMethodIDPtr) + reference.pointer, _id_getBooleanValue as jni$_.JMethodIDPtr) .boolean; } @@ -3358,16 +3358,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _getEmbeddedObject = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getEmbeddedObject = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object getEmbeddedObject()` @@ -3387,10 +3387,10 @@ class JsonParser extends _$jni.JObject { /// for the current token, if any; {@code null otherwise} ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JObject? getEmbeddedObject() { + jni$_.JObject? getEmbeddedObject() { return _getEmbeddedObject( - reference.pointer, _id_getEmbeddedObject as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getEmbeddedObject as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getBinaryValue = _class.instanceMethodId( @@ -3398,16 +3398,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/Base64Variant;)[B', ); - static final _getBinaryValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getBinaryValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant bv)` /// The returned object must be released after use, by calling the [release] method. @@ -3432,14 +3432,14 @@ class JsonParser extends _$jni.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JArray<_$jni.jbyte>? getBinaryValue( - _$jni.JObject? bv, + jni$_.JArray? getBinaryValue( + jni$_.JObject? bv, ) { - final _$bv = bv?.reference ?? _$jni.jNullReference; + final _$bv = bv?.reference ?? jni$_.jNullReference; return _getBinaryValue(reference.pointer, - _id_getBinaryValue as _$jni.JMethodIDPtr, _$bv.pointer) - .object<_$jni.JArray<_$jni.jbyte>?>( - const _$jni.JArrayNullableType<_$jni.jbyte>(_$jni.jbyteType())); + _id_getBinaryValue as jni$_.JMethodIDPtr, _$bv.pointer) + .object?>( + const jni$_.JArrayNullableType(jni$_.jbyteType())); } static final _id_getBinaryValue$1 = _class.instanceMethodId( @@ -3447,16 +3447,16 @@ class JsonParser extends _$jni.JObject { r'()[B', ); - static final _getBinaryValue$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getBinaryValue$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public byte[] getBinaryValue()` @@ -3468,11 +3468,11 @@ class JsonParser extends _$jni.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - _$jni.JArray<_$jni.jbyte>? getBinaryValue$1() { + jni$_.JArray? getBinaryValue$1() { return _getBinaryValue$1( - reference.pointer, _id_getBinaryValue$1 as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jbyte>?>( - const _$jni.JArrayNullableType<_$jni.jbyte>(_$jni.jbyteType())); + reference.pointer, _id_getBinaryValue$1 as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jbyteType())); } static final _id_readBinaryValue = _class.instanceMethodId( @@ -3480,16 +3480,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/io/OutputStream;)I', ); - static final _readBinaryValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _readBinaryValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public int readBinaryValue(java.io.OutputStream out)` /// @@ -3505,11 +3505,11 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.1 int readBinaryValue( - _$jni.JObject? out, + jni$_.JObject? out, ) { - final _$out = out?.reference ?? _$jni.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _readBinaryValue(reference.pointer, - _id_readBinaryValue as _$jni.JMethodIDPtr, _$out.pointer) + _id_readBinaryValue as jni$_.JMethodIDPtr, _$out.pointer) .integer; } @@ -3518,22 +3518,22 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/Base64Variant;Ljava/io/OutputStream;)I', ); - static final _readBinaryValue$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _readBinaryValue$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public int readBinaryValue(com.fasterxml.jackson.core.Base64Variant bv, java.io.OutputStream out)` /// @@ -3546,14 +3546,14 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems ///@since 2.1 int readBinaryValue$1( - _$jni.JObject? bv, - _$jni.JObject? out, + jni$_.JObject? bv, + jni$_.JObject? out, ) { - final _$bv = bv?.reference ?? _$jni.jNullReference; - final _$out = out?.reference ?? _$jni.jNullReference; + final _$bv = bv?.reference ?? jni$_.jNullReference; + final _$out = out?.reference ?? jni$_.jNullReference; return _readBinaryValue$1( reference.pointer, - _id_readBinaryValue$1 as _$jni.JMethodIDPtr, + _id_readBinaryValue$1 as jni$_.JMethodIDPtr, _$bv.pointer, _$out.pointer) .integer; @@ -3564,16 +3564,16 @@ class JsonParser extends _$jni.JObject { r'()I', ); - static final _getValueAsInt = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValueAsInt = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getValueAsInt()` @@ -3593,7 +3593,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getValueAsInt() { return _getValueAsInt( - reference.pointer, _id_getValueAsInt as _$jni.JMethodIDPtr) + reference.pointer, _id_getValueAsInt as jni$_.JMethodIDPtr) .integer; } @@ -3602,15 +3602,15 @@ class JsonParser extends _$jni.JObject { r'(I)I', ); - static final _getValueAsInt$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallIntMethod') + static final _getValueAsInt$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public int getValueAsInt(int def)` /// @@ -3631,7 +3631,7 @@ class JsonParser extends _$jni.JObject { int def, ) { return _getValueAsInt$1( - reference.pointer, _id_getValueAsInt$1 as _$jni.JMethodIDPtr, def) + reference.pointer, _id_getValueAsInt$1 as jni$_.JMethodIDPtr, def) .integer; } @@ -3640,16 +3640,16 @@ class JsonParser extends _$jni.JObject { r'()J', ); - static final _getValueAsLong = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValueAsLong = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public long getValueAsLong()` @@ -3669,7 +3669,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems int getValueAsLong() { return _getValueAsLong( - reference.pointer, _id_getValueAsLong as _$jni.JMethodIDPtr) + reference.pointer, _id_getValueAsLong as jni$_.JMethodIDPtr) .long; } @@ -3678,15 +3678,15 @@ class JsonParser extends _$jni.JObject { r'(J)J', ); - static final _getValueAsLong$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int64,)>)>>('globalEnv_CallLongMethod') + static final _getValueAsLong$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int64,)>)>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public long getValueAsLong(long def)` /// @@ -3707,7 +3707,7 @@ class JsonParser extends _$jni.JObject { int def, ) { return _getValueAsLong$1( - reference.pointer, _id_getValueAsLong$1 as _$jni.JMethodIDPtr, def) + reference.pointer, _id_getValueAsLong$1 as jni$_.JMethodIDPtr, def) .long; } @@ -3716,16 +3716,16 @@ class JsonParser extends _$jni.JObject { r'()D', ); - static final _getValueAsDouble = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValueAsDouble = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallDoubleMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public double getValueAsDouble()` @@ -3745,7 +3745,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems double getValueAsDouble() { return _getValueAsDouble( - reference.pointer, _id_getValueAsDouble as _$jni.JMethodIDPtr) + reference.pointer, _id_getValueAsDouble as jni$_.JMethodIDPtr) .doubleFloat; } @@ -3754,16 +3754,16 @@ class JsonParser extends _$jni.JObject { r'(D)D', ); - static final _getValueAsDouble$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Double,)>)>>('globalEnv_CallDoubleMethod') + static final _getValueAsDouble$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Double,)>)>>('globalEnv_CallDoubleMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public double getValueAsDouble(double def)` /// @@ -3784,7 +3784,7 @@ class JsonParser extends _$jni.JObject { double def, ) { return _getValueAsDouble$1(reference.pointer, - _id_getValueAsDouble$1 as _$jni.JMethodIDPtr, def) + _id_getValueAsDouble$1 as jni$_.JMethodIDPtr, def) .doubleFloat; } @@ -3793,16 +3793,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _getValueAsBoolean = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValueAsBoolean = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getValueAsBoolean()` @@ -3822,7 +3822,7 @@ class JsonParser extends _$jni.JObject { /// JsonParseException for decoding problems bool getValueAsBoolean() { return _getValueAsBoolean( - reference.pointer, _id_getValueAsBoolean as _$jni.JMethodIDPtr) + reference.pointer, _id_getValueAsBoolean as jni$_.JMethodIDPtr) .boolean; } @@ -3831,16 +3831,16 @@ class JsonParser extends _$jni.JObject { r'(Z)Z', ); - static final _getValueAsBoolean$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallBooleanMethod') + static final _getValueAsBoolean$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public boolean getValueAsBoolean(boolean def)` /// @@ -3861,7 +3861,7 @@ class JsonParser extends _$jni.JObject { bool def, ) { return _getValueAsBoolean$1(reference.pointer, - _id_getValueAsBoolean$1 as _$jni.JMethodIDPtr, def ? 1 : 0) + _id_getValueAsBoolean$1 as jni$_.JMethodIDPtr, def ? 1 : 0) .boolean; } @@ -3870,16 +3870,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getValueAsString = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValueAsString = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getValueAsString()` @@ -3896,10 +3896,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.1 - _$jni.JString? getValueAsString() { + jni$_.JString? getValueAsString() { return _getValueAsString( - reference.pointer, _id_getValueAsString as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getValueAsString as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getValueAsString$1 = _class.instanceMethodId( @@ -3907,16 +3907,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _getValueAsString$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getValueAsString$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract java.lang.String getValueAsString(java.lang.String def)` /// The returned object must be released after use, by calling the [release] method. @@ -3933,13 +3933,13 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.1 - _$jni.JString? getValueAsString$1( - _$jni.JString? def, + jni$_.JString? getValueAsString$1( + jni$_.JString? def, ) { - final _$def = def?.reference ?? _$jni.jNullReference; + final _$def = def?.reference ?? jni$_.jNullReference; return _getValueAsString$1(reference.pointer, - _id_getValueAsString$1 as _$jni.JMethodIDPtr, _$def.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_getValueAsString$1 as jni$_.JMethodIDPtr, _$def.pointer) + .object(const jni$_.JStringNullableType()); } static final _id_canReadObjectId = _class.instanceMethodId( @@ -3947,16 +3947,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _canReadObjectId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _canReadObjectId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean canReadObjectId()` @@ -3974,7 +3974,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.3 bool canReadObjectId() { return _canReadObjectId( - reference.pointer, _id_canReadObjectId as _$jni.JMethodIDPtr) + reference.pointer, _id_canReadObjectId as jni$_.JMethodIDPtr) .boolean; } @@ -3983,16 +3983,16 @@ class JsonParser extends _$jni.JObject { r'()Z', ); - static final _canReadTypeId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _canReadTypeId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean canReadTypeId()` @@ -4010,7 +4010,7 @@ class JsonParser extends _$jni.JObject { ///@since 2.3 bool canReadTypeId() { return _canReadTypeId( - reference.pointer, _id_canReadTypeId as _$jni.JMethodIDPtr) + reference.pointer, _id_canReadTypeId as jni$_.JMethodIDPtr) .boolean; } @@ -4019,16 +4019,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _getObjectId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getObjectId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object getObjectId()` @@ -4047,10 +4047,10 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.3 - _$jni.JObject? getObjectId() { + jni$_.JObject? getObjectId() { return _getObjectId( - reference.pointer, _id_getObjectId as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_getObjectId as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_getTypeId = _class.instanceMethodId( @@ -4058,16 +4058,16 @@ class JsonParser extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _getTypeId = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getTypeId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object getTypeId()` @@ -4086,9 +4086,9 @@ class JsonParser extends _$jni.JObject { ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems ///@since 2.3 - _$jni.JObject? getTypeId() { - return _getTypeId(reference.pointer, _id_getTypeId as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? getTypeId() { + return _getTypeId(reference.pointer, _id_getTypeId as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_readValueAs = _class.instanceMethodId( @@ -4096,16 +4096,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/lang/Class;)Ljava/lang/Object;', ); - static final _readValueAs = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _readValueAs = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T readValueAs(java.lang.Class valueType)` /// The returned object must be released after use, by calling the [release] method. @@ -4135,13 +4135,13 @@ class JsonParser extends _$jni.JObject { ///@return Java value read from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T? readValueAs<$T extends _$jni.JObject?>( - _$jni.JObject? valueType, { - required _$jni.JObjType<$T> T, + $T? readValueAs<$T extends jni$_.JObject?>( + jni$_.JObject? valueType, { + required jni$_.JObjType<$T> T, }) { - final _$valueType = valueType?.reference ?? _$jni.jNullReference; + final _$valueType = valueType?.reference ?? jni$_.jNullReference; return _readValueAs(reference.pointer, - _id_readValueAs as _$jni.JMethodIDPtr, _$valueType.pointer) + _id_readValueAs as jni$_.JMethodIDPtr, _$valueType.pointer) .object<$T?>(T.nullableType); } @@ -4150,16 +4150,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/lang/Object;', ); - static final _readValueAs$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _readValueAs$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T readValueAs(com.fasterxml.jackson.core.type.TypeReference valueTypeRef)` /// The returned object must be released after use, by calling the [release] method. @@ -4186,13 +4186,13 @@ class JsonParser extends _$jni.JObject { ///@return Java value read from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T? readValueAs$1<$T extends _$jni.JObject?>( - _$jni.JObject? valueTypeRef, { - required _$jni.JObjType<$T> T, + $T? readValueAs$1<$T extends jni$_.JObject?>( + jni$_.JObject? valueTypeRef, { + required jni$_.JObjType<$T> T, }) { - final _$valueTypeRef = valueTypeRef?.reference ?? _$jni.jNullReference; + final _$valueTypeRef = valueTypeRef?.reference ?? jni$_.jNullReference; return _readValueAs$1(reference.pointer, - _id_readValueAs$1 as _$jni.JMethodIDPtr, _$valueTypeRef.pointer) + _id_readValueAs$1 as jni$_.JMethodIDPtr, _$valueTypeRef.pointer) .object<$T?>(T.nullableType); } @@ -4201,16 +4201,16 @@ class JsonParser extends _$jni.JObject { r'(Ljava/lang/Class;)Ljava/util/Iterator;', ); - static final _readValuesAs = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _readValuesAs = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.util.Iterator readValuesAs(java.lang.Class valueType)` /// The returned object must be released after use, by calling the [release] method. @@ -4223,15 +4223,15 @@ class JsonParser extends _$jni.JObject { ///@return Iterator for reading multiple Java values from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - _$jni.JIterator<$T?>? readValuesAs<$T extends _$jni.JObject?>( - _$jni.JObject? valueType, { - required _$jni.JObjType<$T> T, + jni$_.JIterator<$T?>? readValuesAs<$T extends jni$_.JObject?>( + jni$_.JObject? valueType, { + required jni$_.JObjType<$T> T, }) { - final _$valueType = valueType?.reference ?? _$jni.jNullReference; + final _$valueType = valueType?.reference ?? jni$_.jNullReference; return _readValuesAs(reference.pointer, - _id_readValuesAs as _$jni.JMethodIDPtr, _$valueType.pointer) - .object<_$jni.JIterator<$T?>?>( - _$jni.JIteratorNullableType<$T?>(T.nullableType)); + _id_readValuesAs as jni$_.JMethodIDPtr, _$valueType.pointer) + .object?>( + jni$_.JIteratorNullableType<$T?>(T.nullableType)); } static final _id_readValuesAs$1 = _class.instanceMethodId( @@ -4239,16 +4239,16 @@ class JsonParser extends _$jni.JObject { r'(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/util/Iterator;', ); - static final _readValuesAs$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _readValuesAs$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.util.Iterator readValuesAs(com.fasterxml.jackson.core.type.TypeReference valueTypeRef)` /// The returned object must be released after use, by calling the [release] method. @@ -4261,15 +4261,15 @@ class JsonParser extends _$jni.JObject { ///@return Iterator for reading multiple Java values from content ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - _$jni.JIterator<$T?>? readValuesAs$1<$T extends _$jni.JObject?>( - _$jni.JObject? valueTypeRef, { - required _$jni.JObjType<$T> T, + jni$_.JIterator<$T?>? readValuesAs$1<$T extends jni$_.JObject?>( + jni$_.JObject? valueTypeRef, { + required jni$_.JObjType<$T> T, }) { - final _$valueTypeRef = valueTypeRef?.reference ?? _$jni.jNullReference; + final _$valueTypeRef = valueTypeRef?.reference ?? jni$_.jNullReference; return _readValuesAs$1(reference.pointer, - _id_readValuesAs$1 as _$jni.JMethodIDPtr, _$valueTypeRef.pointer) - .object<_$jni.JIterator<$T?>?>( - _$jni.JIteratorNullableType<$T?>(T.nullableType)); + _id_readValuesAs$1 as jni$_.JMethodIDPtr, _$valueTypeRef.pointer) + .object?>( + jni$_.JIteratorNullableType<$T?>(T.nullableType)); } static final _id_readValueAsTree = _class.instanceMethodId( @@ -4277,16 +4277,16 @@ class JsonParser extends _$jni.JObject { r'()Lcom/fasterxml/jackson/core/TreeNode;', ); - static final _readValueAsTree = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _readValueAsTree = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public T readValueAsTree()` @@ -4301,83 +4301,83 @@ class JsonParser extends _$jni.JObject { ///@return root of the document, or null if empty or whitespace. ///@throws IOException if there is either an underlying I/O problem or decoding /// issue at format layer - $T? readValueAsTree<$T extends _$jni.JObject?>({ - required _$jni.JObjType<$T> T, + $T? readValueAsTree<$T extends jni$_.JObject?>({ + required jni$_.JObjType<$T> T, }) { return _readValueAsTree( - reference.pointer, _id_readValueAsTree as _$jni.JMethodIDPtr) + reference.pointer, _id_readValueAsTree as jni$_.JMethodIDPtr) .object<$T?>(T.nullableType); } } -final class $JsonParser$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $JsonParser$NullableType extends jni$_.JObjType { + @jni$_.internal const $JsonParser$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser;'; - @_$jni.internal - @_$core.override - JsonParser? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + JsonParser? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonParser.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonParser$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonParser$NullableType) && other is $JsonParser$NullableType; } } -final class $JsonParser$Type extends _$jni.JObjType { - @_$jni.internal +final class $JsonParser$Type extends jni$_.JObjType { + @jni$_.internal const $JsonParser$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonParser;'; - @_$jni.internal - @_$core.override - JsonParser fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonParser fromReference(jni$_.JReference reference) => JsonParser.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonParser$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonParser$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonParser$Type) && other is $JsonParser$Type; } diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart index cc94a7cc7..88f09cde7 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart @@ -47,28 +47,28 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `com.fasterxml.jackson.core.JsonToken` /// /// Enumeration for basic token types used for returning results /// of parsing JSON content. -class JsonToken extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonToken extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonToken.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/fasterxml/jackson/core/JsonToken'); + jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonToken'); /// The type which includes information such as the signature of this class. static const nullableType = $JsonToken$NullableType(); @@ -78,24 +78,24 @@ class JsonToken extends _$jni.JObject { r'()[Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.fasterxml.jackson.core.JsonToken[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType( + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( $JsonToken$NullableType())); } @@ -104,24 +104,24 @@ class JsonToken extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonToken;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonToken? valueOf( - _$jni.JString? name, + jni$_.JString? name, ) { - final _$name = name?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$name = name?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) .object(const $JsonToken$NullableType()); } @@ -131,21 +131,21 @@ class JsonToken extends _$jni.JObject { r'()I', ); - static final _id = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _id = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final int id()` int id() { - return _id(reference.pointer, _id_id as _$jni.JMethodIDPtr).integer; + return _id(reference.pointer, _id_id as jni$_.JMethodIDPtr).integer; } static final _id_asString = _class.instanceMethodId( @@ -153,23 +153,23 @@ class JsonToken extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _asString = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _asString = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final java.lang.String asString()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? asString() { - return _asString(reference.pointer, _id_asString as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + jni$_.JString? asString() { + return _asString(reference.pointer, _id_asString as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_asCharArray = _class.instanceMethodId( @@ -177,25 +177,25 @@ class JsonToken extends _$jni.JObject { r'()[C', ); - static final _asCharArray = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _asCharArray = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final char[] asCharArray()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.jchar>? asCharArray() { + jni$_.JArray? asCharArray() { return _asCharArray( - reference.pointer, _id_asCharArray as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jchar>?>( - const _$jni.JArrayNullableType<_$jni.jchar>(_$jni.jcharType())); + reference.pointer, _id_asCharArray as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jcharType())); } static final _id_asByteArray = _class.instanceMethodId( @@ -203,25 +203,25 @@ class JsonToken extends _$jni.JObject { r'()[B', ); - static final _asByteArray = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _asByteArray = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final byte[] asByteArray()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.jbyte>? asByteArray() { + jni$_.JArray? asByteArray() { return _asByteArray( - reference.pointer, _id_asByteArray as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jbyte>?>( - const _$jni.JArrayNullableType<_$jni.jbyte>(_$jni.jbyteType())); + reference.pointer, _id_asByteArray as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jbyteType())); } static final _id_isNumeric = _class.instanceMethodId( @@ -229,16 +229,16 @@ class JsonToken extends _$jni.JObject { r'()Z', ); - static final _isNumeric = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isNumeric = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final boolean isNumeric()` @@ -246,7 +246,7 @@ class JsonToken extends _$jni.JObject { /// @return {@code True} if this token is {@code VALUE_NUMBER_INT} or {@code VALUE_NUMBER_FLOAT}, /// {@code false} otherwise bool isNumeric() { - return _isNumeric(reference.pointer, _id_isNumeric as _$jni.JMethodIDPtr) + return _isNumeric(reference.pointer, _id_isNumeric as jni$_.JMethodIDPtr) .boolean; } @@ -255,16 +255,16 @@ class JsonToken extends _$jni.JObject { r'()Z', ); - static final _isStructStart = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isStructStart = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final boolean isStructStart()` @@ -278,7 +278,7 @@ class JsonToken extends _$jni.JObject { ///@since 2.3 bool isStructStart() { return _isStructStart( - reference.pointer, _id_isStructStart as _$jni.JMethodIDPtr) + reference.pointer, _id_isStructStart as jni$_.JMethodIDPtr) .boolean; } @@ -287,16 +287,16 @@ class JsonToken extends _$jni.JObject { r'()Z', ); - static final _isStructEnd = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isStructEnd = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final boolean isStructEnd()` @@ -310,7 +310,7 @@ class JsonToken extends _$jni.JObject { ///@since 2.3 bool isStructEnd() { return _isStructEnd( - reference.pointer, _id_isStructEnd as _$jni.JMethodIDPtr) + reference.pointer, _id_isStructEnd as jni$_.JMethodIDPtr) .boolean; } @@ -319,16 +319,16 @@ class JsonToken extends _$jni.JObject { r'()Z', ); - static final _isScalarValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isScalarValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final boolean isScalarValue()` @@ -341,7 +341,7 @@ class JsonToken extends _$jni.JObject { /// {@code VALUE_xxx} tokens), {@code false} otherwise bool isScalarValue() { return _isScalarValue( - reference.pointer, _id_isScalarValue as _$jni.JMethodIDPtr) + reference.pointer, _id_isScalarValue as jni$_.JMethodIDPtr) .boolean; } @@ -350,16 +350,16 @@ class JsonToken extends _$jni.JObject { r'()Z', ); - static final _isBoolean = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _isBoolean = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final boolean isBoolean()` @@ -367,79 +367,79 @@ class JsonToken extends _$jni.JObject { /// @return {@code True} if this token is {@code VALUE_TRUE} or {@code VALUE_FALSE}, /// {@code false} otherwise bool isBoolean() { - return _isBoolean(reference.pointer, _id_isBoolean as _$jni.JMethodIDPtr) + return _isBoolean(reference.pointer, _id_isBoolean as jni$_.JMethodIDPtr) .boolean; } } -final class $JsonToken$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $JsonToken$NullableType extends jni$_.JObjType { + @jni$_.internal const $JsonToken$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonToken;'; - @_$jni.internal - @_$core.override - JsonToken? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + JsonToken? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonToken.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonToken$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonToken$NullableType) && other is $JsonToken$NullableType; } } -final class $JsonToken$Type extends _$jni.JObjType { - @_$jni.internal +final class $JsonToken$Type extends jni$_.JObjType { + @jni$_.internal const $JsonToken$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/fasterxml/jackson/core/JsonToken;'; - @_$jni.internal - @_$core.override - JsonToken fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonToken fromReference(jni$_.JReference reference) => JsonToken.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonToken$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonToken$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonToken$Type) && other is $JsonToken$Type; } diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index d6769f1aa..a7ba372f5 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -34,41 +34,41 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `com.github.dart_lang.jnigen.Measure` -class Measure<$T extends _$jni.JObject> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class Measure<$T extends jni$_.JObject> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal Measure.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Measure'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/Measure'); /// The type which includes information such as the signature of this class. - static $Measure$NullableType<$T> nullableType<$T extends _$jni.JObject>( - _$jni.JObjType<$T> T, + static $Measure$NullableType<$T> nullableType<$T extends jni$_.JObject>( + jni$_.JObjType<$T> T, ) { return $Measure$NullableType<$T>( T, ); } - static $Measure$Type<$T> type<$T extends _$jni.JObject>( - _$jni.JObjType<$T> T, + static $Measure$Type<$T> type<$T extends jni$_.JObject>( + jni$_.JObjType<$T> T, ) { return $Measure$Type<$T>( T, @@ -80,21 +80,21 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { r'()F', ); - static final _getValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getValue()` double getValue() { - return _getValue(reference.pointer, _id_getValue as _$jni.JMethodIDPtr) + return _getValue(reference.pointer, _id_getValue as jni$_.JMethodIDPtr) .float; } @@ -103,22 +103,22 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/MeasureUnit;', ); - static final _getUnit = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getUnit = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public T getUnit()` /// The returned object must be released after use, by calling the [release] method. $T getUnit() { - return _getUnit(reference.pointer, _id_getUnit as _$jni.JMethodIDPtr) + return _getUnit(reference.pointer, _id_getUnit as jni$_.JMethodIDPtr) .object<$T>(T); } @@ -127,16 +127,16 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { r'(Lcom/github/dart_lang/jnigen/MeasureUnit;)F', ); - static final _convertValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _convertValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final float convertValue(T measureUnit)` double convertValue( @@ -144,49 +144,49 @@ class Measure<$T extends _$jni.JObject> extends _$jni.JObject { ) { final _$measureUnit = measureUnit.reference; return _convertValue(reference.pointer, - _id_convertValue as _$jni.JMethodIDPtr, _$measureUnit.pointer) + _id_convertValue as jni$_.JMethodIDPtr, _$measureUnit.pointer) .float; } } -final class $Measure$NullableType<$T extends _$jni.JObject> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Measure$NullableType<$T extends jni$_.JObject> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $Measure$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Measure;'; - @_$jni.internal - @_$core.override - Measure<$T>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Measure<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : Measure<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Measure$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Measure$NullableType<$T>) && other is $Measure$NullableType<$T> && @@ -194,43 +194,43 @@ final class $Measure$NullableType<$T extends _$jni.JObject> } } -final class $Measure$Type<$T extends _$jni.JObject> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Measure$Type<$T extends jni$_.JObject> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $Measure$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Measure;'; - @_$jni.internal - @_$core.override - Measure<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Measure<$T> fromReference(jni$_.JReference reference) => Measure<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => $Measure$NullableType<$T>(T); + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $Measure$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Measure$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Measure$Type<$T>) && other is $Measure$Type<$T> && @@ -239,19 +239,19 @@ final class $Measure$Type<$T extends _$jni.JObject> } /// from: `com.github.dart_lang.jnigen.MeasureUnit` -class MeasureUnit extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class MeasureUnit extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal MeasureUnit.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/MeasureUnit'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/MeasureUnit'); /// The type which includes information such as the signature of this class. static const nullableType = $MeasureUnit$NullableType(); @@ -261,23 +261,23 @@ class MeasureUnit extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getSign = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSign = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getSign() { - return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) - .object<_$jni.JString>(const _$jni.JStringType()); + jni$_.JString getSign() { + return _getSign(reference.pointer, _id_getSign as jni$_.JMethodIDPtr) + .object(const jni$_.JStringType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -285,35 +285,35 @@ class MeasureUnit extends _$jni.JObject { r'()F', ); - static final _getCoefficient = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCoefficient = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract float getCoefficient()` double getCoefficient() { return _getCoefficient( - reference.pointer, _id_getCoefficient as _$jni.JMethodIDPtr) + reference.pointer, _id_getCoefficient as jni$_.JMethodIDPtr) .float; } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -321,51 +321,51 @@ class MeasureUnit extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r'getSign()Ljava/lang/String;') { final $r = _$impls[$p]!.getSign(); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'getCoefficient()F') { final $r = _$impls[$p]!.getCoefficient(); - return _$jni.JFloat($r).reference.toPointer(); + return jni$_.JFloat($r).reference.toPointer(); } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $MeasureUnit $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.MeasureUnit', @@ -380,7 +380,7 @@ class MeasureUnit extends _$jni.JObject { factory MeasureUnit.implement( $MeasureUnit $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return MeasureUnit.fromReference( $i.implementReference(), @@ -390,25 +390,25 @@ class MeasureUnit extends _$jni.JObject { abstract base mixin class $MeasureUnit { factory $MeasureUnit({ - required _$jni.JString Function() getSign, + required jni$_.JString Function() getSign, required double Function() getCoefficient, }) = _$MeasureUnit; - _$jni.JString getSign(); + jni$_.JString getSign(); double getCoefficient(); } final class _$MeasureUnit with $MeasureUnit { _$MeasureUnit({ - required _$jni.JString Function() getSign, + required jni$_.JString Function() getSign, required double Function() getCoefficient, }) : _getSign = getSign, _getCoefficient = getCoefficient; - final _$jni.JString Function() _getSign; + final jni$_.JString Function() _getSign; final double Function() _getCoefficient; - _$jni.JString getSign() { + jni$_.JString getSign() { return _getSign(); } @@ -417,74 +417,74 @@ final class _$MeasureUnit with $MeasureUnit { } } -final class $MeasureUnit$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $MeasureUnit$NullableType extends jni$_.JObjType { + @jni$_.internal const $MeasureUnit$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; - @_$jni.internal - @_$core.override - MeasureUnit? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + MeasureUnit? fromReference(jni$_.JReference reference) => reference.isNull ? null : MeasureUnit.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MeasureUnit$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MeasureUnit$NullableType) && other is $MeasureUnit$NullableType; } } -final class $MeasureUnit$Type extends _$jni.JObjType { - @_$jni.internal +final class $MeasureUnit$Type extends jni$_.JObjType { + @jni$_.internal const $MeasureUnit$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/MeasureUnit;'; - @_$jni.internal - @_$core.override - MeasureUnit fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MeasureUnit fromReference(jni$_.JReference reference) => MeasureUnit.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $MeasureUnit$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MeasureUnit$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MeasureUnit$Type) && other is $MeasureUnit$Type; @@ -492,41 +492,41 @@ final class $MeasureUnit$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.Nullability$InnerClass` -class Nullability_InnerClass<$T extends _$jni.JObject?, - $U extends _$jni.JObject, $V extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class Nullability_InnerClass<$T extends jni$_.JObject?, + $U extends jni$_.JObject, $V extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal Nullability_InnerClass.fromReference( this.T, this.U, this.V, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T, $U, $V>(T, U, V), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/Nullability$InnerClass'); /// The type which includes information such as the signature of this class. static $Nullability_InnerClass$NullableType<$T, $U, $V> nullableType< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $V extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, - _$jni.JObjType<$V> V, + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $V extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, + jni$_.JObjType<$V> V, ) { return $Nullability_InnerClass$NullableType<$T, $U, $V>( T, @@ -536,12 +536,12 @@ class Nullability_InnerClass<$T extends _$jni.JObject?, } static $Nullability_InnerClass$Type<$T, $U, $V> type< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $V extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, - _$jni.JObjType<$V> V, + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $V extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, + jni$_.JObjType<$V> V, ) { return $Nullability_InnerClass$Type<$T, $U, $V>( T, @@ -554,39 +554,39 @@ class Nullability_InnerClass<$T extends _$jni.JObject?, r'(Lcom/github/dart_lang/jnigen/Nullability;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.Nullability $outerClass)` /// The returned object must be released after use, by calling the [release] method. factory Nullability_InnerClass( Nullability<$T?, $U> $outerClass, { - _$jni.JObjType<$T>? T, - _$jni.JObjType<$U>? U, - required _$jni.JObjType<$V> V, + jni$_.JObjType<$T>? T, + jni$_.JObjType<$U>? U, + required jni$_.JObjType<$V> V, }) { - T ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $Nullability$Type<_$core.dynamic, _$core.dynamic>) + T ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $Nullability$Type) .T, - ]) as _$jni.JObjType<$T>; - U ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $Nullability$Type<_$core.dynamic, _$core.dynamic>) + ]) as jni$_.JObjType<$T>; + U ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $Nullability$Type) .U, - ]) as _$jni.JObjType<$U>; + ]) as jni$_.JObjType<$U>; final _$$outerClass = $outerClass.reference; return Nullability_InnerClass<$T, $U, $V>.fromReference( T, U, V, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer) .reference); } @@ -596,24 +596,24 @@ class Nullability_InnerClass<$T extends _$jni.JObject?, r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _f = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _f = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public final void f(T object, U object1, V object2)` void f( @@ -621,43 +621,43 @@ class Nullability_InnerClass<$T extends _$jni.JObject?, $U object1, $V object2, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; final _$object1 = object1.reference; - final _$object2 = object2?.reference ?? _$jni.jNullReference; - _f(reference.pointer, _id_f as _$jni.JMethodIDPtr, _$object.pointer, + final _$object2 = object2?.reference ?? jni$_.jNullReference; + _f(reference.pointer, _id_f as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer, _$object2.pointer) .check(); } } -final class $Nullability_InnerClass$NullableType<$T extends _$jni.JObject?, - $U extends _$jni.JObject, $V extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Nullability_InnerClass$NullableType<$T extends jni$_.JObject?, + $U extends jni$_.JObject, $V extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $Nullability_InnerClass$NullableType( this.T, this.U, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Nullability$InnerClass;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override Nullability_InnerClass<$T, $U, $V>? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : Nullability_InnerClass<$T, $U, $V>.fromReference( @@ -666,23 +666,23 @@ final class $Nullability_InnerClass$NullableType<$T extends _$jni.JObject?, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Nullability_InnerClass$NullableType, T, U, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Nullability_InnerClass$NullableType<$T, $U, $V>) && @@ -693,57 +693,57 @@ final class $Nullability_InnerClass$NullableType<$T extends _$jni.JObject?, } } -final class $Nullability_InnerClass$Type<$T extends _$jni.JObject?, - $U extends _$jni.JObject, $V extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Nullability_InnerClass$Type<$T extends jni$_.JObject?, + $U extends jni$_.JObject, $V extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $Nullability_InnerClass$Type( this.T, this.U, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Nullability$InnerClass;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override Nullability_InnerClass<$T, $U, $V> fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => Nullability_InnerClass<$T, $U, $V>.fromReference( T, U, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $Nullability_InnerClass$NullableType<$T, $U, $V>(T, U, V); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Nullability_InnerClass$Type, T, U, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Nullability_InnerClass$Type<$T, $U, $V>) && other is $Nullability_InnerClass$Type<$T, $U, $V> && @@ -754,34 +754,34 @@ final class $Nullability_InnerClass$Type<$T extends _$jni.JObject?, } /// from: `com.github.dart_lang.jnigen.Nullability` -class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal Nullability.fromReference( this.T, this.U, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T, $U>(T, U), super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Nullability'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/Nullability'); /// The type which includes information such as the signature of this class. static $Nullability$NullableType<$T, $U> - nullableType<$T extends _$jni.JObject?, $U extends _$jni.JObject>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, + nullableType<$T extends jni$_.JObject?, $U extends jni$_.JObject>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, ) { return $Nullability$NullableType<$T, $U>( T, @@ -790,9 +790,9 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> } static $Nullability$Type<$T, $U> - type<$T extends _$jni.JObject?, $U extends _$jni.JObject>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, + type<$T extends jni$_.JObject?, $U extends jni$_.JObject>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, ) { return $Nullability$Type<$T, $U>( T, @@ -804,24 +804,24 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (T object, U object1, U object2)` /// The returned object must be released after use, by calling the [release] method. @@ -829,19 +829,19 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> $T object, $U object1, $U? object2, { - required _$jni.JObjType<$T> T, - _$jni.JObjType<$U>? U, + required jni$_.JObjType<$T> T, + jni$_.JObjType<$U>? U, }) { - U ??= _$jni.lowestCommonSuperType([ + U ??= jni$_.lowestCommonSuperType([ object1.$type, - ]) as _$jni.JObjType<$U>; - final _$object = object?.reference ?? _$jni.jNullReference; + ]) as jni$_.JObjType<$U>; + final _$object = object?.reference ?? jni$_.jNullReference; final _$object1 = object1.reference; - final _$object2 = object2?.reference ?? _$jni.jNullReference; + final _$object2 = object2?.reference ?? jni$_.jNullReference; return Nullability<$T, $U>.fromReference( T, U, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer, _$object2.pointer) .reference); } @@ -851,22 +851,22 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'()Ljava/lang/Object;', ); - static final _getT = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getT = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final T getT()` /// The returned object must be released after use, by calling the [release] method. $T getT() { - return _getT(reference.pointer, _id_getT as _$jni.JMethodIDPtr) + return _getT(reference.pointer, _id_getT as jni$_.JMethodIDPtr) .object<$T>(T); } @@ -875,22 +875,22 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'()Ljava/lang/Object;', ); - static final _getU = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getU = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final U getU()` /// The returned object must be released after use, by calling the [release] method. $U getU() { - return _getU(reference.pointer, _id_getU as _$jni.JMethodIDPtr) + return _getU(reference.pointer, _id_getU as jni$_.JMethodIDPtr) .object<$U>(U); } @@ -899,23 +899,23 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'()Ljava/lang/Object;', ); - static final _getNullableU = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNullableU = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final U getNullableU()` /// The returned object must be released after use, by calling the [release] method. $U? getNullableU() { return _getNullableU( - reference.pointer, _id_getNullableU as _$jni.JMethodIDPtr) + reference.pointer, _id_getNullableU as jni$_.JMethodIDPtr) .object<$U?>(U.nullableType); } @@ -924,23 +924,23 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)V', ); - static final _setNullableU = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setNullableU = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final void setNullableU(U object)` void setNullableU( $U? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - _setNullableU(reference.pointer, _id_setNullableU as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + _setNullableU(reference.pointer, _id_setNullableU as jni$_.JMethodIDPtr, _$object.pointer) .check(); } @@ -950,23 +950,23 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'()Ljava/lang/String;', ); - static final _hello = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _hello = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final java.lang.String hello()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString hello() { - return _hello(reference.pointer, _id_hello as _$jni.JMethodIDPtr) - .object<_$jni.JString>(const _$jni.JStringType()); + jni$_.JString hello() { + return _hello(reference.pointer, _id_hello as jni$_.JMethodIDPtr) + .object(const jni$_.JStringType()); } static final _id_nullableHello = _class.instanceMethodId( @@ -974,24 +974,24 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Z)Ljava/lang/String;', ); - static final _nullableHello = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableHello = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public final java.lang.String nullableHello(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? nullableHello( + jni$_.JString? nullableHello( bool z, ) { return _nullableHello(reference.pointer, - _id_nullableHello as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_nullableHello as jni$_.JMethodIDPtr, z ? 1 : 0) + .object(const jni$_.JStringNullableType()); } static final _id_methodGenericEcho = _class.instanceMethodId( @@ -999,29 +999,29 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _methodGenericEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final V methodGenericEcho(V object)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericEcho<$V extends _$jni.JObject>( + $V methodGenericEcho<$V extends jni$_.JObject>( $V object, { - _$jni.JObjType<$V>? V, + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ + V ??= jni$_.lowestCommonSuperType([ object.$type, - ]) as _$jni.JObjType<$V>; + ]) as jni$_.JObjType<$V>; final _$object = object.reference; return _methodGenericEcho(reference.pointer, - _id_methodGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + _id_methodGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -1030,27 +1030,27 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _methodGenericNullableEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericNullableEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final V methodGenericNullableEcho(V object)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericNullableEcho<$V extends _$jni.JObject?>( + $V methodGenericNullableEcho<$V extends jni$_.JObject?>( $V object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _methodGenericNullableEcho( reference.pointer, - _id_methodGenericNullableEcho as _$jni.JMethodIDPtr, + _id_methodGenericNullableEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -1060,16 +1060,16 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _classGenericEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _classGenericEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final U classGenericEcho(U object)` /// The returned object must be released after use, by calling the [release] method. @@ -1078,7 +1078,7 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> ) { final _$object = object.reference; return _classGenericEcho(reference.pointer, - _id_classGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + _id_classGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$U>(U); } @@ -1087,26 +1087,26 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _classGenericNullableEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _classGenericNullableEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final T classGenericNullableEcho(T object)` /// The returned object must be released after use, by calling the [release] method. $T classGenericNullableEcho( $T object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _classGenericNullableEcho( reference.pointer, - _id_classGenericNullableEcho as _$jni.JMethodIDPtr, + _id_classGenericNullableEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$T>(T); } @@ -1116,26 +1116,26 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/util/List;)Ljava/lang/String;', ); - static final _firstOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.lang.String firstOf(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString firstOf( - _$jni.JList<_$jni.JString> list, + jni$_.JString firstOf( + jni$_.JList list, ) { final _$list = list.reference; - return _firstOf(reference.pointer, _id_firstOf as _$jni.JMethodIDPtr, + return _firstOf(reference.pointer, _id_firstOf as jni$_.JMethodIDPtr, _$list.pointer) - .object<_$jni.JString>(const _$jni.JStringType()); + .object(const jni$_.JStringType()); } static final _id_firstOfNullable = _class.instanceMethodId( @@ -1143,26 +1143,26 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/util/List;)Ljava/lang/String;', ); - static final _firstOfNullable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstOfNullable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.lang.String firstOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? firstOfNullable( - _$jni.JList<_$jni.JString?> list, + jni$_.JString? firstOfNullable( + jni$_.JList list, ) { final _$list = list.reference; return _firstOfNullable(reference.pointer, - _id_firstOfNullable as _$jni.JMethodIDPtr, _$list.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_firstOfNullable as jni$_.JMethodIDPtr, _$list.pointer) + .object(const jni$_.JStringNullableType()); } static final _id_classGenericFirstOf = _class.instanceMethodId( @@ -1170,25 +1170,25 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/util/List;)Ljava/lang/Object;', ); - static final _classGenericFirstOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _classGenericFirstOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final U classGenericFirstOf(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $U classGenericFirstOf( - _$jni.JList<$U> list, + jni$_.JList<$U> list, ) { final _$list = list.reference; return _classGenericFirstOf(reference.pointer, - _id_classGenericFirstOf as _$jni.JMethodIDPtr, _$list.pointer) + _id_classGenericFirstOf as jni$_.JMethodIDPtr, _$list.pointer) .object<$U>(U); } @@ -1198,26 +1198,26 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> ); static final _classGenericFirstOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final T classGenericFirstOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T classGenericFirstOfNullable( - _$jni.JList<$T> list, + jni$_.JList<$T> list, ) { final _$list = list.reference; return _classGenericFirstOfNullable( reference.pointer, - _id_classGenericFirstOfNullable as _$jni.JMethodIDPtr, + _id_classGenericFirstOfNullable as jni$_.JMethodIDPtr, _$list.pointer) .object<$T>(T); } @@ -1227,29 +1227,29 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/util/List;)Ljava/lang/Object;', ); - static final _methodGenericFirstOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericFirstOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final V methodGenericFirstOf(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericFirstOf<$V extends _$jni.JObject>( - _$jni.JList<$V> list, { - _$jni.JObjType<$V>? V, + $V methodGenericFirstOf<$V extends jni$_.JObject>( + jni$_.JList<$V> list, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (list.$type as _$jni.JListType<_$core.dynamic>).E, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (list.$type as jni$_.JListType).E, + ]) as jni$_.JObjType<$V>; final _$list = list.reference; return _methodGenericFirstOf(reference.pointer, - _id_methodGenericFirstOf as _$jni.JMethodIDPtr, _$list.pointer) + _id_methodGenericFirstOf as jni$_.JMethodIDPtr, _$list.pointer) .object<$V>(V); } @@ -1259,30 +1259,30 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> ); static final _methodGenericFirstOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final V methodGenericFirstOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericFirstOfNullable<$V extends _$jni.JObject?>( - _$jni.JList<$V> list, { - _$jni.JObjType<$V>? V, + $V methodGenericFirstOfNullable<$V extends jni$_.JObject?>( + jni$_.JList<$V> list, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (list.$type as _$jni.JListType<_$core.dynamic>).E, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (list.$type as jni$_.JListType).E, + ]) as jni$_.JObjType<$V>; final _$list = list.reference; return _methodGenericFirstOfNullable( reference.pointer, - _id_methodGenericFirstOfNullable as _$jni.JMethodIDPtr, + _id_methodGenericFirstOfNullable as jni$_.JMethodIDPtr, _$list.pointer) .object<$V>(V); } @@ -1292,27 +1292,27 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/String;)Ljava/util/List;', ); - static final _stringListOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _stringListOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.util.List stringListOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString> stringListOf( - _$jni.JString string, + jni$_.JList stringListOf( + jni$_.JString string, ) { final _$string = string.reference; return _stringListOf(reference.pointer, - _id_stringListOf as _$jni.JMethodIDPtr, _$string.pointer) - .object<_$jni.JList<_$jni.JString>>( - const _$jni.JListType<_$jni.JString>(_$jni.JStringType())); + _id_stringListOf as jni$_.JMethodIDPtr, _$string.pointer) + .object>( + const jni$_.JListType(jni$_.JStringType())); } static final _id_nullableListOf = _class.instanceMethodId( @@ -1320,27 +1320,27 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/String;)Ljava/util/List;', ); - static final _nullableListOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _nullableListOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.util.List nullableListOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString?> nullableListOf( - _$jni.JString? string, + jni$_.JList nullableListOf( + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _nullableListOf(reference.pointer, - _id_nullableListOf as _$jni.JMethodIDPtr, _$string.pointer) - .object<_$jni.JList<_$jni.JString?>>( - const _$jni.JListType<_$jni.JString?>(_$jni.JStringNullableType())); + _id_nullableListOf as jni$_.JMethodIDPtr, _$string.pointer) + .object>( + const jni$_.JListType(jni$_.JStringNullableType())); } static final _id_classGenericListOf = _class.instanceMethodId( @@ -1348,26 +1348,26 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)Ljava/util/List;', ); - static final _classGenericListOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _classGenericListOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.util.List classGenericListOf(U object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$U> classGenericListOf( + jni$_.JList<$U> classGenericListOf( $U object, ) { final _$object = object.reference; return _classGenericListOf(reference.pointer, - _id_classGenericListOf as _$jni.JMethodIDPtr, _$object.pointer) - .object<_$jni.JList<$U>>(_$jni.JListType<$U>(U)); + _id_classGenericListOf as jni$_.JMethodIDPtr, _$object.pointer) + .object>(jni$_.JListType<$U>(U)); } static final _id_classGenericNullableListOf = _class.instanceMethodId( @@ -1376,28 +1376,28 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> ); static final _classGenericNullableListOf = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.util.List classGenericNullableListOf(T object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$T> classGenericNullableListOf( + jni$_.JList<$T> classGenericNullableListOf( $T object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _classGenericNullableListOf( reference.pointer, - _id_classGenericNullableListOf as _$jni.JMethodIDPtr, + _id_classGenericNullableListOf as jni$_.JMethodIDPtr, _$object.pointer) - .object<_$jni.JList<$T>>(_$jni.JListType<$T>(T)); + .object>(jni$_.JListType<$T>(T)); } static final _id_methodGenericListOf = _class.instanceMethodId( @@ -1405,30 +1405,30 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> r'(Ljava/lang/Object;)Ljava/util/List;', ); - static final _methodGenericListOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericListOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.util.List methodGenericListOf(V object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$V> methodGenericListOf<$V extends _$jni.JObject>( + jni$_.JList<$V> methodGenericListOf<$V extends jni$_.JObject>( $V object, { - _$jni.JObjType<$V>? V, + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ + V ??= jni$_.lowestCommonSuperType([ object.$type, - ]) as _$jni.JObjType<$V>; + ]) as jni$_.JObjType<$V>; final _$object = object.reference; return _methodGenericListOf(reference.pointer, - _id_methodGenericListOf as _$jni.JMethodIDPtr, _$object.pointer) - .object<_$jni.JList<$V>>(_$jni.JListType<$V>(V)); + _id_methodGenericListOf as jni$_.JMethodIDPtr, _$object.pointer) + .object>(jni$_.JListType<$V>(V)); } static final _id_methodGenericNullableListOf = _class.instanceMethodId( @@ -1437,53 +1437,53 @@ class Nullability<$T extends _$jni.JObject?, $U extends _$jni.JObject> ); static final _methodGenericNullableListOf = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.util.List methodGenericNullableListOf(V object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$V> methodGenericNullableListOf<$V extends _$jni.JObject?>( + jni$_.JList<$V> methodGenericNullableListOf<$V extends jni$_.JObject?>( $V object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _methodGenericNullableListOf( reference.pointer, - _id_methodGenericNullableListOf as _$jni.JMethodIDPtr, + _id_methodGenericNullableListOf as jni$_.JMethodIDPtr, _$object.pointer) - .object<_$jni.JList<$V>>(_$jni.JListType<$V>(V)); + .object>(jni$_.JListType<$V>(V)); } } -final class $Nullability$NullableType<$T extends _$jni.JObject?, - $U extends _$jni.JObject> extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Nullability$NullableType<$T extends jni$_.JObject?, + $U extends jni$_.JObject> extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal const $Nullability$NullableType( this.T, this.U, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Nullability;'; - @_$jni.internal - @_$core.override - Nullability<$T, $U>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Nullability<$T, $U>? fromReference(jni$_.JReference reference) => reference.isNull ? null : Nullability<$T, $U>.fromReference( @@ -1491,22 +1491,22 @@ final class $Nullability$NullableType<$T extends _$jni.JObject?, U, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Nullability$NullableType, T, U); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Nullability$NullableType<$T, $U>) && other is $Nullability$NullableType<$T, $U> && @@ -1515,49 +1515,49 @@ final class $Nullability$NullableType<$T extends _$jni.JObject?, } } -final class $Nullability$Type<$T extends _$jni.JObject?, - $U extends _$jni.JObject> extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Nullability$Type<$T extends jni$_.JObject?, + $U extends jni$_.JObject> extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal const $Nullability$Type( this.T, this.U, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Nullability;'; - @_$jni.internal - @_$core.override - Nullability<$T, $U> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Nullability<$T, $U> fromReference(jni$_.JReference reference) => Nullability<$T, $U>.fromReference( T, U, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $Nullability$NullableType<$T, $U>(T, U); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Nullability$Type, T, U); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Nullability$Type<$T, $U>) && other is $Nullability$Type<$T, $U> && @@ -1568,18 +1568,18 @@ final class $Nullability$Type<$T extends _$jni.JObject?, /// from: `com.github.dart_lang.jnigen.Speed` class Speed extends Measure { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Speed.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(const $SpeedUnit$Type(), reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/Speed'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/Speed'); /// The type which includes information such as the signature of this class. static const nullableType = $Speed$NullableType(); @@ -1588,19 +1588,19 @@ class Speed extends Measure { r'(FLcom/github/dart_lang/jnigen/SpeedUnit;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Double, - _$jni.Pointer<_$jni.Void> + jni$_.Double, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, double, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, double, jni$_.Pointer)>(); /// from: `public void (float f, com.github.dart_lang.jnigen.SpeedUnit speedUnit)` /// The returned object must be released after use, by calling the [release] method. @@ -1610,7 +1610,7 @@ class Speed extends Measure { ) { final _$speedUnit = speedUnit.reference; return Speed.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, f, _$speedUnit.pointer) + _id_new$ as jni$_.JMethodIDPtr, f, _$speedUnit.pointer) .reference); } @@ -1619,21 +1619,21 @@ class Speed extends Measure { r'()F', ); - static final _getValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getValue()` double getValue() { - return _getValue(reference.pointer, _id_getValue as _$jni.JMethodIDPtr) + return _getValue(reference.pointer, _id_getValue as jni$_.JMethodIDPtr) .float; } @@ -1642,22 +1642,22 @@ class Speed extends Measure { r'()Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _getUnit$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getUnit$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.SpeedUnit getUnit()` /// The returned object must be released after use, by calling the [release] method. SpeedUnit getUnit$1() { - return _getUnit$1(reference.pointer, _id_getUnit$1 as _$jni.JMethodIDPtr) + return _getUnit$1(reference.pointer, _id_getUnit$1 as jni$_.JMethodIDPtr) .object(const $SpeedUnit$Type()); } @@ -1666,23 +1666,23 @@ class Speed extends Measure { r'()Ljava/lang/String;', ); - static final _toString$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _toString$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String toString()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString toString$1() { - return _toString$1(reference.pointer, _id_toString$1 as _$jni.JMethodIDPtr) - .object<_$jni.JString>(const _$jni.JStringType()); + jni$_.JString toString$1() { + return _toString$1(reference.pointer, _id_toString$1 as jni$_.JMethodIDPtr) + .object(const jni$_.JStringType()); } static final _id_component1 = _class.instanceMethodId( @@ -1690,21 +1690,21 @@ class Speed extends Measure { r'()F', ); - static final _component1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _component1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final float component1()` double component1() { - return _component1(reference.pointer, _id_component1 as _$jni.JMethodIDPtr) + return _component1(reference.pointer, _id_component1 as jni$_.JMethodIDPtr) .float; } @@ -1713,22 +1713,22 @@ class Speed extends Measure { r'()Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _component2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _component2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final com.github.dart_lang.jnigen.SpeedUnit component2()` /// The returned object must be released after use, by calling the [release] method. SpeedUnit component2() { - return _component2(reference.pointer, _id_component2 as _$jni.JMethodIDPtr) + return _component2(reference.pointer, _id_component2 as jni$_.JMethodIDPtr) .object(const $SpeedUnit$Type()); } @@ -1737,19 +1737,19 @@ class Speed extends Measure { r'(FLcom/github/dart_lang/jnigen/SpeedUnit;)Lcom/github/dart_lang/jnigen/Speed;', ); - static final _copy = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _copy = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Double, - _$jni.Pointer<_$jni.Void> + jni$_.Double, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, double, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, double, jni$_.Pointer)>(); /// from: `public final com.github.dart_lang.jnigen.Speed copy(float f, com.github.dart_lang.jnigen.SpeedUnit speedUnit)` /// The returned object must be released after use, by calling the [release] method. @@ -1758,7 +1758,7 @@ class Speed extends Measure { SpeedUnit speedUnit, ) { final _$speedUnit = speedUnit.reference; - return _copy(reference.pointer, _id_copy as _$jni.JMethodIDPtr, f, + return _copy(reference.pointer, _id_copy as jni$_.JMethodIDPtr, f, _$speedUnit.pointer) .object(const $Speed$Type()); } @@ -1768,21 +1768,21 @@ class Speed extends Measure { r'()I', ); - static final _hashCode$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _hashCode$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int hashCode()` int hashCode$1() { - return _hashCode$1(reference.pointer, _id_hashCode$1 as _$jni.JMethodIDPtr) + return _hashCode$1(reference.pointer, _id_hashCode$1 as jni$_.JMethodIDPtr) .integer; } @@ -1791,115 +1791,115 @@ class Speed extends Measure { r'(Ljava/lang/Object;)Z', ); - static final _equals = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _equals = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public boolean equals(java.lang.Object object)` bool equals( - _$jni.JObject? object, + jni$_.JObject? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - return _equals(reference.pointer, _id_equals as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + return _equals(reference.pointer, _id_equals as jni$_.JMethodIDPtr, _$object.pointer) .boolean; } } -final class $Speed$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Speed$NullableType extends jni$_.JObjType { + @jni$_.internal const $Speed$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Speed;'; - @_$jni.internal - @_$core.override - Speed? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Speed? fromReference(jni$_.JReference reference) => reference.isNull ? null : Speed.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $Measure$Type($SpeedUnit$Type()); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($Speed$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Speed$NullableType) && other is $Speed$NullableType; } } -final class $Speed$Type extends _$jni.JObjType { - @_$jni.internal +final class $Speed$Type extends jni$_.JObjType { + @jni$_.internal const $Speed$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/Speed;'; - @_$jni.internal - @_$core.override - Speed fromReference(_$jni.JReference reference) => Speed.fromReference( + @jni$_.internal + @core$_.override + Speed fromReference(jni$_.JReference reference) => Speed.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $Measure$Type($SpeedUnit$Type()); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Speed$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Speed$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($Speed$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Speed$Type) && other is $Speed$Type; } } /// from: `com.github.dart_lang.jnigen.SpeedUnit` -class SpeedUnit extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class SpeedUnit extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal SpeedUnit.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/SpeedUnit'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/SpeedUnit'); /// The type which includes information such as the signature of this class. static const nullableType = $SpeedUnit$NullableType(); @@ -1929,23 +1929,23 @@ class SpeedUnit extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getSign = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSign = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getSign()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString getSign() { - return _getSign(reference.pointer, _id_getSign as _$jni.JMethodIDPtr) - .object<_$jni.JString>(const _$jni.JStringType()); + jni$_.JString getSign() { + return _getSign(reference.pointer, _id_getSign as jni$_.JMethodIDPtr) + .object(const jni$_.JStringType()); } static final _id_getCoefficient = _class.instanceMethodId( @@ -1953,22 +1953,22 @@ class SpeedUnit extends _$jni.JObject { r'()F', ); - static final _getCoefficient = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCoefficient = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallFloatMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public float getCoefficient()` double getCoefficient() { return _getCoefficient( - reference.pointer, _id_getCoefficient as _$jni.JMethodIDPtr) + reference.pointer, _id_getCoefficient as jni$_.JMethodIDPtr) .float; } @@ -1977,24 +1977,24 @@ class SpeedUnit extends _$jni.JObject { r'()[Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.SpeedUnit[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType( + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( $SpeedUnit$NullableType())); } @@ -2003,116 +2003,116 @@ class SpeedUnit extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/SpeedUnit;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.SpeedUnit valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. static SpeedUnit? valueOf( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$string.pointer) .object(const $SpeedUnit$NullableType()); } } -final class $SpeedUnit$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $SpeedUnit$NullableType extends jni$_.JObjType { + @jni$_.internal const $SpeedUnit$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/SpeedUnit;'; - @_$jni.internal - @_$core.override - SpeedUnit? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + SpeedUnit? fromReference(jni$_.JReference reference) => reference.isNull ? null : SpeedUnit.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($SpeedUnit$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($SpeedUnit$NullableType) && other is $SpeedUnit$NullableType; } } -final class $SpeedUnit$Type extends _$jni.JObjType { - @_$jni.internal +final class $SpeedUnit$Type extends jni$_.JObjType { + @jni$_.internal const $SpeedUnit$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/SpeedUnit;'; - @_$jni.internal - @_$core.override - SpeedUnit fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + SpeedUnit fromReference(jni$_.JReference reference) => SpeedUnit.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $SpeedUnit$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($SpeedUnit$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($SpeedUnit$Type) && other is $SpeedUnit$Type; } } /// from: `com.github.dart_lang.jnigen.SuspendFun` -class SuspendFun extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class SuspendFun extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal SuspendFun.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/SuspendFun'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/SuspendFun'); /// The type which includes information such as the signature of this class. static const nullableType = $SuspendFun$NullableType(); @@ -2121,23 +2121,23 @@ class SuspendFun extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory SuspendFun() { return SuspendFun.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -2146,36 +2146,36 @@ class SuspendFun extends _$jni.JObject { r'(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;', ); - static final _sayHello = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _sayHello = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString> sayHello() async { - final $p = _$jni.ReceivePort(); - final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); + core$_.Future sayHello() async { + final $p = jni$_.ReceivePort(); + final _$continuation = jni$_.ProtectedJniExtensions.newPortContinuation($p); - _sayHello(reference.pointer, _id_sayHello as _$jni.JMethodIDPtr, + _sayHello(reference.pointer, _id_sayHello as jni$_.JMethodIDPtr, _$continuation.pointer) - .object<_$jni.JObject>(const _$jni.JObjectType()); + .object(const jni$_.JObjectType()); _$continuation.release(); final $o = - _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringType().jClass.reference; - if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { + jni$_.JGlobalReference(jni$_.JObjectPtr.fromAddress(await $p.first)); + final $k = const jni$_.JStringType().jClass.reference; + if (!jni$_.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { $k.release(); throw 'Failed'; } $k.release(); - return const _$jni.JStringType().fromReference($o); + return const jni$_.JStringType().fromReference($o); } static final _id_sayHello$1 = _class.instanceMethodId( @@ -2183,144 +2183,144 @@ class SuspendFun extends _$jni.JObject { r'(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;', ); - static final _sayHello$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _sayHello$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. - _$core.Future<_$jni.JString> sayHello$1( - _$jni.JString? string, + core$_.Future sayHello$1( + jni$_.JString? string, ) async { - final $p = _$jni.ReceivePort(); - final _$continuation = _$jni.ProtectedJniExtensions.newPortContinuation($p); - final _$string = string?.reference ?? _$jni.jNullReference; - _sayHello$1(reference.pointer, _id_sayHello$1 as _$jni.JMethodIDPtr, + final $p = jni$_.ReceivePort(); + final _$continuation = jni$_.ProtectedJniExtensions.newPortContinuation($p); + final _$string = string?.reference ?? jni$_.jNullReference; + _sayHello$1(reference.pointer, _id_sayHello$1 as jni$_.JMethodIDPtr, _$string.pointer, _$continuation.pointer) - .object<_$jni.JObject>(const _$jni.JObjectType()); + .object(const jni$_.JObjectType()); _$continuation.release(); final $o = - _$jni.JGlobalReference(_$jni.JObjectPtr.fromAddress(await $p.first)); - final $k = const _$jni.JStringType().jClass.reference; - if (!_$jni.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { + jni$_.JGlobalReference(jni$_.JObjectPtr.fromAddress(await $p.first)); + final $k = const jni$_.JStringType().jClass.reference; + if (!jni$_.Jni.env.IsInstanceOf($o.pointer, $k.pointer)) { $k.release(); throw 'Failed'; } $k.release(); - return const _$jni.JStringType().fromReference($o); + return const jni$_.JStringType().fromReference($o); } } -final class $SuspendFun$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $SuspendFun$NullableType extends jni$_.JObjType { + @jni$_.internal const $SuspendFun$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/SuspendFun;'; - @_$jni.internal - @_$core.override - SuspendFun? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + SuspendFun? fromReference(jni$_.JReference reference) => reference.isNull ? null : SuspendFun.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($SuspendFun$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($SuspendFun$NullableType) && other is $SuspendFun$NullableType; } } -final class $SuspendFun$Type extends _$jni.JObjType { - @_$jni.internal +final class $SuspendFun$Type extends jni$_.JObjType { + @jni$_.internal const $SuspendFun$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/SuspendFun;'; - @_$jni.internal - @_$core.override - SuspendFun fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + SuspendFun fromReference(jni$_.JReference reference) => SuspendFun.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $SuspendFun$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($SuspendFun$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($SuspendFun$Type) && other is $SuspendFun$Type; } } final _TopLevelKtClass = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/TopLevelKt'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/TopLevelKt'); final _id_getTopLevelField = _TopLevelKtClass.staticMethodId( r'getTopLevelField', r'()I', ); -final _getTopLevelField = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, +final _getTopLevelField = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public final int getTopLevelField()` int getTopLevelField() { return _getTopLevelField(_TopLevelKtClass.reference.pointer, - _id_getTopLevelField as _$jni.JMethodIDPtr) + _id_getTopLevelField as jni$_.JMethodIDPtr) .integer; } @@ -2329,21 +2329,21 @@ final _id_setTopLevelField = _TopLevelKtClass.staticMethodId( r'(I)V', ); -final _setTopLevelField = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( +final _setTopLevelField = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `static public final void setTopLevelField(int i)` void setTopLevelField( int i, ) { _setTopLevelField(_TopLevelKtClass.reference.pointer, - _id_setTopLevelField as _$jni.JMethodIDPtr, i) + _id_setTopLevelField as jni$_.JMethodIDPtr, i) .check(); } @@ -2352,22 +2352,22 @@ final _id_topLevel = _TopLevelKtClass.staticMethodId( r'()I', ); -final _topLevel = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, +final _topLevel = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public final int topLevel()` int topLevel() { return _topLevel(_TopLevelKtClass.reference.pointer, - _id_topLevel as _$jni.JMethodIDPtr) + _id_topLevel as jni$_.JMethodIDPtr) .integer; } @@ -2376,16 +2376,16 @@ final _id_topLevelSum = _TopLevelKtClass.staticMethodId( r'(II)I', ); -final _topLevelSum = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( +final _topLevelSum = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( 'globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); /// from: `static public final int topLevelSum(int i, int i1)` int topLevelSum( @@ -2393,6 +2393,6 @@ int topLevelSum( int i1, ) { return _topLevelSum(_TopLevelKtClass.reference.pointer, - _id_topLevelSum as _$jni.JMethodIDPtr, i, i1) + _id_topLevelSum as jni$_.JMethodIDPtr, i, i1) .integer; } diff --git a/pkgs/jnigen/test/package_resolver_test.dart b/pkgs/jnigen/test/package_resolver_test.dart index a29e04362..59595522e 100644 --- a/pkgs/jnigen/test/package_resolver_test.dart +++ b/pkgs/jnigen/test/package_resolver_test.dart @@ -43,23 +43,24 @@ void main() async { final tests = [ // Absolute imports resolved using import map - ResolverTest('android.os.Process', 'package:android/os.dart', 'process_.'), + ResolverTest( + 'android.os.Process', 'package:android/os.dart', r'process$_.'), ResolverTest('org.apache.pdfbox.pdmodel.PDDocument', - 'package:pdfbox/pdfbox.dart', 'pddocument_.'), + 'package:pdfbox/pdfbox.dart', r'pddocument$_.'), // Relative imports // inner package - ResolverTest('a.b.c.D', 'c/D.dart', 'd_.'), + ResolverTest('a.b.c.D', 'c/D.dart', r'd$_.'), // inner package, deeper - ResolverTest('a.b.c.d.E', 'c/d/E.dart', 'e_.'), + ResolverTest('a.b.c.d.E', 'c/d/E.dart', r'e$_.'), // parent package - ResolverTest('a.X', '../X.dart', 'x_.'), + ResolverTest('a.X', '../X.dart', r'x$_.'), // unrelated package in same translation unit - ResolverTest('e.f.G', '../../e/f/G.dart', 'g_.'), - ResolverTest('e.F', '../../e/F.dart', 'f_.'), + ResolverTest('e.f.G', '../../e/f/G.dart', r'g$_.'), + ResolverTest('e.F', '../../e/F.dart', r'f$_.'), // neighbour package - ResolverTest('a.g.Y', '../g/Y.dart', 'y_.'), + ResolverTest('a.g.Y', '../g/Y.dart', r'y$_.'), // inner package of a neighbour package - ResolverTest('a.m.n.P', '../m/n/P.dart', 'p_.'), + ResolverTest('a.m.n.P', '../m/n/P.dart', r'p$_.'), ]; for (var testCase in tests) { diff --git a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart index 25783ec6d..80aa9e5a3 100644 --- a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart @@ -34,25 +34,25 @@ // ignore_for_file: use_super_parameters import 'dart:core' show Object, String, bool, double, int; -import 'dart:core' as _$core; +import 'dart:core' as core$_; -import 'package:jni/_internal.dart' as _$jni; -import 'package:jni/jni.dart' as _$jni; +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; /// from: `com.github.dart_lang.jnigen.simple_package.Color` -class Color extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Color extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Color.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/simple_package/Color'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/simple_package/Color'); /// The type which includes information such as the signature of this class. static const nullableType = $Color$NullableType(); @@ -117,24 +117,24 @@ class Color extends _$jni.JObject { r'()[Lcom/github/dart_lang/jnigen/simple_package/Color;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.simple_package.Color[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType($Color$NullableType())); + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType($Color$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -142,113 +142,113 @@ class Color extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. static Color? valueOf( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$string.pointer) .object(const $Color$NullableType()); } } -final class $Color$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Color$NullableType extends jni$_.JObjType { + @jni$_.internal const $Color$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Color;'; - @_$jni.internal - @_$core.override - Color? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Color? fromReference(jni$_.JReference reference) => reference.isNull ? null : Color.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Color$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Color$NullableType) && other is $Color$NullableType; } } -final class $Color$Type extends _$jni.JObjType { - @_$jni.internal +final class $Color$Type extends jni$_.JObjType { + @jni$_.internal const $Color$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Color;'; - @_$jni.internal - @_$core.override - Color fromReference(_$jni.JReference reference) => Color.fromReference( + @jni$_.internal + @core$_.override + Color fromReference(jni$_.JReference reference) => Color.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Color$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Color$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Color$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Color$Type) && other is $Color$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice` -class Example_Nested_NestedTwice extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Example_Nested_NestedTwice extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Example_Nested_NestedTwice.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice'); /// The type which includes information such as the signature of this class. @@ -260,71 +260,71 @@ class Example_Nested_NestedTwice extends _$jni.JObject { ); /// from: `static public int ZERO` - static int get ZERO => _id_ZERO.get(_class, const _$jni.jintType()); + static int get ZERO => _id_ZERO.get(_class, const jni$_.jintType()); /// from: `static public int ZERO` static set ZERO(int value) => - _id_ZERO.set(_class, const _$jni.jintType(), value); + _id_ZERO.set(_class, const jni$_.jintType(), value); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example_Nested_NestedTwice() { return Example_Nested_NestedTwice.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } final class $Example_Nested_NestedTwice$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Example_Nested_NestedTwice$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;'; - @_$jni.internal - @_$core.override - Example_Nested_NestedTwice? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Example_Nested_NestedTwice? fromReference(jni$_.JReference reference) => reference.isNull ? null : Example_Nested_NestedTwice.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example_Nested_NestedTwice$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example_Nested_NestedTwice$NullableType) && other is $Example_Nested_NestedTwice$NullableType; @@ -332,38 +332,38 @@ final class $Example_Nested_NestedTwice$NullableType } final class $Example_Nested_NestedTwice$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Example_Nested_NestedTwice$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice;'; - @_$jni.internal - @_$core.override - Example_Nested_NestedTwice fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Example_Nested_NestedTwice fromReference(jni$_.JReference reference) => Example_Nested_NestedTwice.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Example_Nested_NestedTwice$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example_Nested_NestedTwice$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example_Nested_NestedTwice$Type) && other is $Example_Nested_NestedTwice$Type; @@ -371,18 +371,18 @@ final class $Example_Nested_NestedTwice$Type } /// from: `com.github.dart_lang.jnigen.simple_package.Example$Nested` -class Example_Nested extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Example_Nested extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Example_Nested.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Example$Nested'); /// The type which includes information such as the signature of this class. @@ -392,15 +392,15 @@ class Example_Nested extends _$jni.JObject { r'(Z)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_NewObject') + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void (boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -408,7 +408,7 @@ class Example_Nested extends _$jni.JObject { bool z, ) { return Example_Nested.fromReference(_new$( - _class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, z ? 1 : 0) + _class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, z ? 1 : 0) .reference); } @@ -417,22 +417,22 @@ class Example_Nested extends _$jni.JObject { r'()V', ); - static final _usesAnonymousInnerClass = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _usesAnonymousInnerClass = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void usesAnonymousInnerClass()` void usesAnonymousInnerClass() { _usesAnonymousInnerClass(reference.pointer, - _id_usesAnonymousInnerClass as _$jni.JMethodIDPtr) + _id_usesAnonymousInnerClass as jni$_.JMethodIDPtr) .check(); } @@ -441,21 +441,21 @@ class Example_Nested extends _$jni.JObject { r'()Z', ); - static final _getValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getValue()` bool getValue() { - return _getValue(reference.pointer, _id_getValue as _$jni.JMethodIDPtr) + return _getValue(reference.pointer, _id_getValue as jni$_.JMethodIDPtr) .boolean; } @@ -464,96 +464,96 @@ class Example_Nested extends _$jni.JObject { r'(Z)V', ); - static final _setValue = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setValue = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setValue(boolean z)` void setValue( bool z, ) { - _setValue(reference.pointer, _id_setValue as _$jni.JMethodIDPtr, z ? 1 : 0) + _setValue(reference.pointer, _id_setValue as jni$_.JMethodIDPtr, z ? 1 : 0) .check(); } } final class $Example_Nested$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Example_Nested$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;'; - @_$jni.internal - @_$core.override - Example_Nested? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Example_Nested? fromReference(jni$_.JReference reference) => reference.isNull ? null : Example_Nested.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example_Nested$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example_Nested$NullableType) && other is $Example_Nested$NullableType; } } -final class $Example_Nested$Type extends _$jni.JObjType { - @_$jni.internal +final class $Example_Nested$Type extends jni$_.JObjType { + @jni$_.internal const $Example_Nested$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;'; - @_$jni.internal - @_$core.override - Example_Nested fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Example_Nested fromReference(jni$_.JReference reference) => Example_Nested.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Example_Nested$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example_Nested$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example_Nested$Type) && other is $Example_Nested$Type; @@ -561,18 +561,18 @@ final class $Example_Nested$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested` -class Example_NonStaticNested extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Example_NonStaticNested extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Example_NonStaticNested.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested'); /// The type which includes information such as the signature of this class. @@ -584,25 +584,25 @@ class Example_NonStaticNested extends _$jni.JObject { ); /// from: `public boolean ok` - bool get ok => _id_ok.get(this, const _$jni.jbooleanType()); + bool get ok => _id_ok.get(this, const jni$_.jbooleanType()); /// from: `public boolean ok` - set ok(bool value) => _id_ok.set(this, const _$jni.jbooleanType(), value); + set ok(bool value) => _id_ok.set(this, const jni$_.jbooleanType(), value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/simple_package/Example;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.simple_package.Example $outerClass)` /// The returned object must be released after use, by calling the [release] method. @@ -611,45 +611,45 @@ class Example_NonStaticNested extends _$jni.JObject { ) { final _$$outerClass = $outerClass.reference; return Example_NonStaticNested.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, _$$outerClass.pointer) + _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer) .reference); } } final class $Example_NonStaticNested$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Example_NonStaticNested$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;'; - @_$jni.internal - @_$core.override - Example_NonStaticNested? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Example_NonStaticNested? fromReference(jni$_.JReference reference) => reference.isNull ? null : Example_NonStaticNested.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example_NonStaticNested$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example_NonStaticNested$NullableType) && other is $Example_NonStaticNested$NullableType; @@ -657,38 +657,38 @@ final class $Example_NonStaticNested$NullableType } final class $Example_NonStaticNested$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $Example_NonStaticNested$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example$NonStaticNested;'; - @_$jni.internal - @_$core.override - Example_NonStaticNested fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Example_NonStaticNested fromReference(jni$_.JReference reference) => Example_NonStaticNested.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Example_NonStaticNested$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example_NonStaticNested$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example_NonStaticNested$Type) && other is $Example_NonStaticNested$Type; @@ -696,18 +696,18 @@ final class $Example_NonStaticNested$Type } /// from: `com.github.dart_lang.jnigen.simple_package.Example` -class Example extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Example extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Example.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Example'); /// The type which includes information such as the signature of this class. @@ -732,8 +732,8 @@ class Example extends _$jni.JObject { /// from: `static public final java.lang.String SEMICOLON_STRING` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get SEMICOLON_STRING => - _id_SEMICOLON_STRING.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get SEMICOLON_STRING => + _id_SEMICOLON_STRING.get(_class, const jni$_.JStringNullableType()); static final _id_unusedRandom = _class.staticFieldId( r'unusedRandom', @@ -742,30 +742,30 @@ class Example extends _$jni.JObject { /// from: `static public final java.util.Random unusedRandom` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject? get unusedRandom => - _id_unusedRandom.get(_class, const _$jni.JObjectNullableType()); + static jni$_.JObject? get unusedRandom => + _id_unusedRandom.get(_class, const jni$_.JObjectNullableType()); static final _id_getAmount = _class.staticMethodId( r'getAmount', r'()I', ); - static final _getAmount = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getAmount = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public int getAmount()` static int getAmount() { return _getAmount( - _class.reference.pointer, _id_getAmount as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_getAmount as jni$_.JMethodIDPtr) .integer; } @@ -774,21 +774,21 @@ class Example extends _$jni.JObject { r'()D', ); - static final _getPi = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getPi = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticDoubleMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public double getPi()` static double getPi() { - return _getPi(_class.reference.pointer, _id_getPi as _$jni.JMethodIDPtr) + return _getPi(_class.reference.pointer, _id_getPi as jni$_.JMethodIDPtr) .doubleFloat; } @@ -797,22 +797,22 @@ class Example extends _$jni.JObject { r'()C', ); - static final _getAsterisk = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getAsterisk = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticCharMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public char getAsterisk()` static int getAsterisk() { return _getAsterisk( - _class.reference.pointer, _id_getAsterisk as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_getAsterisk as jni$_.JMethodIDPtr) .char; } @@ -821,23 +821,23 @@ class Example extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public java.lang.String getName()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? getName() { - return _getName(_class.reference.pointer, _id_getName as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + static jni$_.JString? getName() { + return _getName(_class.reference.pointer, _id_getName as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_getNestedInstance = _class.staticMethodId( @@ -845,23 +845,23 @@ class Example extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;', ); - static final _getNestedInstance = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNestedInstance = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.simple_package.Example$Nested getNestedInstance()` /// The returned object must be released after use, by calling the [release] method. static Example_Nested? getNestedInstance() { return _getNestedInstance(_class.reference.pointer, - _id_getNestedInstance as _$jni.JMethodIDPtr) + _id_getNestedInstance as jni$_.JMethodIDPtr) .object(const $Example_Nested$NullableType()); } @@ -870,20 +870,20 @@ class Example extends _$jni.JObject { r'(I)V', ); - static final _setAmount = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + static final _setAmount = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `static public void setAmount(int i)` static void setAmount( int i, ) { - _setAmount(_class.reference.pointer, _id_setAmount as _$jni.JMethodIDPtr, i) + _setAmount(_class.reference.pointer, _id_setAmount as jni$_.JMethodIDPtr, i) .check(); } @@ -892,23 +892,23 @@ class Example extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setName = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setName = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public void setName(java.lang.String string)` static void setName( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - _setName(_class.reference.pointer, _id_setName as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + _setName(_class.reference.pointer, _id_setName as jni$_.JMethodIDPtr, _$string.pointer) .check(); } @@ -918,24 +918,24 @@ class Example extends _$jni.JObject { r'(Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;)V', ); - static final _setNestedInstance = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setNestedInstance = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public void setNestedInstance(com.github.dart_lang.jnigen.simple_package.Example$Nested nested)` static void setNestedInstance( Example_Nested? nested, ) { - final _$nested = nested?.reference ?? _$jni.jNullReference; + final _$nested = nested?.reference ?? jni$_.jNullReference; _setNestedInstance(_class.reference.pointer, - _id_setNestedInstance as _$jni.JMethodIDPtr, _$nested.pointer) + _id_setNestedInstance as jni$_.JMethodIDPtr, _$nested.pointer) .check(); } @@ -944,21 +944,21 @@ class Example extends _$jni.JObject { r'(IIII)I', ); - static final _max4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _max4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, int)>(); /// from: `static public int max4(int i, int i1, int i2, int i3)` static int max4( @@ -967,7 +967,7 @@ class Example extends _$jni.JObject { int i2, int i3, ) { - return _max4(_class.reference.pointer, _id_max4 as _$jni.JMethodIDPtr, i, + return _max4(_class.reference.pointer, _id_max4 as jni$_.JMethodIDPtr, i, i1, i2, i3) .integer; } @@ -977,25 +977,25 @@ class Example extends _$jni.JObject { r'(IIIIIIII)I', ); - static final _max8 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _max8 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); /// from: `static public int max8(int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7)` static int max8( @@ -1008,7 +1008,7 @@ class Example extends _$jni.JObject { int i6, int i7, ) { - return _max8(_class.reference.pointer, _id_max8 as _$jni.JMethodIDPtr, i, + return _max8(_class.reference.pointer, _id_max8 as jni$_.JMethodIDPtr, i, i1, i2, i3, i4, i5, i6, i7) .integer; } @@ -1018,21 +1018,21 @@ class Example extends _$jni.JObject { r'()I', ); - static final _getNumber = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getNumber = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int getNumber()` int getNumber() { - return _getNumber(reference.pointer, _id_getNumber as _$jni.JMethodIDPtr) + return _getNumber(reference.pointer, _id_getNumber as jni$_.JMethodIDPtr) .integer; } @@ -1041,21 +1041,21 @@ class Example extends _$jni.JObject { r'(I)V', ); - static final _setNumber = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setNumber = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setNumber(int i)` void setNumber( int i, ) { - _setNumber(reference.pointer, _id_setNumber as _$jni.JMethodIDPtr, i) + _setNumber(reference.pointer, _id_setNumber as jni$_.JMethodIDPtr, i) .check(); } @@ -1064,21 +1064,21 @@ class Example extends _$jni.JObject { r'()Z', ); - static final _getIsUp = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getIsUp = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallBooleanMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public boolean getIsUp()` bool getIsUp() { - return _getIsUp(reference.pointer, _id_getIsUp as _$jni.JMethodIDPtr) + return _getIsUp(reference.pointer, _id_getIsUp as jni$_.JMethodIDPtr) .boolean; } @@ -1087,21 +1087,21 @@ class Example extends _$jni.JObject { r'(Z)V', ); - static final _setUp = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _setUp = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void setUp(boolean z)` void setUp( bool z, ) { - _setUp(reference.pointer, _id_setUp as _$jni.JMethodIDPtr, z ? 1 : 0) + _setUp(reference.pointer, _id_setUp as jni$_.JMethodIDPtr, z ? 1 : 0) .check(); } @@ -1110,24 +1110,24 @@ class Example extends _$jni.JObject { r'()Ljava/lang/String;', ); - static final _getCodename = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getCodename = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String getCodename()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getCodename() { + jni$_.JString? getCodename() { return _getCodename( - reference.pointer, _id_getCodename as _$jni.JMethodIDPtr) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + reference.pointer, _id_getCodename as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } static final _id_setCodename = _class.instanceMethodId( @@ -1135,23 +1135,23 @@ class Example extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _setCodename = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setCodename = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setCodename(java.lang.String string)` void setCodename( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - _setCodename(reference.pointer, _id_setCodename as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + _setCodename(reference.pointer, _id_setCodename as jni$_.JMethodIDPtr, _$string.pointer) .check(); } @@ -1161,23 +1161,23 @@ class Example extends _$jni.JObject { r'()Ljava/util/Random;', ); - static final _getRandom = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getRandom = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.Random getRandom()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? getRandom() { - return _getRandom(reference.pointer, _id_getRandom as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + jni$_.JObject? getRandom() { + return _getRandom(reference.pointer, _id_getRandom as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_setRandom = _class.instanceMethodId( @@ -1185,23 +1185,23 @@ class Example extends _$jni.JObject { r'(Ljava/util/Random;)V', ); - static final _setRandom = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _setRandom = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void setRandom(java.util.Random random)` void setRandom( - _$jni.JObject? random, + jni$_.JObject? random, ) { - final _$random = random?.reference ?? _$jni.jNullReference; - _setRandom(reference.pointer, _id_setRandom as _$jni.JMethodIDPtr, + final _$random = random?.reference ?? jni$_.jNullReference; + _setRandom(reference.pointer, _id_setRandom as jni$_.JMethodIDPtr, _$random.pointer) .check(); } @@ -1211,22 +1211,22 @@ class Example extends _$jni.JObject { r'()J', ); - static final _getRandomLong = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getRandomLong = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public long getRandomLong()` int getRandomLong() { return _getRandomLong( - reference.pointer, _id_getRandomLong as _$jni.JMethodIDPtr) + reference.pointer, _id_getRandomLong as jni$_.JMethodIDPtr) .long; } @@ -1235,21 +1235,21 @@ class Example extends _$jni.JObject { r'(JJJJ)J', ); - static final _add4Longs = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _add4Longs = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int64, - _$jni.Int64, - _$jni.Int64, - _$jni.Int64 + jni$_.Int64, + jni$_.Int64, + jni$_.Int64, + jni$_.Int64 )>)>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, int)>(); /// from: `public long add4Longs(long j, long j1, long j2, long j3)` int add4Longs( @@ -1258,7 +1258,7 @@ class Example extends _$jni.JObject { int j2, int j3, ) { - return _add4Longs(reference.pointer, _id_add4Longs as _$jni.JMethodIDPtr, j, + return _add4Longs(reference.pointer, _id_add4Longs as jni$_.JMethodIDPtr, j, j1, j2, j3) .long; } @@ -1268,25 +1268,25 @@ class Example extends _$jni.JObject { r'(JJJJJJJJ)J', ); - static final _add8Longs = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _add8Longs = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int64, - _$jni.Int64, - _$jni.Int64, - _$jni.Int64, - _$jni.Int64, - _$jni.Int64, - _$jni.Int64, - _$jni.Int64 + jni$_.Int64, + jni$_.Int64, + jni$_.Int64, + jni$_.Int64, + jni$_.Int64, + jni$_.Int64, + jni$_.Int64, + jni$_.Int64 )>)>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); /// from: `public long add8Longs(long j, long j1, long j2, long j3, long j4, long j5, long j6, long j7)` int add8Longs( @@ -1299,7 +1299,7 @@ class Example extends _$jni.JObject { int j6, int j7, ) { - return _add8Longs(reference.pointer, _id_add8Longs as _$jni.JMethodIDPtr, j, + return _add8Longs(reference.pointer, _id_add8Longs as jni$_.JMethodIDPtr, j, j1, j2, j3, j4, j5, j6, j7) .long; } @@ -1309,26 +1309,26 @@ class Example extends _$jni.JObject { r'(Ljava/util/Random;)Ljava/lang/String;', ); - static final _getRandomNumericString = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _getRandomNumericString = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.String getRandomNumericString(java.util.Random random)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? getRandomNumericString( - _$jni.JObject? random, + jni$_.JString? getRandomNumericString( + jni$_.JObject? random, ) { - final _$random = random?.reference ?? _$jni.jNullReference; + final _$random = random?.reference ?? jni$_.jNullReference; return _getRandomNumericString(reference.pointer, - _id_getRandomNumericString as _$jni.JMethodIDPtr, _$random.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_getRandomNumericString as jni$_.JMethodIDPtr, _$random.pointer) + .object(const jni$_.JStringNullableType()); } static final _id_finalMethod = _class.instanceMethodId( @@ -1336,21 +1336,21 @@ class Example extends _$jni.JObject { r'()V', ); - static final _finalMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _finalMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public final void finalMethod()` void finalMethod() { - _finalMethod(reference.pointer, _id_finalMethod as _$jni.JMethodIDPtr) + _finalMethod(reference.pointer, _id_finalMethod as jni$_.JMethodIDPtr) .check(); } @@ -1359,25 +1359,25 @@ class Example extends _$jni.JObject { r'()Ljava/util/List;', ); - static final _getList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List getList()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString?>? getList() { - return _getList(reference.pointer, _id_getList as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JString?>?>( - const _$jni.JListNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + jni$_.JList? getList() { + return _getList(reference.pointer, _id_getList as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JListNullableType( + jni$_.JStringNullableType())); } static final _id_joinStrings = _class.instanceMethodId( @@ -1385,37 +1385,37 @@ class Example extends _$jni.JObject { r'(Ljava/util/List;Ljava/lang/String;)Ljava/lang/String;', ); - static final _joinStrings = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _joinStrings = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public java.lang.String joinStrings(java.util.List list, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? joinStrings( - _$jni.JList<_$jni.JString?>? list, - _$jni.JString? string, + jni$_.JString? joinStrings( + jni$_.JList? list, + jni$_.JString? string, ) { - final _$list = list?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _joinStrings( reference.pointer, - _id_joinStrings as _$jni.JMethodIDPtr, + _id_joinStrings as jni$_.JMethodIDPtr, _$list.pointer, _$string.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + .object(const jni$_.JStringNullableType()); } static final _id_methodWithSeveralParams = _class.instanceMethodId( @@ -1423,49 +1423,49 @@ class Example extends _$jni.JObject { r'(CLjava/lang/String;[ILjava/lang/CharSequence;Ljava/util/List;Ljava/util/Map;)V', ); - static final _methodWithSeveralParams = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _methodWithSeveralParams = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Int32, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, int, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void methodWithSeveralParams(char c, java.lang.String string, java.lang.Object[] is, T charSequence, java.util.List list, java.util.Map map)` - void methodWithSeveralParams<$T extends _$jni.JObject?>( + void methodWithSeveralParams<$T extends jni$_.JObject?>( int c, - _$jni.JString? string, - _$jni.JArray<_$jni.jint>? is$, + jni$_.JString? string, + jni$_.JArray? is$, $T? charSequence, - _$jni.JList<$T?>? list, - _$jni.JMap<_$jni.JString?, _$jni.JObject?>? map, { - required _$jni.JObjType<$T> T, + jni$_.JList<$T?>? list, + jni$_.JMap? map, { + required jni$_.JObjType<$T> T, }) { - final _$string = string?.reference ?? _$jni.jNullReference; - final _$is$ = is$?.reference ?? _$jni.jNullReference; - final _$charSequence = charSequence?.reference ?? _$jni.jNullReference; - final _$list = list?.reference ?? _$jni.jNullReference; - final _$map = map?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; + final _$is$ = is$?.reference ?? jni$_.jNullReference; + final _$charSequence = charSequence?.reference ?? jni$_.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; + final _$map = map?.reference ?? jni$_.jNullReference; _methodWithSeveralParams( reference.pointer, - _id_methodWithSeveralParams as _$jni.JMethodIDPtr, + _id_methodWithSeveralParams as jni$_.JMethodIDPtr, c, _$string.pointer, _$is$.pointer, @@ -1479,23 +1479,23 @@ class Example extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -1503,15 +1503,15 @@ class Example extends _$jni.JObject { r'(I)V', ); - static final _new$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_NewObject') + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void (int i)` /// The returned object must be released after use, by calling the [release] method. @@ -1519,7 +1519,7 @@ class Example extends _$jni.JObject { int i, ) { return Example.fromReference( - _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, i) + _new$1(_class.reference.pointer, _id_new$1 as jni$_.JMethodIDPtr, i) .reference); } @@ -1527,16 +1527,16 @@ class Example extends _$jni.JObject { r'(IZ)V', ); - static final _new$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + static final _new$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); /// from: `public void (int i, boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -1545,7 +1545,7 @@ class Example extends _$jni.JObject { bool z, ) { return Example.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, i, z ? 1 : 0) + _id_new$2 as jni$_.JMethodIDPtr, i, z ? 1 : 0) .reference); } @@ -1553,31 +1553,31 @@ class Example extends _$jni.JObject { r'(IZLjava/lang/String;)V', ); - static final _new$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Int32, - _$jni.Pointer<_$jni.Void> + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, jni$_.Pointer)>(); /// from: `public void (int i, boolean z, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. factory Example.new$3( int i, bool z, - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return Example.fromReference(_new$3(_class.reference.pointer, - _id_new$3 as _$jni.JMethodIDPtr, i, z ? 1 : 0, _$string.pointer) + _id_new$3 as jni$_.JMethodIDPtr, i, z ? 1 : 0, _$string.pointer) .reference); } @@ -1585,25 +1585,25 @@ class Example extends _$jni.JObject { r'(IIIIIIII)V', ); - static final _new$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, int, int, int, int, int)>(); /// from: `public void (int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7)` /// The returned object must be released after use, by calling the [release] method. @@ -1618,7 +1618,7 @@ class Example extends _$jni.JObject { int i7, ) { return Example.fromReference(_new$4(_class.reference.pointer, - _id_new$4 as _$jni.JMethodIDPtr, i, i1, i2, i3, i4, i5, i6, i7) + _id_new$4 as jni$_.JMethodIDPtr, i, i1, i2, i3, i4, i5, i6, i7) .reference); } @@ -1627,22 +1627,22 @@ class Example extends _$jni.JObject { r'()I', ); - static final _whichExample = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _whichExample = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int whichExample()` int whichExample() { return _whichExample( - reference.pointer, _id_whichExample as _$jni.JMethodIDPtr) + reference.pointer, _id_whichExample as jni$_.JMethodIDPtr) .integer; } @@ -1651,16 +1651,16 @@ class Example extends _$jni.JObject { r'(II)I', ); - static final _addInts = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32, _$jni.Int32)>)>>( + static final _addInts = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( 'globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); /// from: `static public int addInts(int i, int i1)` static int addInts( @@ -1668,7 +1668,7 @@ class Example extends _$jni.JObject { int i1, ) { return _addInts( - _class.reference.pointer, _id_addInts as _$jni.JMethodIDPtr, i, i1) + _class.reference.pointer, _id_addInts as jni$_.JMethodIDPtr, i, i1) .integer; } @@ -1677,24 +1677,24 @@ class Example extends _$jni.JObject { r'()[I', ); - static final _getArr = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getArr = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public int[] getArr()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.jint>? getArr() { - return _getArr(_class.reference.pointer, _id_getArr as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jint>?>( - const _$jni.JArrayNullableType<_$jni.jint>(_$jni.jintType())); + static jni$_.JArray? getArr() { + return _getArr(_class.reference.pointer, _id_getArr as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jintType())); } static final _id_addAll = _class.staticMethodId( @@ -1702,23 +1702,23 @@ class Example extends _$jni.JObject { r'([I)I', ); - static final _addAll = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _addAll = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public int addAll(int[] is)` static int addAll( - _$jni.JArray<_$jni.jint>? is$, + jni$_.JArray? is$, ) { - final _$is$ = is$?.reference ?? _$jni.jNullReference; - return _addAll(_class.reference.pointer, _id_addAll as _$jni.JMethodIDPtr, + final _$is$ = is$?.reference ?? jni$_.jNullReference; + return _addAll(_class.reference.pointer, _id_addAll as jni$_.JMethodIDPtr, _$is$.pointer) .integer; } @@ -1728,22 +1728,22 @@ class Example extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/simple_package/Example;', ); - static final _getSelf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getSelf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.simple_package.Example getSelf()` /// The returned object must be released after use, by calling the [release] method. Example? getSelf() { - return _getSelf(reference.pointer, _id_getSelf as _$jni.JMethodIDPtr) + return _getSelf(reference.pointer, _id_getSelf as jni$_.JMethodIDPtr) .object(const $Example$NullableType()); } @@ -1752,22 +1752,22 @@ class Example extends _$jni.JObject { r'()V', ); - static final _throwException = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _throwException = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public void throwException()` static void throwException() { _throwException( - _class.reference.pointer, _id_throwException as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_throwException as jni$_.JMethodIDPtr) .check(); } @@ -1776,21 +1776,21 @@ class Example extends _$jni.JObject { r'()V', ); - static final _overloaded = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _overloaded = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void overloaded()` void overloaded() { - _overloaded(reference.pointer, _id_overloaded as _$jni.JMethodIDPtr) + _overloaded(reference.pointer, _id_overloaded as jni$_.JMethodIDPtr) .check(); } @@ -1799,25 +1799,25 @@ class Example extends _$jni.JObject { r'(ILjava/lang/String;)V', ); - static final _overloaded$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Int32, _$jni.Pointer<_$jni.Void>)>)>>( + static final _overloaded$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Int32, jni$_.Pointer)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, jni$_.Pointer)>(); /// from: `public void overloaded(int i, java.lang.String string)` void overloaded$1( int i, - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - _overloaded$1(reference.pointer, _id_overloaded$1 as _$jni.JMethodIDPtr, i, + final _$string = string?.reference ?? jni$_.jNullReference; + _overloaded$1(reference.pointer, _id_overloaded$1 as jni$_.JMethodIDPtr, i, _$string.pointer) .check(); } @@ -1827,21 +1827,21 @@ class Example extends _$jni.JObject { r'(I)V', ); - static final _overloaded$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallVoidMethod') + static final _overloaded$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public void overloaded(int i)` void overloaded$2( int i, ) { - _overloaded$2(reference.pointer, _id_overloaded$2 as _$jni.JMethodIDPtr, i) + _overloaded$2(reference.pointer, _id_overloaded$2 as jni$_.JMethodIDPtr, i) .check(); } @@ -1850,31 +1850,31 @@ class Example extends _$jni.JObject { r'(Ljava/util/List;Ljava/lang/String;)V', ); - static final _overloaded$3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _overloaded$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void overloaded(java.util.List list, java.lang.String string)` void overloaded$3( - _$jni.JList<_$jni.JInteger?>? list, - _$jni.JString? string, + jni$_.JList? list, + jni$_.JString? string, ) { - final _$list = list?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; - _overloaded$3(reference.pointer, _id_overloaded$3 as _$jni.JMethodIDPtr, + final _$list = list?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; + _overloaded$3(reference.pointer, _id_overloaded$3 as jni$_.JMethodIDPtr, _$list.pointer, _$string.pointer) .check(); } @@ -1884,114 +1884,114 @@ class Example extends _$jni.JObject { r'(Ljava/util/List;)V', ); - static final _overloaded$4 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _overloaded$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void overloaded(java.util.List list)` void overloaded$4( - _$jni.JList<_$jni.JInteger?>? list, + jni$_.JList? list, ) { - final _$list = list?.reference ?? _$jni.jNullReference; - _overloaded$4(reference.pointer, _id_overloaded$4 as _$jni.JMethodIDPtr, + final _$list = list?.reference ?? jni$_.jNullReference; + _overloaded$4(reference.pointer, _id_overloaded$4 as jni$_.JMethodIDPtr, _$list.pointer) .check(); } } -final class $Example$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Example$NullableType extends jni$_.JObjType { + @jni$_.internal const $Example$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example;'; - @_$jni.internal - @_$core.override - Example? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Example? fromReference(jni$_.JReference reference) => reference.isNull ? null : Example.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example$NullableType) && other is $Example$NullableType; } } -final class $Example$Type extends _$jni.JObjType { - @_$jni.internal +final class $Example$Type extends jni$_.JObjType { + @jni$_.internal const $Example$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Example;'; - @_$jni.internal - @_$core.override - Example fromReference(_$jni.JReference reference) => Example.fromReference( + @jni$_.internal + @core$_.override + Example fromReference(jni$_.JReference reference) => Example.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Example$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Example$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example$Type) && other is $Example$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Exceptions` -class Exceptions extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Exceptions extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Exceptions.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Exceptions'); /// The type which includes information such as the signature of this class. @@ -2001,23 +2001,23 @@ class Exceptions extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Exceptions() { return Exceptions.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -2025,15 +2025,15 @@ class Exceptions extends _$jni.JObject { r'(F)V', ); - static final _new$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Double,)>)>>('globalEnv_NewObject') + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Double,)>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, double)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, double)>(); /// from: `public void (float f)` /// The returned object must be released after use, by calling the [release] method. @@ -2041,7 +2041,7 @@ class Exceptions extends _$jni.JObject { double f, ) { return Exceptions.fromReference( - _new$1(_class.reference.pointer, _id_new$1 as _$jni.JMethodIDPtr, f) + _new$1(_class.reference.pointer, _id_new$1 as jni$_.JMethodIDPtr, f) .reference); } @@ -2049,23 +2049,23 @@ class Exceptions extends _$jni.JObject { r'(IIIIII)V', ); - static final _new$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32 + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, int, int, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, int, int, int)>(); /// from: `public void (int i, int i1, int i2, int i3, int i4, int i5)` /// The returned object must be released after use, by calling the [release] method. @@ -2078,7 +2078,7 @@ class Exceptions extends _$jni.JObject { int i5, ) { return Exceptions.fromReference(_new$2(_class.reference.pointer, - _id_new$2 as _$jni.JMethodIDPtr, i, i1, i2, i3, i4, i5) + _id_new$2 as jni$_.JMethodIDPtr, i, i1, i2, i3, i4, i5) .reference); } @@ -2087,24 +2087,24 @@ class Exceptions extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _staticObjectMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _staticObjectMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public java.lang.Object staticObjectMethod()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject? staticObjectMethod() { + static jni$_.JObject? staticObjectMethod() { return _staticObjectMethod(_class.reference.pointer, - _id_staticObjectMethod as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_staticObjectMethod as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_staticIntMethod = _class.staticMethodId( @@ -2112,22 +2112,22 @@ class Exceptions extends _$jni.JObject { r'()I', ); - static final _staticIntMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _staticIntMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public int staticIntMethod()` static int staticIntMethod() { return _staticIntMethod( - _class.reference.pointer, _id_staticIntMethod as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_staticIntMethod as jni$_.JMethodIDPtr) .integer; } @@ -2136,26 +2136,26 @@ class Exceptions extends _$jni.JObject { r'()[Ljava/lang/Object;', ); - static final _staticObjectArrayMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _staticObjectArrayMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public java.lang.Object[] staticObjectArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.JObject?>? staticObjectArrayMethod() { + static jni$_.JArray? staticObjectArrayMethod() { return _staticObjectArrayMethod(_class.reference.pointer, - _id_staticObjectArrayMethod as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.JObject?>?>( - const _$jni.JArrayNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + _id_staticObjectArrayMethod as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( + jni$_.JObjectNullableType())); } static final _id_staticIntArrayMethod = _class.staticMethodId( @@ -2163,25 +2163,25 @@ class Exceptions extends _$jni.JObject { r'()[I', ); - static final _staticIntArrayMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _staticIntArrayMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public int[] staticIntArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray<_$jni.jint>? staticIntArrayMethod() { + static jni$_.JArray? staticIntArrayMethod() { return _staticIntArrayMethod(_class.reference.pointer, - _id_staticIntArrayMethod as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jint>?>( - const _$jni.JArrayNullableType<_$jni.jint>(_$jni.jintType())); + _id_staticIntArrayMethod as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jintType())); } static final _id_objectMethod = _class.instanceMethodId( @@ -2189,24 +2189,24 @@ class Exceptions extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _objectMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _objectMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object objectMethod()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? objectMethod() { + jni$_.JObject? objectMethod() { return _objectMethod( - reference.pointer, _id_objectMethod as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + reference.pointer, _id_objectMethod as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_intMethod = _class.instanceMethodId( @@ -2214,21 +2214,21 @@ class Exceptions extends _$jni.JObject { r'()I', ); - static final _intMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _intMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int intMethod()` int intMethod() { - return _intMethod(reference.pointer, _id_intMethod as _$jni.JMethodIDPtr) + return _intMethod(reference.pointer, _id_intMethod as jni$_.JMethodIDPtr) .integer; } @@ -2237,26 +2237,26 @@ class Exceptions extends _$jni.JObject { r'()[Ljava/lang/Object;', ); - static final _objectArrayMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _objectArrayMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.Object[] objectArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JObject?>? objectArrayMethod() { + jni$_.JArray? objectArrayMethod() { return _objectArrayMethod( - reference.pointer, _id_objectArrayMethod as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.JObject?>?>( - const _$jni.JArrayNullableType<_$jni.JObject?>( - _$jni.JObjectNullableType())); + reference.pointer, _id_objectArrayMethod as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( + jni$_.JObjectNullableType())); } static final _id_intArrayMethod = _class.instanceMethodId( @@ -2264,25 +2264,25 @@ class Exceptions extends _$jni.JObject { r'()[I', ); - static final _intArrayMethod = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _intArrayMethod = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int[] intArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.jint>? intArrayMethod() { + jni$_.JArray? intArrayMethod() { return _intArrayMethod( - reference.pointer, _id_intArrayMethod as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.jint>?>( - const _$jni.JArrayNullableType<_$jni.jint>(_$jni.jintType())); + reference.pointer, _id_intArrayMethod as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType(jni$_.jintType())); } static final _id_throwNullPointerException = _class.instanceMethodId( @@ -2290,22 +2290,22 @@ class Exceptions extends _$jni.JObject { r'()I', ); - static final _throwNullPointerException = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _throwNullPointerException = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int throwNullPointerException()` int throwNullPointerException() { return _throwNullPointerException(reference.pointer, - _id_throwNullPointerException as _$jni.JMethodIDPtr) + _id_throwNullPointerException as jni$_.JMethodIDPtr) .integer; } @@ -2315,24 +2315,24 @@ class Exceptions extends _$jni.JObject { ); static final _throwFileNotFoundException = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.io.InputStream throwFileNotFoundException()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? throwFileNotFoundException() { + jni$_.JObject? throwFileNotFoundException() { return _throwFileNotFoundException(reference.pointer, - _id_throwFileNotFoundException as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_throwFileNotFoundException as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_throwClassCastException = _class.instanceMethodId( @@ -2340,24 +2340,24 @@ class Exceptions extends _$jni.JObject { r'()Ljava/io/FileInputStream;', ); - static final _throwClassCastException = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _throwClassCastException = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.io.FileInputStream throwClassCastException()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? throwClassCastException() { + jni$_.JObject? throwClassCastException() { return _throwClassCastException(reference.pointer, - _id_throwClassCastException as _$jni.JMethodIDPtr) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_throwClassCastException as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } static final _id_throwArrayIndexException = _class.instanceMethodId( @@ -2365,22 +2365,22 @@ class Exceptions extends _$jni.JObject { r'()I', ); - static final _throwArrayIndexException = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _throwArrayIndexException = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int throwArrayIndexException()` int throwArrayIndexException() { return _throwArrayIndexException(reference.pointer, - _id_throwArrayIndexException as _$jni.JMethodIDPtr) + _id_throwArrayIndexException as jni$_.JMethodIDPtr) .integer; } @@ -2389,22 +2389,22 @@ class Exceptions extends _$jni.JObject { r'()I', ); - static final _throwArithmeticException = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _throwArithmeticException = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int throwArithmeticException()` int throwArithmeticException() { return _throwArithmeticException(reference.pointer, - _id_throwArithmeticException as _$jni.JMethodIDPtr) + _id_throwArithmeticException as jni$_.JMethodIDPtr) .integer; } @@ -2413,114 +2413,114 @@ class Exceptions extends _$jni.JObject { r'()V', ); - static final _throwLoremIpsum = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _throwLoremIpsum = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public void throwLoremIpsum()` static void throwLoremIpsum() { _throwLoremIpsum( - _class.reference.pointer, _id_throwLoremIpsum as _$jni.JMethodIDPtr) + _class.reference.pointer, _id_throwLoremIpsum as jni$_.JMethodIDPtr) .check(); } } -final class $Exceptions$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Exceptions$NullableType extends jni$_.JObjType { + @jni$_.internal const $Exceptions$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Exceptions;'; - @_$jni.internal - @_$core.override - Exceptions? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Exceptions? fromReference(jni$_.JReference reference) => reference.isNull ? null : Exceptions.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Exceptions$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Exceptions$NullableType) && other is $Exceptions$NullableType; } } -final class $Exceptions$Type extends _$jni.JObjType { - @_$jni.internal +final class $Exceptions$Type extends jni$_.JObjType { + @jni$_.internal const $Exceptions$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Exceptions;'; - @_$jni.internal - @_$core.override - Exceptions fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Exceptions fromReference(jni$_.JReference reference) => Exceptions.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Exceptions$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Exceptions$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Exceptions$Type) && other is $Exceptions$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Fields$Nested` -class Fields_Nested extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Fields_Nested extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Fields_Nested.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Fields$Nested'); /// The type which includes information such as the signature of this class. @@ -2532,11 +2532,11 @@ class Fields_Nested extends _$jni.JObject { ); /// from: `public long hundred` - int get hundred => _id_hundred.get(this, const _$jni.jlongType()); + int get hundred => _id_hundred.get(this, const jni$_.jlongType()); /// from: `public long hundred` set hundred(int value) => - _id_hundred.set(this, const _$jni.jlongType(), value); + _id_hundred.set(this, const jni$_.jlongType(), value); static final _id_BEST_GOD = _class.staticFieldId( r'BEST_GOD', @@ -2545,109 +2545,109 @@ class Fields_Nested extends _$jni.JObject { /// from: `static public java.lang.String BEST_GOD` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get BEST_GOD => - _id_BEST_GOD.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get BEST_GOD => + _id_BEST_GOD.get(_class, const jni$_.JStringNullableType()); /// from: `static public java.lang.String BEST_GOD` /// The returned object must be released after use, by calling the [release] method. - static set BEST_GOD(_$jni.JString? value) => - _id_BEST_GOD.set(_class, const _$jni.JStringNullableType(), value); + static set BEST_GOD(jni$_.JString? value) => + _id_BEST_GOD.set(_class, const jni$_.JStringNullableType(), value); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Fields_Nested() { return Fields_Nested.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Fields_Nested$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Fields_Nested$NullableType extends jni$_.JObjType { + @jni$_.internal const $Fields_Nested$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;'; - @_$jni.internal - @_$core.override - Fields_Nested? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Fields_Nested? fromReference(jni$_.JReference reference) => reference.isNull ? null : Fields_Nested.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Fields_Nested$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Fields_Nested$NullableType) && other is $Fields_Nested$NullableType; } } -final class $Fields_Nested$Type extends _$jni.JObjType { - @_$jni.internal +final class $Fields_Nested$Type extends jni$_.JObjType { + @jni$_.internal const $Fields_Nested$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Fields$Nested;'; - @_$jni.internal - @_$core.override - Fields_Nested fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Fields_Nested fromReference(jni$_.JReference reference) => Fields_Nested.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Fields_Nested$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Fields_Nested$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Fields_Nested$Type) && other is $Fields_Nested$Type; @@ -2655,18 +2655,18 @@ final class $Fields_Nested$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.simple_package.Fields` -class Fields extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Fields extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Fields.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/simple_package/Fields'); /// The type which includes information such as the signature of this class. @@ -2678,11 +2678,11 @@ class Fields extends _$jni.JObject { ); /// from: `static public int amount` - static int get amount => _id_amount.get(_class, const _$jni.jintType()); + static int get amount => _id_amount.get(_class, const jni$_.jintType()); /// from: `static public int amount` static set amount(int value) => - _id_amount.set(_class, const _$jni.jintType(), value); + _id_amount.set(_class, const jni$_.jintType(), value); static final _id_pi = _class.staticFieldId( r'pi', @@ -2690,11 +2690,11 @@ class Fields extends _$jni.JObject { ); /// from: `static public double pi` - static double get pi => _id_pi.get(_class, const _$jni.jdoubleType()); + static double get pi => _id_pi.get(_class, const jni$_.jdoubleType()); /// from: `static public double pi` static set pi(double value) => - _id_pi.set(_class, const _$jni.jdoubleType(), value); + _id_pi.set(_class, const jni$_.jdoubleType(), value); static final _id_asterisk = _class.staticFieldId( r'asterisk', @@ -2702,11 +2702,11 @@ class Fields extends _$jni.JObject { ); /// from: `static public char asterisk` - static int get asterisk => _id_asterisk.get(_class, const _$jni.jcharType()); + static int get asterisk => _id_asterisk.get(_class, const jni$_.jcharType()); /// from: `static public char asterisk` static set asterisk(int value) => - _id_asterisk.set(_class, const _$jni.jcharType(), value); + _id_asterisk.set(_class, const jni$_.jcharType(), value); static final _id_name = _class.staticFieldId( r'name', @@ -2715,13 +2715,13 @@ class Fields extends _$jni.JObject { /// from: `static public java.lang.String name` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JString? get name => - _id_name.get(_class, const _$jni.JStringNullableType()); + static jni$_.JString? get name => + _id_name.get(_class, const jni$_.JStringNullableType()); /// from: `static public java.lang.String name` /// The returned object must be released after use, by calling the [release] method. - static set name(_$jni.JString? value) => - _id_name.set(_class, const _$jni.JStringNullableType(), value); + static set name(jni$_.JString? value) => + _id_name.set(_class, const jni$_.JStringNullableType(), value); static final _id_i = _class.instanceFieldId( r'i', @@ -2730,12 +2730,12 @@ class Fields extends _$jni.JObject { /// from: `public java.lang.Integer i` /// The returned object must be released after use, by calling the [release] method. - _$jni.JInteger? get i => _id_i.get(this, const _$jni.JIntegerNullableType()); + jni$_.JInteger? get i => _id_i.get(this, const jni$_.JIntegerNullableType()); /// from: `public java.lang.Integer i` /// The returned object must be released after use, by calling the [release] method. - set i(_$jni.JInteger? value) => - _id_i.set(this, const _$jni.JIntegerNullableType(), value); + set i(jni$_.JInteger? value) => + _id_i.set(this, const jni$_.JIntegerNullableType(), value); static final _id_trillion = _class.instanceFieldId( r'trillion', @@ -2743,11 +2743,11 @@ class Fields extends _$jni.JObject { ); /// from: `public long trillion` - int get trillion => _id_trillion.get(this, const _$jni.jlongType()); + int get trillion => _id_trillion.get(this, const jni$_.jlongType()); /// from: `public long trillion` set trillion(int value) => - _id_trillion.set(this, const _$jni.jlongType(), value); + _id_trillion.set(this, const jni$_.jlongType(), value); static final _id_isAchillesDead = _class.instanceFieldId( r'isAchillesDead', @@ -2756,11 +2756,11 @@ class Fields extends _$jni.JObject { /// from: `public boolean isAchillesDead` bool get isAchillesDead => - _id_isAchillesDead.get(this, const _$jni.jbooleanType()); + _id_isAchillesDead.get(this, const jni$_.jbooleanType()); /// from: `public boolean isAchillesDead` set isAchillesDead(bool value) => - _id_isAchillesDead.set(this, const _$jni.jbooleanType(), value); + _id_isAchillesDead.set(this, const jni$_.jbooleanType(), value); static final _id_bestFighterInGreece = _class.instanceFieldId( r'bestFighterInGreece', @@ -2769,13 +2769,13 @@ class Fields extends _$jni.JObject { /// from: `public java.lang.String bestFighterInGreece` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? get bestFighterInGreece => - _id_bestFighterInGreece.get(this, const _$jni.JStringNullableType()); + jni$_.JString? get bestFighterInGreece => + _id_bestFighterInGreece.get(this, const jni$_.JStringNullableType()); /// from: `public java.lang.String bestFighterInGreece` /// The returned object must be released after use, by calling the [release] method. - set bestFighterInGreece(_$jni.JString? value) => _id_bestFighterInGreece.set( - this, const _$jni.JStringNullableType(), value); + set bestFighterInGreece(jni$_.JString? value) => _id_bestFighterInGreece.set( + this, const jni$_.JStringNullableType(), value); static final _id_random = _class.instanceFieldId( r'random', @@ -2784,13 +2784,13 @@ class Fields extends _$jni.JObject { /// from: `public java.util.Random random` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? get random => - _id_random.get(this, const _$jni.JObjectNullableType()); + jni$_.JObject? get random => + _id_random.get(this, const jni$_.JObjectNullableType()); /// from: `public java.util.Random random` /// The returned object must be released after use, by calling the [release] method. - set random(_$jni.JObject? value) => - _id_random.set(this, const _$jni.JObjectNullableType(), value); + set random(jni$_.JObject? value) => + _id_random.set(this, const jni$_.JObjectNullableType(), value); static final _id_euroSymbol = _class.staticFieldId( r'euroSymbol', @@ -2799,124 +2799,124 @@ class Fields extends _$jni.JObject { /// from: `static public char euroSymbol` static int get euroSymbol => - _id_euroSymbol.get(_class, const _$jni.jcharType()); + _id_euroSymbol.get(_class, const jni$_.jcharType()); /// from: `static public char euroSymbol` static set euroSymbol(int value) => - _id_euroSymbol.set(_class, const _$jni.jcharType(), value); + _id_euroSymbol.set(_class, const jni$_.jcharType(), value); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Fields() { return Fields.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Fields$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Fields$NullableType extends jni$_.JObjType { + @jni$_.internal const $Fields$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Fields;'; - @_$jni.internal - @_$core.override - Fields? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Fields? fromReference(jni$_.JReference reference) => reference.isNull ? null : Fields.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Fields$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Fields$NullableType) && other is $Fields$NullableType; } } -final class $Fields$Type extends _$jni.JObjType { - @_$jni.internal +final class $Fields$Type extends jni$_.JObjType { + @jni$_.internal const $Fields$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/simple_package/Fields;'; - @_$jni.internal - @_$core.override - Fields fromReference(_$jni.JReference reference) => Fields.fromReference( + @jni$_.internal + @core$_.override + Fields fromReference(jni$_.JReference reference) => Fields.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Fields$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Fields$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Fields$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Fields$Type) && other is $Fields$Type; } } /// from: `com.github.dart_lang.jnigen.pkg2.C2` -class C2 extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class C2 extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal C2.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/C2'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/C2'); /// The type which includes information such as the signature of this class. static const nullableType = $C2$NullableType(); @@ -2927,121 +2927,121 @@ class C2 extends _$jni.JObject { ); /// from: `static public int CONSTANT` - static int get CONSTANT => _id_CONSTANT.get(_class, const _$jni.jintType()); + static int get CONSTANT => _id_CONSTANT.get(_class, const jni$_.jintType()); /// from: `static public int CONSTANT` static set CONSTANT(int value) => - _id_CONSTANT.set(_class, const _$jni.jintType(), value); + _id_CONSTANT.set(_class, const jni$_.jintType(), value); static final _id_new$ = _class.constructorId( r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory C2() { return C2.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $C2$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $C2$NullableType extends jni$_.JObjType { + @jni$_.internal const $C2$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/C2;'; - @_$jni.internal - @_$core.override - C2? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + C2? fromReference(jni$_.JReference reference) => reference.isNull ? null : C2.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($C2$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($C2$NullableType) && other is $C2$NullableType; } } -final class $C2$Type extends _$jni.JObjType { - @_$jni.internal +final class $C2$Type extends jni$_.JObjType { + @jni$_.internal const $C2$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/C2;'; - @_$jni.internal - @_$core.override - C2 fromReference(_$jni.JReference reference) => C2.fromReference( + @jni$_.internal + @core$_.override + C2 fromReference(jni$_.JReference reference) => C2.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $C2$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $C2$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($C2$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($C2$Type) && other is $C2$Type; } } /// from: `com.github.dart_lang.jnigen.pkg2.Example` -class Example$1 extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Example$1 extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Example$1.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/Example'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/pkg2/Example'); /// The type which includes information such as the signature of this class. static const nullableType = $Example$1$NullableType(); @@ -3050,23 +3050,23 @@ class Example$1 extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory Example$1() { return Example$1.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -3075,128 +3075,128 @@ class Example$1 extends _$jni.JObject { r'()I', ); - static final _whichExample = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _whichExample = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int whichExample()` int whichExample() { return _whichExample( - reference.pointer, _id_whichExample as _$jni.JMethodIDPtr) + reference.pointer, _id_whichExample as jni$_.JMethodIDPtr) .integer; } } -final class $Example$1$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Example$1$NullableType extends jni$_.JObjType { + @jni$_.internal const $Example$1$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/Example;'; - @_$jni.internal - @_$core.override - Example$1? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Example$1? fromReference(jni$_.JReference reference) => reference.isNull ? null : Example$1.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example$1$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example$1$NullableType) && other is $Example$1$NullableType; } } -final class $Example$1$Type extends _$jni.JObjType { - @_$jni.internal +final class $Example$1$Type extends jni$_.JObjType { + @jni$_.internal const $Example$1$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/pkg2/Example;'; - @_$jni.internal - @_$core.override - Example$1 fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Example$1 fromReference(jni$_.JReference reference) => Example$1.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Example$1$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Example$1$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Example$1$Type) && other is $Example$1$Type; } } /// from: `com.github.dart_lang.jnigen.generics.GenericTypeParams` -class GenericTypeParams<$S extends _$jni.JObject?, $K extends _$jni.JObject?> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GenericTypeParams<$S extends jni$_.JObject?, $K extends jni$_.JObject?> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal + @jni$_.internal GenericTypeParams.fromReference( this.S, this.K, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$S, $K>(S, K), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/GenericTypeParams'); /// The type which includes information such as the signature of this class. static $GenericTypeParams$NullableType<$S, $K> - nullableType<$S extends _$jni.JObject?, $K extends _$jni.JObject?>( - _$jni.JObjType<$S> S, - _$jni.JObjType<$K> K, + nullableType<$S extends jni$_.JObject?, $K extends jni$_.JObject?>( + jni$_.JObjType<$S> S, + jni$_.JObjType<$K> K, ) { return $GenericTypeParams$NullableType<$S, $K>( S, @@ -3205,9 +3205,9 @@ class GenericTypeParams<$S extends _$jni.JObject?, $K extends _$jni.JObject?> } static $GenericTypeParams$Type<$S, $K> - type<$S extends _$jni.JObject?, $K extends _$jni.JObject?>( - _$jni.JObjType<$S> S, - _$jni.JObjType<$K> K, + type<$S extends jni$_.JObject?, $K extends jni$_.JObject?>( + jni$_.JObjType<$S> S, + jni$_.JObjType<$K> K, ) { return $GenericTypeParams$Type<$S, $K>( S, @@ -3219,55 +3219,55 @@ class GenericTypeParams<$S extends _$jni.JObject?, $K extends _$jni.JObject?> r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory GenericTypeParams({ - required _$jni.JObjType<$S> S, - required _$jni.JObjType<$K> K, + required jni$_.JObjType<$S> S, + required jni$_.JObjType<$K> K, }) { return GenericTypeParams<$S, $K>.fromReference( S, K, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $GenericTypeParams$NullableType<$S extends _$jni.JObject?, - $K extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$S> S; +final class $GenericTypeParams$NullableType<$S extends jni$_.JObject?, + $K extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal + @jni$_.internal const $GenericTypeParams$NullableType( this.S, this.K, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;'; - @_$jni.internal - @_$core.override - GenericTypeParams<$S, $K>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GenericTypeParams<$S, $K>? fromReference(jni$_.JReference reference) => reference.isNull ? null : GenericTypeParams<$S, $K>.fromReference( @@ -3275,22 +3275,22 @@ final class $GenericTypeParams$NullableType<$S extends _$jni.JObject?, K, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GenericTypeParams$NullableType, S, K); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GenericTypeParams$NullableType<$S, $K>) && other is $GenericTypeParams$NullableType<$S, $K> && @@ -3299,51 +3299,51 @@ final class $GenericTypeParams$NullableType<$S extends _$jni.JObject?, } } -final class $GenericTypeParams$Type<$S extends _$jni.JObject?, - $K extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$S> S; +final class $GenericTypeParams$Type<$S extends jni$_.JObject?, + $K extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal + @jni$_.internal const $GenericTypeParams$Type( this.S, this.K, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GenericTypeParams;'; - @_$jni.internal - @_$core.override - GenericTypeParams<$S, $K> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GenericTypeParams<$S, $K> fromReference(jni$_.JReference reference) => GenericTypeParams<$S, $K>.fromReference( S, K, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GenericTypeParams$NullableType<$S, $K>(S, K); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GenericTypeParams$Type, S, K); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GenericTypeParams$Type<$S, $K>) && other is $GenericTypeParams$Type<$S, $K> && @@ -3354,42 +3354,42 @@ final class $GenericTypeParams$Type<$S extends _$jni.JObject?, /// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child` class GrandParent_Parent_Child< - $T extends _$jni.JObject?, - $S extends _$jni.JObject?, - $U extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; + $T extends jni$_.JObject?, + $S extends jni$_.JObject?, + $U extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal GrandParent_Parent_Child.fromReference( this.T, this.S, this.U, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T, $S, $U>(T, S, U), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child'); /// The type which includes information such as the signature of this class. static $GrandParent_Parent_Child$NullableType<$T, $S, $U> nullableType< - $T extends _$jni.JObject?, - $S extends _$jni.JObject?, - $U extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$S> S, - _$jni.JObjType<$U> U, + $T extends jni$_.JObject?, + $S extends jni$_.JObject?, + $U extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$S> S, + jni$_.JObjType<$U> U, ) { return $GrandParent_Parent_Child$NullableType<$T, $S, $U>( T, @@ -3399,12 +3399,12 @@ class GrandParent_Parent_Child< } static $GrandParent_Parent_Child$Type<$T, $S, $U> type< - $T extends _$jni.JObject?, - $S extends _$jni.JObject?, - $U extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$S> S, - _$jni.JObjType<$U> U, + $T extends jni$_.JObject?, + $S extends jni$_.JObject?, + $U extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$S> S, + jni$_.JObjType<$U> U, ) { return $GrandParent_Parent_Child$Type<$T, $S, $U>( T, @@ -3458,82 +3458,82 @@ class GrandParent_Parent_Child< r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $outerClass, U object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent_Child( GrandParent_Parent<$T?, $S?> $outerClass, $U? object, { - _$jni.JObjType<$T>? T, - _$jni.JObjType<$S>? S, - required _$jni.JObjType<$U> U, + jni$_.JObjType<$T>? T, + jni$_.JObjType<$S>? S, + required jni$_.JObjType<$U> U, }) { - T ??= _$jni.lowestCommonSuperType([ + T ??= jni$_.lowestCommonSuperType([ ($outerClass.$type - as $GrandParent_Parent$Type<_$core.dynamic, _$core.dynamic>) + as $GrandParent_Parent$Type) .T, - ]) as _$jni.JObjType<$T>; - S ??= _$jni.lowestCommonSuperType([ + ]) as jni$_.JObjType<$T>; + S ??= jni$_.lowestCommonSuperType([ ($outerClass.$type - as $GrandParent_Parent$Type<_$core.dynamic, _$core.dynamic>) + as $GrandParent_Parent$Type) .S, - ]) as _$jni.JObjType<$S>; + ]) as jni$_.JObjType<$S>; final _$$outerClass = $outerClass.reference; - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return GrandParent_Parent_Child<$T, $S, $U>.fromReference( T, S, U, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer, _$object.pointer) .reference); } } -final class $GrandParent_Parent_Child$NullableType<$T extends _$jni.JObject?, - $S extends _$jni.JObject?, $U extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GrandParent_Parent_Child$NullableType<$T extends jni$_.JObject?, + $S extends jni$_.JObject?, $U extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal const $GrandParent_Parent_Child$NullableType( this.T, this.S, this.U, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override GrandParent_Parent_Child<$T, $S, $U>? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : GrandParent_Parent_Child<$T, $S, $U>.fromReference( @@ -3542,24 +3542,24 @@ final class $GrandParent_Parent_Child$NullableType<$T extends _$jni.JObject?, U, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_Parent_Child$NullableType, T, S, U); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_Parent_Child$NullableType<$T, $S, $U>) && @@ -3570,57 +3570,57 @@ final class $GrandParent_Parent_Child$NullableType<$T extends _$jni.JObject?, } } -final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject?, - $S extends _$jni.JObject?, $U extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GrandParent_Parent_Child$Type<$T extends jni$_.JObject?, + $S extends jni$_.JObject?, $U extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal const $GrandParent_Parent_Child$Type( this.T, this.S, this.U, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent$Child;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override GrandParent_Parent_Child<$T, $S, $U> fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => GrandParent_Parent_Child<$T, $S, $U>.fromReference( T, S, U, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GrandParent_Parent_Child$NullableType<$T, $S, $U>(T, S, U); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_Parent_Child$Type, T, S, U); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_Parent_Child$Type<$T, $S, $U>) && other is $GrandParent_Parent_Child$Type<$T, $S, $U> && @@ -3631,34 +3631,34 @@ final class $GrandParent_Parent_Child$Type<$T extends _$jni.JObject?, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent` -class GrandParent_Parent<$T extends _$jni.JObject?, $S extends _$jni.JObject?> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal + @jni$_.internal GrandParent_Parent.fromReference( this.T, this.S, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T, $S>(T, S), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$Parent'); /// The type which includes information such as the signature of this class. static $GrandParent_Parent$NullableType<$T, $S> - nullableType<$T extends _$jni.JObject?, $S extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$S> S, + nullableType<$T extends jni$_.JObject?, $S extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$S> S, ) { return $GrandParent_Parent$NullableType<$T, $S>( T, @@ -3667,9 +3667,9 @@ class GrandParent_Parent<$T extends _$jni.JObject?, $S extends _$jni.JObject?> } static $GrandParent_Parent$Type<$T, $S> - type<$T extends _$jni.JObject?, $S extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$S> S, + type<$T extends jni$_.JObject?, $S extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$S> S, ) { return $GrandParent_Parent$Type<$T, $S>( T, @@ -3708,68 +3708,68 @@ class GrandParent_Parent<$T extends _$jni.JObject?, $S extends _$jni.JObject?> r'(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $outerClass, S object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent( GrandParent<$T?> $outerClass, $S? object, { - _$jni.JObjType<$T>? T, - required _$jni.JObjType<$S> S, + jni$_.JObjType<$T>? T, + required jni$_.JObjType<$S> S, }) { - T ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $GrandParent$Type<_$core.dynamic>).T, - ]) as _$jni.JObjType<$T>; + T ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $GrandParent$Type).T, + ]) as jni$_.JObjType<$T>; final _$$outerClass = $outerClass.reference; - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return GrandParent_Parent<$T, $S>.fromReference( T, S, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer, _$object.pointer) .reference); } } -final class $GrandParent_Parent$NullableType<$T extends _$jni.JObject?, - $S extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GrandParent_Parent$NullableType<$T extends jni$_.JObject?, + $S extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal + @jni$_.internal const $GrandParent_Parent$NullableType( this.T, this.S, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;'; - @_$jni.internal - @_$core.override - GrandParent_Parent<$T, $S>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GrandParent_Parent<$T, $S>? fromReference(jni$_.JReference reference) => reference.isNull ? null : GrandParent_Parent<$T, $S>.fromReference( @@ -3777,22 +3777,22 @@ final class $GrandParent_Parent$NullableType<$T extends _$jni.JObject?, S, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_Parent$NullableType, T, S); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_Parent$NullableType<$T, $S>) && other is $GrandParent_Parent$NullableType<$T, $S> && @@ -3801,51 +3801,51 @@ final class $GrandParent_Parent$NullableType<$T extends _$jni.JObject?, } } -final class $GrandParent_Parent$Type<$T extends _$jni.JObject?, - $S extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GrandParent_Parent$Type<$T extends jni$_.JObject?, + $S extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal + @jni$_.internal const $GrandParent_Parent$Type( this.T, this.S, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;'; - @_$jni.internal - @_$core.override - GrandParent_Parent<$T, $S> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GrandParent_Parent<$T, $S> fromReference(jni$_.JReference reference) => GrandParent_Parent<$T, $S>.fromReference( T, S, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GrandParent_Parent$NullableType<$T, $S>(T, S); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_Parent$Type, T, S); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_Parent$Type<$T, $S>) && other is $GrandParent_Parent$Type<$T, $S> && @@ -3855,34 +3855,34 @@ final class $GrandParent_Parent$Type<$T extends _$jni.JObject?, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child` -class GrandParent_StaticParent_Child<$S extends _$jni.JObject?, - $U extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GrandParent_StaticParent_Child<$S extends jni$_.JObject?, + $U extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal GrandParent_StaticParent_Child.fromReference( this.S, this.U, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$S, $U>(S, U), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child'); /// The type which includes information such as the signature of this class. static $GrandParent_StaticParent_Child$NullableType<$S, $U> - nullableType<$S extends _$jni.JObject?, $U extends _$jni.JObject?>( - _$jni.JObjType<$S> S, - _$jni.JObjType<$U> U, + nullableType<$S extends jni$_.JObject?, $U extends jni$_.JObject?>( + jni$_.JObjType<$S> S, + jni$_.JObjType<$U> U, ) { return $GrandParent_StaticParent_Child$NullableType<$S, $U>( S, @@ -3891,9 +3891,9 @@ class GrandParent_StaticParent_Child<$S extends _$jni.JObject?, } static $GrandParent_StaticParent_Child$Type<$S, $U> - type<$S extends _$jni.JObject?, $U extends _$jni.JObject?>( - _$jni.JObjType<$S> S, - _$jni.JObjType<$U> U, + type<$S extends jni$_.JObject?, $U extends jni$_.JObject?>( + jni$_.JObjType<$S> S, + jni$_.JObjType<$U> U, ) { return $GrandParent_StaticParent_Child$Type<$S, $U>( S, @@ -3932,24 +3932,24 @@ class GrandParent_StaticParent_Child<$S extends _$jni.JObject?, r'(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $outerClass, S object, U object1)` /// The returned object must be released after use, by calling the [release] method. @@ -3957,48 +3957,48 @@ class GrandParent_StaticParent_Child<$S extends _$jni.JObject?, GrandParent_StaticParent<$S?> $outerClass, $S? object, $U? object1, { - _$jni.JObjType<$S>? S, - required _$jni.JObjType<$U> U, + jni$_.JObjType<$S>? S, + required jni$_.JObjType<$U> U, }) { - S ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $GrandParent_StaticParent$Type<_$core.dynamic>).S, - ]) as _$jni.JObjType<$S>; + S ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $GrandParent_StaticParent$Type).S, + ]) as jni$_.JObjType<$S>; final _$$outerClass = $outerClass.reference; - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; return GrandParent_StaticParent_Child<$S, $U>.fromReference( S, U, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer, _$object.pointer, _$object1.pointer) .reference); } } final class $GrandParent_StaticParent_Child$NullableType< - $S extends _$jni.JObject?, $U extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$S> S; + $S extends jni$_.JObject?, $U extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal const $GrandParent_StaticParent_Child$NullableType( this.S, this.U, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override GrandParent_StaticParent_Child<$S, $U>? fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => reference.isNull ? null : GrandParent_StaticParent_Child<$S, $U>.fromReference( @@ -4006,24 +4006,24 @@ final class $GrandParent_StaticParent_Child$NullableType< U, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_StaticParent_Child$NullableType, S, U); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_StaticParent_Child$NullableType<$S, $U>) && @@ -4033,52 +4033,52 @@ final class $GrandParent_StaticParent_Child$NullableType< } } -final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject?, - $U extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$S> S; +final class $GrandParent_StaticParent_Child$Type<$S extends jni$_.JObject?, + $U extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal + @jni$_.internal const $GrandParent_StaticParent_Child$Type( this.S, this.U, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child;'; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override GrandParent_StaticParent_Child<$S, $U> fromReference( - _$jni.JReference reference) => + jni$_.JReference reference) => GrandParent_StaticParent_Child<$S, $U>.fromReference( S, U, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GrandParent_StaticParent_Child$NullableType<$S, $U>(S, U); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_StaticParent_Child$Type, S, U); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_StaticParent_Child$Type<$S, $U>) && @@ -4089,37 +4089,37 @@ final class $GrandParent_StaticParent_Child$Type<$S extends _$jni.JObject?, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent` -class GrandParent_StaticParent<$S extends _$jni.JObject?> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GrandParent_StaticParent<$S extends jni$_.JObject?> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$S> S; + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal + @jni$_.internal GrandParent_StaticParent.fromReference( this.S, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$S>(S), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent'); /// The type which includes information such as the signature of this class. static $GrandParent_StaticParent$NullableType<$S> - nullableType<$S extends _$jni.JObject?>( - _$jni.JObjType<$S> S, + nullableType<$S extends jni$_.JObject?>( + jni$_.JObjType<$S> S, ) { return $GrandParent_StaticParent$NullableType<$S>( S, ); } - static $GrandParent_StaticParent$Type<$S> type<$S extends _$jni.JObject?>( - _$jni.JObjType<$S> S, + static $GrandParent_StaticParent$Type<$S> type<$S extends jni$_.JObject?>( + jni$_.JObjType<$S> S, ) { return $GrandParent_StaticParent$Type<$S>( S, @@ -4143,72 +4143,72 @@ class GrandParent_StaticParent<$S extends _$jni.JObject?> r'(Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (S object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent( $S? object, { - required _$jni.JObjType<$S> S, + required jni$_.JObjType<$S> S, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return GrandParent_StaticParent<$S>.fromReference( S, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$object.pointer) .reference); } } -final class $GrandParent_StaticParent$NullableType<$S extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$S> S; +final class $GrandParent_StaticParent$NullableType<$S extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal + @jni$_.internal const $GrandParent_StaticParent$NullableType( this.S, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;'; - @_$jni.internal - @_$core.override - GrandParent_StaticParent<$S>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GrandParent_StaticParent<$S>? fromReference(jni$_.JReference reference) => reference.isNull ? null : GrandParent_StaticParent<$S>.fromReference( S, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_StaticParent$NullableType, S); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_StaticParent$NullableType<$S>) && other is $GrandParent_StaticParent$NullableType<$S> && @@ -4216,45 +4216,45 @@ final class $GrandParent_StaticParent$NullableType<$S extends _$jni.JObject?> } } -final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$S> S; +final class $GrandParent_StaticParent$Type<$S extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$S> S; - @_$jni.internal + @jni$_.internal const $GrandParent_StaticParent$Type( this.S, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;'; - @_$jni.internal - @_$core.override - GrandParent_StaticParent<$S> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GrandParent_StaticParent<$S> fromReference(jni$_.JReference reference) => GrandParent_StaticParent<$S>.fromReference( S, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GrandParent_StaticParent$NullableType<$S>(S); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent_StaticParent$Type, S); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent_StaticParent$Type<$S>) && other is $GrandParent_StaticParent$Type<$S> && @@ -4263,35 +4263,35 @@ final class $GrandParent_StaticParent$Type<$S extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.generics.GrandParent` -class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal GrandParent.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/GrandParent'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/generics/GrandParent'); /// The type which includes information such as the signature of this class. - static $GrandParent$NullableType<$T> nullableType<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $GrandParent$NullableType<$T> nullableType<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $GrandParent$NullableType<$T>( T, ); } - static $GrandParent$Type<$T> type<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $GrandParent$Type<$T> type<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $GrandParent$Type<$T>( T, @@ -4315,27 +4315,27 @@ class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (T object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent( $T? object, { - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return GrandParent<$T>.fromReference( T, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$object.pointer) .reference); } @@ -4345,26 +4345,26 @@ class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;', ); - static final _stringParent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _stringParent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent<$T?, _$jni.JString?>? stringParent() { + GrandParent_Parent<$T?, jni$_.JString?>? stringParent() { return _stringParent( - reference.pointer, _id_stringParent as _$jni.JMethodIDPtr) - .object?>( - $GrandParent_Parent$NullableType<$T?, _$jni.JString?>( - T.nullableType, const _$jni.JStringNullableType())); + reference.pointer, _id_stringParent as jni$_.JMethodIDPtr) + .object?>( + $GrandParent_Parent$NullableType<$T?, jni$_.JString?>( + T.nullableType, const jni$_.JStringNullableType())); } static final _id_varParent = _class.instanceMethodId( @@ -4372,25 +4372,25 @@ class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;', ); - static final _varParent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _varParent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S object)` /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent<$T?, $S?>? varParent<$S extends _$jni.JObject?>( + GrandParent_Parent<$T?, $S?>? varParent<$S extends jni$_.JObject?>( $S? object, { - required _$jni.JObjType<$S> S, + required jni$_.JObjType<$S> S, }) { - final _$object = object?.reference ?? _$jni.jNullReference; - return _varParent(reference.pointer, _id_varParent as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + return _varParent(reference.pointer, _id_varParent as jni$_.JMethodIDPtr, _$object.pointer) .object?>( $GrandParent_Parent$NullableType<$T?, $S?>( @@ -4402,26 +4402,26 @@ class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', ); - static final _stringStaticParent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _stringStaticParent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent stringStaticParent()` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent<_$jni.JString?>? stringStaticParent() { + static GrandParent_StaticParent? stringStaticParent() { return _stringStaticParent(_class.reference.pointer, - _id_stringStaticParent as _$jni.JMethodIDPtr) - .object?>( - const $GrandParent_StaticParent$NullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + _id_stringStaticParent as jni$_.JMethodIDPtr) + .object?>( + const $GrandParent_StaticParent$NullableType( + jni$_.JStringNullableType())); } static final _id_varStaticParent = _class.staticMethodId( @@ -4429,27 +4429,27 @@ class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', ); - static final _varStaticParent = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _varStaticParent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent varStaticParent(S object)` /// The returned object must be released after use, by calling the [release] method. static GrandParent_StaticParent<$S?>? - varStaticParent<$S extends _$jni.JObject?>( + varStaticParent<$S extends jni$_.JObject?>( $S? object, { - required _$jni.JObjType<$S> S, + required jni$_.JObjType<$S> S, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _varStaticParent(_class.reference.pointer, - _id_varStaticParent as _$jni.JMethodIDPtr, _$object.pointer) + _id_varStaticParent as jni$_.JMethodIDPtr, _$object.pointer) .object?>( $GrandParent_StaticParent$NullableType<$S?>(S.nullableType)); } @@ -4459,66 +4459,66 @@ class GrandParent<$T extends _$jni.JObject?> extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;', ); - static final _staticParentWithSameType = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _staticParentWithSameType = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent staticParentWithSameType()` /// The returned object must be released after use, by calling the [release] method. GrandParent_StaticParent<$T?>? staticParentWithSameType() { return _staticParentWithSameType(reference.pointer, - _id_staticParentWithSameType as _$jni.JMethodIDPtr) + _id_staticParentWithSameType as jni$_.JMethodIDPtr) .object?>( $GrandParent_StaticParent$NullableType<$T?>(T.nullableType)); } } -final class $GrandParent$NullableType<$T extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GrandParent$NullableType<$T extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $GrandParent$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent;'; - @_$jni.internal - @_$core.override - GrandParent<$T>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + GrandParent<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : GrandParent<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent$NullableType<$T>) && other is $GrandParent$NullableType<$T> && @@ -4526,44 +4526,44 @@ final class $GrandParent$NullableType<$T extends _$jni.JObject?> } } -final class $GrandParent$Type<$T extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GrandParent$Type<$T extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $GrandParent$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/GrandParent;'; - @_$jni.internal - @_$core.override - GrandParent<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GrandParent<$T> fromReference(jni$_.JReference reference) => GrandParent<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GrandParent$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GrandParent$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GrandParent$Type<$T>) && other is $GrandParent$Type<$T> && @@ -4572,34 +4572,34 @@ final class $GrandParent$Type<$T extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.generics.MyMap$MyEntry` -class MyMap_MyEntry<$K extends _$jni.JObject?, $V extends _$jni.JObject?> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal MyMap_MyEntry.fromReference( this.K, this.V, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$K, $V>(K, V), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/MyMap$MyEntry'); /// The type which includes information such as the signature of this class. static $MyMap_MyEntry$NullableType<$K, $V> - nullableType<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( - _$jni.JObjType<$K> K, - _$jni.JObjType<$V> V, + nullableType<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( + jni$_.JObjType<$K> K, + jni$_.JObjType<$V> V, ) { return $MyMap_MyEntry$NullableType<$K, $V>( K, @@ -4608,9 +4608,9 @@ class MyMap_MyEntry<$K extends _$jni.JObject?, $V extends _$jni.JObject?> } static $MyMap_MyEntry$Type<$K, $V> - type<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( - _$jni.JObjType<$K> K, - _$jni.JObjType<$V> V, + type<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( + jni$_.JObjType<$K> K, + jni$_.JObjType<$V> V, ) { return $MyMap_MyEntry$Type<$K, $V>( K, @@ -4648,24 +4648,24 @@ class MyMap_MyEntry<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $outerClass, K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -4673,49 +4673,49 @@ class MyMap_MyEntry<$K extends _$jni.JObject?, $V extends _$jni.JObject?> MyMap<$K?, $V?> $outerClass, $K? object, $V? object1, { - _$jni.JObjType<$K>? K, - _$jni.JObjType<$V>? V, + jni$_.JObjType<$K>? K, + jni$_.JObjType<$V>? V, }) { - K ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $MyMap$Type<_$core.dynamic, _$core.dynamic>).K, - ]) as _$jni.JObjType<$K>; - V ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $MyMap$Type<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + K ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $MyMap$Type).K, + ]) as jni$_.JObjType<$K>; + V ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $MyMap$Type).V, + ]) as jni$_.JObjType<$V>; final _$$outerClass = $outerClass.reference; - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; return MyMap_MyEntry<$K, $V>.fromReference( K, V, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer, _$object.pointer, _$object1.pointer) .reference); } } -final class $MyMap_MyEntry$NullableType<$K extends _$jni.JObject?, - $V extends _$jni.JObject?> extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $MyMap_MyEntry$NullableType<$K extends jni$_.JObject?, + $V extends jni$_.JObject?> extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $MyMap_MyEntry$NullableType( this.K, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;'; - @_$jni.internal - @_$core.override - MyMap_MyEntry<$K, $V>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyMap_MyEntry<$K, $V>? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyMap_MyEntry<$K, $V>.fromReference( @@ -4723,22 +4723,22 @@ final class $MyMap_MyEntry$NullableType<$K extends _$jni.JObject?, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyMap_MyEntry$NullableType, K, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyMap_MyEntry$NullableType<$K, $V>) && other is $MyMap_MyEntry$NullableType<$K, $V> && @@ -4747,50 +4747,50 @@ final class $MyMap_MyEntry$NullableType<$K extends _$jni.JObject?, } } -final class $MyMap_MyEntry$Type<$K extends _$jni.JObject?, - $V extends _$jni.JObject?> extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $MyMap_MyEntry$Type<$K extends jni$_.JObject?, + $V extends jni$_.JObject?> extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $MyMap_MyEntry$Type( this.K, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap$MyEntry;'; - @_$jni.internal - @_$core.override - MyMap_MyEntry<$K, $V> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyMap_MyEntry<$K, $V> fromReference(jni$_.JReference reference) => MyMap_MyEntry<$K, $V>.fromReference( K, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $MyMap_MyEntry$NullableType<$K, $V>(K, V); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyMap_MyEntry$Type, K, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyMap_MyEntry$Type<$K, $V>) && other is $MyMap_MyEntry$Type<$K, $V> && @@ -4800,34 +4800,34 @@ final class $MyMap_MyEntry$Type<$K extends _$jni.JObject?, } /// from: `com.github.dart_lang.jnigen.generics.MyMap` -class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> - extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class MyMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> + extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal MyMap.fromReference( this.K, this.V, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$K, $V>(K, V), super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyMap'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyMap'); /// The type which includes information such as the signature of this class. static $MyMap$NullableType<$K, $V> - nullableType<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( - _$jni.JObjType<$K> K, - _$jni.JObjType<$V> V, + nullableType<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( + jni$_.JObjType<$K> K, + jni$_.JObjType<$V> V, ) { return $MyMap$NullableType<$K, $V>( K, @@ -4836,9 +4836,9 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> } static $MyMap$Type<$K, $V> - type<$K extends _$jni.JObject?, $V extends _$jni.JObject?>( - _$jni.JObjType<$K> K, - _$jni.JObjType<$V> V, + type<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( + jni$_.JObjType<$K> K, + jni$_.JObjType<$V> V, ) { return $MyMap$Type<$K, $V>( K, @@ -4850,28 +4850,28 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory MyMap({ - required _$jni.JObjType<$K> K, - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$K> K, + required jni$_.JObjType<$V> V, }) { return MyMap<$K, $V>.fromReference( K, V, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -4880,25 +4880,25 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _get = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _get = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V get(K object)` /// The returned object must be released after use, by calling the [release] method. $V? get( $K? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _get( - reference.pointer, _id_get as _$jni.JMethodIDPtr, _$object.pointer) + reference.pointer, _id_get as jni$_.JMethodIDPtr, _$object.pointer) .object<$V?>(V.nullableType); } @@ -4907,22 +4907,22 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _put = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _put = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public V put(K object, V object1)` /// The returned object must be released after use, by calling the [release] method. @@ -4930,9 +4930,9 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> $K? object, $V? object1, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - return _put(reference.pointer, _id_put as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + return _put(reference.pointer, _id_put as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .object<$V?>(V.nullableType); } @@ -4942,22 +4942,22 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> r'()Lcom/github/dart_lang/jnigen/generics/MyStack;', ); - static final _entryStack = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _entryStack = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.generics.MyStack entryStack()` /// The returned object must be released after use, by calling the [release] method. MyStack?>? entryStack() { - return _entryStack(reference.pointer, _id_entryStack as _$jni.JMethodIDPtr) + return _entryStack(reference.pointer, _id_entryStack as jni$_.JMethodIDPtr) .object?>?>( $MyStack$NullableType?>( $MyMap_MyEntry$NullableType<$K?, $V?>( @@ -4965,49 +4965,49 @@ class MyMap<$K extends _$jni.JObject?, $V extends _$jni.JObject?> } } -final class $MyMap$NullableType<$K extends _$jni.JObject?, - $V extends _$jni.JObject?> extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $MyMap$NullableType<$K extends jni$_.JObject?, + $V extends jni$_.JObject?> extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $MyMap$NullableType( this.K, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap;'; - @_$jni.internal - @_$core.override - MyMap<$K, $V>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + MyMap<$K, $V>? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyMap<$K, $V>.fromReference( K, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyMap$NullableType, K, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyMap$NullableType<$K, $V>) && other is $MyMap$NullableType<$K, $V> && @@ -5016,49 +5016,49 @@ final class $MyMap$NullableType<$K extends _$jni.JObject?, } } -final class $MyMap$Type<$K extends _$jni.JObject?, $V extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $MyMap$Type<$K extends jni$_.JObject?, $V extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $MyMap$Type( this.K, this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyMap;'; - @_$jni.internal - @_$core.override - MyMap<$K, $V> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyMap<$K, $V> fromReference(jni$_.JReference reference) => MyMap<$K, $V>.fromReference( K, V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $MyMap$NullableType<$K, $V>(K, V); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyMap$Type, K, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyMap$Type<$K, $V>) && other is $MyMap$Type<$K, $V> && @@ -5068,35 +5068,35 @@ final class $MyMap$Type<$K extends _$jni.JObject?, $V extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.generics.MyStack` -class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class MyStack<$T extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal MyStack.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyStack'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/generics/MyStack'); /// The type which includes information such as the signature of this class. - static $MyStack$NullableType<$T> nullableType<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $MyStack$NullableType<$T> nullableType<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $MyStack$NullableType<$T>( T, ); } - static $MyStack$Type<$T> type<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $MyStack$Type<$T> type<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $MyStack$Type<$T>( T, @@ -5107,26 +5107,26 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory MyStack({ - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { return MyStack<$T>.fromReference( T, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -5135,26 +5135,26 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', ); - static final _fromArray = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _fromArray = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(java.lang.Object[] objects)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T?>? fromArray<$T extends _$jni.JObject?>( - _$jni.JArray<$T?>? objects, { - required _$jni.JObjType<$T> T, + static MyStack<$T?>? fromArray<$T extends jni$_.JObject?>( + jni$_.JArray<$T?>? objects, { + required jni$_.JObjType<$T> T, }) { - final _$objects = objects?.reference ?? _$jni.jNullReference; + final _$objects = objects?.reference ?? jni$_.jNullReference; return _fromArray(_class.reference.pointer, - _id_fromArray as _$jni.JMethodIDPtr, _$objects.pointer) + _id_fromArray as jni$_.JMethodIDPtr, _$objects.pointer) .object?>($MyStack$NullableType<$T?>(T.nullableType)); } @@ -5164,28 +5164,28 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { ); static final _fromArrayOfArrayOfGrandParents = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(java.lang.Object[] grandParents)` /// The returned object must be released after use, by calling the [release] method. static MyStack<$S?>? - fromArrayOfArrayOfGrandParents<$S extends _$jni.JObject?>( - _$jni.JArray<_$jni.JArray?>?>? grandParents, { - required _$jni.JObjType<$S> S, + fromArrayOfArrayOfGrandParents<$S extends jni$_.JObject?>( + jni$_.JArray?>?>? grandParents, { + required jni$_.JObjType<$S> S, }) { - final _$grandParents = grandParents?.reference ?? _$jni.jNullReference; + final _$grandParents = grandParents?.reference ?? jni$_.jNullReference; return _fromArrayOfArrayOfGrandParents( _class.reference.pointer, - _id_fromArrayOfArrayOfGrandParents as _$jni.JMethodIDPtr, + _id_fromArrayOfArrayOfGrandParents as jni$_.JMethodIDPtr, _$grandParents.pointer) .object?>($MyStack$NullableType<$S?>(S.nullableType)); } @@ -5195,24 +5195,24 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/generics/MyStack;', ); - static final _of = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _of = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T?>? of<$T extends _$jni.JObject?>({ - required _$jni.JObjType<$T> T, + static MyStack<$T?>? of<$T extends jni$_.JObject?>({ + required jni$_.JObjType<$T> T, }) { - return _of(_class.reference.pointer, _id_of as _$jni.JMethodIDPtr) + return _of(_class.reference.pointer, _id_of as jni$_.JMethodIDPtr) .object?>($MyStack$NullableType<$T?>(T.nullableType)); } @@ -5221,25 +5221,25 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', ); - static final _of$1 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _of$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T?>? of$1<$T extends _$jni.JObject?>( + static MyStack<$T?>? of$1<$T extends jni$_.JObject?>( $T? object, { - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { - final _$object = object?.reference ?? _$jni.jNullReference; - return _of$1(_class.reference.pointer, _id_of$1 as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + return _of$1(_class.reference.pointer, _id_of$1 as jni$_.JMethodIDPtr, _$object.pointer) .object?>($MyStack$NullableType<$T?>(T.nullableType)); } @@ -5249,33 +5249,33 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;', ); - static final _of$2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _of$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object, T object1)` /// The returned object must be released after use, by calling the [release] method. - static MyStack<$T?>? of$2<$T extends _$jni.JObject?>( + static MyStack<$T?>? of$2<$T extends jni$_.JObject?>( $T? object, $T? object1, { - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - return _of$2(_class.reference.pointer, _id_of$2 as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + return _of$2(_class.reference.pointer, _id_of$2 as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) .object?>($MyStack$NullableType<$T?>(T.nullableType)); } @@ -5285,23 +5285,23 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)V', ); - static final _push = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _push = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void push(T object)` void push( $T? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - _push(reference.pointer, _id_push as _$jni.JMethodIDPtr, _$object.pointer) + final _$object = object?.reference ?? jni$_.jNullReference; + _push(reference.pointer, _id_push as jni$_.JMethodIDPtr, _$object.pointer) .check(); } @@ -5310,22 +5310,22 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'()Ljava/lang/Object;', ); - static final _pop = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _pop = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public T pop()` /// The returned object must be released after use, by calling the [release] method. $T? pop() { - return _pop(reference.pointer, _id_pop as _$jni.JMethodIDPtr) + return _pop(reference.pointer, _id_pop as jni$_.JMethodIDPtr) .object<$T?>(T.nullableType); } @@ -5334,62 +5334,62 @@ class MyStack<$T extends _$jni.JObject?> extends _$jni.JObject { r'()I', ); - static final _size = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _size = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public int size()` int size() { - return _size(reference.pointer, _id_size as _$jni.JMethodIDPtr).integer; + return _size(reference.pointer, _id_size as jni$_.JMethodIDPtr).integer; } } -final class $MyStack$NullableType<$T extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $MyStack$NullableType<$T extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $MyStack$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyStack;'; - @_$jni.internal - @_$core.override - MyStack<$T>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + MyStack<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyStack<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyStack$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyStack$NullableType<$T>) && other is $MyStack$NullableType<$T> && @@ -5397,43 +5397,43 @@ final class $MyStack$NullableType<$T extends _$jni.JObject?> } } -final class $MyStack$Type<$T extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $MyStack$Type<$T extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $MyStack$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/MyStack;'; - @_$jni.internal - @_$core.override - MyStack<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyStack<$T> fromReference(jni$_.JReference reference) => MyStack<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => $MyStack$NullableType<$T>(T); + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $MyStack$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyStack$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyStack$Type<$T>) && other is $MyStack$Type<$T> && @@ -5442,38 +5442,38 @@ final class $MyStack$Type<$T extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.generics.StringKeyedMap` -class StringKeyedMap<$V extends _$jni.JObject?> - extends MyMap<_$jni.JString?, $V?> { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class StringKeyedMap<$V extends jni$_.JObject?> + extends MyMap { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal StringKeyedMap.fromReference( this.V, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$V>(V), super.fromReference( - const _$jni.JStringNullableType(), V.nullableType, reference); + const jni$_.JStringNullableType(), V.nullableType, reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/StringKeyedMap'); /// The type which includes information such as the signature of this class. static $StringKeyedMap$NullableType<$V> - nullableType<$V extends _$jni.JObject?>( - _$jni.JObjType<$V> V, + nullableType<$V extends jni$_.JObject?>( + jni$_.JObjType<$V> V, ) { return $StringKeyedMap$NullableType<$V>( V, ); } - static $StringKeyedMap$Type<$V> type<$V extends _$jni.JObject?>( - _$jni.JObjType<$V> V, + static $StringKeyedMap$Type<$V> type<$V extends jni$_.JObject?>( + jni$_.JObjType<$V> V, ) { return $StringKeyedMap$Type<$V>( V, @@ -5484,71 +5484,71 @@ class StringKeyedMap<$V extends _$jni.JObject?> r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory StringKeyedMap({ - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { return StringKeyedMap<$V>.fromReference( V, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $StringKeyedMap$NullableType<$V extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$V> V; +final class $StringKeyedMap$NullableType<$V extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $StringKeyedMap$NullableType( this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;'; - @_$jni.internal - @_$core.override - StringKeyedMap<$V>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringKeyedMap<$V>? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringKeyedMap<$V>.fromReference( V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => $MyMap$NullableType<_$jni.JString?, $V?>( - const _$jni.JStringNullableType(), V.nullableType); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => $MyMap$NullableType( + const jni$_.JStringNullableType(), V.nullableType); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => Object.hash($StringKeyedMap$NullableType, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringKeyedMap$NullableType<$V>) && other is $StringKeyedMap$NullableType<$V> && @@ -5556,46 +5556,46 @@ final class $StringKeyedMap$NullableType<$V extends _$jni.JObject?> } } -final class $StringKeyedMap$Type<$V extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$V> V; +final class $StringKeyedMap$Type<$V extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $StringKeyedMap$Type( this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringKeyedMap;'; - @_$jni.internal - @_$core.override - StringKeyedMap<$V> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringKeyedMap<$V> fromReference(jni$_.JReference reference) => StringKeyedMap<$V>.fromReference( V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => $MyMap$NullableType<_$jni.JString?, $V?>( - const _$jni.JStringNullableType(), V.nullableType); - - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => $MyMap$NullableType( + const jni$_.JStringNullableType(), V.nullableType); + + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $StringKeyedMap$NullableType<$V>(V); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => Object.hash($StringKeyedMap$Type, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringKeyedMap$Type<$V>) && other is $StringKeyedMap$Type<$V> && @@ -5604,19 +5604,19 @@ final class $StringKeyedMap$Type<$V extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.generics.StringMap` -class StringMap extends StringKeyedMap<_$jni.JString?> { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class StringMap extends StringKeyedMap { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal StringMap.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, - super.fromReference(const _$jni.JStringNullableType(), reference); + super.fromReference(const jni$_.JStringNullableType(), reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringMap'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringMap'); /// The type which includes information such as the signature of this class. static const nullableType = $StringMap$NullableType(); @@ -5625,118 +5625,118 @@ class StringMap extends StringKeyedMap<_$jni.JString?> { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory StringMap() { return StringMap.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $StringMap$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $StringMap$NullableType extends jni$_.JObjType { + @jni$_.internal const $StringMap$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringMap;'; - @_$jni.internal - @_$core.override - StringMap? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + StringMap? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringMap.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => - const $StringKeyedMap$NullableType<_$jni.JString?>( - _$jni.JStringNullableType()); - - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; - - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => + const $StringKeyedMap$NullableType( + jni$_.JStringNullableType()); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override final superCount = 3; - @_$core.override + @core$_.override int get hashCode => ($StringMap$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringMap$NullableType) && other is $StringMap$NullableType; } } -final class $StringMap$Type extends _$jni.JObjType { - @_$jni.internal +final class $StringMap$Type extends jni$_.JObjType { + @jni$_.internal const $StringMap$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringMap;'; - @_$jni.internal - @_$core.override - StringMap fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringMap fromReference(jni$_.JReference reference) => StringMap.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => - const $StringKeyedMap$NullableType<_$jni.JString?>( - _$jni.JStringNullableType()); - - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => + const $StringKeyedMap$NullableType( + jni$_.JStringNullableType()); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $StringMap$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 3; - @_$core.override + @core$_.override int get hashCode => ($StringMap$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringMap$Type) && other is $StringMap$Type; } } /// from: `com.github.dart_lang.jnigen.generics.StringStack` -class StringStack extends MyStack<_$jni.JString?> { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class StringStack extends MyStack { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal StringStack.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, - super.fromReference(const _$jni.JStringNullableType(), reference); + super.fromReference(const jni$_.JStringNullableType(), reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringStack'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/generics/StringStack'); /// The type which includes information such as the signature of this class. static const nullableType = $StringStack$NullableType(); @@ -5745,97 +5745,97 @@ class StringStack extends MyStack<_$jni.JString?> { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory StringStack() { return StringStack.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $StringStack$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $StringStack$NullableType extends jni$_.JObjType { + @jni$_.internal const $StringStack$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringStack;'; - @_$jni.internal - @_$core.override - StringStack? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + StringStack? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringStack.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => - const $MyStack$NullableType<_$jni.JString?>(_$jni.JStringNullableType()); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => + const $MyStack$NullableType(jni$_.JStringNullableType()); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($StringStack$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringStack$NullableType) && other is $StringStack$NullableType; } } -final class $StringStack$Type extends _$jni.JObjType { - @_$jni.internal +final class $StringStack$Type extends jni$_.JObjType { + @jni$_.internal const $StringStack$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringStack;'; - @_$jni.internal - @_$core.override - StringStack fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringStack fromReference(jni$_.JReference reference) => StringStack.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => - const $MyStack$NullableType<_$jni.JString?>(_$jni.JStringNullableType()); - - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => + const $MyStack$NullableType(jni$_.JStringNullableType()); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $StringStack$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($StringStack$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringStack$Type) && other is $StringStack$Type; @@ -5843,38 +5843,38 @@ final class $StringStack$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.generics.StringValuedMap` -class StringValuedMap<$K extends _$jni.JObject?> - extends MyMap<$K?, _$jni.JString?> { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class StringValuedMap<$K extends jni$_.JObject?> + extends MyMap<$K?, jni$_.JString?> { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$K> K; + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal + @jni$_.internal StringValuedMap.fromReference( this.K, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$K>(K), super.fromReference( - K.nullableType, const _$jni.JStringNullableType(), reference); + K.nullableType, const jni$_.JStringNullableType(), reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/generics/StringValuedMap'); /// The type which includes information such as the signature of this class. static $StringValuedMap$NullableType<$K> - nullableType<$K extends _$jni.JObject?>( - _$jni.JObjType<$K> K, + nullableType<$K extends jni$_.JObject?>( + jni$_.JObjType<$K> K, ) { return $StringValuedMap$NullableType<$K>( K, ); } - static $StringValuedMap$Type<$K> type<$K extends _$jni.JObject?>( - _$jni.JObjType<$K> K, + static $StringValuedMap$Type<$K> type<$K extends jni$_.JObject?>( + jni$_.JObjType<$K> K, ) { return $StringValuedMap$Type<$K>( K, @@ -5885,71 +5885,71 @@ class StringValuedMap<$K extends _$jni.JObject?> r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory StringValuedMap({ - required _$jni.JObjType<$K> K, + required jni$_.JObjType<$K> K, }) { return StringValuedMap<$K>.fromReference( K, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $StringValuedMap$NullableType<$K extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $StringValuedMap$NullableType<$K extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal + @jni$_.internal const $StringValuedMap$NullableType( this.K, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringValuedMap;'; - @_$jni.internal - @_$core.override - StringValuedMap<$K>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringValuedMap<$K>? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringValuedMap<$K>.fromReference( K, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => $MyMap$NullableType<$K?, _$jni.JString?>( - K.nullableType, const _$jni.JStringNullableType()); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => $MyMap$NullableType<$K?, jni$_.JString?>( + K.nullableType, const jni$_.JStringNullableType()); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => Object.hash($StringValuedMap$NullableType, K); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringValuedMap$NullableType<$K>) && other is $StringValuedMap$NullableType<$K> && @@ -5957,46 +5957,46 @@ final class $StringValuedMap$NullableType<$K extends _$jni.JObject?> } } -final class $StringValuedMap$Type<$K extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$K> K; +final class $StringValuedMap$Type<$K extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$K> K; - @_$jni.internal + @jni$_.internal const $StringValuedMap$Type( this.K, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/generics/StringValuedMap;'; - @_$jni.internal - @_$core.override - StringValuedMap<$K> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringValuedMap<$K> fromReference(jni$_.JReference reference) => StringValuedMap<$K>.fromReference( K, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => $MyMap$NullableType<$K?, _$jni.JString?>( - K.nullableType, const _$jni.JStringNullableType()); - - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => $MyMap$NullableType<$K?, jni$_.JString?>( + K.nullableType, const jni$_.JStringNullableType()); + + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $StringValuedMap$NullableType<$K>(K); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => Object.hash($StringValuedMap$Type, K); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringValuedMap$Type<$K>) && other is $StringValuedMap$Type<$K> && @@ -6005,36 +6005,36 @@ final class $StringValuedMap$Type<$K extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.interfaces.GenericInterface` -class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal GenericInterface.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/GenericInterface'); /// The type which includes information such as the signature of this class. static $GenericInterface$NullableType<$T> - nullableType<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + nullableType<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $GenericInterface$NullableType<$T>( T, ); } - static $GenericInterface$Type<$T> type<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $GenericInterface$Type<$T> type<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $GenericInterface$Type<$T>( T, @@ -6046,28 +6046,28 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)[Ljava/lang/Object;', ); - static final _genericArrayOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _genericArrayOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract java.lang.Object[] genericArrayOf(U object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<$U?>? genericArrayOf<$U extends _$jni.JObject?>( + jni$_.JArray<$U?>? genericArrayOf<$U extends jni$_.JObject?>( $U? object, { - required _$jni.JObjType<$U> U, + required jni$_.JObjType<$U> U, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _genericArrayOf(reference.pointer, - _id_genericArrayOf as _$jni.JMethodIDPtr, _$object.pointer) - .object<_$jni.JArray<$U?>?>( - _$jni.JArrayNullableType<$U?>(U.nullableType)); + _id_genericArrayOf as jni$_.JMethodIDPtr, _$object.pointer) + .object?>( + jni$_.JArrayNullableType<$U?>(U.nullableType)); } static final _id_arrayOf = _class.instanceMethodId( @@ -6075,27 +6075,27 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)[Ljava/lang/Object;', ); - static final _arrayOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _arrayOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract java.lang.Object[] arrayOf(T object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<$T?>? arrayOf( + jni$_.JArray<$T?>? arrayOf( $T? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; - return _arrayOf(reference.pointer, _id_arrayOf as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + return _arrayOf(reference.pointer, _id_arrayOf as jni$_.JMethodIDPtr, _$object.pointer) - .object<_$jni.JArray<$T?>?>( - _$jni.JArrayNullableType<$T?>(T.nullableType)); + .object?>( + jni$_.JArrayNullableType<$T?>(T.nullableType)); } static final _id_mapOf = _class.instanceMethodId( @@ -6103,36 +6103,36 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;', ); - static final _mapOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _mapOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public abstract java.util.Map mapOf(T object, U object1)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JMap<$T?, $U?>? mapOf<$U extends _$jni.JObject?>( + jni$_.JMap<$T?, $U?>? mapOf<$U extends jni$_.JObject?>( $T? object, $U? object1, { - required _$jni.JObjType<$U> U, + required jni$_.JObjType<$U> U, }) { - final _$object = object?.reference ?? _$jni.jNullReference; - final _$object1 = object1?.reference ?? _$jni.jNullReference; - return _mapOf(reference.pointer, _id_mapOf as _$jni.JMethodIDPtr, + final _$object = object?.reference ?? jni$_.jNullReference; + final _$object1 = object1?.reference ?? jni$_.jNullReference; + return _mapOf(reference.pointer, _id_mapOf as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer) - .object<_$jni.JMap<$T?, $U?>?>( - _$jni.JMapNullableType<$T?, $U?>(T.nullableType, U.nullableType)); + .object?>( + jni$_.JMapNullableType<$T?, $U?>(T.nullableType, U.nullableType)); } static final _id_firstOfGenericArray = _class.instanceMethodId( @@ -6140,26 +6140,26 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'([Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _firstOfGenericArray = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstOfGenericArray = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract U firstOfGenericArray(java.lang.Object[] objects)` /// The returned object must be released after use, by calling the [release] method. - $U? firstOfGenericArray<$U extends _$jni.JObject?>( - _$jni.JArray<$U?>? objects, { - required _$jni.JObjType<$U> U, + $U? firstOfGenericArray<$U extends jni$_.JObject?>( + jni$_.JArray<$U?>? objects, { + required jni$_.JObjType<$U> U, }) { - final _$objects = objects?.reference ?? _$jni.jNullReference; + final _$objects = objects?.reference ?? jni$_.jNullReference; return _firstOfGenericArray(reference.pointer, - _id_firstOfGenericArray as _$jni.JMethodIDPtr, _$objects.pointer) + _id_firstOfGenericArray as jni$_.JMethodIDPtr, _$objects.pointer) .object<$U?>(U.nullableType); } @@ -6168,25 +6168,25 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'([Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _firstOfArray = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstOfArray = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract T firstOfArray(java.lang.Object[] objects)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfArray( - _$jni.JArray<$T?>? objects, + jni$_.JArray<$T?>? objects, ) { - final _$objects = objects?.reference ?? _$jni.jNullReference; + final _$objects = objects?.reference ?? jni$_.jNullReference; return _firstOfArray(reference.pointer, - _id_firstOfArray as _$jni.JMethodIDPtr, _$objects.pointer) + _id_firstOfArray as jni$_.JMethodIDPtr, _$objects.pointer) .object<$T?>(T.nullableType); } @@ -6195,25 +6195,25 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/util/Map;)Ljava/lang/Object;', ); - static final _firstKeyOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstKeyOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract T firstKeyOf(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $T? firstKeyOf<$U extends _$jni.JObject?>( - _$jni.JMap<$T?, $U?>? map, { - required _$jni.JObjType<$U> U, + $T? firstKeyOf<$U extends jni$_.JObject?>( + jni$_.JMap<$T?, $U?>? map, { + required jni$_.JObjType<$U> U, }) { - final _$map = map?.reference ?? _$jni.jNullReference; - return _firstKeyOf(reference.pointer, _id_firstKeyOf as _$jni.JMethodIDPtr, + final _$map = map?.reference ?? jni$_.jNullReference; + return _firstKeyOf(reference.pointer, _id_firstKeyOf as jni$_.JMethodIDPtr, _$map.pointer) .object<$T?>(T.nullableType); } @@ -6223,39 +6223,39 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/util/Map;)Ljava/lang/Object;', ); - static final _firstValueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstValueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract U firstValueOf(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $U? firstValueOf<$U extends _$jni.JObject?>( - _$jni.JMap<$T?, $U?>? map, { - required _$jni.JObjType<$U> U, + $U? firstValueOf<$U extends jni$_.JObject?>( + jni$_.JMap<$T?, $U?>? map, { + required jni$_.JObjType<$U> U, }) { - final _$map = map?.reference ?? _$jni.jNullReference; + final _$map = map?.reference ?? jni$_.jNullReference; return _firstValueOf(reference.pointer, - _id_firstValueOf as _$jni.JMethodIDPtr, _$map.pointer) + _id_firstValueOf as jni$_.JMethodIDPtr, _$map.pointer) .object<$U?>(U.nullableType); } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -6263,122 +6263,122 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r'genericArrayOf(Ljava/lang/Object;)[Ljava/lang/Object;') { final $r = _$impls[$p]!.genericArrayOf( - $a![0]?.as(const _$jni.JObjectType(), releaseOriginal: true), + $a![0]?.as(const jni$_.JObjectType(), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'arrayOf(Ljava/lang/Object;)[Ljava/lang/Object;') { final $r = _$impls[$p]!.arrayOf( $a![0]?.as(_$impls[$p]!.T, releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'mapOf(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;') { final $r = _$impls[$p]!.mapOf( $a![0]?.as(_$impls[$p]!.T, releaseOriginal: true), - $a![1]?.as(const _$jni.JObjectType(), releaseOriginal: true), + $a![1]?.as(const jni$_.JObjectType(), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'firstOfGenericArray([Ljava/lang/Object;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstOfGenericArray( $a![0]?.as( - const _$jni.JArrayType<_$jni.JObject?>( - _$jni.JObjectNullableType()), + const jni$_.JArrayType( + jni$_.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'firstOfArray([Ljava/lang/Object;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstOfArray( $a![0]?.as( - const _$jni.JArrayType<_$jni.JObject?>( - _$jni.JObjectNullableType()), + const jni$_.JArrayType( + jni$_.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'firstKeyOf(Ljava/util/Map;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstKeyOf( $a![0]?.as( - const _$jni.JMapType<_$jni.JObject?, _$jni.JObject?>( - _$jni.JObjectNullableType(), _$jni.JObjectNullableType()), + const jni$_.JMapType( + jni$_.JObjectNullableType(), jni$_.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'firstValueOf(Ljava/util/Map;)Ljava/lang/Object;') { final $r = _$impls[$p]!.firstValueOf( $a![0]?.as( - const _$jni.JMapType<_$jni.JObject?, _$jni.JObject?>( - _$jni.JObjectNullableType(), _$jni.JObjectNullableType()), + const jni$_.JMapType( + jni$_.JObjectNullableType(), jni$_.JObjectNullableType()), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } - static void implementIn<$T extends _$jni.JObject?>( - _$jni.JImplementer implementer, + static void implementIn<$T extends jni$_.JObject?>( + jni$_.JImplementer implementer, $GenericInterface<$T> $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.interfaces.GenericInterface', @@ -6393,7 +6393,7 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { factory GenericInterface.implement( $GenericInterface<$T> $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return GenericInterface<$T>.fromReference( $impl.T, @@ -6402,54 +6402,54 @@ class GenericInterface<$T extends _$jni.JObject?> extends _$jni.JObject { } } -abstract base mixin class $GenericInterface<$T extends _$jni.JObject?> { +abstract base mixin class $GenericInterface<$T extends jni$_.JObject?> { factory $GenericInterface({ - required _$jni.JObjType<$T> T, - required _$jni.JArray<_$jni.JObject?>? Function(_$jni.JObject? object) + required jni$_.JObjType<$T> T, + required jni$_.JArray? Function(jni$_.JObject? object) genericArrayOf, - required _$jni.JArray<_$jni.JObject?>? Function($T? object) arrayOf, - required _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? Function( - $T? object, _$jni.JObject? object1) + required jni$_.JArray? Function($T? object) arrayOf, + required jni$_.JMap? Function( + $T? object, jni$_.JObject? object1) mapOf, - required _$jni.JObject? Function(_$jni.JArray<_$jni.JObject?>? objects) + required jni$_.JObject? Function(jni$_.JArray? objects) firstOfGenericArray, - required $T? Function(_$jni.JArray<_$jni.JObject?>? objects) firstOfArray, - required $T? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + required $T? Function(jni$_.JArray? objects) firstOfArray, + required $T? Function(jni$_.JMap? map) firstKeyOf, - required _$jni.JObject? Function( - _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + required jni$_.JObject? Function( + jni$_.JMap? map) firstValueOf, }) = _$GenericInterface<$T>; - _$jni.JObjType<$T> get T; + jni$_.JObjType<$T> get T; - _$jni.JArray<_$jni.JObject?>? genericArrayOf(_$jni.JObject? object); - _$jni.JArray<_$jni.JObject?>? arrayOf($T? object); - _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? mapOf( - $T? object, _$jni.JObject? object1); - _$jni.JObject? firstOfGenericArray(_$jni.JArray<_$jni.JObject?>? objects); - $T? firstOfArray(_$jni.JArray<_$jni.JObject?>? objects); - $T? firstKeyOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map); - _$jni.JObject? firstValueOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map); + jni$_.JArray? genericArrayOf(jni$_.JObject? object); + jni$_.JArray? arrayOf($T? object); + jni$_.JMap? mapOf( + $T? object, jni$_.JObject? object1); + jni$_.JObject? firstOfGenericArray(jni$_.JArray? objects); + $T? firstOfArray(jni$_.JArray? objects); + $T? firstKeyOf(jni$_.JMap? map); + jni$_.JObject? firstValueOf(jni$_.JMap? map); } -final class _$GenericInterface<$T extends _$jni.JObject?> +final class _$GenericInterface<$T extends jni$_.JObject?> with $GenericInterface<$T> { _$GenericInterface({ required this.T, - required _$jni.JArray<_$jni.JObject?>? Function(_$jni.JObject? object) + required jni$_.JArray? Function(jni$_.JObject? object) genericArrayOf, - required _$jni.JArray<_$jni.JObject?>? Function($T? object) arrayOf, - required _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? Function( - $T? object, _$jni.JObject? object1) + required jni$_.JArray? Function($T? object) arrayOf, + required jni$_.JMap? Function( + $T? object, jni$_.JObject? object1) mapOf, - required _$jni.JObject? Function(_$jni.JArray<_$jni.JObject?>? objects) + required jni$_.JObject? Function(jni$_.JArray? objects) firstOfGenericArray, - required $T? Function(_$jni.JArray<_$jni.JObject?>? objects) firstOfArray, - required $T? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + required $T? Function(jni$_.JArray? objects) firstOfArray, + required $T? Function(jni$_.JMap? map) firstKeyOf, - required _$jni.JObject? Function( - _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + required jni$_.JObject? Function( + jni$_.JMap? map) firstValueOf, }) : _genericArrayOf = genericArrayOf, _arrayOf = arrayOf, @@ -6459,92 +6459,92 @@ final class _$GenericInterface<$T extends _$jni.JObject?> _firstKeyOf = firstKeyOf, _firstValueOf = firstValueOf; - @_$core.override - final _$jni.JObjType<$T> T; + @core$_.override + final jni$_.JObjType<$T> T; - final _$jni.JArray<_$jni.JObject?>? Function(_$jni.JObject? object) + final jni$_.JArray? Function(jni$_.JObject? object) _genericArrayOf; - final _$jni.JArray<_$jni.JObject?>? Function($T? object) _arrayOf; - final _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? Function( - $T? object, _$jni.JObject? object1) _mapOf; - final _$jni.JObject? Function(_$jni.JArray<_$jni.JObject?>? objects) + final jni$_.JArray? Function($T? object) _arrayOf; + final jni$_.JMap? Function( + $T? object, jni$_.JObject? object1) _mapOf; + final jni$_.JObject? Function(jni$_.JArray? objects) _firstOfGenericArray; - final $T? Function(_$jni.JArray<_$jni.JObject?>? objects) _firstOfArray; - final $T? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + final $T? Function(jni$_.JArray? objects) _firstOfArray; + final $T? Function(jni$_.JMap? map) _firstKeyOf; - final _$jni.JObject? Function(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) + final jni$_.JObject? Function(jni$_.JMap? map) _firstValueOf; - _$jni.JArray<_$jni.JObject?>? genericArrayOf(_$jni.JObject? object) { + jni$_.JArray? genericArrayOf(jni$_.JObject? object) { return _genericArrayOf(object); } - _$jni.JArray<_$jni.JObject?>? arrayOf($T? object) { + jni$_.JArray? arrayOf($T? object) { return _arrayOf(object); } - _$jni.JMap<_$jni.JObject?, _$jni.JObject?>? mapOf( - $T? object, _$jni.JObject? object1) { + jni$_.JMap? mapOf( + $T? object, jni$_.JObject? object1) { return _mapOf(object, object1); } - _$jni.JObject? firstOfGenericArray(_$jni.JArray<_$jni.JObject?>? objects) { + jni$_.JObject? firstOfGenericArray(jni$_.JArray? objects) { return _firstOfGenericArray(objects); } - $T? firstOfArray(_$jni.JArray<_$jni.JObject?>? objects) { + $T? firstOfArray(jni$_.JArray? objects) { return _firstOfArray(objects); } - $T? firstKeyOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) { + $T? firstKeyOf(jni$_.JMap? map) { return _firstKeyOf(map); } - _$jni.JObject? firstValueOf(_$jni.JMap<_$jni.JObject?, _$jni.JObject?>? map) { + jni$_.JObject? firstValueOf(jni$_.JMap? map) { return _firstValueOf(map); } } -final class $GenericInterface$NullableType<$T extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GenericInterface$NullableType<$T extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $GenericInterface$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/GenericInterface;'; - @_$jni.internal - @_$core.override - GenericInterface<$T>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GenericInterface<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : GenericInterface<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GenericInterface$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GenericInterface$NullableType<$T>) && other is $GenericInterface$NullableType<$T> && @@ -6552,45 +6552,45 @@ final class $GenericInterface$NullableType<$T extends _$jni.JObject?> } } -final class $GenericInterface$Type<$T extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GenericInterface$Type<$T extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $GenericInterface$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/GenericInterface;'; - @_$jni.internal - @_$core.override - GenericInterface<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GenericInterface<$T> fromReference(jni$_.JReference reference) => GenericInterface<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GenericInterface$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($GenericInterface$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GenericInterface$Type<$T>) && other is $GenericInterface$Type<$T> && @@ -6599,35 +6599,35 @@ final class $GenericInterface$Type<$T extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.interfaces.MyInterface` -class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class MyInterface<$T extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal MyInterface.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/MyInterface'); /// The type which includes information such as the signature of this class. - static $MyInterface$NullableType<$T> nullableType<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $MyInterface$NullableType<$T> nullableType<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $MyInterface$NullableType<$T>( T, ); } - static $MyInterface$Type<$T> type<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $MyInterface$Type<$T> type<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $MyInterface$Type<$T>( T, @@ -6639,23 +6639,23 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _voidCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _voidCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract void voidCallback(java.lang.String string)` void voidCallback( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - _voidCallback(reference.pointer, _id_voidCallback as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + _voidCallback(reference.pointer, _id_voidCallback as jni$_.JMethodIDPtr, _$string.pointer) .check(); } @@ -6665,26 +6665,26 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _stringCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _stringCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract java.lang.String stringCallback(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? stringCallback( - _$jni.JString? string, + jni$_.JString? stringCallback( + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _stringCallback(reference.pointer, - _id_stringCallback as _$jni.JMethodIDPtr, _$string.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_stringCallback as jni$_.JMethodIDPtr, _$string.pointer) + .object(const jni$_.JStringNullableType()); } static final _id_varCallback = _class.instanceMethodId( @@ -6692,25 +6692,25 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _varCallback = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _varCallback = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract T varCallback(T object)` /// The returned object must be released after use, by calling the [release] method. $T? varCallback( $T? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _varCallback(reference.pointer, - _id_varCallback as _$jni.JMethodIDPtr, _$object.pointer) + _id_varCallback as jni$_.JMethodIDPtr, _$object.pointer) .object<$T?>(T.nullableType); } @@ -6719,21 +6719,21 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { r'(IZCD)J', ); - static final _manyPrimitives = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _manyPrimitives = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Double + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Double )>)>>('globalEnv_CallLongMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, int, int, int, double)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, int, double)>(); /// from: `public abstract long manyPrimitives(int i, boolean z, char c, double d)` int manyPrimitives( @@ -6743,20 +6743,20 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { double d, ) { return _manyPrimitives(reference.pointer, - _id_manyPrimitives as _$jni.JMethodIDPtr, i, z ? 1 : 0, c, d) + _id_manyPrimitives as jni$_.JMethodIDPtr, i, z ? 1 : 0, c, d) .long; } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -6764,82 +6764,82 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r'voidCallback(Ljava/lang/String;)V') { _$impls[$p]!.voidCallback( - $a![0]?.as(const _$jni.JStringType(), releaseOriginal: true), + $a![0]?.as(const jni$_.JStringType(), releaseOriginal: true), ); - return _$jni.nullptr; + return jni$_.nullptr; } if ($d == r'stringCallback(Ljava/lang/String;)Ljava/lang/String;') { final $r = _$impls[$p]!.stringCallback( - $a![0]?.as(const _$jni.JStringType(), releaseOriginal: true), + $a![0]?.as(const jni$_.JStringType(), releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'varCallback(Ljava/lang/Object;)Ljava/lang/Object;') { final $r = _$impls[$p]!.varCallback( $a![0]?.as(_$impls[$p]!.T, releaseOriginal: true), ); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } if ($d == r'manyPrimitives(IZCD)J') { final $r = _$impls[$p]!.manyPrimitives( $a![0]! - .as(const _$jni.JIntegerType(), releaseOriginal: true) + .as(const jni$_.JIntegerType(), releaseOriginal: true) .intValue(releaseOriginal: true), $a![1]! - .as(const _$jni.JBooleanType(), releaseOriginal: true) + .as(const jni$_.JBooleanType(), releaseOriginal: true) .booleanValue(releaseOriginal: true), $a![2]! - .as(const _$jni.JCharacterType(), releaseOriginal: true) + .as(const jni$_.JCharacterType(), releaseOriginal: true) .charValue(releaseOriginal: true), $a![3]! - .as(const _$jni.JDoubleType(), releaseOriginal: true) + .as(const jni$_.JDoubleType(), releaseOriginal: true) .doubleValue(releaseOriginal: true), ); - return _$jni.JLong($r).reference.toPointer(); + return jni$_.JLong($r).reference.toPointer(); } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } - static void implementIn<$T extends _$jni.JObject?>( - _$jni.JImplementer implementer, + static void implementIn<$T extends jni$_.JObject?>( + jni$_.JImplementer implementer, $MyInterface<$T> $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.interfaces.MyInterface', @@ -6856,41 +6856,41 @@ class MyInterface<$T extends _$jni.JObject?> extends _$jni.JObject { factory MyInterface.implement( $MyInterface<$T> $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return MyInterface<$T>.fromReference( $impl.T, $i.implementReference(), ); } - static _$core.Map get $impls => _$impls; + static core$_.Map get $impls => _$impls; } -abstract base mixin class $MyInterface<$T extends _$jni.JObject?> { +abstract base mixin class $MyInterface<$T extends jni$_.JObject?> { factory $MyInterface({ - required _$jni.JObjType<$T> T, - required void Function(_$jni.JString? string) voidCallback, + required jni$_.JObjType<$T> T, + required void Function(jni$_.JString? string) voidCallback, bool voidCallback$async, - required _$jni.JString? Function(_$jni.JString? string) stringCallback, + required jni$_.JString? Function(jni$_.JString? string) stringCallback, required $T? Function($T? object) varCallback, required int Function(int i, bool z, int c, double d) manyPrimitives, }) = _$MyInterface<$T>; - _$jni.JObjType<$T> get T; + jni$_.JObjType<$T> get T; - void voidCallback(_$jni.JString? string); + void voidCallback(jni$_.JString? string); bool get voidCallback$async => false; - _$jni.JString? stringCallback(_$jni.JString? string); + jni$_.JString? stringCallback(jni$_.JString? string); $T? varCallback($T? object); int manyPrimitives(int i, bool z, int c, double d); } -final class _$MyInterface<$T extends _$jni.JObject?> with $MyInterface<$T> { +final class _$MyInterface<$T extends jni$_.JObject?> with $MyInterface<$T> { _$MyInterface({ required this.T, - required void Function(_$jni.JString? string) voidCallback, + required void Function(jni$_.JString? string) voidCallback, this.voidCallback$async = false, - required _$jni.JString? Function(_$jni.JString? string) stringCallback, + required jni$_.JString? Function(jni$_.JString? string) stringCallback, required $T? Function($T? object) varCallback, required int Function(int i, bool z, int c, double d) manyPrimitives, }) : _voidCallback = voidCallback, @@ -6898,20 +6898,20 @@ final class _$MyInterface<$T extends _$jni.JObject?> with $MyInterface<$T> { _varCallback = varCallback, _manyPrimitives = manyPrimitives; - @_$core.override - final _$jni.JObjType<$T> T; + @core$_.override + final jni$_.JObjType<$T> T; - final void Function(_$jni.JString? string) _voidCallback; + final void Function(jni$_.JString? string) _voidCallback; final bool voidCallback$async; - final _$jni.JString? Function(_$jni.JString? string) _stringCallback; + final jni$_.JString? Function(jni$_.JString? string) _stringCallback; final $T? Function($T? object) _varCallback; final int Function(int i, bool z, int c, double d) _manyPrimitives; - void voidCallback(_$jni.JString? string) { + void voidCallback(jni$_.JString? string) { return _voidCallback(string); } - _$jni.JString? stringCallback(_$jni.JString? string) { + jni$_.JString? stringCallback(jni$_.JString? string) { return _stringCallback(string); } @@ -6924,45 +6924,45 @@ final class _$MyInterface<$T extends _$jni.JObject?> with $MyInterface<$T> { } } -final class $MyInterface$NullableType<$T extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $MyInterface$NullableType<$T extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $MyInterface$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyInterface;'; - @_$jni.internal - @_$core.override - MyInterface<$T>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + MyInterface<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyInterface<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyInterface$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyInterface$NullableType<$T>) && other is $MyInterface$NullableType<$T> && @@ -6970,45 +6970,45 @@ final class $MyInterface$NullableType<$T extends _$jni.JObject?> } } -final class $MyInterface$Type<$T extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $MyInterface$Type<$T extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $MyInterface$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyInterface;'; - @_$jni.internal - @_$core.override - MyInterface<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyInterface<$T> fromReference(jni$_.JReference reference) => MyInterface<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $MyInterface$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($MyInterface$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyInterface$Type<$T>) && other is $MyInterface$Type<$T> && @@ -7017,18 +7017,18 @@ final class $MyInterface$Type<$T extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer` -class MyInterfaceConsumer extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class MyInterfaceConsumer extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal MyInterfaceConsumer.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer'); /// The type which includes information such as the signature of this class. @@ -7038,23 +7038,23 @@ class MyInterfaceConsumer extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory MyInterfaceConsumer() { return MyInterfaceConsumer.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -7063,50 +7063,50 @@ class MyInterfaceConsumer extends _$jni.JObject { r'(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V', ); - static final _consumeOnAnotherThread = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _consumeOnAnotherThread = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Double, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Double, + jni$_.Pointer )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, int, int, int, double, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.Pointer)>(); /// from: `static public void consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` - static void consumeOnAnotherThread<$T extends _$jni.JObject?>( + static void consumeOnAnotherThread<$T extends jni$_.JObject?>( MyInterface<$T?>? myInterface, - _$jni.JString? string, + jni$_.JString? string, int i, bool z, int c, double d, $T? object, { - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { - final _$myInterface = myInterface?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; - final _$object = object?.reference ?? _$jni.jNullReference; + final _$myInterface = myInterface?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; _consumeOnAnotherThread( _class.reference.pointer, - _id_consumeOnAnotherThread as _$jni.JMethodIDPtr, + _id_consumeOnAnotherThread as jni$_.JMethodIDPtr, _$myInterface.pointer, _$string.pointer, i, @@ -7122,50 +7122,50 @@ class MyInterfaceConsumer extends _$jni.JObject { r'(Lcom/github/dart_lang/jnigen/interfaces/MyInterface;Ljava/lang/String;IZCDLjava/lang/Object;)V', ); - static final _consumeOnSameThread = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _consumeOnSameThread = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Int32, - _$jni.Int32, - _$jni.Int32, - _$jni.Double, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Double, + jni$_.Pointer )>)>>('globalEnv_CallStaticVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, int, int, int, double, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.Pointer)>(); /// from: `static public void consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` - static void consumeOnSameThread<$T extends _$jni.JObject?>( + static void consumeOnSameThread<$T extends jni$_.JObject?>( MyInterface<$T?>? myInterface, - _$jni.JString? string, + jni$_.JString? string, int i, bool z, int c, double d, $T? object, { - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { - final _$myInterface = myInterface?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; - final _$object = object?.reference ?? _$jni.jNullReference; + final _$myInterface = myInterface?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; _consumeOnSameThread( _class.reference.pointer, - _id_consumeOnSameThread as _$jni.JMethodIDPtr, + _id_consumeOnSameThread as jni$_.JMethodIDPtr, _$myInterface.pointer, _$string.pointer, i, @@ -7178,39 +7178,39 @@ class MyInterfaceConsumer extends _$jni.JObject { } final class $MyInterfaceConsumer$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $MyInterfaceConsumer$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;'; - @_$jni.internal - @_$core.override - MyInterfaceConsumer? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyInterfaceConsumer? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyInterfaceConsumer.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyInterfaceConsumer$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyInterfaceConsumer$NullableType) && other is $MyInterfaceConsumer$NullableType; @@ -7218,38 +7218,38 @@ final class $MyInterfaceConsumer$NullableType } final class $MyInterfaceConsumer$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $MyInterfaceConsumer$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer;'; - @_$jni.internal - @_$core.override - MyInterfaceConsumer fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyInterfaceConsumer fromReference(jni$_.JReference reference) => MyInterfaceConsumer.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $MyInterfaceConsumer$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyInterfaceConsumer$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyInterfaceConsumer$Type) && other is $MyInterfaceConsumer$Type; @@ -7257,18 +7257,18 @@ final class $MyInterfaceConsumer$Type } /// from: `com.github.dart_lang.jnigen.interfaces.MyRunnable` -class MyRunnable extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class MyRunnable extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal MyRunnable.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/MyRunnable'); /// The type which includes information such as the signature of this class. @@ -7279,33 +7279,33 @@ class MyRunnable extends _$jni.JObject { r'()V', ); - static final _run = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _run = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract void run()` void run() { - _run(reference.pointer, _id_run as _$jni.JMethodIDPtr).check(); + _run(reference.pointer, _id_run as jni$_.JMethodIDPtr).check(); } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -7313,43 +7313,43 @@ class MyRunnable extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r'run()V') { _$impls[$p]!.run(); - return _$jni.nullptr; + return jni$_.nullptr; } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $MyRunnable $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.interfaces.MyRunnable', @@ -7366,13 +7366,13 @@ class MyRunnable extends _$jni.JObject { factory MyRunnable.implement( $MyRunnable $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return MyRunnable.fromReference( $i.implementReference(), ); } - static _$core.Map get $impls => _$impls; + static core$_.Map get $impls => _$impls; } abstract base mixin class $MyRunnable { @@ -7399,94 +7399,94 @@ final class _$MyRunnable with $MyRunnable { } } -final class $MyRunnable$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $MyRunnable$NullableType extends jni$_.JObjType { + @jni$_.internal const $MyRunnable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;'; - @_$jni.internal - @_$core.override - MyRunnable? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + MyRunnable? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyRunnable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyRunnable$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyRunnable$NullableType) && other is $MyRunnable$NullableType; } } -final class $MyRunnable$Type extends _$jni.JObjType { - @_$jni.internal +final class $MyRunnable$Type extends jni$_.JObjType { + @jni$_.internal const $MyRunnable$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;'; - @_$jni.internal - @_$core.override - MyRunnable fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyRunnable fromReference(jni$_.JReference reference) => MyRunnable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $MyRunnable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyRunnable$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyRunnable$Type) && other is $MyRunnable$Type; } } /// from: `com.github.dart_lang.jnigen.interfaces.MyRunnableRunner` -class MyRunnableRunner extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class MyRunnableRunner extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal MyRunnableRunner.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/MyRunnableRunner'); /// The type which includes information such as the signature of this class. @@ -7499,37 +7499,37 @@ class MyRunnableRunner extends _$jni.JObject { /// from: `public java.lang.Throwable error` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? get error => - _id_error.get(this, const _$jni.JObjectNullableType()); + jni$_.JObject? get error => + _id_error.get(this, const jni$_.JObjectNullableType()); /// from: `public java.lang.Throwable error` /// The returned object must be released after use, by calling the [release] method. - set error(_$jni.JObject? value) => - _id_error.set(this, const _$jni.JObjectNullableType(), value); + set error(jni$_.JObject? value) => + _id_error.set(this, const jni$_.JObjectNullableType(), value); static final _id_new$ = _class.constructorId( r'(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.interfaces.MyRunnable myRunnable)` /// The returned object must be released after use, by calling the [release] method. factory MyRunnableRunner( MyRunnable? myRunnable, ) { - final _$myRunnable = myRunnable?.reference ?? _$jni.jNullReference; + final _$myRunnable = myRunnable?.reference ?? jni$_.jNullReference; return MyRunnableRunner.fromReference(_new$(_class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, _$myRunnable.pointer) + _id_new$ as jni$_.JMethodIDPtr, _$myRunnable.pointer) .reference); } @@ -7538,22 +7538,22 @@ class MyRunnableRunner extends _$jni.JObject { r'()V', ); - static final _runOnSameThread = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _runOnSameThread = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void runOnSameThread()` void runOnSameThread() { _runOnSameThread( - reference.pointer, _id_runOnSameThread as _$jni.JMethodIDPtr) + reference.pointer, _id_runOnSameThread as jni$_.JMethodIDPtr) .check(); } @@ -7562,22 +7562,22 @@ class MyRunnableRunner extends _$jni.JObject { r'()V', ); - static final _runOnAnotherThread = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _runOnAnotherThread = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void runOnAnotherThread()` void runOnAnotherThread() { _runOnAnotherThread( - reference.pointer, _id_runOnAnotherThread as _$jni.JMethodIDPtr) + reference.pointer, _id_runOnAnotherThread as jni$_.JMethodIDPtr) .check(); } @@ -7586,98 +7586,98 @@ class MyRunnableRunner extends _$jni.JObject { r'()V', ); - static final _runOnAnotherThreadAndJoin = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _runOnAnotherThreadAndJoin = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallVoidMethod') .asFunction< - _$jni.JThrowablePtr Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void runOnAnotherThreadAndJoin()` void runOnAnotherThreadAndJoin() { _runOnAnotherThreadAndJoin(reference.pointer, - _id_runOnAnotherThreadAndJoin as _$jni.JMethodIDPtr) + _id_runOnAnotherThreadAndJoin as jni$_.JMethodIDPtr) .check(); } } final class $MyRunnableRunner$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $MyRunnableRunner$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;'; - @_$jni.internal - @_$core.override - MyRunnableRunner? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyRunnableRunner? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyRunnableRunner.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyRunnableRunner$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyRunnableRunner$NullableType) && other is $MyRunnableRunner$NullableType; } } -final class $MyRunnableRunner$Type extends _$jni.JObjType { - @_$jni.internal +final class $MyRunnableRunner$Type extends jni$_.JObjType { + @jni$_.internal const $MyRunnableRunner$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/MyRunnableRunner;'; - @_$jni.internal - @_$core.override - MyRunnableRunner fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyRunnableRunner fromReference(jni$_.JReference reference) => MyRunnableRunner.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $MyRunnableRunner$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyRunnableRunner$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyRunnableRunner$Type) && other is $MyRunnableRunner$Type; @@ -7685,18 +7685,18 @@ final class $MyRunnableRunner$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.interfaces.StringConversionException` -class StringConversionException extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class StringConversionException extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal StringConversionException.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/StringConversionException'); /// The type which includes information such as the signature of this class. @@ -7706,65 +7706,65 @@ class StringConversionException extends _$jni.JObject { r'(Ljava/lang/String;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_NewObject') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public void (java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. factory StringConversionException( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return StringConversionException.fromReference(_new$( _class.reference.pointer, - _id_new$ as _$jni.JMethodIDPtr, + _id_new$ as jni$_.JMethodIDPtr, _$string.pointer) .reference); } } final class $StringConversionException$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $StringConversionException$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/StringConversionException;'; - @_$jni.internal - @_$core.override - StringConversionException? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringConversionException? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringConversionException.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($StringConversionException$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringConversionException$NullableType) && other is $StringConversionException$NullableType; @@ -7772,38 +7772,38 @@ final class $StringConversionException$NullableType } final class $StringConversionException$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $StringConversionException$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/StringConversionException;'; - @_$jni.internal - @_$core.override - StringConversionException fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringConversionException fromReference(jni$_.JReference reference) => StringConversionException.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $StringConversionException$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($StringConversionException$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringConversionException$Type) && other is $StringConversionException$Type; @@ -7811,18 +7811,18 @@ final class $StringConversionException$Type } /// from: `com.github.dart_lang.jnigen.interfaces.StringConverter` -class StringConverter extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class StringConverter extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal StringConverter.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/StringConverter'); /// The type which includes information such as the signature of this class. @@ -7833,37 +7833,37 @@ class StringConverter extends _$jni.JObject { r'(Ljava/lang/String;)I', ); - static final _parseToInt = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _parseToInt = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallIntMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public abstract int parseToInt(java.lang.String string)` int parseToInt( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - return _parseToInt(reference.pointer, _id_parseToInt as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + return _parseToInt(reference.pointer, _id_parseToInt as jni$_.JMethodIDPtr, _$string.pointer) .integer; } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -7871,45 +7871,45 @@ class StringConverter extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r'parseToInt(Ljava/lang/String;)I') { final $r = _$impls[$p]!.parseToInt( - $a![0]?.as(const _$jni.JStringType(), releaseOriginal: true), + $a![0]?.as(const jni$_.JStringType(), releaseOriginal: true), ); - return _$jni.JInteger($r).reference.toPointer(); + return jni$_.JInteger($r).reference.toPointer(); } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $StringConverter $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.interfaces.StringConverter', @@ -7924,7 +7924,7 @@ class StringConverter extends _$jni.JObject { factory StringConverter.implement( $StringConverter $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return StringConverter.fromReference( $i.implementReference(), @@ -7934,95 +7934,95 @@ class StringConverter extends _$jni.JObject { abstract base mixin class $StringConverter { factory $StringConverter({ - required int Function(_$jni.JString? string) parseToInt, + required int Function(jni$_.JString? string) parseToInt, }) = _$StringConverter; - int parseToInt(_$jni.JString? string); + int parseToInt(jni$_.JString? string); } final class _$StringConverter with $StringConverter { _$StringConverter({ - required int Function(_$jni.JString? string) parseToInt, + required int Function(jni$_.JString? string) parseToInt, }) : _parseToInt = parseToInt; - final int Function(_$jni.JString? string) _parseToInt; + final int Function(jni$_.JString? string) _parseToInt; - int parseToInt(_$jni.JString? string) { + int parseToInt(jni$_.JString? string) { return _parseToInt(string); } } final class $StringConverter$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $StringConverter$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/StringConverter;'; - @_$jni.internal - @_$core.override - StringConverter? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + StringConverter? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringConverter.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($StringConverter$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringConverter$NullableType) && other is $StringConverter$NullableType; } } -final class $StringConverter$Type extends _$jni.JObjType { - @_$jni.internal +final class $StringConverter$Type extends jni$_.JObjType { + @jni$_.internal const $StringConverter$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/StringConverter;'; - @_$jni.internal - @_$core.override - StringConverter fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringConverter fromReference(jni$_.JReference reference) => StringConverter.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $StringConverter$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($StringConverter$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringConverter$Type) && other is $StringConverter$Type; @@ -8030,18 +8030,18 @@ final class $StringConverter$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.interfaces.StringConverterConsumer` -class StringConverterConsumer extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class StringConverterConsumer extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal StringConverterConsumer.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/interfaces/StringConverterConsumer'); /// The type which includes information such as the signature of this class. @@ -8051,23 +8051,23 @@ class StringConverterConsumer extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory StringConverterConsumer() { return StringConverterConsumer.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -8076,38 +8076,38 @@ class StringConverterConsumer extends _$jni.JObject { r'(Lcom/github/dart_lang/jnigen/interfaces/StringConverter;Ljava/lang/String;)Ljava/lang/Integer;', ); - static final _consumeOnSameThread = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _consumeOnSameThread = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public java.lang.Integer consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JInteger? consumeOnSameThread( + static jni$_.JInteger? consumeOnSameThread( StringConverter? stringConverter, - _$jni.JString? string, + jni$_.JString? string, ) { final _$stringConverter = - stringConverter?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; + stringConverter?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _consumeOnSameThread( _class.reference.pointer, - _id_consumeOnSameThread as _$jni.JMethodIDPtr, + _id_consumeOnSameThread as jni$_.JMethodIDPtr, _$stringConverter.pointer, _$string.pointer) - .object<_$jni.JInteger?>(const _$jni.JIntegerNullableType()); + .object(const jni$_.JIntegerNullableType()); } static final _id_consumeOnAnotherThread = _class.staticMethodId( @@ -8115,75 +8115,75 @@ class StringConverterConsumer extends _$jni.JObject { r'(Lcom/github/dart_lang/jnigen/interfaces/StringConverter;Ljava/lang/String;)Ljava/util/concurrent/Future;', ); - static final _consumeOnAnotherThread = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _consumeOnAnotherThread = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JObject? consumeOnAnotherThread( + static jni$_.JObject? consumeOnAnotherThread( StringConverter? stringConverter, - _$jni.JString? string, + jni$_.JString? string, ) { final _$stringConverter = - stringConverter?.reference ?? _$jni.jNullReference; - final _$string = string?.reference ?? _$jni.jNullReference; + stringConverter?.reference ?? jni$_.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _consumeOnAnotherThread( _class.reference.pointer, - _id_consumeOnAnotherThread as _$jni.JMethodIDPtr, + _id_consumeOnAnotherThread as jni$_.JMethodIDPtr, _$stringConverter.pointer, _$string.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + .object(const jni$_.JObjectNullableType()); } } final class $StringConverterConsumer$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $StringConverterConsumer$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/StringConverterConsumer;'; - @_$jni.internal - @_$core.override - StringConverterConsumer? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringConverterConsumer? fromReference(jni$_.JReference reference) => reference.isNull ? null : StringConverterConsumer.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($StringConverterConsumer$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringConverterConsumer$NullableType) && other is $StringConverterConsumer$NullableType; @@ -8191,38 +8191,38 @@ final class $StringConverterConsumer$NullableType } final class $StringConverterConsumer$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $StringConverterConsumer$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/interfaces/StringConverterConsumer;'; - @_$jni.internal - @_$core.override - StringConverterConsumer fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + StringConverterConsumer fromReference(jni$_.JReference reference) => StringConverterConsumer.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $StringConverterConsumer$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($StringConverterConsumer$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($StringConverterConsumer$Type) && other is $StringConverterConsumer$Type; @@ -8230,35 +8230,35 @@ final class $StringConverterConsumer$Type } /// from: `com.github.dart_lang.jnigen.inheritance.BaseClass` -class BaseClass<$T extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class BaseClass<$T extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal BaseClass.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/inheritance/BaseClass'); /// The type which includes information such as the signature of this class. - static $BaseClass$NullableType<$T> nullableType<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $BaseClass$NullableType<$T> nullableType<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $BaseClass$NullableType<$T>( T, ); } - static $BaseClass$Type<$T> type<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $BaseClass$Type<$T> type<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $BaseClass$Type<$T>( T, @@ -8269,69 +8269,69 @@ class BaseClass<$T extends _$jni.JObject?> extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory BaseClass({ - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { return BaseClass<$T>.fromReference( T, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $BaseClass$NullableType<$T extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $BaseClass$NullableType<$T extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $BaseClass$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/inheritance/BaseClass;'; - @_$jni.internal - @_$core.override - BaseClass<$T>? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + BaseClass<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : BaseClass<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($BaseClass$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($BaseClass$NullableType<$T>) && other is $BaseClass$NullableType<$T> && @@ -8339,45 +8339,45 @@ final class $BaseClass$NullableType<$T extends _$jni.JObject?> } } -final class $BaseClass$Type<$T extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $BaseClass$Type<$T extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $BaseClass$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/inheritance/BaseClass;'; - @_$jni.internal - @_$core.override - BaseClass<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + BaseClass<$T> fromReference(jni$_.JReference reference) => BaseClass<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $BaseClass$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($BaseClass$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($BaseClass$Type<$T>) && other is $BaseClass$Type<$T> && @@ -8386,36 +8386,36 @@ final class $BaseClass$Type<$T extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.inheritance.GenericDerivedClass` -class GenericDerivedClass<$T extends _$jni.JObject?> extends BaseClass<$T?> { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class GenericDerivedClass<$T extends jni$_.JObject?> extends BaseClass<$T?> { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal GenericDerivedClass.fromReference( this.T, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T>(T), super.fromReference(T.nullableType, reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/inheritance/GenericDerivedClass'); /// The type which includes information such as the signature of this class. static $GenericDerivedClass$NullableType<$T> - nullableType<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + nullableType<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $GenericDerivedClass$NullableType<$T>( T, ); } - static $GenericDerivedClass$Type<$T> type<$T extends _$jni.JObject?>( - _$jni.JObjType<$T> T, + static $GenericDerivedClass$Type<$T> type<$T extends jni$_.JObject?>( + jni$_.JObjType<$T> T, ) { return $GenericDerivedClass$Type<$T>( T, @@ -8426,70 +8426,70 @@ class GenericDerivedClass<$T extends _$jni.JObject?> extends BaseClass<$T?> { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory GenericDerivedClass({ - required _$jni.JObjType<$T> T, + required jni$_.JObjType<$T> T, }) { return GenericDerivedClass<$T>.fromReference( T, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $GenericDerivedClass$NullableType<$T extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GenericDerivedClass$NullableType<$T extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $GenericDerivedClass$NullableType( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/inheritance/GenericDerivedClass;'; - @_$jni.internal - @_$core.override - GenericDerivedClass<$T>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GenericDerivedClass<$T>? fromReference(jni$_.JReference reference) => reference.isNull ? null : GenericDerivedClass<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => $BaseClass$NullableType<$T?>(T.nullableType); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => $BaseClass$NullableType<$T?>(T.nullableType); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => Object.hash($GenericDerivedClass$NullableType, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GenericDerivedClass$NullableType<$T>) && other is $GenericDerivedClass$NullableType<$T> && @@ -8497,45 +8497,45 @@ final class $GenericDerivedClass$NullableType<$T extends _$jni.JObject?> } } -final class $GenericDerivedClass$Type<$T extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $GenericDerivedClass$Type<$T extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal + @jni$_.internal const $GenericDerivedClass$Type( this.T, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/inheritance/GenericDerivedClass;'; - @_$jni.internal - @_$core.override - GenericDerivedClass<$T> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + GenericDerivedClass<$T> fromReference(jni$_.JReference reference) => GenericDerivedClass<$T>.fromReference( T, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => $BaseClass$NullableType<$T?>(T.nullableType); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => $BaseClass$NullableType<$T?>(T.nullableType); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $GenericDerivedClass$NullableType<$T>(T); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => Object.hash($GenericDerivedClass$Type, T); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($GenericDerivedClass$Type<$T>) && other is $GenericDerivedClass$Type<$T> && @@ -8544,18 +8544,18 @@ final class $GenericDerivedClass$Type<$T extends _$jni.JObject?> } /// from: `com.github.dart_lang.jnigen.inheritance.SpecificDerivedClass` -class SpecificDerivedClass extends BaseClass<_$jni.JString?> { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class SpecificDerivedClass extends BaseClass { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal SpecificDerivedClass.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, - super.fromReference(const _$jni.JStringNullableType(), reference); + super.fromReference(const jni$_.JStringNullableType(), reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/inheritance/SpecificDerivedClass'); /// The type which includes information such as the signature of this class. @@ -8565,62 +8565,62 @@ class SpecificDerivedClass extends BaseClass<_$jni.JString?> { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory SpecificDerivedClass() { return SpecificDerivedClass.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } final class $SpecificDerivedClass$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $SpecificDerivedClass$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/inheritance/SpecificDerivedClass;'; - @_$jni.internal - @_$core.override - SpecificDerivedClass? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + SpecificDerivedClass? fromReference(jni$_.JReference reference) => reference.isNull ? null : SpecificDerivedClass.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const $BaseClass$NullableType<_$jni.JString?>( - _$jni.JStringNullableType()); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $BaseClass$NullableType( + jni$_.JStringNullableType()); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($SpecificDerivedClass$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($SpecificDerivedClass$NullableType) && other is $SpecificDerivedClass$NullableType; @@ -8628,39 +8628,39 @@ final class $SpecificDerivedClass$NullableType } final class $SpecificDerivedClass$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $SpecificDerivedClass$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/inheritance/SpecificDerivedClass;'; - @_$jni.internal - @_$core.override - SpecificDerivedClass fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + SpecificDerivedClass fromReference(jni$_.JReference reference) => SpecificDerivedClass.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const $BaseClass$NullableType<_$jni.JString?>( - _$jni.JStringNullableType()); - - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const $BaseClass$NullableType( + jni$_.JStringNullableType()); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $SpecificDerivedClass$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 2; - @_$core.override + @core$_.override int get hashCode => ($SpecificDerivedClass$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($SpecificDerivedClass$Type) && other is $SpecificDerivedClass$Type; @@ -8668,47 +8668,47 @@ final class $SpecificDerivedClass$Type } /// from: `com.github.dart_lang.jnigen.annotations.Annotated$Nested` -class Annotated_Nested<$T extends _$jni.JObject?, $U extends _$jni.JObject, - $W extends _$jni.JObject, $V extends _$jni.JObject?> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, + $W extends jni$_.JObject, $V extends jni$_.JObject?> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$W> W; + @jni$_.internal + final jni$_.JObjType<$W> W; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal Annotated_Nested.fromReference( this.T, this.U, this.W, this.V, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T, $U, $W, $V>(T, U, W, V), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/annotations/Annotated$Nested'); /// The type which includes information such as the signature of this class. static $Annotated_Nested$NullableType<$T, $U, $W, $V> nullableType< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $W extends _$jni.JObject, - $V extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, - _$jni.JObjType<$W> W, - _$jni.JObjType<$V> V, + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $W extends jni$_.JObject, + $V extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, + jni$_.JObjType<$W> W, + jni$_.JObjType<$V> V, ) { return $Annotated_Nested$NullableType<$T, $U, $W, $V>( T, @@ -8719,14 +8719,14 @@ class Annotated_Nested<$T extends _$jni.JObject?, $U extends _$jni.JObject, } static $Annotated_Nested$Type<$T, $U, $W, $V> type< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $W extends _$jni.JObject, - $V extends _$jni.JObject?>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, - _$jni.JObjType<$W> W, - _$jni.JObjType<$V> V, + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $W extends jni$_.JObject, + $V extends jni$_.JObject?>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, + jni$_.JObjType<$W> W, + jni$_.JObjType<$V> V, ) { return $Annotated_Nested$Type<$T, $U, $W, $V>( T, @@ -8766,80 +8766,80 @@ class Annotated_Nested<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Lcom/github/dart_lang/jnigen/annotations/Annotated;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (com.github.dart_lang.jnigen.annotations.Annotated $outerClass, V object)` /// The returned object must be released after use, by calling the [release] method. factory Annotated_Nested( Annotated<$T?, $U, $W> $outerClass, $V? object, { - _$jni.JObjType<$T>? T, - _$jni.JObjType<$U>? U, - _$jni.JObjType<$W>? W, - required _$jni.JObjType<$V> V, + jni$_.JObjType<$T>? T, + jni$_.JObjType<$U>? U, + jni$_.JObjType<$W>? W, + required jni$_.JObjType<$V> V, }) { - T ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $Annotated$Type<_$core.dynamic, _$core.dynamic, - _$core.dynamic>) + T ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $Annotated$Type) .T, - ]) as _$jni.JObjType<$T>; - U ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $Annotated$Type<_$core.dynamic, _$core.dynamic, - _$core.dynamic>) + ]) as jni$_.JObjType<$T>; + U ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $Annotated$Type) .U, - ]) as _$jni.JObjType<$U>; - W ??= _$jni.lowestCommonSuperType([ - ($outerClass.$type as $Annotated$Type<_$core.dynamic, _$core.dynamic, - _$core.dynamic>) + ]) as jni$_.JObjType<$U>; + W ??= jni$_.lowestCommonSuperType([ + ($outerClass.$type as $Annotated$Type) .W, - ]) as _$jni.JObjType<$W>; + ]) as jni$_.JObjType<$W>; final _$$outerClass = $outerClass.reference; - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return Annotated_Nested<$T, $U, $W, $V>.fromReference( T, U, W, V, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer, _$object.pointer) .reference); } } final class $Annotated_Nested$NullableType< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $W extends _$jni.JObject, - $V extends _$jni.JObject?> - extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $W extends jni$_.JObject, + $V extends jni$_.JObject?> + extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$W> W; + @jni$_.internal + final jni$_.JObjType<$W> W; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $Annotated_Nested$NullableType( this.T, this.U, @@ -8847,14 +8847,14 @@ final class $Annotated_Nested$NullableType< this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Annotated$Nested;'; - @_$jni.internal - @_$core.override - Annotated_Nested<$T, $U, $W, $V>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Annotated_Nested<$T, $U, $W, $V>? fromReference(jni$_.JReference reference) => reference.isNull ? null : Annotated_Nested<$T, $U, $W, $V>.fromReference( @@ -8864,22 +8864,22 @@ final class $Annotated_Nested$NullableType< V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Annotated_Nested$NullableType, T, U, W, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Annotated_Nested$NullableType<$T, $U, $W, $V>) && @@ -8892,24 +8892,24 @@ final class $Annotated_Nested$NullableType< } final class $Annotated_Nested$Type< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $W extends _$jni.JObject, - $V extends _$jni.JObject?> - extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $W extends jni$_.JObject, + $V extends jni$_.JObject?> + extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$W> W; + @jni$_.internal + final jni$_.JObjType<$W> W; - @_$jni.internal - final _$jni.JObjType<$V> V; + @jni$_.internal + final jni$_.JObjType<$V> V; - @_$jni.internal + @jni$_.internal const $Annotated_Nested$Type( this.T, this.U, @@ -8917,14 +8917,14 @@ final class $Annotated_Nested$Type< this.V, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Annotated$Nested;'; - @_$jni.internal - @_$core.override - Annotated_Nested<$T, $U, $W, $V> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Annotated_Nested<$T, $U, $W, $V> fromReference(jni$_.JReference reference) => Annotated_Nested<$T, $U, $W, $V>.fromReference( T, U, @@ -8932,23 +8932,23 @@ final class $Annotated_Nested$Type< V, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $Annotated_Nested$NullableType<$T, $U, $W, $V>(T, U, W, V); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Annotated_Nested$Type, T, U, W, V); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Annotated_Nested$Type<$T, $U, $W, $V>) && other is $Annotated_Nested$Type<$T, $U, $W, $V> && @@ -8960,41 +8960,41 @@ final class $Annotated_Nested$Type< } /// from: `com.github.dart_lang.jnigen.annotations.Annotated` -class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, - $W extends _$jni.JObject> extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType> $type; +class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, + $W extends jni$_.JObject> extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType> $type; - @_$jni.internal - final _$jni.JObjType<$T> T; + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$W> W; + @jni$_.internal + final jni$_.JObjType<$W> W; - @_$jni.internal + @jni$_.internal Annotated.fromReference( this.T, this.U, this.W, - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type<$T, $U, $W>(T, U, W), super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/annotations/Annotated'); /// The type which includes information such as the signature of this class. static $Annotated$NullableType<$T, $U, $W> nullableType< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $W extends _$jni.JObject>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, - _$jni.JObjType<$W> W, + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $W extends jni$_.JObject>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, + jni$_.JObjType<$W> W, ) { return $Annotated$NullableType<$T, $U, $W>( T, @@ -9003,11 +9003,11 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); } - static $Annotated$Type<$T, $U, $W> type<$T extends _$jni.JObject?, - $U extends _$jni.JObject, $W extends _$jni.JObject>( - _$jni.JObjType<$T> T, - _$jni.JObjType<$U> U, - _$jni.JObjType<$W> W, + static $Annotated$Type<$T, $U, $W> type<$T extends jni$_.JObject?, + $U extends jni$_.JObject, $W extends jni$_.JObject>( + jni$_.JObjType<$T> T, + jni$_.JObjType<$U> U, + jni$_.JObjType<$W> W, ) { return $Annotated$Type<$T, $U, $W>( T, @@ -9059,24 +9059,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void> + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>, - _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); /// from: `public void (T object, U object1, W object2)` /// The returned object must be released after use, by calling the [release] method. @@ -9084,24 +9084,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, $T? object, $U object1, $W object2, { - required _$jni.JObjType<$T> T, - _$jni.JObjType<$U>? U, - _$jni.JObjType<$W>? W, + required jni$_.JObjType<$T> T, + jni$_.JObjType<$U>? U, + jni$_.JObjType<$W>? W, }) { - U ??= _$jni.lowestCommonSuperType([ + U ??= jni$_.lowestCommonSuperType([ object1.$type, - ]) as _$jni.JObjType<$U>; - W ??= _$jni.lowestCommonSuperType([ + ]) as jni$_.JObjType<$U>; + W ??= jni$_.lowestCommonSuperType([ object2.$type, - ]) as _$jni.JObjType<$W>; - final _$object = object?.reference ?? _$jni.jNullReference; + ]) as jni$_.JObjType<$W>; + final _$object = object?.reference ?? jni$_.jNullReference; final _$object1 = object1.reference; final _$object2 = object2.reference; return Annotated<$T, $U, $W>.fromReference( T, U, W, - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr, + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$object.pointer, _$object1.pointer, _$object2.pointer) .reference); } @@ -9111,23 +9111,23 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/lang/String;', ); - static final _hello = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _hello = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String hello()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString hello() { - return _hello(reference.pointer, _id_hello as _$jni.JMethodIDPtr) - .object<_$jni.JString>(const _$jni.JStringType()); + jni$_.JString hello() { + return _hello(reference.pointer, _id_hello as jni$_.JMethodIDPtr) + .object(const jni$_.JStringType()); } static final _id_nullableHello = _class.instanceMethodId( @@ -9135,24 +9135,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/lang/String;', ); - static final _nullableHello = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableHello = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.lang.String nullableHello(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? nullableHello( + jni$_.JString? nullableHello( bool z, ) { return _nullableHello(reference.pointer, - _id_nullableHello as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_nullableHello as jni$_.JMethodIDPtr, z ? 1 : 0) + .object(const jni$_.JStringNullableType()); } static final _id_echo = _class.instanceMethodId( @@ -9160,26 +9160,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _echo = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _echo = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.String echo(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString echo( - _$jni.JString string, + jni$_.JString echo( + jni$_.JString string, ) { final _$string = string.reference; return _echo( - reference.pointer, _id_echo as _$jni.JMethodIDPtr, _$string.pointer) - .object<_$jni.JString>(const _$jni.JStringType()); + reference.pointer, _id_echo as jni$_.JMethodIDPtr, _$string.pointer) + .object(const jni$_.JStringType()); } static final _id_nullableEcho = _class.instanceMethodId( @@ -9187,26 +9187,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/String;)Ljava/lang/String;', ); - static final _nullableEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _nullableEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.lang.String nullableEcho(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JString? nullableEcho( - _$jni.JString? string, + jni$_.JString? nullableEcho( + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; + final _$string = string?.reference ?? jni$_.jNullReference; return _nullableEcho(reference.pointer, - _id_nullableEcho as _$jni.JMethodIDPtr, _$string.pointer) - .object<_$jni.JString?>(const _$jni.JStringNullableType()); + _id_nullableEcho as jni$_.JMethodIDPtr, _$string.pointer) + .object(const jni$_.JStringNullableType()); } static final _id_array = _class.instanceMethodId( @@ -9214,24 +9214,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()[Ljava/lang/String;', ); - static final _array = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _array = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String[] array()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JString> array() { - return _array(reference.pointer, _id_array as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.JString>>( - const _$jni.JArrayType<_$jni.JString>(_$jni.JStringType())); + jni$_.JArray array() { + return _array(reference.pointer, _id_array as jni$_.JMethodIDPtr) + .object>( + const jni$_.JArrayType(jni$_.JStringType())); } static final _id_arrayOfNullable = _class.instanceMethodId( @@ -9239,26 +9239,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()[Ljava/lang/String;', ); - static final _arrayOfNullable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _arrayOfNullable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.lang.String[] arrayOfNullable()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JString?> arrayOfNullable() { + jni$_.JArray arrayOfNullable() { return _arrayOfNullable( - reference.pointer, _id_arrayOfNullable as _$jni.JMethodIDPtr) - .object<_$jni.JArray<_$jni.JString?>>( - const _$jni.JArrayType<_$jni.JString?>( - _$jni.JStringNullableType())); + reference.pointer, _id_arrayOfNullable as jni$_.JMethodIDPtr) + .object>( + const jni$_.JArrayType( + jni$_.JStringNullableType())); } static final _id_nullableArray = _class.instanceMethodId( @@ -9266,25 +9266,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)[Ljava/lang/String;', ); - static final _nullableArray = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableArray = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.lang.String[] nullableArray(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JString>? nullableArray( + jni$_.JArray? nullableArray( bool z, ) { return _nullableArray(reference.pointer, - _id_nullableArray as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JArray<_$jni.JString>?>( - const _$jni.JArrayNullableType<_$jni.JString>(_$jni.JStringType())); + _id_nullableArray as jni$_.JMethodIDPtr, z ? 1 : 0) + .object?>( + const jni$_.JArrayNullableType(jni$_.JStringType())); } static final _id_nullableArrayOfNullable = _class.instanceMethodId( @@ -9292,26 +9292,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)[Ljava/lang/String;', ); - static final _nullableArrayOfNullable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableArrayOfNullable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.lang.String[] nullableArrayOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JArray<_$jni.JString?>? nullableArrayOfNullable( + jni$_.JArray? nullableArrayOfNullable( bool z, ) { return _nullableArrayOfNullable(reference.pointer, - _id_nullableArrayOfNullable as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JArray<_$jni.JString?>?>( - const _$jni.JArrayNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + _id_nullableArrayOfNullable as jni$_.JMethodIDPtr, z ? 1 : 0) + .object?>( + const jni$_.JArrayNullableType( + jni$_.JStringNullableType())); } static final _id_list = _class.instanceMethodId( @@ -9319,24 +9319,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _list = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _list = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List list()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString> list() { - return _list(reference.pointer, _id_list as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JString>>( - const _$jni.JListType<_$jni.JString>(_$jni.JStringType())); + jni$_.JList list() { + return _list(reference.pointer, _id_list as jni$_.JMethodIDPtr) + .object>( + const jni$_.JListType(jni$_.JStringType())); } static final _id_listOfNullable = _class.instanceMethodId( @@ -9344,25 +9344,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _listOfNullable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _listOfNullable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List listOfNullable()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString?> listOfNullable() { + jni$_.JList listOfNullable() { return _listOfNullable( - reference.pointer, _id_listOfNullable as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JString?>>( - const _$jni.JListType<_$jni.JString?>(_$jni.JStringNullableType())); + reference.pointer, _id_listOfNullable as jni$_.JMethodIDPtr) + .object>( + const jni$_.JListType(jni$_.JStringNullableType())); } static final _id_nullableList = _class.instanceMethodId( @@ -9370,25 +9370,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/util/List;', ); - static final _nullableList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List nullableList(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString>? nullableList( + jni$_.JList? nullableList( bool z, ) { return _nullableList(reference.pointer, - _id_nullableList as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<_$jni.JString>?>( - const _$jni.JListNullableType<_$jni.JString>(_$jni.JStringType())); + _id_nullableList as jni$_.JMethodIDPtr, z ? 1 : 0) + .object?>( + const jni$_.JListNullableType(jni$_.JStringType())); } static final _id_nullableListOfNullable = _class.instanceMethodId( @@ -9396,26 +9396,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/util/List;', ); - static final _nullableListOfNullable = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableListOfNullable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List nullableListOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JString?>? nullableListOfNullable( + jni$_.JList? nullableListOfNullable( bool z, ) { return _nullableListOfNullable(reference.pointer, - _id_nullableListOfNullable as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<_$jni.JString?>?>( - const _$jni.JListNullableType<_$jni.JString?>( - _$jni.JStringNullableType())); + _id_nullableListOfNullable as jni$_.JMethodIDPtr, z ? 1 : 0) + .object?>( + const jni$_.JListNullableType( + jni$_.JStringNullableType())); } static final _id_classGenericEcho = _class.instanceMethodId( @@ -9423,25 +9423,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _classGenericEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _classGenericEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T classGenericEcho(T object)` /// The returned object must be released after use, by calling the [release] method. $T classGenericEcho( $T object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _classGenericEcho(reference.pointer, - _id_classGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + _id_classGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$T>(T); } @@ -9450,26 +9450,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _nullableClassGenericEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _nullableClassGenericEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T nullableClassGenericEcho(T object)` /// The returned object must be released after use, by calling the [release] method. $T? nullableClassGenericEcho( $T? object, ) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _nullableClassGenericEcho( reference.pointer, - _id_nullableClassGenericEcho as _$jni.JMethodIDPtr, + _id_nullableClassGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$T?>(T.nullableType); } @@ -9479,26 +9479,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _methodGenericEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V methodGenericEcho(V object)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericEcho<$V extends _$jni.JObject?>( + $V methodGenericEcho<$V extends jni$_.JObject?>( $V object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _methodGenericEcho(reference.pointer, - _id_methodGenericEcho as _$jni.JMethodIDPtr, _$object.pointer) + _id_methodGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -9507,29 +9507,29 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _methodGenericEcho2 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericEcho2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V methodGenericEcho2(V object)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericEcho2<$V extends _$jni.JObject>( + $V methodGenericEcho2<$V extends jni$_.JObject>( $V object, { - _$jni.JObjType<$V>? V, + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ + V ??= jni$_.lowestCommonSuperType([ object.$type, - ]) as _$jni.JObjType<$V>; + ]) as jni$_.JObjType<$V>; final _$object = object.reference; return _methodGenericEcho2(reference.pointer, - _id_methodGenericEcho2 as _$jni.JMethodIDPtr, _$object.pointer) + _id_methodGenericEcho2 as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -9538,29 +9538,29 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _methodGenericEcho3 = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericEcho3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V methodGenericEcho3(V object)` /// The returned object must be released after use, by calling the [release] method. - $V methodGenericEcho3<$V extends _$jni.JObject>( + $V methodGenericEcho3<$V extends jni$_.JObject>( $V object, { - _$jni.JObjType<$V>? V, + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ + V ??= jni$_.lowestCommonSuperType([ object.$type, - ]) as _$jni.JObjType<$V>; + ]) as jni$_.JObjType<$V>; final _$object = object.reference; return _methodGenericEcho3(reference.pointer, - _id_methodGenericEcho3 as _$jni.JMethodIDPtr, _$object.pointer) + _id_methodGenericEcho3 as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -9570,31 +9570,31 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _nullableReturnMethodGenericEcho = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public V nullableReturnMethodGenericEcho(V object, boolean z)` /// The returned object must be released after use, by calling the [release] method. - $V? nullableReturnMethodGenericEcho<$V extends _$jni.JObject?>( + $V? nullableReturnMethodGenericEcho<$V extends jni$_.JObject?>( $V object, bool z, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _nullableReturnMethodGenericEcho( reference.pointer, - _id_nullableReturnMethodGenericEcho as _$jni.JMethodIDPtr, + _id_nullableReturnMethodGenericEcho as jni$_.JMethodIDPtr, _$object.pointer, z ? 1 : 0) .object<$V?>(V.nullableType); @@ -9606,34 +9606,34 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _nullableReturnMethodGenericEcho2 = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs< + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< ( - _$jni.Pointer<_$jni.Void>, - _$jni.Int32 + jni$_.Pointer, + jni$_.Int32 )>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public V nullableReturnMethodGenericEcho2(V object, boolean z)` /// The returned object must be released after use, by calling the [release] method. - $V? nullableReturnMethodGenericEcho2<$V extends _$jni.JObject>( + $V? nullableReturnMethodGenericEcho2<$V extends jni$_.JObject>( $V object, bool z, { - _$jni.JObjType<$V>? V, + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ + V ??= jni$_.lowestCommonSuperType([ object.$type, - ]) as _$jni.JObjType<$V>; + ]) as jni$_.JObjType<$V>; final _$object = object.reference; return _nullableReturnMethodGenericEcho2( reference.pointer, - _id_nullableReturnMethodGenericEcho2 as _$jni.JMethodIDPtr, + _id_nullableReturnMethodGenericEcho2 as jni$_.JMethodIDPtr, _$object.pointer, z ? 1 : 0) .object<$V?>(V.nullableType); @@ -9644,27 +9644,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/lang/Object;', ); - static final _nullableMethodGenericEcho = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _nullableMethodGenericEcho = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V nullableMethodGenericEcho(V object)` /// The returned object must be released after use, by calling the [release] method. - $V nullableMethodGenericEcho<$V extends _$jni.JObject?>( + $V nullableMethodGenericEcho<$V extends jni$_.JObject?>( $V object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _nullableMethodGenericEcho( reference.pointer, - _id_nullableMethodGenericEcho as _$jni.JMethodIDPtr, + _id_nullableMethodGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -9675,27 +9675,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _noAnnotationMethodGenericEcho = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V noAnnotationMethodGenericEcho(V object)` /// The returned object must be released after use, by calling the [release] method. - $V? noAnnotationMethodGenericEcho<$V extends _$jni.JObject?>( + $V? noAnnotationMethodGenericEcho<$V extends jni$_.JObject?>( $V? object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _noAnnotationMethodGenericEcho( reference.pointer, - _id_noAnnotationMethodGenericEcho as _$jni.JMethodIDPtr, + _id_noAnnotationMethodGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$V?>(V.nullableType); } @@ -9706,27 +9706,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _nullableArgMethodGenericEcho = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V nullableArgMethodGenericEcho(V object)` /// The returned object must be released after use, by calling the [release] method. - $V nullableArgMethodGenericEcho<$V extends _$jni.JObject>( + $V nullableArgMethodGenericEcho<$V extends jni$_.JObject>( $V? object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _nullableArgMethodGenericEcho( reference.pointer, - _id_nullableArgMethodGenericEcho as _$jni.JMethodIDPtr, + _id_nullableArgMethodGenericEcho as jni$_.JMethodIDPtr, _$object.pointer) .object<$V>(V); } @@ -9736,24 +9736,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _classGenericList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _classGenericList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List classGenericList()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$T> classGenericList() { + jni$_.JList<$T> classGenericList() { return _classGenericList( - reference.pointer, _id_classGenericList as _$jni.JMethodIDPtr) - .object<_$jni.JList<$T>>(_$jni.JListType<$T>(T)); + reference.pointer, _id_classGenericList as jni$_.JMethodIDPtr) + .object>(jni$_.JListType<$T>(T)); } static final _id_classGenericListOfNullable = _class.instanceMethodId( @@ -9762,24 +9762,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _classGenericListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List classGenericListOfNullable()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$T?> classGenericListOfNullable() { + jni$_.JList<$T?> classGenericListOfNullable() { return _classGenericListOfNullable(reference.pointer, - _id_classGenericListOfNullable as _$jni.JMethodIDPtr) - .object<_$jni.JList<$T?>>(_$jni.JListType<$T?>(T.nullableType)); + _id_classGenericListOfNullable as jni$_.JMethodIDPtr) + .object>(jni$_.JListType<$T?>(T.nullableType)); } static final _id_nullableClassGenericList = _class.instanceMethodId( @@ -9787,24 +9787,24 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/util/List;', ); - static final _nullableClassGenericList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableClassGenericList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List nullableClassGenericList(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$T>? nullableClassGenericList( + jni$_.JList<$T>? nullableClassGenericList( bool z, ) { return _nullableClassGenericList(reference.pointer, - _id_nullableClassGenericList as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<$T>?>(_$jni.JListNullableType<$T>(T)); + _id_nullableClassGenericList as jni$_.JMethodIDPtr, z ? 1 : 0) + .object?>(jni$_.JListNullableType<$T>(T)); } static final _id_nullableClassGenericListOfNullable = _class.instanceMethodId( @@ -9813,26 +9813,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _nullableClassGenericListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List nullableClassGenericListOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$T?>? nullableClassGenericListOfNullable( + jni$_.JList<$T?>? nullableClassGenericListOfNullable( bool z, ) { return _nullableClassGenericListOfNullable( reference.pointer, - _id_nullableClassGenericListOfNullable as _$jni.JMethodIDPtr, + _id_nullableClassGenericListOfNullable as jni$_.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<$T?>?>( - _$jni.JListNullableType<$T?>(T.nullableType)); + .object?>( + jni$_.JListNullableType<$T?>(T.nullableType)); } static final _id_methodGenericList = _class.instanceMethodId( @@ -9840,27 +9840,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;)Ljava/util/List;', ); - static final _methodGenericList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _methodGenericList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.util.List methodGenericList(V object)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$V> methodGenericList<$V extends _$jni.JObject?>( + jni$_.JList<$V> methodGenericList<$V extends jni$_.JObject?>( $V object, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _methodGenericList(reference.pointer, - _id_methodGenericList as _$jni.JMethodIDPtr, _$object.pointer) - .object<_$jni.JList<$V>>(_$jni.JListType<$V>(V)); + _id_methodGenericList as jni$_.JMethodIDPtr, _$object.pointer) + .object>(jni$_.JListType<$V>(V)); } static final _id_methodGenericListOfNullable = _class.instanceMethodId( @@ -9869,26 +9869,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _methodGenericListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List methodGenericListOfNullable()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$V?> methodGenericListOfNullable<$V extends _$jni.JObject?>({ - required _$jni.JObjType<$V> V, + jni$_.JList<$V?> methodGenericListOfNullable<$V extends jni$_.JObject?>({ + required jni$_.JObjType<$V> V, }) { return _methodGenericListOfNullable(reference.pointer, - _id_methodGenericListOfNullable as _$jni.JMethodIDPtr) - .object<_$jni.JList<$V?>>(_$jni.JListType<$V?>(V.nullableType)); + _id_methodGenericListOfNullable as jni$_.JMethodIDPtr) + .object>(jni$_.JListType<$V?>(V.nullableType)); } static final _id_nullableMethodGenericList = _class.instanceMethodId( @@ -9896,32 +9896,32 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/lang/Object;Z)Ljava/util/List;', ); - static final _nullableMethodGenericList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni - .VarArgs<(_$jni.Pointer<_$jni.Void>, _$jni.Int32)>)>>( + static final _nullableMethodGenericList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); /// from: `public java.util.List nullableMethodGenericList(V object, boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$V>? nullableMethodGenericList<$V extends _$jni.JObject?>( + jni$_.JList<$V>? nullableMethodGenericList<$V extends jni$_.JObject?>( $V object, bool z, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { - final _$object = object?.reference ?? _$jni.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; return _nullableMethodGenericList( reference.pointer, - _id_nullableMethodGenericList as _$jni.JMethodIDPtr, + _id_nullableMethodGenericList as jni$_.JMethodIDPtr, _$object.pointer, z ? 1 : 0) - .object<_$jni.JList<$V>?>(_$jni.JListNullableType<$V>(V)); + .object?>(jni$_.JListNullableType<$V>(V)); } static final _id_nullableMethodGenericListOfNullable = @@ -9931,28 +9931,28 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _nullableMethodGenericListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.VarArgs<(_$jni.Int32,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List nullableMethodGenericListOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<$V?>? - nullableMethodGenericListOfNullable<$V extends _$jni.JObject?>( + jni$_.JList<$V?>? + nullableMethodGenericListOfNullable<$V extends jni$_.JObject?>( bool z, { - required _$jni.JObjType<$V> V, + required jni$_.JObjType<$V> V, }) { return _nullableMethodGenericListOfNullable( reference.pointer, - _id_nullableMethodGenericListOfNullable as _$jni.JMethodIDPtr, + _id_nullableMethodGenericListOfNullable as jni$_.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<$V?>?>( - _$jni.JListNullableType<$V?>(V.nullableType)); + .object?>( + jni$_.JListNullableType<$V?>(V.nullableType)); } static final _id_firstOfClassGenericList = _class.instanceMethodId( @@ -9960,25 +9960,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/util/List;)Ljava/lang/Object;', ); - static final _firstOfClassGenericList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstOfClassGenericList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstOfClassGenericList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericList( - _$jni.JList<$T> list, + jni$_.JList<$T> list, ) { final _$list = list.reference; return _firstOfClassGenericList(reference.pointer, - _id_firstOfClassGenericList as _$jni.JMethodIDPtr, _$list.pointer) + _id_firstOfClassGenericList as jni$_.JMethodIDPtr, _$list.pointer) .object<$T?>(T.nullableType); } @@ -9988,26 +9988,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstOfClassGenericNullableList = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstOfClassGenericNullableList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericNullableList( - _$jni.JList<$T>? list, + jni$_.JList<$T>? list, ) { - final _$list = list?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; return _firstOfClassGenericNullableList( reference.pointer, - _id_firstOfClassGenericNullableList as _$jni.JMethodIDPtr, + _id_firstOfClassGenericNullableList as jni$_.JMethodIDPtr, _$list.pointer) .object<$T?>(T.nullableType); } @@ -10018,26 +10018,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstOfClassGenericListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstOfClassGenericListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericListOfNullable( - _$jni.JList<$T?> list, + jni$_.JList<$T?> list, ) { final _$list = list.reference; return _firstOfClassGenericListOfNullable( reference.pointer, - _id_firstOfClassGenericListOfNullable as _$jni.JMethodIDPtr, + _id_firstOfClassGenericListOfNullable as jni$_.JMethodIDPtr, _$list.pointer) .object<$T?>(T.nullableType); } @@ -10049,26 +10049,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstOfClassGenericNullableListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstOfClassGenericNullableListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericNullableListOfNullable( - _$jni.JList<$T?>? list, + jni$_.JList<$T?>? list, ) { - final _$list = list?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; return _firstOfClassGenericNullableListOfNullable( reference.pointer, - _id_firstOfClassGenericNullableListOfNullable as _$jni.JMethodIDPtr, + _id_firstOfClassGenericNullableListOfNullable as jni$_.JMethodIDPtr, _$list.pointer) .object<$T?>(T.nullableType); } @@ -10078,29 +10078,29 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/util/List;)Ljava/lang/Object;', ); - static final _firstOfMethodGenericList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstOfMethodGenericList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstOfMethodGenericList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - $V? firstOfMethodGenericList<$V extends _$jni.JObject?>( - _$jni.JList<$V> list, { - _$jni.JObjType<$V>? V, + $V? firstOfMethodGenericList<$V extends jni$_.JObject?>( + jni$_.JList<$V> list, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (list.$type as _$jni.JListType<_$core.dynamic>).E, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (list.$type as jni$_.JListType).E, + ]) as jni$_.JObjType<$V>; final _$list = list.reference; return _firstOfMethodGenericList(reference.pointer, - _id_firstOfMethodGenericList as _$jni.JMethodIDPtr, _$list.pointer) + _id_firstOfMethodGenericList as jni$_.JMethodIDPtr, _$list.pointer) .object<$V?>(V.nullableType); } @@ -10110,27 +10110,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstOfMethodGenericNullableList = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstOfMethodGenericNullableList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - $V? firstOfMethodGenericNullableList<$V extends _$jni.JObject?>( - _$jni.JList<$V>? list, { - required _$jni.JObjType<$V> V, + $V? firstOfMethodGenericNullableList<$V extends jni$_.JObject?>( + jni$_.JList<$V>? list, { + required jni$_.JObjType<$V> V, }) { - final _$list = list?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; return _firstOfMethodGenericNullableList( reference.pointer, - _id_firstOfMethodGenericNullableList as _$jni.JMethodIDPtr, + _id_firstOfMethodGenericNullableList as jni$_.JMethodIDPtr, _$list.pointer) .object<$V?>(V.nullableType); } @@ -10141,30 +10141,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstOfMethodGenericListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstOfMethodGenericListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - $V? firstOfMethodGenericListOfNullable<$V extends _$jni.JObject?>( - _$jni.JList<$V?> list, { - _$jni.JObjType<$V>? V, + $V? firstOfMethodGenericListOfNullable<$V extends jni$_.JObject?>( + jni$_.JList<$V?> list, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (list.$type as _$jni.JListType<_$core.dynamic>).E, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (list.$type as jni$_.JListType).E, + ]) as jni$_.JObjType<$V>; final _$list = list.reference; return _firstOfMethodGenericListOfNullable( reference.pointer, - _id_firstOfMethodGenericListOfNullable as _$jni.JMethodIDPtr, + _id_firstOfMethodGenericListOfNullable as jni$_.JMethodIDPtr, _$list.pointer) .object<$V?>(V.nullableType); } @@ -10176,28 +10176,28 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstOfMethodGenericNullableListOfNullable = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstOfMethodGenericNullableListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - $V? firstOfMethodGenericNullableListOfNullable<$V extends _$jni.JObject?>( - _$jni.JList<$V?>? list, { - required _$jni.JObjType<$V> V, + $V? firstOfMethodGenericNullableListOfNullable<$V extends jni$_.JObject?>( + jni$_.JList<$V?>? list, { + required jni$_.JObjType<$V> V, }) { - final _$list = list?.reference ?? _$jni.jNullReference; + final _$list = list?.reference ?? jni$_.jNullReference; return _firstOfMethodGenericNullableListOfNullable( reference.pointer, _id_firstOfMethodGenericNullableListOfNullable - as _$jni.JMethodIDPtr, + as jni$_.JMethodIDPtr, _$list.pointer) .object<$V?>(V.nullableType); } @@ -10207,29 +10207,29 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/util/Map;)Ljava/lang/Object;', ); - static final _firstKeyOfComboMap = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstKeyOfComboMap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstKeyOfComboMap(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $T? firstKeyOfComboMap<$V extends _$jni.JObject?>( - _$jni.JMap<$T, $V> map, { - _$jni.JObjType<$V>? V, + $T? firstKeyOfComboMap<$V extends jni$_.JObject?>( + jni$_.JMap<$T, $V> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstKeyOfComboMap(reference.pointer, - _id_firstKeyOfComboMap as _$jni.JMethodIDPtr, _$map.pointer) + _id_firstKeyOfComboMap as jni$_.JMethodIDPtr, _$map.pointer) .object<$T?>(T.nullableType); } @@ -10238,29 +10238,29 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/util/Map;)Ljava/lang/Object;', ); - static final _firstValueOfComboMap = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstValueOfComboMap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstValueOfComboMap(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $V? firstValueOfComboMap<$V extends _$jni.JObject?>( - _$jni.JMap<$T, $V> map, { - _$jni.JObjType<$V>? V, + $V? firstValueOfComboMap<$V extends jni$_.JObject?>( + jni$_.JMap<$T, $V> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstValueOfComboMap(reference.pointer, - _id_firstValueOfComboMap as _$jni.JMethodIDPtr, _$map.pointer) + _id_firstValueOfComboMap as jni$_.JMethodIDPtr, _$map.pointer) .object<$V?>(V.nullableType); } @@ -10270,30 +10270,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstKeyOfComboMapNullableKey = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstKeyOfComboMapNullableKey(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $T? firstKeyOfComboMapNullableKey<$V extends _$jni.JObject?>( - _$jni.JMap<$T?, $V> map, { - _$jni.JObjType<$V>? V, + $T? firstKeyOfComboMapNullableKey<$V extends jni$_.JObject?>( + jni$_.JMap<$T?, $V> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstKeyOfComboMapNullableKey( reference.pointer, - _id_firstKeyOfComboMapNullableKey as _$jni.JMethodIDPtr, + _id_firstKeyOfComboMapNullableKey as jni$_.JMethodIDPtr, _$map.pointer) .object<$T?>(T.nullableType); } @@ -10304,30 +10304,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstValueOfComboMapNullableKey = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstValueOfComboMapNullableKey(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $V? firstValueOfComboMapNullableKey<$V extends _$jni.JObject?>( - _$jni.JMap<$T?, $V> map, { - _$jni.JObjType<$V>? V, + $V? firstValueOfComboMapNullableKey<$V extends jni$_.JObject?>( + jni$_.JMap<$T?, $V> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstValueOfComboMapNullableKey( reference.pointer, - _id_firstValueOfComboMapNullableKey as _$jni.JMethodIDPtr, + _id_firstValueOfComboMapNullableKey as jni$_.JMethodIDPtr, _$map.pointer) .object<$V?>(V.nullableType); } @@ -10338,30 +10338,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstKeyOfComboMapNullableValue = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstKeyOfComboMapNullableValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $T? firstKeyOfComboMapNullableValue<$V extends _$jni.JObject?>( - _$jni.JMap<$T, $V?> map, { - _$jni.JObjType<$V>? V, + $T? firstKeyOfComboMapNullableValue<$V extends jni$_.JObject?>( + jni$_.JMap<$T, $V?> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstKeyOfComboMapNullableValue( reference.pointer, - _id_firstKeyOfComboMapNullableValue as _$jni.JMethodIDPtr, + _id_firstKeyOfComboMapNullableValue as jni$_.JMethodIDPtr, _$map.pointer) .object<$T?>(T.nullableType); } @@ -10372,30 +10372,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstValueOfComboMapNullableValue = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstValueOfComboMapNullableValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $V? firstValueOfComboMapNullableValue<$V extends _$jni.JObject?>( - _$jni.JMap<$T, $V?> map, { - _$jni.JObjType<$V>? V, + $V? firstValueOfComboMapNullableValue<$V extends jni$_.JObject?>( + jni$_.JMap<$T, $V?> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstValueOfComboMapNullableValue( reference.pointer, - _id_firstValueOfComboMapNullableValue as _$jni.JMethodIDPtr, + _id_firstValueOfComboMapNullableValue as jni$_.JMethodIDPtr, _$map.pointer) .object<$V?>(V.nullableType); } @@ -10407,30 +10407,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstKeyOfComboMapNullableKeyAndValue = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public T firstKeyOfComboMapNullableKeyAndValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $T? firstKeyOfComboMapNullableKeyAndValue<$V extends _$jni.JObject?>( - _$jni.JMap<$T?, $V?> map, { - _$jni.JObjType<$V>? V, + $T? firstKeyOfComboMapNullableKeyAndValue<$V extends jni$_.JObject?>( + jni$_.JMap<$T?, $V?> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstKeyOfComboMapNullableKeyAndValue( reference.pointer, - _id_firstKeyOfComboMapNullableKeyAndValue as _$jni.JMethodIDPtr, + _id_firstKeyOfComboMapNullableKeyAndValue as jni$_.JMethodIDPtr, _$map.pointer) .object<$T?>(T.nullableType); } @@ -10442,30 +10442,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, ); static final _firstValueOfComboMapNullableKeyAndValue = - _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public V firstValueOfComboMapNullableKeyAndValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - $V? firstValueOfComboMapNullableKeyAndValue<$V extends _$jni.JObject?>( - _$jni.JMap<$T?, $V?> map, { - _$jni.JObjType<$V>? V, + $V? firstValueOfComboMapNullableKeyAndValue<$V extends jni$_.JObject?>( + jni$_.JMap<$T?, $V?> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstValueOfComboMapNullableKeyAndValue( reference.pointer, - _id_firstValueOfComboMapNullableKeyAndValue as _$jni.JMethodIDPtr, + _id_firstValueOfComboMapNullableKeyAndValue as jni$_.JMethodIDPtr, _$map.pointer) .object<$V?>(V.nullableType); } @@ -10475,30 +10475,30 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Ljava/util/Map;)Ljava/util/Map$Entry;', ); - static final _firstEntryOfComboMap = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _firstEntryOfComboMap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `public java.util.Map$Entry firstEntryOfComboMap(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JObject? firstEntryOfComboMap<$V extends _$jni.JObject?>( - _$jni.JMap<$T, $V> map, { - _$jni.JObjType<$V>? V, + jni$_.JObject? firstEntryOfComboMap<$V extends jni$_.JObject?>( + jni$_.JMap<$T, $V> map, { + jni$_.JObjType<$V>? V, }) { - V ??= _$jni.lowestCommonSuperType([ - (map.$type as _$jni.JMapType<_$core.dynamic, _$core.dynamic>).V, - ]) as _$jni.JObjType<$V>; + V ??= jni$_.lowestCommonSuperType([ + (map.$type as jni$_.JMapType).V, + ]) as jni$_.JObjType<$V>; final _$map = map.reference; return _firstEntryOfComboMap(reference.pointer, - _id_firstEntryOfComboMap as _$jni.JMethodIDPtr, _$map.pointer) - .object<_$jni.JObject?>(const _$jni.JObjectNullableType()); + _id_firstEntryOfComboMap as jni$_.JMethodIDPtr, _$map.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_getW = _class.instanceMethodId( @@ -10506,22 +10506,22 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/lang/Object;', ); - static final _getW = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _getW = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public W getW()` /// The returned object must be released after use, by calling the [release] method. $W getW() { - return _getW(reference.pointer, _id_getW as _$jni.JMethodIDPtr) + return _getW(reference.pointer, _id_getW as jni$_.JMethodIDPtr) .object<$W>(W); } @@ -10530,15 +10530,15 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/lang/Object;', ); - static final _nullableGetW = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _nullableGetW = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public W nullableGetW(boolean z)` /// The returned object must be released after use, by calling the [release] method. @@ -10546,7 +10546,7 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, bool z, ) { return _nullableGetW(reference.pointer, - _id_nullableGetW as _$jni.JMethodIDPtr, z ? 1 : 0) + _id_nullableGetW as jni$_.JMethodIDPtr, z ? 1 : 0) .object<$W?>(W.nullableType); } @@ -10555,26 +10555,26 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _list3dOfT = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _list3dOfT = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List list3dOfT()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JList<_$jni.JList<$T?>>> list3dOfT() { - return _list3dOfT(reference.pointer, _id_list3dOfT as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JList<_$jni.JList<$T?>>>>( - _$jni.JListType<_$jni.JList<_$jni.JList<$T?>>>( - _$jni.JListType<_$jni.JList<$T?>>( - _$jni.JListType<$T?>(T.nullableType)))); + jni$_.JList>> list3dOfT() { + return _list3dOfT(reference.pointer, _id_list3dOfT as jni$_.JMethodIDPtr) + .object>>>( + jni$_.JListType>>( + jni$_.JListType>( + jni$_.JListType<$T?>(T.nullableType)))); } static final _id_list3dOfU = _class.instanceMethodId( @@ -10582,25 +10582,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _list3dOfU = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _list3dOfU = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List list3dOfU()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JList<_$jni.JList<$U>>> list3dOfU() { - return _list3dOfU(reference.pointer, _id_list3dOfU as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JList<_$jni.JList<$U>>>>( - _$jni.JListType<_$jni.JList<_$jni.JList<$U>>>( - _$jni.JListType<_$jni.JList<$U>>(_$jni.JListType<$U>(U)))); + jni$_.JList>> list3dOfU() { + return _list3dOfU(reference.pointer, _id_list3dOfU as jni$_.JMethodIDPtr) + .object>>>( + jni$_.JListType>>( + jni$_.JListType>(jni$_.JListType<$U>(U)))); } static final _id_list3dOfW = _class.instanceMethodId( @@ -10608,25 +10608,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _list3dOfW = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _list3dOfW = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List list3dOfW()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JList<_$jni.JList<$W>>> list3dOfW() { - return _list3dOfW(reference.pointer, _id_list3dOfW as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JList<_$jni.JList<$W>>>>( - _$jni.JListType<_$jni.JList<_$jni.JList<$W>>>( - _$jni.JListType<_$jni.JList<$W>>(_$jni.JListType<$W>(W)))); + jni$_.JList>> list3dOfW() { + return _list3dOfW(reference.pointer, _id_list3dOfW as jni$_.JMethodIDPtr) + .object>>>( + jni$_.JListType>>( + jni$_.JListType>(jni$_.JListType<$W>(W)))); } static final _id_list3dOfNullableU = _class.instanceMethodId( @@ -10634,27 +10634,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/util/List;', ); - static final _list3dOfNullableU = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _list3dOfNullableU = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List list3dOfNullableU(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JList<_$jni.JList<$U?>>> list3dOfNullableU( + jni$_.JList>> list3dOfNullableU( bool z, ) { return _list3dOfNullableU(reference.pointer, - _id_list3dOfNullableU as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<_$jni.JList<_$jni.JList<$U?>>>>( - _$jni.JListType<_$jni.JList<_$jni.JList<$U?>>>( - _$jni.JListType<_$jni.JList<$U?>>( - _$jni.JListType<$U?>(U.nullableType)))); + _id_list3dOfNullableU as jni$_.JMethodIDPtr, z ? 1 : 0) + .object>>>( + jni$_.JListType>>( + jni$_.JListType>( + jni$_.JListType<$U?>(U.nullableType)))); } static final _id_list3dOfNullableW = _class.instanceMethodId( @@ -10662,27 +10662,27 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'(Z)Ljava/util/List;', ); - static final _list3dOfNullableW = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Int32,)>)>>('globalEnv_CallObjectMethod') + static final _list3dOfNullableW = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, _$jni.JMethodIDPtr, int)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); /// from: `public java.util.List list3dOfNullableW(boolean z)` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JList<_$jni.JList<$W?>>> list3dOfNullableW( + jni$_.JList>> list3dOfNullableW( bool z, ) { return _list3dOfNullableW(reference.pointer, - _id_list3dOfNullableW as _$jni.JMethodIDPtr, z ? 1 : 0) - .object<_$jni.JList<_$jni.JList<_$jni.JList<$W?>>>>( - _$jni.JListType<_$jni.JList<_$jni.JList<$W?>>>( - _$jni.JListType<_$jni.JList<$W?>>( - _$jni.JListType<$W?>(W.nullableType)))); + _id_list3dOfNullableW as jni$_.JMethodIDPtr, z ? 1 : 0) + .object>>>( + jni$_.JListType>>( + jni$_.JListType>( + jni$_.JListType<$W?>(W.nullableType)))); } static final _id_nested = _class.instanceMethodId( @@ -10690,25 +10690,25 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Lcom/github/dart_lang/jnigen/annotations/Annotated$Nested;', ); - static final _nested = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _nested = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public com.github.dart_lang.jnigen.annotations.Annotated.Nested nested()` /// The returned object must be released after use, by calling the [release] method. - Annotated_Nested<$T?, $U, $W, _$jni.JInteger>? nested() { - return _nested(reference.pointer, _id_nested as _$jni.JMethodIDPtr) - .object?>( - $Annotated_Nested$NullableType<$T?, $U, $W, _$jni.JInteger>( - T.nullableType, U, W, const _$jni.JIntegerType())); + Annotated_Nested<$T?, $U, $W, jni$_.JInteger>? nested() { + return _nested(reference.pointer, _id_nested as jni$_.JMethodIDPtr) + .object?>( + $Annotated_Nested$NullableType<$T?, $U, $W, jni$_.JInteger>( + T.nullableType, U, W, const jni$_.JIntegerType())); } static final _id_intList = _class.instanceMethodId( @@ -10716,55 +10716,55 @@ class Annotated<$T extends _$jni.JObject?, $U extends _$jni.JObject, r'()Ljava/util/List;', ); - static final _intList = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _intList = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public java.util.List intList()` /// The returned object must be released after use, by calling the [release] method. - _$jni.JList<_$jni.JInteger> intList() { - return _intList(reference.pointer, _id_intList as _$jni.JMethodIDPtr) - .object<_$jni.JList<_$jni.JInteger>>( - const _$jni.JListType<_$jni.JInteger>(_$jni.JIntegerType())); + jni$_.JList intList() { + return _intList(reference.pointer, _id_intList as jni$_.JMethodIDPtr) + .object>( + const jni$_.JListType(jni$_.JIntegerType())); } } final class $Annotated$NullableType< - $T extends _$jni.JObject?, - $U extends _$jni.JObject, - $W extends _$jni.JObject> extends _$jni.JObjType?> { - @_$jni.internal - final _$jni.JObjType<$T> T; + $T extends jni$_.JObject?, + $U extends jni$_.JObject, + $W extends jni$_.JObject> extends jni$_.JObjType?> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$W> W; + @jni$_.internal + final jni$_.JObjType<$W> W; - @_$jni.internal + @jni$_.internal const $Annotated$NullableType( this.T, this.U, this.W, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Annotated;'; - @_$jni.internal - @_$core.override - Annotated<$T, $U, $W>? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Annotated<$T, $U, $W>? fromReference(jni$_.JReference reference) => reference.isNull ? null : Annotated<$T, $U, $W>.fromReference( @@ -10773,22 +10773,22 @@ final class $Annotated$NullableType< W, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Annotated$NullableType, T, U, W); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Annotated$NullableType<$T, $U, $W>) && other is $Annotated$NullableType<$T, $U, $W> && @@ -10798,55 +10798,55 @@ final class $Annotated$NullableType< } } -final class $Annotated$Type<$T extends _$jni.JObject?, $U extends _$jni.JObject, - $W extends _$jni.JObject> extends _$jni.JObjType> { - @_$jni.internal - final _$jni.JObjType<$T> T; +final class $Annotated$Type<$T extends jni$_.JObject?, $U extends jni$_.JObject, + $W extends jni$_.JObject> extends jni$_.JObjType> { + @jni$_.internal + final jni$_.JObjType<$T> T; - @_$jni.internal - final _$jni.JObjType<$U> U; + @jni$_.internal + final jni$_.JObjType<$U> U; - @_$jni.internal - final _$jni.JObjType<$W> W; + @jni$_.internal + final jni$_.JObjType<$W> W; - @_$jni.internal + @jni$_.internal const $Annotated$Type( this.T, this.U, this.W, ); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Annotated;'; - @_$jni.internal - @_$core.override - Annotated<$T, $U, $W> fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + Annotated<$T, $U, $W> fromReference(jni$_.JReference reference) => Annotated<$T, $U, $W>.fromReference( T, U, W, reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType?> get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType?> get nullableType => $Annotated$NullableType<$T, $U, $W>(T, U, W); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => Object.hash($Annotated$Type, T, U, W); - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Annotated$Type<$T, $U, $W>) && other is $Annotated$Type<$T, $U, $W> && @@ -10857,18 +10857,18 @@ final class $Annotated$Type<$T extends _$jni.JObject?, $U extends _$jni.JObject, } /// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable$Case` -class JsonSerializable_Case extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonSerializable_Case extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonSerializable_Case.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/annotations/JsonSerializable$Case'); /// The type which includes information such as the signature of this class. @@ -10909,24 +10909,24 @@ class JsonSerializable_Case extends _$jni.JObject { r'()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', ); - static final _values = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable$Case[] values()` /// The returned object must be released after use, by calling the [release] method. - static _$jni.JArray? values() { - return _values(_class.reference.pointer, _id_values as _$jni.JMethodIDPtr) - .object<_$jni.JArray?>( - const _$jni.JArrayNullableType( + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( $JsonSerializable_Case$NullableType())); } @@ -10935,24 +10935,24 @@ class JsonSerializable_Case extends _$jni.JObject { r'(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', ); - static final _valueOf = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, - _$jni.VarArgs<(_$jni.Pointer<_$jni.Void>,)>)>>( + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - _$jni.JniResult Function(_$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, _$jni.Pointer<_$jni.Void>)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable$Case valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. static JsonSerializable_Case? valueOf( - _$jni.JString? string, + jni$_.JString? string, ) { - final _$string = string?.reference ?? _$jni.jNullReference; - return _valueOf(_class.reference.pointer, _id_valueOf as _$jni.JMethodIDPtr, + final _$string = string?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$string.pointer) .object( const $JsonSerializable_Case$NullableType()); @@ -10960,39 +10960,39 @@ class JsonSerializable_Case extends _$jni.JObject { } final class $JsonSerializable_Case$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonSerializable_Case$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; - @_$jni.internal - @_$core.override - JsonSerializable_Case? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonSerializable_Case? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonSerializable_Case.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonSerializable_Case$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonSerializable_Case$NullableType) && other is $JsonSerializable_Case$NullableType; @@ -11000,38 +11000,38 @@ final class $JsonSerializable_Case$NullableType } final class $JsonSerializable_Case$Type - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonSerializable_Case$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;'; - @_$jni.internal - @_$core.override - JsonSerializable_Case fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonSerializable_Case fromReference(jni$_.JReference reference) => JsonSerializable_Case.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonSerializable_Case$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonSerializable_Case$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonSerializable_Case$Type) && other is $JsonSerializable_Case$Type; @@ -11039,18 +11039,18 @@ final class $JsonSerializable_Case$Type } /// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable` -class JsonSerializable extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class JsonSerializable extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal JsonSerializable.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/annotations/JsonSerializable'); /// The type which includes information such as the signature of this class. @@ -11061,36 +11061,36 @@ class JsonSerializable extends _$jni.JObject { r'()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', ); - static final _value = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _value = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_CallObjectMethod') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public abstract com.github.dart_lang.jnigen.annotations.JsonSerializable$Case value()` /// The returned object must be released after use, by calling the [release] method. JsonSerializable_Case? value() { - return _value(reference.pointer, _id_value as _$jni.JMethodIDPtr) + return _value(reference.pointer, _id_value as jni$_.JMethodIDPtr) .object( const $JsonSerializable_Case$NullableType()); } /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -11098,15 +11098,15 @@ class JsonSerializable extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); @@ -11114,32 +11114,32 @@ class JsonSerializable extends _$jni.JObject { if ($d == r'value()Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;') { final $r = _$impls[$p]!.value(); - return ($r as _$jni.JObject?) - ?.as(const _$jni.JObjectType()) + return ($r as jni$_.JObject?) + ?.as(const jni$_.JObjectType()) .reference .toPointer() ?? - _$jni.nullptr; + jni$_.nullptr; } } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $JsonSerializable $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.annotations.JsonSerializable', @@ -11154,7 +11154,7 @@ class JsonSerializable extends _$jni.JObject { factory JsonSerializable.implement( $JsonSerializable $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return JsonSerializable.fromReference( $i.implementReference(), @@ -11183,77 +11183,77 @@ final class _$JsonSerializable with $JsonSerializable { } final class $JsonSerializable$NullableType - extends _$jni.JObjType { - @_$jni.internal + extends jni$_.JObjType { + @jni$_.internal const $JsonSerializable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; - @_$jni.internal - @_$core.override - JsonSerializable? fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonSerializable? fromReference(jni$_.JReference reference) => reference.isNull ? null : JsonSerializable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonSerializable$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonSerializable$NullableType) && other is $JsonSerializable$NullableType; } } -final class $JsonSerializable$Type extends _$jni.JObjType { - @_$jni.internal +final class $JsonSerializable$Type extends jni$_.JObjType { + @jni$_.internal const $JsonSerializable$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable;'; - @_$jni.internal - @_$core.override - JsonSerializable fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + JsonSerializable fromReference(jni$_.JReference reference) => JsonSerializable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $JsonSerializable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($JsonSerializable$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($JsonSerializable$Type) && other is $JsonSerializable$Type; @@ -11261,18 +11261,18 @@ final class $JsonSerializable$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.annotations.MyDataClass` -class MyDataClass extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class MyDataClass extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal MyDataClass.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); - static final _class = _$jni.JClass.forName( + static final _class = jni$_.JClass.forName( r'com/github/dart_lang/jnigen/annotations/MyDataClass'); /// The type which includes information such as the signature of this class. @@ -11282,97 +11282,97 @@ class MyDataClass extends _$jni.JObject { r'()V', ); - static final _new$ = _$jni.ProtectedJniExtensions.lookup< - _$jni.NativeFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>>('globalEnv_NewObject') .asFunction< - _$jni.JniResult Function( - _$jni.Pointer<_$jni.Void>, - _$jni.JMethodIDPtr, + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, )>(); /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. factory MyDataClass() { return MyDataClass.fromReference( - _new$(_class.reference.pointer, _id_new$ as _$jni.JMethodIDPtr) + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $MyDataClass$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $MyDataClass$NullableType extends jni$_.JObjType { + @jni$_.internal const $MyDataClass$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; - @_$jni.internal - @_$core.override - MyDataClass? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + MyDataClass? fromReference(jni$_.JReference reference) => reference.isNull ? null : MyDataClass.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyDataClass$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyDataClass$NullableType) && other is $MyDataClass$NullableType; } } -final class $MyDataClass$Type extends _$jni.JObjType { - @_$jni.internal +final class $MyDataClass$Type extends jni$_.JObjType { + @jni$_.internal const $MyDataClass$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/MyDataClass;'; - @_$jni.internal - @_$core.override - MyDataClass fromReference(_$jni.JReference reference) => + @jni$_.internal + @core$_.override + MyDataClass fromReference(jni$_.JReference reference) => MyDataClass.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $MyDataClass$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($MyDataClass$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($MyDataClass$Type) && other is $MyDataClass$Type; @@ -11380,34 +11380,34 @@ final class $MyDataClass$Type extends _$jni.JObjType { } /// from: `com.github.dart_lang.jnigen.annotations.NotNull` -class NotNull extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class NotNull extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal NotNull.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/annotations/NotNull'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/annotations/NotNull'); /// The type which includes information such as the signature of this class. static const nullableType = $NotNull$NullableType(); static const type = $NotNull$Type(); /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -11415,39 +11415,39 @@ class NotNull extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $NotNull $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.annotations.NotNull', @@ -11462,7 +11462,7 @@ class NotNull extends _$jni.JObject { factory NotNull.implement( $NotNull $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return NotNull.fromReference( $i.implementReference(), @@ -11478,106 +11478,106 @@ final class _$NotNull with $NotNull { _$NotNull(); } -final class $NotNull$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $NotNull$NullableType extends jni$_.JObjType { + @jni$_.internal const $NotNull$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/NotNull;'; - @_$jni.internal - @_$core.override - NotNull? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + NotNull? fromReference(jni$_.JReference reference) => reference.isNull ? null : NotNull.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($NotNull$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($NotNull$NullableType) && other is $NotNull$NullableType; } } -final class $NotNull$Type extends _$jni.JObjType { - @_$jni.internal +final class $NotNull$Type extends jni$_.JObjType { + @jni$_.internal const $NotNull$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/NotNull;'; - @_$jni.internal - @_$core.override - NotNull fromReference(_$jni.JReference reference) => NotNull.fromReference( + @jni$_.internal + @core$_.override + NotNull fromReference(jni$_.JReference reference) => NotNull.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $NotNull$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $NotNull$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($NotNull$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($NotNull$Type) && other is $NotNull$Type; } } /// from: `com.github.dart_lang.jnigen.annotations.Nullable` -class Nullable extends _$jni.JObject { - @_$jni.internal - @_$core.override - final _$jni.JObjType $type; +class Nullable extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; - @_$jni.internal + @jni$_.internal Nullable.fromReference( - _$jni.JReference reference, + jni$_.JReference reference, ) : $type = type, super.fromReference(reference); static final _class = - _$jni.JClass.forName(r'com/github/dart_lang/jnigen/annotations/Nullable'); + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/annotations/Nullable'); /// The type which includes information such as the signature of this class. static const nullableType = $Nullable$NullableType(); static const type = $Nullable$Type(); /// Maps a specific port to the implemented interface. - static final _$core.Map _$impls = {}; - static _$jni.JObjectPtr _$invoke( + static final core$_.Map _$impls = {}; + static jni$_.JObjectPtr _$invoke( int port, - _$jni.JObjectPtr descriptor, - _$jni.JObjectPtr args, + jni$_.JObjectPtr descriptor, + jni$_.JObjectPtr args, ) { return _$invokeMethod( port, - _$jni.MethodInvocation.fromAddresses( + jni$_.MethodInvocation.fromAddresses( 0, descriptor.address, args.address, @@ -11585,39 +11585,39 @@ class Nullable extends _$jni.JObject { ); } - static final _$jni.Pointer< - _$jni.NativeFunction< - _$jni.JObjectPtr Function( - _$jni.Int64, _$jni.JObjectPtr, _$jni.JObjectPtr)>> - _$invokePointer = _$jni.Pointer.fromFunction(_$invoke); + static final jni$_.Pointer< + jni$_.NativeFunction< + jni$_.JObjectPtr Function( + jni$_.Int64, jni$_.JObjectPtr, jni$_.JObjectPtr)>> + _$invokePointer = jni$_.Pointer.fromFunction(_$invoke); - static _$jni.Pointer<_$jni.Void> _$invokeMethod( + static jni$_.Pointer _$invokeMethod( int $p, - _$jni.MethodInvocation $i, + jni$_.MethodInvocation $i, ) { try { final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; } catch (e) { - return _$jni.ProtectedJniExtensions.newDartException(e); + return jni$_.ProtectedJniExtensions.newDartException(e); } - return _$jni.nullptr; + return jni$_.nullptr; } static void implementIn( - _$jni.JImplementer implementer, + jni$_.JImplementer implementer, $Nullable $impl, ) { - late final _$jni.RawReceivePort $p; - $p = _$jni.RawReceivePort(($m) { + late final jni$_.RawReceivePort $p; + $p = jni$_.RawReceivePort(($m) { if ($m == null) { _$impls.remove($p.sendPort.nativePort); $p.close(); return; } - final $i = _$jni.MethodInvocation.fromMessage($m); + final $i = jni$_.MethodInvocation.fromMessage($m); final $r = _$invokeMethod($p.sendPort.nativePort, $i); - _$jni.ProtectedJniExtensions.returnResult($i.result, $r); + jni$_.ProtectedJniExtensions.returnResult($i.result, $r); }); implementer.add( r'com.github.dart_lang.jnigen.annotations.Nullable', @@ -11632,7 +11632,7 @@ class Nullable extends _$jni.JObject { factory Nullable.implement( $Nullable $impl, ) { - final $i = _$jni.JImplementer(); + final $i = jni$_.JImplementer(); implementIn($i, $impl); return Nullable.fromReference( $i.implementReference(), @@ -11648,72 +11648,72 @@ final class _$Nullable with $Nullable { _$Nullable(); } -final class $Nullable$NullableType extends _$jni.JObjType { - @_$jni.internal +final class $Nullable$NullableType extends jni$_.JObjType { + @jni$_.internal const $Nullable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Nullable;'; - @_$jni.internal - @_$core.override - Nullable? fromReference(_$jni.JReference reference) => reference.isNull + @jni$_.internal + @core$_.override + Nullable? fromReference(jni$_.JReference reference) => reference.isNull ? null : Nullable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => this; + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Nullable$NullableType).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Nullable$NullableType) && other is $Nullable$NullableType; } } -final class $Nullable$Type extends _$jni.JObjType { - @_$jni.internal +final class $Nullable$Type extends jni$_.JObjType { + @jni$_.internal const $Nullable$Type(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override String get signature => r'Lcom/github/dart_lang/jnigen/annotations/Nullable;'; - @_$jni.internal - @_$core.override - Nullable fromReference(_$jni.JReference reference) => Nullable.fromReference( + @jni$_.internal + @core$_.override + Nullable fromReference(jni$_.JReference reference) => Nullable.fromReference( reference, ); - @_$jni.internal - @_$core.override - _$jni.JObjType get superType => const _$jni.JObjectNullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); - @_$jni.internal - @_$core.override - _$jni.JObjType get nullableType => const $Nullable$NullableType(); + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Nullable$NullableType(); - @_$jni.internal - @_$core.override + @jni$_.internal + @core$_.override final superCount = 1; - @_$core.override + @core$_.override int get hashCode => ($Nullable$Type).hashCode; - @_$core.override + @core$_.override bool operator ==(Object other) { return other.runtimeType == ($Nullable$Type) && other is $Nullable$Type; } diff --git a/pkgs/jnigen/test/simple_package_test/generate.dart b/pkgs/jnigen/test/simple_package_test/generate.dart index 05595f7b9..96b692adc 100644 --- a/pkgs/jnigen/test/simple_package_test/generate.dart +++ b/pkgs/jnigen/test/simple_package_test/generate.dart @@ -85,10 +85,10 @@ Config getConfig() { nullableAnnotations: ['com.github.dart_lang.jnigen.annotations.Nullable'], customClassBody: { 'com.github.dart_lang.jnigen.interfaces.MyInterface': r''' - static _$core.Map get $impls => _$impls; + static core$_.Map get $impls => _$impls; ''', 'com.github.dart_lang.jnigen.interfaces.MyRunnable': r''' - static _$core.Map get $impls => _$impls; + static core$_.Map get $impls => _$impls; ''' }, outputConfig: OutputConfig( From e00afd983fe686aff3b87628afd241b35010e826 Mon Sep 17 00:00:00 2001 From: Gabriel Terwesten Date: Tue, 10 Dec 2024 09:12:32 +0100 Subject: [PATCH 35/50] [native_toolchain_c] Add `libraries` and `libraryDirectories` options to `CTool` (#1423) --- .github/workflows/native.yaml | 3 + .../native_dynamic_linking/hook/build.dart | 28 +---- .../native_dynamic_linking/src/debug.c | 2 + .../native_dynamic_linking/hook/build.dart | 27 +---- .../build/native_dynamic_linking/src/debug.c | 2 + .../example/native_dynamic_linking_test.dart | 34 +++--- pkgs/native_toolchain_c/CHANGELOG.md | 1 + .../lib/src/cbuilder/cbuilder.dart | 10 ++ .../lib/src/cbuilder/clinker.dart | 8 ++ .../lib/src/cbuilder/ctool.dart | 31 +++++- .../lib/src/cbuilder/run_cbuilder.dart | 31 +++++- .../test/cbuilder/cbuilder_test.dart | 104 ++++++++++++++++++ .../testfiles/dynamically_linked/src/debug.c | 22 ++++ .../testfiles/dynamically_linked/src/debug.h | 11 ++ .../src/dynamically_linked.c | 9 ++ .../testfiles/dynamically_linked/src/math.c | 11 ++ .../testfiles/dynamically_linked/src/math.h | 13 +++ 17 files changed, 272 insertions(+), 75 deletions(-) create mode 100644 pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.c create mode 100644 pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.h create mode 100644 pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/dynamically_linked.c create mode 100644 pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.c create mode 100644 pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.h diff --git a/.github/workflows/native.yaml b/.github/workflows/native.yaml index 2aab3d265..84ea83274 100644 --- a/.github/workflows/native.yaml +++ b/.github/workflows/native.yaml @@ -142,6 +142,9 @@ jobs: - run: dart --enable-experiment=native-assets test working-directory: pkgs/${{ matrix.package }}/example/build/native_dynamic_linking/ + # TODO(https://github.com/dart-lang/native/issues/190): Enable on windows once + # https://github.com/dart-lang/sdk/commit/903eea6bfb8ee405587f0866a1d1e92eea45d29e + # has landed in dev channel. if: ${{ matrix.package == 'native_assets_cli' && matrix.sdk == 'dev' && !matrix.breaking-change && matrix.os != 'windows' }} - run: dart --enable-experiment=native-assets test diff --git a/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart b/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart index 79b97a40e..0713eab62 100644 --- a/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart @@ -26,9 +26,7 @@ void main(List args) async { sources: [ 'src/math.c', ], - // TODO(https://github.com/dart-lang/native/issues/190): Use specific - // API for linking once available. - flags: config.dynamicLinkingFlags('debug'), + libraries: ['debug'], ), CBuilder.library( name: 'add', @@ -36,13 +34,11 @@ void main(List args) async { sources: [ 'src/add.c', ], - // TODO(https://github.com/dart-lang/native/issues/190): Use specific - // API for linking once available. - flags: config.dynamicLinkingFlags('math'), + libraries: ['math'], ) ]; - // Note: This builders need to be run sequentially because they depend on + // Note: These builders need to be run sequentially because they depend on // each others output. for (final builder in builders) { await builder.run( @@ -53,21 +49,3 @@ void main(List args) async { } }); } - -extension on BuildConfig { - List dynamicLinkingFlags(String libraryName) => switch (targetOS) { - OS.macOS => [ - '-L${outputDirectory.toFilePath()}', - '-l$libraryName', - ], - OS.linux => [ - r'-Wl,-rpath=$ORIGIN', - '-L${outputDirectory.toFilePath()}', - '-l$libraryName', - ], - OS.windows => [ - outputDirectory.resolve('$libraryName.lib').toFilePath(), - ], - _ => throw UnimplementedError('Unsupported OS: $targetOS'), - }; -} diff --git a/pkgs/native_assets_builder/test_data/native_dynamic_linking/src/debug.c b/pkgs/native_assets_builder/test_data/native_dynamic_linking/src/debug.c index 92e42f1d2..b840d62a5 100644 --- a/pkgs/native_assets_builder/test_data/native_dynamic_linking/src/debug.c +++ b/pkgs/native_assets_builder/test_data/native_dynamic_linking/src/debug.c @@ -16,5 +16,7 @@ int debug_printf(const char* format, ...) { int ret = vprintf(format, args); va_end(args); return ret; +#else + return 0; #endif } diff --git a/pkgs/native_assets_cli/example/build/native_dynamic_linking/hook/build.dart b/pkgs/native_assets_cli/example/build/native_dynamic_linking/hook/build.dart index 88b3d2d12..0713eab62 100644 --- a/pkgs/native_assets_cli/example/build/native_dynamic_linking/hook/build.dart +++ b/pkgs/native_assets_cli/example/build/native_dynamic_linking/hook/build.dart @@ -26,9 +26,7 @@ void main(List args) async { sources: [ 'src/math.c', ], - // TODO(https://github.com/dart-lang/native/issues/190): Use specific - // API for linking once available. - flags: config.dynamicLinkingFlags('debug'), + libraries: ['debug'], ), CBuilder.library( name: 'add', @@ -36,13 +34,11 @@ void main(List args) async { sources: [ 'src/add.c', ], - // TODO(https://github.com/dart-lang/native/issues/190): Use specific - // API for linking once available. - flags: config.dynamicLinkingFlags('math'), + libraries: ['math'], ) ]; - // Note: This builders need to be run sequentially because they depend on + // Note: These builders need to be run sequentially because they depend on // each others output. for (final builder in builders) { await builder.run( @@ -53,20 +49,3 @@ void main(List args) async { } }); } - -extension on BuildConfig { - List dynamicLinkingFlags(String libraryName) => switch (targetOS) { - OS.macOS => [ - '-L${outputDirectory.toFilePath()}', - '-l$libraryName', - ], - OS.linux => [ - '-Wl,-rpath=\$ORIGIN/.', - '-L${outputDirectory.toFilePath()}', - '-l$libraryName', - ], - // TODO(https://github.com/dart-lang/native/issues/1415): Enable support - // for Windows once linker flags are supported by CBuilder. - _ => throw UnimplementedError('Unsupported OS: $targetOS'), - }; -} diff --git a/pkgs/native_assets_cli/example/build/native_dynamic_linking/src/debug.c b/pkgs/native_assets_cli/example/build/native_dynamic_linking/src/debug.c index 92e42f1d2..b840d62a5 100644 --- a/pkgs/native_assets_cli/example/build/native_dynamic_linking/src/debug.c +++ b/pkgs/native_assets_cli/example/build/native_dynamic_linking/src/debug.c @@ -16,5 +16,7 @@ int debug_printf(const char* format, ...) { int ret = vprintf(format, args); va_end(args); return ret; +#else + return 0; #endif } diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index a721b058f..b70e28274 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -6,8 +6,9 @@ 'mac-os': Timeout.factor(2), 'windows': Timeout.factor(10), }) -// TODO(https://github.com/dart-lang/native/issues/1415): Enable support -// for Windows once linker flags are supported by CBuilder. +// TODO(https://github.com/dart-lang/native/issues/190): Enable on windows once +// https://github.com/dart-lang/sdk/commit/903eea6bfb8ee405587f0866a1d1e92eea45d29e +// has landed in dev channel. @TestOn('!windows') library; @@ -20,12 +21,6 @@ import 'package:test/test.dart'; import '../helpers.dart'; void main() async { - if (Platform.isWindows) { - // TODO(https://github.com/dart-lang/native/issues/1415): Enable support - // for Windows once linker flags are supported by CBuilder. - return; - } - late Uri tempUri; const name = 'native_dynamic_linking'; @@ -51,19 +46,22 @@ void main() async { final configBuilder = BuildConfigBuilder() ..setupHookConfig( - packageRoot: testPackageUri, - packageName: name, - targetOS: OS.current, - buildAssetTypes: [CodeAsset.type], - buildMode: dryRun ? null : BuildMode.debug) + packageRoot: testPackageUri, + packageName: name, + targetOS: OS.current, + buildAssetTypes: [CodeAsset.type], + buildMode: dryRun ? null : BuildMode.debug, + ) ..setupBuildRunConfig( - outputDirectory: outputDirectory, - outputDirectoryShared: outputDirectoryShared) + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, + ) ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( - targetArchitecture: dryRun ? null : Architecture.current, - linkModePreference: LinkModePreference.dynamic, - cCompilerConfig: dryRun ? null : cCompiler); + targetArchitecture: dryRun ? null : Architecture.current, + linkModePreference: LinkModePreference.dynamic, + cCompilerConfig: dryRun ? null : cCompiler, + ); final buildConfigUri = testTempUri.resolve('build_config.json'); await File.fromUri(buildConfigUri) diff --git a/pkgs/native_toolchain_c/CHANGELOG.md b/pkgs/native_toolchain_c/CHANGELOG.md index d0edf147c..0d1a8e172 100644 --- a/pkgs/native_toolchain_c/CHANGELOG.md +++ b/pkgs/native_toolchain_c/CHANGELOG.md @@ -4,6 +4,7 @@ https://github.com/dart-lang/native/issues/1611 - Make optimization level configurable. Defaults to `-3s` and `/O3`. https://github.com/dart-lang/native/issues/1267 +- Add `libraries` and `libraryDirectories` to `CTool`. ## 0.6.0 diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart index 81d6b8f11..8e99e7ebc 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart @@ -53,6 +53,8 @@ class CBuilder extends CTool implements Builder { super.sources = const [], super.includes = const [], super.frameworks = CTool.defaultFrameworks, + super.libraries = const [], + super.libraryDirectories = CTool.defaultLibraryDirectories, @Deprecated( 'Newer Dart and Flutter SDKs automatically add the Dart hook ' 'sources as dependencies.', @@ -76,6 +78,8 @@ class CBuilder extends CTool implements Builder { super.sources = const [], super.includes = const [], super.frameworks = CTool.defaultFrameworks, + super.libraries = const [], + super.libraryDirectories = CTool.defaultLibraryDirectories, @Deprecated( 'Newer Dart and Flutter SDKs automatically add the Dart hook ' 'sources as dependencies.', @@ -132,6 +136,10 @@ class CBuilder extends CTool implements Builder { // ignore: deprecated_member_use_from_same_package for (final source in this.dartBuildFiles) packageRoot.resolve(source), ]; + final libraryDirectories = [ + for (final directory in this.libraryDirectories) + outDir.resolveUri(Uri.file(directory)), + ]; // ignore: deprecated_member_use if (!config.dryRun) { final task = RunCBuilder( @@ -141,6 +149,8 @@ class CBuilder extends CTool implements Builder { sources: sources, includes: includes, frameworks: frameworks, + libraries: libraries, + libraryDirectories: libraryDirectories, dynamicLibrary: type == OutputType.library && linkMode == DynamicLoadingBundled() ? libUri diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart index b79174967..aa804863e 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart @@ -29,6 +29,8 @@ class CLinker extends CTool implements Linker { super.sources = const [], super.includes = const [], super.frameworks = CTool.defaultFrameworks, + super.libraries = const [], + super.libraryDirectories = CTool.defaultLibraryDirectories, @visibleForTesting super.installName, super.flags = const [], super.defines = const {}, @@ -68,6 +70,10 @@ class CLinker extends CTool implements Linker { for (final directory in this.includes) packageRoot.resolveUri(Uri.file(directory)), ]; + final libraryDirectories = [ + for (final directory in this.libraryDirectories) + outDir.resolveUri(Uri.file(directory)), + ]; final task = RunCBuilder( config: config, codeConfig: config.codeConfig, @@ -76,6 +82,8 @@ class CLinker extends CTool implements Linker { sources: sources, includes: includes, frameworks: frameworks, + libraries: libraries, + libraryDirectories: libraryDirectories, dynamicLibrary: linkMode == DynamicLoadingBundled() ? libUri : null, staticLibrary: linkMode == StaticLinking() ? libUri : null, // ignore: invalid_use_of_visible_for_testing_member diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart index 1a977e106..13e9ff0ad 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart @@ -6,15 +6,17 @@ import 'package:meta/meta.dart'; import 'package:native_assets_cli/code_assets.dart'; import 'cbuilder.dart'; +import 'clinker.dart'; import 'language.dart'; import 'optimization_level.dart'; import 'output_type.dart'; +/// Common options for [CBuilder] and [CLinker]. abstract class CTool { /// What kind of artifact to build. final OutputType type; - /// Name of the library or executable to linkg. + /// Name of the library or executable to build or link. /// /// The filename will be decided by [LinkConfig.targetOS] and /// [OSLibraryNaming.libraryFileName] or @@ -50,7 +52,7 @@ abstract class CTool { /// /// Defaults to `['Foundation']`. /// - /// Framworks will not be automatically reported as dependencies of the hook. + /// Frameworks will not be automatically reported as dependencies of the hook. /// Frameworks can be mentioned by name if they are available on the system, /// so the file path is not known. If you're depending on your own frameworks /// report them as dependencies of the hook by calling @@ -58,8 +60,31 @@ abstract class CTool { /// manually. final List frameworks; + /// The default [frameworks]. static const List defaultFrameworks = ['Foundation']; + /// Libraries to link to. + /// + /// In addition to the system default directories, libraries will be searched + /// for in [libraryDirectories]. + /// + /// If you want to link to a library that was built by another [CBuilder] or + /// [CLinker], either leave the default [libraryDirectories] or include `'.'` + /// in the list. + final List libraries; + + /// Directories to search for [libraries], in addition to the system default + /// directories. + /// + /// Resolved against [LinkConfig.outputDirectory]. + /// + /// Defaults to `['.']`, which means the [LinkConfig.outputDirectory] will be + /// searched for libraries. + final List libraryDirectories; + + /// The default [libraryDirectories]. + static const List defaultLibraryDirectories = ['.']; + /// TODO(https://github.com/dart-lang/native/issues/54): Move to [LinkConfig] /// or hide in public API. @visibleForTesting @@ -130,6 +155,8 @@ abstract class CTool { required this.sources, required this.includes, required this.frameworks, + required this.libraries, + required this.libraryDirectories, required this.installName, required this.flags, required this.defines, diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart index 8342f109c..a4b8197c1 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart @@ -28,6 +28,8 @@ class RunCBuilder { final List sources; final List includes; final List frameworks; + final List libraries; + final List libraryDirectories; final Uri? executable; final Uri? dynamicLibrary; final Uri? staticLibrary; @@ -56,6 +58,8 @@ class RunCBuilder { this.sources = const [], this.includes = const [], required this.frameworks, + this.libraries = const [], + this.libraryDirectories = const [], this.executable, this.dynamicLibrary, this.staticLibrary, @@ -298,8 +302,7 @@ class RunCBuilder { if (executable != null) ...[ '-o', outDir.resolveUri(executable!).toFilePath(), - ], - if (dynamicLibrary != null) ...[ + ] else if (dynamicLibrary != null) ...[ '--shared', '-o', outFile!.toFilePath(), @@ -310,6 +313,19 @@ class RunCBuilder { ], ...linkerOptions?.postSourcesFlags(toolInstance.tool, sourceFiles) ?? [], + if (executable != null || dynamicLibrary != null) ...[ + if (config.targetOS case OS.android || OS.linux) + // During bundling code assets are all placed in the same directory. + // Setting this rpath allows the binary to find other code assets + // it is linked against. + if (linkerOptions != null) + '-rpath=\$ORIGIN' + else + '-Wl,-rpath=\$ORIGIN', + for (final directory in libraryDirectories) + '-L${directory.toFilePath()}', + for (final library in libraries) '-l$library', + ], ], logger: logger, captureOutput: false, @@ -344,17 +360,20 @@ class RunCBuilder { ...sources.map((e) => e.toFilePath()), '/link', '/out:${outDir.resolveUri(executable!).toFilePath()}', - ], - if (dynamicLibrary != null) ...[ + ] else if (dynamicLibrary != null) ...[ ...sources.map((e) => e.toFilePath()), '/link', '/DLL', '/out:${outDir.resolveUri(dynamicLibrary!).toFilePath()}', - ], - if (staticLibrary != null) ...[ + ] else if (staticLibrary != null) ...[ '/c', ...sources.map((e) => e.toFilePath()), ], + if (executable != null || dynamicLibrary != null) ...[ + for (final directory in libraryDirectories) + '/LIBPATH:${directory.toFilePath()}', + for (final library in libraries) '$library.lib', + ], ], workingDirectory: outDir, environment: environment, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index 3906383e7..d076c7fd9 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -554,6 +554,110 @@ void main() { expect(compilerInvocation, contains('-l stdc++')); } }); + + test('CBuilder libraries and libraryDirectories', () async { + final tempUri = await tempDirForTest(); + final tempUri2 = await tempDirForTest(); + + final dynamicallyLinkedSrcUri = + packageUri.resolve('test/cbuilder/testfiles/dynamically_linked/src/'); + final dynamicallyLinkedCUri = + dynamicallyLinkedSrcUri.resolve('dynamically_linked.c'); + final debugCUri = dynamicallyLinkedSrcUri.resolve('debug.c'); + final mathCUri = dynamicallyLinkedSrcUri.resolve('math.c'); + + if (!await File.fromUri(dynamicallyLinkedCUri).exists()) { + throw Exception('Run the test from the root directory.'); + } + const name = 'dynamically_linked'; + + final logMessages = []; + final logger = createCapturingLogger(logMessages); + + final buildConfigBuilder = BuildConfigBuilder() + ..setupHookConfig( + buildAssetTypes: [CodeAsset.type], + packageName: name, + packageRoot: tempUri, + targetOS: OS.current, + buildMode: BuildMode.release, + ) + ..setupBuildConfig( + linkingEnabled: false, + dryRun: false, + ) + ..setupCodeConfig( + targetArchitecture: Architecture.current, + // Ignored by executables. + linkModePreference: LinkModePreference.dynamic, + cCompilerConfig: cCompiler, + ); + buildConfigBuilder.setupBuildRunConfig( + outputDirectory: tempUri, + outputDirectoryShared: tempUri2, + ); + final buildConfig = BuildConfig(buildConfigBuilder.json); + final buildOutput = BuildOutputBuilder(); + + final debugBuilder = CBuilder.library( + name: 'debug', + assetName: 'debug', + includes: [dynamicallyLinkedSrcUri.toFilePath()], + sources: [debugCUri.toFilePath()], + ); + + await debugBuilder.run( + config: buildConfig, + output: buildOutput, + logger: logger, + ); + + final debugLibraryFile = + File.fromUri(tempUri.resolve(OS.current.dylibFileName('debug'))); + final nestedDebugLibraryFile = File.fromUri( + tempUri.resolve('debug/').resolve(OS.current.dylibFileName('debug')), + ); + await nestedDebugLibraryFile.parent.create(recursive: true); + await debugLibraryFile.rename(nestedDebugLibraryFile.path); + + final mathBuilder = CBuilder.library( + name: 'math', + assetName: 'math', + includes: [dynamicallyLinkedSrcUri.toFilePath()], + sources: [mathCUri.toFilePath()], + libraries: ['debug'], + libraryDirectories: ['debug'], + ); + + await mathBuilder.run( + config: buildConfig, + output: buildOutput, + logger: logger, + ); + + await nestedDebugLibraryFile.rename(debugLibraryFile.path); + + final executableBuilder = CBuilder.executable( + name: name, + includes: [dynamicallyLinkedSrcUri.toFilePath()], + sources: [dynamicallyLinkedCUri.toFilePath()], + libraries: ['math'], + ); + + await executableBuilder.run( + config: buildConfig, + output: buildOutput, + logger: logger, + ); + + final executableUri = tempUri.resolve(OS.current.executableFileName(name)); + expect(await File.fromUri(executableUri).exists(), true); + final result = await runProcess( + executable: executableUri, + logger: logger, + ); + expect(result.exitCode, 0); + }); } Future testDefines({ diff --git a/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.c new file mode 100644 index 000000000..b840d62a5 --- /dev/null +++ b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.c @@ -0,0 +1,22 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include "debug.h" + +#ifdef DEBUG +#include +#include +#endif + +int debug_printf(const char* format, ...) { +#ifdef DEBUG + va_list args; + va_start(args, format); + int ret = vprintf(format, args); + va_end(args); + return ret; +#else + return 0; +#endif +} diff --git a/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.h b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.h new file mode 100644 index 000000000..557cba0d1 --- /dev/null +++ b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/debug.h @@ -0,0 +1,11 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#if _WIN32 +#define MYLIB_EXPORT __declspec(dllexport) +#else +#define MYLIB_EXPORT +#endif + +MYLIB_EXPORT int debug_printf(const char * format, ...); diff --git a/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/dynamically_linked.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/dynamically_linked.c new file mode 100644 index 000000000..c8cc6d94b --- /dev/null +++ b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/dynamically_linked.c @@ -0,0 +1,9 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include "math.h" + +int main() { + return math_add(1, 2) == 3 ? 0 : 1; +} diff --git a/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.c b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.c new file mode 100644 index 000000000..08313a5bb --- /dev/null +++ b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.c @@ -0,0 +1,11 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include "debug.h" +#include "math.h" + +int32_t math_add(int32_t a, int32_t b) { + debug_printf("Adding %i and %i.\n", a, b); + return a + b; +} diff --git a/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.h b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.h new file mode 100644 index 000000000..7d22a65c8 --- /dev/null +++ b/pkgs/native_toolchain_c/test/cbuilder/testfiles/dynamically_linked/src/math.h @@ -0,0 +1,13 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#include + +#if _WIN32 +#define MYLIB_EXPORT __declspec(dllexport) +#else +#define MYLIB_EXPORT +#endif + +MYLIB_EXPORT int32_t math_add(int32_t a, int32_t b); From e090b32f0db12f3ca078a30f654d052292dfa9ae Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 10 Dec 2024 10:15:16 +0100 Subject: [PATCH 36/50] [native_assets_builder] Remove dry run (#1788) --- pkgs/native_assets_builder/CHANGELOG.md | 9 +- .../lib/native_assets_builder.dart | 1 - .../lib/src/build_runner/build_runner.dart | 127 ----------- .../lib/src/model/build_dry_run_result.dart | 15 -- .../lib/src/model/hook_result.dart | 2 +- pkgs/native_assets_builder/pubspec.yaml | 2 +- .../build_runner_build_dry_run_test.dart | 84 ------- .../build_runner/build_runner_cycle_test.dart | 20 -- .../build_runner_reusability_test.dart | 18 +- .../test/build_runner/helpers.dart | 32 --- .../native_dynamic_linking_test.dart | 207 +++++++++--------- .../package_reading_metadata/hook/build.dart | 23 +- .../test_data/transformer/hook/build.dart | 26 +-- .../test_data/wrong_linker/hook/build.dart | 6 +- .../wrong_namespace_asset/hook/build.dart | 6 +- pkgs/native_assets_cli/CHANGELOG.md | 11 +- pkgs/native_assets_cli/pubspec.yaml | 4 +- 17 files changed, 139 insertions(+), 454 deletions(-) delete mode 100644 pkgs/native_assets_builder/lib/src/model/build_dry_run_result.dart delete mode 100644 pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart diff --git a/pkgs/native_assets_builder/CHANGELOG.md b/pkgs/native_assets_builder/CHANGELOG.md index 7f60b74ef..97f2bf472 100644 --- a/pkgs/native_assets_builder/CHANGELOG.md +++ b/pkgs/native_assets_builder/CHANGELOG.md @@ -1,10 +1,7 @@ -## 0.9.1-wip +## 0.10.0-wip -- **Breaking change**: Rename `supportedAssetTypes` to `buildAssetTypes`. Hooks - should no longer fail. Instead, the code should fail at runtime if an asset is - missing. This enables (1) code to run if an asset is missing but that code is - not invoked at runtime, and (2) doing fallback implementations in Dart if an - asset is missing. +- Removed support for dry run (Flutter no long requires it). +- Various fixes to caching. ## 0.9.0 diff --git a/pkgs/native_assets_builder/lib/native_assets_builder.dart b/pkgs/native_assets_builder/lib/native_assets_builder.dart index ec69de6cd..b71f7a6f2 100644 --- a/pkgs/native_assets_builder/lib/native_assets_builder.dart +++ b/pkgs/native_assets_builder/lib/native_assets_builder.dart @@ -3,7 +3,6 @@ // BSD-style license that can be found in the LICENSE file. export 'package:native_assets_builder/src/build_runner/build_runner.dart'; -export 'package:native_assets_builder/src/model/build_dry_run_result.dart'; export 'package:native_assets_builder/src/model/build_result.dart'; export 'package:native_assets_builder/src/model/kernel_assets.dart'; export 'package:native_assets_builder/src/model/link_result.dart'; diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index ef524724e..8390608cd 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -12,7 +12,6 @@ import 'package:package_config/package_config.dart'; import '../dependencies_hash_file/dependencies_hash_file.dart'; import '../locking/locking.dart'; -import '../model/build_dry_run_result.dart'; import '../model/build_result.dart'; import '../model/hook_result.dart'; import '../model/link_result.dart'; @@ -315,132 +314,6 @@ class NativeAssetsBuildRunner { return (buildDirUri, outDirUri, outDirSharedUri); } - /// [workingDirectory] is expected to contain `.dart_tool`. - /// - /// This method is invoked by launchers such as dartdev (for `dart run`) and - /// flutter_tools (for `flutter run` and `flutter build`). - /// - /// If provided, only native assets of all transitive dependencies of - /// [runPackageName] are built. - Future buildDryRun({ - required BuildConfigCreator configCreator, - required BuildValidator buildValidator, - required OS targetOS, - required Uri workingDirectory, - required bool linkingEnabled, - PackageLayout? packageLayout, - String? runPackageName, - required List buildAssetTypes, - }) => - _runDryRun( - targetOS: targetOS, - configCreator: configCreator, - validator: (HookConfig config, HookOutput output) => - buildValidator(config as BuildConfig, output as BuildOutput), - workingDirectory: workingDirectory, - packageLayout: packageLayout, - runPackageName: runPackageName, - buildAssetTypes: buildAssetTypes, - linkingEnabled: linkingEnabled, - ); - - Future _runDryRun({ - required BuildConfigCreator configCreator, - required _HookValidator validator, - required OS targetOS, - required Uri workingDirectory, - PackageLayout? packageLayout, - String? runPackageName, - required bool linkingEnabled, - required List buildAssetTypes, - }) async { - const hook = Hook.build; - - packageLayout ??= await PackageLayout.fromRootPackageRoot(workingDirectory); - final (buildPlan, _) = await _makePlan( - hook: hook, - packageLayout: packageLayout, - runPackageName: runPackageName, - ); - if (buildPlan == null) { - return null; - } - - var hookResult = HookResult(); - for (final package in buildPlan) { - final configBuilder = configCreator(); - configBuilder.setupHookConfig( - targetOS: targetOS, - buildAssetTypes: buildAssetTypes, - buildMode: null, // not set in dry-run mode - packageName: package.name, - packageRoot: packageLayout.packageRoot(package.name), - ); - configBuilder.setupBuildConfig( - dryRun: true, - linkingEnabled: linkingEnabled, - metadata: const {}, - ); - - final buildDirName = configBuilder.computeChecksum(); - final buildDirUri = - packageLayout.dartToolNativeAssetsBuilder.resolve('$buildDirName/'); - final outDirUri = buildDirUri.resolve('out/'); - final outDir = Directory.fromUri(outDirUri); - if (!await outDir.exists()) { - // TODO(https://dartbug.com/50565): Purge old or unused folders. - await outDir.create(recursive: true); - } - final outputDirectoryShared = packageLayout.dartToolNativeAssetsBuilder - .resolve('shared/${package.name}/$hook/'); - final outDirShared = Directory.fromUri(outputDirectoryShared); - if (!await outDirShared.exists()) { - // TODO(https://dartbug.com/50565): Purge old or unused folders. - await outDirShared.create(recursive: true); - } - configBuilder.setupBuildRunConfig( - outputDirectory: outDirUri, - outputDirectoryShared: outputDirectoryShared, - ); - - final config = BuildConfig(configBuilder.json); - final packageConfigUri = packageLayout.packageConfigUri; - final hookCompileResult = await _compileHookForPackageCached( - config.packageName, - config.outputDirectory, - config.packageRoot.resolve('hook/${hook.scriptName}'), - packageConfigUri, - workingDirectory, - ); - if (hookCompileResult == null) return null; - final (hookKernelFile, _) = hookCompileResult; - - // TODO(https://github.com/dart-lang/native/issues/1321): Should dry runs be cached? - final buildOutput = await runUnderDirectoriesLock( - [ - Directory.fromUri(config.outputDirectoryShared.parent), - Directory.fromUri(config.outputDirectory.parent), - ], - timeout: singleHookTimeout, - logger: logger, - () => _runHookForPackage( - hook, - config, - validator, - packageConfigUri, - workingDirectory, - null, - hookKernelFile, - packageLayout!, - _filteredEnvironment(_environmentVariablesFilter), - ), - ); - if (buildOutput == null) return null; - hookResult = hookResult.copyAdd(buildOutput, [/*dry run is not cached*/]); - } - return hookResult; - } - Future<(HookOutput, List)?> _runHookForPackageCached( Hook hook, HookConfig config, diff --git a/pkgs/native_assets_builder/lib/src/model/build_dry_run_result.dart b/pkgs/native_assets_builder/lib/src/model/build_dry_run_result.dart deleted file mode 100644 index 9863d2ba1..000000000 --- a/pkgs/native_assets_builder/lib/src/model/build_dry_run_result.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:native_assets_cli/native_assets_cli_internal.dart'; - -/// The result of executing the build hooks in dry run mode from all packages in -/// the dependency tree of the entry point application. -abstract interface class BuildDryRunResult { - /// The native assets produced by the hooks, which should be bundled. - List get encodedAssets; - - /// The native assets produced by the hooks, which should be linked. - Map> get encodedAssetsForLinking; -} diff --git a/pkgs/native_assets_builder/lib/src/model/hook_result.dart b/pkgs/native_assets_builder/lib/src/model/hook_result.dart index 655688a19..5a157f1a4 100644 --- a/pkgs/native_assets_builder/lib/src/model/hook_result.dart +++ b/pkgs/native_assets_builder/lib/src/model/hook_result.dart @@ -9,7 +9,7 @@ import '../../native_assets_builder.dart'; /// The result from a [NativeAssetsBuildRunner.build] or /// [NativeAssetsBuildRunner.link]. -final class HookResult implements BuildResult, BuildDryRunResult, LinkResult { +final class HookResult implements BuildResult, LinkResult { /// The native encodedAssets produced by the hooks, which should be bundled. @override final List encodedAssets; diff --git a/pkgs/native_assets_builder/pubspec.yaml b/pkgs/native_assets_builder/pubspec.yaml index 1eaaee1a1..e050da08c 100644 --- a/pkgs/native_assets_builder/pubspec.yaml +++ b/pkgs/native_assets_builder/pubspec.yaml @@ -1,7 +1,7 @@ name: native_assets_builder description: >- This package is the backend that invokes build hooks. -version: 0.9.1-wip +version: 0.10.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_builder publish_to: none diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart deleted file mode 100644 index caf8e980a..000000000 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_build_dry_run_test.dart +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'dart:io'; - -import 'package:file_testing/file_testing.dart'; -import 'package:test/test.dart'; - -import '../helpers.dart'; -import 'helpers.dart'; - -const Timeout longTimeout = Timeout(Duration(minutes: 5)); - -void main() async { - test('dry_run', timeout: longTimeout, () async { - await inTempDir((tempUri) async { - await copyTestProjects(targetUri: tempUri); - final packageUri = tempUri.resolve('native_add/'); - - await runPubGet( - workingDirectory: packageUri, - logger: logger, - ); - - final dryRunResult = (await buildDryRun( - packageUri, - logger, - dartExecutable, - linkingEnabled: false, - buildAssetTypes: [CodeAsset.type], - buildValidator: validateCodeAssetBuildOutput, - ))!; - final buildResult = (await build( - packageUri, - logger, - dartExecutable, - buildAssetTypes: [CodeAsset.type], - configValidator: validateCodeAssetBuildConfig, - buildValidator: validateCodeAssetBuildOutput, - applicationAssetValidator: validateCodeAssetInApplication, - ))!; - - expect(dryRunResult.encodedAssets.length, 1); - expect(buildResult.encodedAssets.length, 1); - - final dryRunAsset = dryRunResult.encodedAssets[0]; - expect(dryRunAsset.type, CodeAsset.type); - final dryRunCodeAsset = CodeAsset.fromEncoded(dryRunAsset); - - final buildAsset = buildResult.encodedAssets[0]; - final buildCodeAsset = CodeAsset.fromEncoded(buildAsset); - expect(buildAsset.type, CodeAsset.type); - - // Common across dry-run & build - expect(dryRunCodeAsset.id, buildCodeAsset.id); - expect(dryRunCodeAsset.os, buildCodeAsset.os); - expect(dryRunCodeAsset.linkMode, buildCodeAsset.linkMode); - expect(dryRunCodeAsset.file?.pathSegments.last, - buildCodeAsset.file?.pathSegments.last); - - // Different in dry-run: No architecture - expect(dryRunCodeAsset.architecture, isNull); - expect(buildCodeAsset.architecture, isNotNull); - - final nativeAssetsBuilderDirectory = - packageUri.resolve('.dart_tool/native_assets_builder/'); - final buildDirectories = - Directory.fromUri(nativeAssetsBuilderDirectory).list(); - await for (final directory in buildDirectories) { - if (directory is! Directory) { - expect( - File.fromUri(directory.uri.resolve('config.json')), - exists, - ); - expect( - File.fromUri(directory.uri.resolve('out/build_output.json')), - exists, - ); - } - } - }); - }); -} diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart index 17476eac1..7e3f3a75c 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_cycle_test.dart @@ -20,26 +20,6 @@ void main() async { workingDirectory: packageUri, logger: logger, ); - { - final logMessages = []; - final result = await buildDryRun( - packageUri, - createCapturingLogger(logMessages, level: Level.SEVERE), - dartExecutable, - linkingEnabled: false, - buildAssetTypes: [], - buildValidator: (config, output) async => [], - ); - final fullLog = logMessages.join('\n'); - expect(result, isNull); - expect( - fullLog, - contains( - 'Cyclic dependency for native asset builds in the following ' - 'packages: [cyclic_package_1, cyclic_package_2]', - ), - ); - } { final logMessages = []; diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index 193784b08..548276f29 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -11,7 +11,7 @@ import 'helpers.dart'; const Timeout longTimeout = Timeout(Duration(minutes: 5)); void main() async { - test('multiple dryRun and build invocations', timeout: longTimeout, () async { + test('multiple build invocations', timeout: longTimeout, () async { await inTempDir((tempUri) async { await copyTestProjects(targetUri: tempUri); final packageUri = tempUri.resolve('package_reading_metadata/'); @@ -33,22 +33,6 @@ void main() async { linkModePreference: LinkModePreference.dynamic, ); - await buildRunner.buildDryRun( - configCreator: configCreator, - targetOS: Target.current.os, - workingDirectory: packageUri, - linkingEnabled: false, - buildAssetTypes: [], - buildValidator: (config, output) async => [], - ); - await buildRunner.buildDryRun( - configCreator: configCreator, - targetOS: Target.current.os, - workingDirectory: packageUri, - linkingEnabled: false, - buildAssetTypes: [], - buildValidator: (config, output) async => [], - ); await buildRunner.build( configCreator: configCreator, targetOS: OS.current, diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index f252da7d4..56a54c445 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -265,38 +265,6 @@ Future runWithLog( return result; } -Future buildDryRun( - Uri packageUri, - Logger logger, - Uri dartExecutable, { - required BuildValidator buildValidator, - LinkModePreference linkModePreference = LinkModePreference.dynamic, - CCompilerConfig? cCompilerConfig, - List? capturedLogs, - PackageLayout? packageLayout, - required bool linkingEnabled, - required List buildAssetTypes, -}) async => - runWithLog(capturedLogs, () async { - final result = await NativeAssetsBuildRunner( - logger: logger, - dartExecutable: dartExecutable, - ).buildDryRun( - configCreator: () => BuildConfigBuilder() - ..setupCodeConfig( - targetArchitecture: null, - linkModePreference: linkModePreference, - ), - targetOS: Target.current.os, - workingDirectory: packageUri, - packageLayout: packageLayout, - linkingEnabled: linkingEnabled, - buildAssetTypes: buildAssetTypes, - buildValidator: buildValidator, - ); - return result; - }); - Future expectSymbols({ required CodeAsset asset, required List symbols, diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index c105e4552..eacf9e375 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -18,116 +18,109 @@ import '../helpers.dart'; void main() async { const name = 'native_dynamic_linking'; - for (final dryRun in [true, false]) { - final testSuffix = dryRun ? ' dry_run' : ''; - test( - 'native_dynamic_linking build$testSuffix', - () => inTempDir((tempUri) async { - final outputDirectory = tempUri.resolve('out/'); - await Directory.fromUri(outputDirectory).create(); - final outputDirectoryShared = tempUri.resolve('out_shared/'); - await Directory.fromUri(outputDirectoryShared).create(); - final testTempUri = tempUri.resolve('test1/'); - await Directory.fromUri(testTempUri).create(); - final testPackageUri = testDataUri.resolve('$name/'); - final dartUri = Uri.file(Platform.resolvedExecutable); + test( + 'native_dynamic_linking build', + () => inTempDir((tempUri) async { + final outputDirectory = tempUri.resolve('out/'); + await Directory.fromUri(outputDirectory).create(); + final outputDirectoryShared = tempUri.resolve('out_shared/'); + await Directory.fromUri(outputDirectoryShared).create(); + final testTempUri = tempUri.resolve('test1/'); + await Directory.fromUri(testTempUri).create(); + final testPackageUri = testDataUri.resolve('$name/'); + final dartUri = Uri.file(Platform.resolvedExecutable); - final configBuilder = BuildConfigBuilder() - ..setupHookConfig( - packageName: name, - packageRoot: testPackageUri, - targetOS: OS.current, - buildAssetTypes: [CodeAsset.type], - buildMode: dryRun ? null : BuildMode.debug) - ..setupBuildConfig(dryRun: dryRun, linkingEnabled: false) - ..setupBuildRunConfig( - outputDirectory: outputDirectory, - outputDirectoryShared: outputDirectoryShared) - ..setupCodeConfig( - targetArchitecture: dryRun ? null : Architecture.current, - linkModePreference: LinkModePreference.dynamic, - cCompilerConfig: dryRun ? null : cCompiler, - ); + final configBuilder = BuildConfigBuilder() + ..setupHookConfig( + packageName: name, + packageRoot: testPackageUri, + targetOS: OS.current, + buildAssetTypes: [CodeAsset.type], + buildMode: BuildMode.debug) + ..setupBuildConfig(dryRun: false, linkingEnabled: false) + ..setupBuildRunConfig( + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared) + ..setupCodeConfig( + targetArchitecture: Architecture.current, + linkModePreference: LinkModePreference.dynamic, + cCompilerConfig: cCompiler, + ); - final buildConfigUri = testTempUri.resolve('build_config.json'); - File.fromUri(buildConfigUri) - .writeAsStringSync(jsonEncode(configBuilder.json)); + final buildConfigUri = testTempUri.resolve('build_config.json'); + File.fromUri(buildConfigUri) + .writeAsStringSync(jsonEncode(configBuilder.json)); - final processResult = await Process.run( - dartUri.toFilePath(), - [ - 'hook/build.dart', - '--config=${buildConfigUri.toFilePath()}', - ], - workingDirectory: testPackageUri.toFilePath(), - ); - if (processResult.exitCode != 0) { - print(processResult.stdout); - print(processResult.stderr); - print(processResult.exitCode); - } - expect(processResult.exitCode, 0); + final processResult = await Process.run( + dartUri.toFilePath(), + [ + 'hook/build.dart', + '--config=${buildConfigUri.toFilePath()}', + ], + workingDirectory: testPackageUri.toFilePath(), + ); + if (processResult.exitCode != 0) { + print(processResult.stdout); + print(processResult.stderr); + print(processResult.exitCode); + } + expect(processResult.exitCode, 0); + + final buildOutputUri = outputDirectory.resolve('build_output.json'); + final buildOutput = BuildOutput( + json.decode(await File.fromUri(buildOutputUri).readAsString()) + as Map); + final assets = buildOutput.encodedAssets; + final dependencies = buildOutput.dependencies; - final buildOutputUri = outputDirectory.resolve('build_output.json'); - final buildOutput = BuildOutput( - json.decode(await File.fromUri(buildOutputUri).readAsString()) - as Map); - final assets = buildOutput.encodedAssets; - final dependencies = buildOutput.dependencies; - if (dryRun) { - expect(assets.length, greaterThanOrEqualTo(3)); - expect(dependencies, []); - } else { - expect(assets.length, 3); - expect(await assets.allExist(), true); - expect( - dependencies, - [ - testPackageUri.resolve('src/debug.c'), - testPackageUri.resolve('src/math.c'), - testPackageUri.resolve('src/add.c'), - ], - ); + expect(assets.length, 3); + expect(await assets.allExist(), true); + expect( + dependencies, + [ + testPackageUri.resolve('src/debug.c'), + testPackageUri.resolve('src/math.c'), + testPackageUri.resolve('src/add.c'), + ], + ); - final addLibraryPath = assets - .where((e) => e.type == CodeAsset.type) - .map(CodeAsset.fromEncoded) - .firstWhere((asset) => asset.id.endsWith('add.dart')) - .file! - .toFilePath(); - final addResult = await runProcess( - executable: dartExecutable, - arguments: [ - 'run', - pkgNativeAssetsBuilderUri - .resolve('test/test_data/native_dynamic_linking_helper.dart') - .toFilePath(), - addLibraryPath, - '1', - '2', - ], - environment: { - // Add the directory containing the linked dynamic libraries to - // the PATH so that the dynamic linker can find them. - // TODO(https://github.com/dart-lang/sdk/issues/56551): We could - // skip this if Dart would implicitly add dylib containing - // directories to the PATH. - if (Platform.isWindows) - 'PATH': '${outputDirectory.toFilePath()};' - '${Platform.environment['PATH']}', - }, - throwOnUnexpectedExitCode: true, - logger: logger, - ); - expect( - addResult.stdout, - allOf( - contains('Adding 1 and 2.'), - contains('Result: 3'), - ), - ); - } - }), - ); - } + final addLibraryPath = assets + .where((e) => e.type == CodeAsset.type) + .map(CodeAsset.fromEncoded) + .firstWhere((asset) => asset.id.endsWith('add.dart')) + .file! + .toFilePath(); + final addResult = await runProcess( + executable: dartExecutable, + arguments: [ + 'run', + pkgNativeAssetsBuilderUri + .resolve('test/test_data/native_dynamic_linking_helper.dart') + .toFilePath(), + addLibraryPath, + '1', + '2', + ], + environment: { + // Add the directory containing the linked dynamic libraries to + // the PATH so that the dynamic linker can find them. + // TODO(https://github.com/dart-lang/sdk/issues/56551): We could + // skip this if Dart would implicitly add dylib containing + // directories to the PATH. + if (Platform.isWindows) + 'PATH': '${outputDirectory.toFilePath()};' + '${Platform.environment['PATH']}', + }, + throwOnUnexpectedExitCode: true, + logger: logger, + ); + expect( + addResult.stdout, + allOf( + contains('Adding 1 and 2.'), + contains('Result: 3'), + ), + ); + }), + ); } diff --git a/pkgs/native_assets_builder/test_data/package_reading_metadata/hook/build.dart b/pkgs/native_assets_builder/test_data/package_reading_metadata/hook/build.dart index 5ae35355f..148fb9b6b 100644 --- a/pkgs/native_assets_builder/test_data/package_reading_metadata/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/package_reading_metadata/hook/build.dart @@ -8,19 +8,14 @@ import 'package:native_assets_cli/native_assets_cli.dart'; void main(List args) async { await build(args, (buildConfig, _) async { - if (!buildConfig.dryRun) { - final someValue = - buildConfig.metadatum('package_with_metadata', 'some_key'); - assert(someValue != null); - final someInt = - buildConfig.metadatum('package_with_metadata', 'some_int'); - assert(someInt != null); - print({ - 'some_int': someInt, - 'some_key': someValue, - }); - } else { - print('meta data not available in dry run'); - } + final someValue = + buildConfig.metadatum('package_with_metadata', 'some_key'); + assert(someValue != null); + final someInt = buildConfig.metadatum('package_with_metadata', 'some_int'); + assert(someInt != null); + print({ + 'some_int': someInt, + 'some_key': someValue, + }); }); } diff --git a/pkgs/native_assets_builder/test_data/transformer/hook/build.dart b/pkgs/native_assets_builder/test_data/transformer/hook/build.dart index 1a2ff86e6..53fba9533 100644 --- a/pkgs/native_assets_builder/test_data/transformer/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/transformer/hook/build.dart @@ -28,17 +28,14 @@ void main(List arguments) async { final targetFile = File.fromUri(config.outputDirectoryShared .resolve(sourceName.replaceFirst('data', 'data_transformed'))); - // ignore: deprecated_member_use - if (!config.dryRun) { - // TODO(dacoharkes): Timestamps are not enough for correct caching. - if (!await targetFile.exists() || - !(await sourceFile.lastModified()) - .isBefore(await targetFile.lastModified())) { - await transformFile(sourceFile, targetFile); - transformedFiles++; - } else { - cachedFiles++; - } + // TODO(dacoharkes): Timestamps are not enough for correct caching. + if (!await targetFile.exists() || + !(await sourceFile.lastModified()) + .isBefore(await targetFile.lastModified())) { + await transformFile(sourceFile, targetFile); + transformedFiles++; + } else { + cachedFiles++; } output.dataAssets.add( @@ -53,10 +50,7 @@ void main(List arguments) async { ); } - // ignore: deprecated_member_use - if (!config.dryRun) { - print('Transformed $transformedFiles files.'); - print('Reused $cachedFiles cached files.'); - } + print('Transformed $transformedFiles files.'); + print('Reused $cachedFiles cached files.'); }); } diff --git a/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart index 4f1509250..e0d486071 100644 --- a/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_linker/hook/build.dart @@ -11,10 +11,8 @@ void main(List arguments) async { final assetUri = config.outputDirectory.resolve( OS.current.dylibFileName('foo'), ); - // ignore: deprecated_member_use - if (!config.dryRun) { - await File.fromUri(assetUri).writeAsBytes([1, 2, 3]); - } + + await File.fromUri(assetUri).writeAsBytes([1, 2, 3]); output.codeAssets.add( CodeAsset( diff --git a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart index 1ce65d36f..f776f1aa1 100644 --- a/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/wrong_namespace_asset/hook/build.dart @@ -11,10 +11,8 @@ void main(List arguments) async { final assetUri = config.outputDirectory.resolve( OS.current.dylibFileName('foo'), ); - // ignore: deprecated_member_use - if (!config.dryRun) { - await File.fromUri(assetUri).writeAsBytes([1, 2, 3]); - } + + await File.fromUri(assetUri).writeAsBytes([1, 2, 3]); output.codeAssets.add( CodeAsset( diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index 76345f3a3..3b7baec21 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -1,6 +1,11 @@ -## 0.9.1-wip - -- Update pubspec.yaml of examples to use 0.9.0 of package:native_assets_cli +## 0.10.0-wip + +- **Breaking change**: Rename `supportedAssetTypes` to `buildAssetTypes`. Hooks + should no longer fail. Instead, the code should fail at runtime if an asset is + missing. This enables (1) code to run if an asset is missing but that code is + not invoked at runtime, and (2) doing fallback implementations in Dart if an + asset is missing. +- Update pubspec.yaml of examples to use 0.9.0 of `package:native_assets_cli`. - Consolidate [CodeAsset] specific things into `lib/src/code_assets/*` ## 0.9.0 diff --git a/pkgs/native_assets_cli/pubspec.yaml b/pkgs/native_assets_cli/pubspec.yaml index cdc0cf5e0..193e6783e 100644 --- a/pkgs/native_assets_cli/pubspec.yaml +++ b/pkgs/native_assets_cli/pubspec.yaml @@ -4,7 +4,7 @@ description: >- native assets CLI. # Note: Bump BuildConfig.version and BuildOutput.version on breaking changes! -version: 0.9.1-wip +version: 0.10.0-wip repository: https://github.com/dart-lang/native/tree/main/pkgs/native_assets_cli publish_to: none @@ -24,7 +24,7 @@ dependencies: meta: ^1.15.0 pub_semver: ^2.1.3 test: ^1.25.7 - yaml: ^3.1.2 # Used for reading pubspec.yaml to obtain the package name + yaml: ^3.1.2 # Used for reading pubspec.yaml to obtain the package name dev_dependencies: dart_flutter_team_lints: ^2.1.1 From da5dc148a0430b6c4224b59178db5385d79b2298 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 10 Dec 2024 10:15:35 +0100 Subject: [PATCH 37/50] [native_assets_builder] If dill file is equal, don't invalidate cache (#1789) --- .../lib/src/build_runner/build_runner.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 8390608cd..3fccab6c1 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -407,8 +407,9 @@ ${e.message} final modifiedDuringBuild = await dependenciesHashes.hashDependencies( [ ...result.dependencies, - // Also depend on the hook source code. - hookHashes.file.uri, + // Also depend on the compiled hook. Don't depend on the sources, + // if only whitespace changes, we don't need to rerun the hook. + hookKernelFile.uri, ], lastModifiedCutoffTime, environment, From d37df9c2d1c6ec1864b2d85c028a5c5c043b2a61 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Tue, 10 Dec 2024 12:00:36 +0100 Subject: [PATCH 38/50] [jnigen] Use dollar signs for nested class name separator (#1791) * Close #1516 --- pkgs/jnigen/CHANGELOG.md | 2 + pkgs/jnigen/doc/java_differences.md | 24 + .../in_app_java/lib/android_utils.dart | 1174 ++++++++--------- pkgs/jnigen/lib/src/bindings/renamer.dart | 20 +- pkgs/jnigen/lib/src/elements/elements.dart | 11 +- .../fasterxml/jackson/core/JsonFactory.dart | 78 +- .../fasterxml/jackson/core/JsonParser.dart | 136 +- .../test/kotlin_test/bindings/kotlin.dart | 56 +- .../kotlin_test/runtime_test_registrant.dart | 2 +- pkgs/jnigen/test/renamer_test.dart | 40 +- .../bindings/simple_package.dart | 688 +++++----- .../runtime_test_registrant.dart | 8 +- pkgs/jnigen/test/summary_test.dart | 2 +- 13 files changed, 1157 insertions(+), 1084 deletions(-) diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index d6d7ee1a0..a1838deaf 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -1,5 +1,7 @@ ## 0.13.0-wip +- **Breaking Change**([#1516](https://github.com/dart-lang/native/issues/1516)): + Inner classes are now generated as `OuterClass$InnerClass`. - **Breaking Change**([#1644](https://github.com/dart-lang/native/issues/1644)): Generate null-safe Dart bindings for Java and Kotlin. - Fixed a potential name collision when generating in multi-file mode. diff --git a/pkgs/jnigen/doc/java_differences.md b/pkgs/jnigen/doc/java_differences.md index 18528c88f..2afd6f0d0 100644 --- a/pkgs/jnigen/doc/java_differences.md +++ b/pkgs/jnigen/doc/java_differences.md @@ -213,3 +213,27 @@ class $_Example extends JObject { void $_printMessage() { /* ... */ } } ``` + +### Inner classes + +Java has the concept of inner classes, while Dart does not. Therefore, inner +classes are generated as separate classes named using the name of their +outer-class followed by a dollar sign (`$`) followed by their original name. + +For example: + +```java +// Java +public class Outer { + public class Inner {} +} +``` + +will be turned into: + +```dart +// Dart Bindings - Boilerplate omitted for clarity. +class Outer extends JObject {} + +class Outer$Inner extends JObject {} +``` diff --git a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart index 0a94169a3..da495471b 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -36,13 +36,13 @@ import 'package:jni/_internal.dart' as jni$_; import 'package:jni/jni.dart' as jni$_; /// from: `com.example.in_app_java.R$drawable` -class R_drawable extends jni$_.JObject { +class R$drawable extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - R_drawable.fromReference( + R$drawable.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -51,8 +51,8 @@ class R_drawable extends jni$_.JObject { jni$_.JClass.forName(r'com/example/in_app_java/R$drawable'); /// The type which includes information such as the signature of this class. - static const nullableType = $R_drawable$NullableType(); - static const type = $R_drawable$Type(); + static const nullableType = $R$drawable$NullableType(); + static const type = $R$drawable$Type(); static final _id_launch_background = _class.staticFieldId( r'launch_background', r'I', @@ -67,9 +67,9 @@ class R_drawable extends jni$_.JObject { _id_launch_background.set(_class, const jni$_.jintType(), value); } -final class $R_drawable$NullableType extends jni$_.JObjType { +final class $R$drawable$NullableType extends jni$_.JObjType { @jni$_.internal - const $R_drawable$NullableType(); + const $R$drawable$NullableType(); @jni$_.internal @core$_.override @@ -77,9 +77,9 @@ final class $R_drawable$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - R_drawable? fromReference(jni$_.JReference reference) => reference.isNull + R$drawable? fromReference(jni$_.JReference reference) => reference.isNull ? null - : R_drawable.fromReference( + : R$drawable.fromReference( reference, ); @jni$_.internal @@ -88,25 +88,25 @@ final class $R_drawable$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($R_drawable$NullableType).hashCode; + int get hashCode => ($R$drawable$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($R_drawable$NullableType) && - other is $R_drawable$NullableType; + return other.runtimeType == ($R$drawable$NullableType) && + other is $R$drawable$NullableType; } } -final class $R_drawable$Type extends jni$_.JObjType { +final class $R$drawable$Type extends jni$_.JObjType { @jni$_.internal - const $R_drawable$Type(); + const $R$drawable$Type(); @jni$_.internal @core$_.override @@ -114,8 +114,8 @@ final class $R_drawable$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - R_drawable fromReference(jni$_.JReference reference) => - R_drawable.fromReference( + R$drawable fromReference(jni$_.JReference reference) => + R$drawable.fromReference( reference, ); @jni$_.internal @@ -124,30 +124,30 @@ final class $R_drawable$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $R_drawable$NullableType(); + jni$_.JObjType get nullableType => + const $R$drawable$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($R_drawable$Type).hashCode; + int get hashCode => ($R$drawable$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($R_drawable$Type) && other is $R_drawable$Type; + return other.runtimeType == ($R$drawable$Type) && other is $R$drawable$Type; } } /// from: `com.example.in_app_java.R$mipmap` -class R_mipmap extends jni$_.JObject { +class R$mipmap extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - R_mipmap.fromReference( + R$mipmap.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -156,8 +156,8 @@ class R_mipmap extends jni$_.JObject { jni$_.JClass.forName(r'com/example/in_app_java/R$mipmap'); /// The type which includes information such as the signature of this class. - static const nullableType = $R_mipmap$NullableType(); - static const type = $R_mipmap$Type(); + static const nullableType = $R$mipmap$NullableType(); + static const type = $R$mipmap$Type(); static final _id_ic_launcher = _class.staticFieldId( r'ic_launcher', r'I', @@ -172,9 +172,9 @@ class R_mipmap extends jni$_.JObject { _id_ic_launcher.set(_class, const jni$_.jintType(), value); } -final class $R_mipmap$NullableType extends jni$_.JObjType { +final class $R$mipmap$NullableType extends jni$_.JObjType { @jni$_.internal - const $R_mipmap$NullableType(); + const $R$mipmap$NullableType(); @jni$_.internal @core$_.override @@ -182,9 +182,9 @@ final class $R_mipmap$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - R_mipmap? fromReference(jni$_.JReference reference) => reference.isNull + R$mipmap? fromReference(jni$_.JReference reference) => reference.isNull ? null - : R_mipmap.fromReference( + : R$mipmap.fromReference( reference, ); @jni$_.internal @@ -193,25 +193,25 @@ final class $R_mipmap$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($R_mipmap$NullableType).hashCode; + int get hashCode => ($R$mipmap$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($R_mipmap$NullableType) && - other is $R_mipmap$NullableType; + return other.runtimeType == ($R$mipmap$NullableType) && + other is $R$mipmap$NullableType; } } -final class $R_mipmap$Type extends jni$_.JObjType { +final class $R$mipmap$Type extends jni$_.JObjType { @jni$_.internal - const $R_mipmap$Type(); + const $R$mipmap$Type(); @jni$_.internal @core$_.override @@ -219,7 +219,7 @@ final class $R_mipmap$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - R_mipmap fromReference(jni$_.JReference reference) => R_mipmap.fromReference( + R$mipmap fromReference(jni$_.JReference reference) => R$mipmap.fromReference( reference, ); @jni$_.internal @@ -228,29 +228,29 @@ final class $R_mipmap$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => const $R_mipmap$NullableType(); + jni$_.JObjType get nullableType => const $R$mipmap$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($R_mipmap$Type).hashCode; + int get hashCode => ($R$mipmap$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($R_mipmap$Type) && other is $R_mipmap$Type; + return other.runtimeType == ($R$mipmap$Type) && other is $R$mipmap$Type; } } /// from: `com.example.in_app_java.R$style` -class R_style extends jni$_.JObject { +class R$style extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - R_style.fromReference( + R$style.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -259,8 +259,8 @@ class R_style extends jni$_.JObject { jni$_.JClass.forName(r'com/example/in_app_java/R$style'); /// The type which includes information such as the signature of this class. - static const nullableType = $R_style$NullableType(); - static const type = $R_style$Type(); + static const nullableType = $R$style$NullableType(); + static const type = $R$style$Type(); static final _id_LaunchTheme = _class.staticFieldId( r'LaunchTheme', r'I', @@ -288,9 +288,9 @@ class R_style extends jni$_.JObject { _id_NormalTheme.set(_class, const jni$_.jintType(), value); } -final class $R_style$NullableType extends jni$_.JObjType { +final class $R$style$NullableType extends jni$_.JObjType { @jni$_.internal - const $R_style$NullableType(); + const $R$style$NullableType(); @jni$_.internal @core$_.override @@ -298,9 +298,9 @@ final class $R_style$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - R_style? fromReference(jni$_.JReference reference) => reference.isNull + R$style? fromReference(jni$_.JReference reference) => reference.isNull ? null - : R_style.fromReference( + : R$style.fromReference( reference, ); @jni$_.internal @@ -309,25 +309,25 @@ final class $R_style$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($R_style$NullableType).hashCode; + int get hashCode => ($R$style$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($R_style$NullableType) && - other is $R_style$NullableType; + return other.runtimeType == ($R$style$NullableType) && + other is $R$style$NullableType; } } -final class $R_style$Type extends jni$_.JObjType { +final class $R$style$Type extends jni$_.JObjType { @jni$_.internal - const $R_style$Type(); + const $R$style$Type(); @jni$_.internal @core$_.override @@ -335,7 +335,7 @@ final class $R_style$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - R_style fromReference(jni$_.JReference reference) => R_style.fromReference( + R$style fromReference(jni$_.JReference reference) => R$style.fromReference( reference, ); @jni$_.internal @@ -344,18 +344,18 @@ final class $R_style$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => const $R_style$NullableType(); + jni$_.JObjType get nullableType => const $R$style$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($R_style$Type).hashCode; + int get hashCode => ($R$style$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($R_style$Type) && other is $R_style$Type; + return other.runtimeType == ($R$style$Type) && other is $R$style$Type; } } @@ -449,13 +449,13 @@ final class $R$Type extends jni$_.JObjType { } /// from: `androidx.emoji2.text.EmojiCompat$CodepointSequenceMatchResult` -class EmojiCompat_CodepointSequenceMatchResult extends jni$_.JObject { +class EmojiCompat$CodepointSequenceMatchResult extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_CodepointSequenceMatchResult.fromReference( + EmojiCompat$CodepointSequenceMatchResult.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -465,11 +465,11 @@ class EmojiCompat_CodepointSequenceMatchResult extends jni$_.JObject { /// The type which includes information such as the signature of this class. static const nullableType = - $EmojiCompat_CodepointSequenceMatchResult$NullableType(); - static const type = $EmojiCompat_CodepointSequenceMatchResult$Type(); + $EmojiCompat$CodepointSequenceMatchResult$NullableType(); + static const type = $EmojiCompat$CodepointSequenceMatchResult$Type(); /// Maps a specific port to the implemented interface. - static final core$_.Map + static final core$_.Map _$impls = {}; static jni$_.JObjectPtr _$invoke( int port, @@ -507,7 +507,7 @@ class EmojiCompat_CodepointSequenceMatchResult extends jni$_.JObject { static void implementIn( jni$_.JImplementer implementer, - $EmojiCompat_CodepointSequenceMatchResult $impl, + $EmojiCompat$CodepointSequenceMatchResult $impl, ) { late final jni$_.RawReceivePort $p; $p = jni$_.RawReceivePort(($m) { @@ -530,31 +530,31 @@ class EmojiCompat_CodepointSequenceMatchResult extends jni$_.JObject { _$impls[$a] = $impl; } - factory EmojiCompat_CodepointSequenceMatchResult.implement( - $EmojiCompat_CodepointSequenceMatchResult $impl, + factory EmojiCompat$CodepointSequenceMatchResult.implement( + $EmojiCompat$CodepointSequenceMatchResult $impl, ) { final $i = jni$_.JImplementer(); implementIn($i, $impl); - return EmojiCompat_CodepointSequenceMatchResult.fromReference( + return EmojiCompat$CodepointSequenceMatchResult.fromReference( $i.implementReference(), ); } } -abstract base mixin class $EmojiCompat_CodepointSequenceMatchResult { - factory $EmojiCompat_CodepointSequenceMatchResult() = - _$EmojiCompat_CodepointSequenceMatchResult; +abstract base mixin class $EmojiCompat$CodepointSequenceMatchResult { + factory $EmojiCompat$CodepointSequenceMatchResult() = + _$EmojiCompat$CodepointSequenceMatchResult; } -final class _$EmojiCompat_CodepointSequenceMatchResult - with $EmojiCompat_CodepointSequenceMatchResult { - _$EmojiCompat_CodepointSequenceMatchResult(); +final class _$EmojiCompat$CodepointSequenceMatchResult + with $EmojiCompat$CodepointSequenceMatchResult { + _$EmojiCompat$CodepointSequenceMatchResult(); } -final class $EmojiCompat_CodepointSequenceMatchResult$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$CodepointSequenceMatchResult$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_CodepointSequenceMatchResult$NullableType(); + const $EmojiCompat$CodepointSequenceMatchResult$NullableType(); @jni$_.internal @core$_.override @@ -563,11 +563,11 @@ final class $EmojiCompat_CodepointSequenceMatchResult$NullableType @jni$_.internal @core$_.override - EmojiCompat_CodepointSequenceMatchResult? fromReference( + EmojiCompat$CodepointSequenceMatchResult? fromReference( jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_CodepointSequenceMatchResult.fromReference( + : EmojiCompat$CodepointSequenceMatchResult.fromReference( reference, ); @jni$_.internal @@ -576,7 +576,7 @@ final class $EmojiCompat_CodepointSequenceMatchResult$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => + jni$_.JObjType get nullableType => this; @jni$_.internal @@ -585,20 +585,20 @@ final class $EmojiCompat_CodepointSequenceMatchResult$NullableType @core$_.override int get hashCode => - ($EmojiCompat_CodepointSequenceMatchResult$NullableType).hashCode; + ($EmojiCompat$CodepointSequenceMatchResult$NullableType).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_CodepointSequenceMatchResult$NullableType) && - other is $EmojiCompat_CodepointSequenceMatchResult$NullableType; + ($EmojiCompat$CodepointSequenceMatchResult$NullableType) && + other is $EmojiCompat$CodepointSequenceMatchResult$NullableType; } } -final class $EmojiCompat_CodepointSequenceMatchResult$Type - extends jni$_.JObjType { +final class $EmojiCompat$CodepointSequenceMatchResult$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_CodepointSequenceMatchResult$Type(); + const $EmojiCompat$CodepointSequenceMatchResult$Type(); @jni$_.internal @core$_.override @@ -607,9 +607,9 @@ final class $EmojiCompat_CodepointSequenceMatchResult$Type @jni$_.internal @core$_.override - EmojiCompat_CodepointSequenceMatchResult fromReference( + EmojiCompat$CodepointSequenceMatchResult fromReference( jni$_.JReference reference) => - EmojiCompat_CodepointSequenceMatchResult.fromReference( + EmojiCompat$CodepointSequenceMatchResult.fromReference( reference, ); @jni$_.internal @@ -618,32 +618,32 @@ final class $EmojiCompat_CodepointSequenceMatchResult$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_CodepointSequenceMatchResult$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$CodepointSequenceMatchResult$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_CodepointSequenceMatchResult$Type).hashCode; + int get hashCode => ($EmojiCompat$CodepointSequenceMatchResult$Type).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_CodepointSequenceMatchResult$Type) && - other is $EmojiCompat_CodepointSequenceMatchResult$Type; + ($EmojiCompat$CodepointSequenceMatchResult$Type) && + other is $EmojiCompat$CodepointSequenceMatchResult$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$Config` -class EmojiCompat_Config extends jni$_.JObject { +class EmojiCompat$Config extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_Config.fromReference( + EmojiCompat$Config.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -652,8 +652,8 @@ class EmojiCompat_Config extends jni$_.JObject { jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$Config'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_Config$NullableType(); - static const type = $EmojiCompat_Config$Type(); + static const nullableType = $EmojiCompat$Config$NullableType(); + static const type = $EmojiCompat$Config$Type(); static final _id_registerInitCallback = _class.instanceMethodId( r'registerInitCallback', r'(Landroidx/emoji2/text/EmojiCompat$InitCallback;)Landroidx/emoji2/text/EmojiCompat$Config;', @@ -672,15 +672,15 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? registerInitCallback( - EmojiCompat_InitCallback? initCallback, + EmojiCompat$Config? registerInitCallback( + EmojiCompat$InitCallback? initCallback, ) { final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; return _registerInitCallback( reference.pointer, _id_registerInitCallback as jni$_.JMethodIDPtr, _$initCallback.pointer) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_unregisterInitCallback = _class.instanceMethodId( @@ -701,15 +701,15 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? unregisterInitCallback( - EmojiCompat_InitCallback? initCallback, + EmojiCompat$Config? unregisterInitCallback( + EmojiCompat$InitCallback? initCallback, ) { final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; return _unregisterInitCallback( reference.pointer, _id_unregisterInitCallback as jni$_.JMethodIDPtr, _$initCallback.pointer) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setReplaceAll = _class.instanceMethodId( @@ -729,12 +729,12 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setReplaceAll(boolean z)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setReplaceAll( + EmojiCompat$Config? setReplaceAll( bool z, ) { return _setReplaceAll(reference.pointer, _id_setReplaceAll as jni$_.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setUseEmojiAsDefaultStyle = _class.instanceMethodId( @@ -754,12 +754,12 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setUseEmojiAsDefaultStyle( + EmojiCompat$Config? setUseEmojiAsDefaultStyle( bool z, ) { return _setUseEmojiAsDefaultStyle(reference.pointer, _id_setUseEmojiAsDefaultStyle as jni$_.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setUseEmojiAsDefaultStyle$1 = _class.instanceMethodId( @@ -784,7 +784,7 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z, java.util.List list)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setUseEmojiAsDefaultStyle$1( + EmojiCompat$Config? setUseEmojiAsDefaultStyle$1( bool z, jni$_.JList? list, ) { @@ -794,7 +794,7 @@ class EmojiCompat_Config extends jni$_.JObject { _id_setUseEmojiAsDefaultStyle$1 as jni$_.JMethodIDPtr, z ? 1 : 0, _$list.pointer) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setEmojiSpanIndicatorEnabled = _class.instanceMethodId( @@ -814,12 +814,12 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorEnabled(boolean z)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setEmojiSpanIndicatorEnabled( + EmojiCompat$Config? setEmojiSpanIndicatorEnabled( bool z, ) { return _setEmojiSpanIndicatorEnabled(reference.pointer, _id_setEmojiSpanIndicatorEnabled as jni$_.JMethodIDPtr, z ? 1 : 0) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setEmojiSpanIndicatorColor = _class.instanceMethodId( @@ -839,12 +839,12 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setEmojiSpanIndicatorColor(int i)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setEmojiSpanIndicatorColor( + EmojiCompat$Config? setEmojiSpanIndicatorColor( int i, ) { return _setEmojiSpanIndicatorColor(reference.pointer, _id_setEmojiSpanIndicatorColor as jni$_.JMethodIDPtr, i) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setMetadataLoadStrategy = _class.instanceMethodId( @@ -864,12 +864,12 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setMetadataLoadStrategy(int i)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setMetadataLoadStrategy( + EmojiCompat$Config? setMetadataLoadStrategy( int i, ) { return _setMetadataLoadStrategy(reference.pointer, _id_setMetadataLoadStrategy as jni$_.JMethodIDPtr, i) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setSpanFactory = _class.instanceMethodId( @@ -890,13 +890,13 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setSpanFactory(androidx.emoji2.text.EmojiCompat$SpanFactory spanFactory)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setSpanFactory( - EmojiCompat_SpanFactory? spanFactory, + EmojiCompat$Config? setSpanFactory( + EmojiCompat$SpanFactory? spanFactory, ) { final _$spanFactory = spanFactory?.reference ?? jni$_.jNullReference; return _setSpanFactory(reference.pointer, _id_setSpanFactory as jni$_.JMethodIDPtr, _$spanFactory.pointer) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } static final _id_setGlyphChecker = _class.instanceMethodId( @@ -917,20 +917,20 @@ class EmojiCompat_Config extends jni$_.JObject { /// from: `public androidx.emoji2.text.EmojiCompat$Config setGlyphChecker(androidx.emoji2.text.EmojiCompat$GlyphChecker glyphChecker)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? setGlyphChecker( - EmojiCompat_GlyphChecker? glyphChecker, + EmojiCompat$Config? setGlyphChecker( + EmojiCompat$GlyphChecker? glyphChecker, ) { final _$glyphChecker = glyphChecker?.reference ?? jni$_.jNullReference; return _setGlyphChecker(reference.pointer, _id_setGlyphChecker as jni$_.JMethodIDPtr, _$glyphChecker.pointer) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } } -final class $EmojiCompat_Config$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$Config$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_Config$NullableType(); + const $EmojiCompat$Config$NullableType(); @jni$_.internal @core$_.override @@ -938,10 +938,10 @@ final class $EmojiCompat_Config$NullableType @jni$_.internal @core$_.override - EmojiCompat_Config? fromReference(jni$_.JReference reference) => + EmojiCompat$Config? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_Config.fromReference( + : EmojiCompat$Config.fromReference( reference, ); @jni$_.internal @@ -950,26 +950,26 @@ final class $EmojiCompat_Config$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_Config$NullableType).hashCode; + int get hashCode => ($EmojiCompat$Config$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_Config$NullableType) && - other is $EmojiCompat_Config$NullableType; + return other.runtimeType == ($EmojiCompat$Config$NullableType) && + other is $EmojiCompat$Config$NullableType; } } -final class $EmojiCompat_Config$Type - extends jni$_.JObjType { +final class $EmojiCompat$Config$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_Config$Type(); + const $EmojiCompat$Config$Type(); @jni$_.internal @core$_.override @@ -977,8 +977,8 @@ final class $EmojiCompat_Config$Type @jni$_.internal @core$_.override - EmojiCompat_Config fromReference(jni$_.JReference reference) => - EmojiCompat_Config.fromReference( + EmojiCompat$Config fromReference(jni$_.JReference reference) => + EmojiCompat$Config.fromReference( reference, ); @jni$_.internal @@ -987,31 +987,31 @@ final class $EmojiCompat_Config$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_Config$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$Config$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_Config$Type).hashCode; + int get hashCode => ($EmojiCompat$Config$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_Config$Type) && - other is $EmojiCompat_Config$Type; + return other.runtimeType == ($EmojiCompat$Config$Type) && + other is $EmojiCompat$Config$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$DefaultSpanFactory` -class EmojiCompat_DefaultSpanFactory extends jni$_.JObject { +class EmojiCompat$DefaultSpanFactory extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_DefaultSpanFactory.fromReference( + EmojiCompat$DefaultSpanFactory.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -1020,8 +1020,8 @@ class EmojiCompat_DefaultSpanFactory extends jni$_.JObject { r'androidx/emoji2/text/EmojiCompat$DefaultSpanFactory'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_DefaultSpanFactory$NullableType(); - static const type = $EmojiCompat_DefaultSpanFactory$Type(); + static const nullableType = $EmojiCompat$DefaultSpanFactory$NullableType(); + static const type = $EmojiCompat$DefaultSpanFactory$Type(); static final _id_new$ = _class.constructorId( r'()V', ); @@ -1040,8 +1040,8 @@ class EmojiCompat_DefaultSpanFactory extends jni$_.JObject { /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory EmojiCompat_DefaultSpanFactory() { - return EmojiCompat_DefaultSpanFactory.fromReference( + factory EmojiCompat$DefaultSpanFactory() { + return EmojiCompat$DefaultSpanFactory.fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } @@ -1075,10 +1075,10 @@ class EmojiCompat_DefaultSpanFactory extends jni$_.JObject { } } -final class $EmojiCompat_DefaultSpanFactory$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$DefaultSpanFactory$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_DefaultSpanFactory$NullableType(); + const $EmojiCompat$DefaultSpanFactory$NullableType(); @jni$_.internal @core$_.override @@ -1087,10 +1087,10 @@ final class $EmojiCompat_DefaultSpanFactory$NullableType @jni$_.internal @core$_.override - EmojiCompat_DefaultSpanFactory? fromReference(jni$_.JReference reference) => + EmojiCompat$DefaultSpanFactory? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_DefaultSpanFactory.fromReference( + : EmojiCompat$DefaultSpanFactory.fromReference( reference, ); @jni$_.internal @@ -1099,27 +1099,27 @@ final class $EmojiCompat_DefaultSpanFactory$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_DefaultSpanFactory$NullableType).hashCode; + int get hashCode => ($EmojiCompat$DefaultSpanFactory$NullableType).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_DefaultSpanFactory$NullableType) && - other is $EmojiCompat_DefaultSpanFactory$NullableType; + ($EmojiCompat$DefaultSpanFactory$NullableType) && + other is $EmojiCompat$DefaultSpanFactory$NullableType; } } -final class $EmojiCompat_DefaultSpanFactory$Type - extends jni$_.JObjType { +final class $EmojiCompat$DefaultSpanFactory$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_DefaultSpanFactory$Type(); + const $EmojiCompat$DefaultSpanFactory$Type(); @jni$_.internal @core$_.override @@ -1128,8 +1128,8 @@ final class $EmojiCompat_DefaultSpanFactory$Type @jni$_.internal @core$_.override - EmojiCompat_DefaultSpanFactory fromReference(jni$_.JReference reference) => - EmojiCompat_DefaultSpanFactory.fromReference( + EmojiCompat$DefaultSpanFactory fromReference(jni$_.JReference reference) => + EmojiCompat$DefaultSpanFactory.fromReference( reference, ); @jni$_.internal @@ -1138,31 +1138,31 @@ final class $EmojiCompat_DefaultSpanFactory$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_DefaultSpanFactory$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$DefaultSpanFactory$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_DefaultSpanFactory$Type).hashCode; + int get hashCode => ($EmojiCompat$DefaultSpanFactory$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_DefaultSpanFactory$Type) && - other is $EmojiCompat_DefaultSpanFactory$Type; + return other.runtimeType == ($EmojiCompat$DefaultSpanFactory$Type) && + other is $EmojiCompat$DefaultSpanFactory$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$GlyphChecker` -class EmojiCompat_GlyphChecker extends jni$_.JObject { +class EmojiCompat$GlyphChecker extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_GlyphChecker.fromReference( + EmojiCompat$GlyphChecker.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -1171,8 +1171,8 @@ class EmojiCompat_GlyphChecker extends jni$_.JObject { jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$GlyphChecker'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_GlyphChecker$NullableType(); - static const type = $EmojiCompat_GlyphChecker$Type(); + static const nullableType = $EmojiCompat$GlyphChecker$NullableType(); + static const type = $EmojiCompat$GlyphChecker$Type(); static final _id_hasGlyph = _class.instanceMethodId( r'hasGlyph', r'(Ljava/lang/CharSequence;III)Z', @@ -1208,7 +1208,7 @@ class EmojiCompat_GlyphChecker extends jni$_.JObject { } /// Maps a specific port to the implemented interface. - static final core$_.Map _$impls = {}; + static final core$_.Map _$impls = {}; static jni$_.JObjectPtr _$invoke( int port, jni$_.JObjectPtr descriptor, @@ -1260,7 +1260,7 @@ class EmojiCompat_GlyphChecker extends jni$_.JObject { static void implementIn( jni$_.JImplementer implementer, - $EmojiCompat_GlyphChecker $impl, + $EmojiCompat$GlyphChecker $impl, ) { late final jni$_.RawReceivePort $p; $p = jni$_.RawReceivePort(($m) { @@ -1283,28 +1283,28 @@ class EmojiCompat_GlyphChecker extends jni$_.JObject { _$impls[$a] = $impl; } - factory EmojiCompat_GlyphChecker.implement( - $EmojiCompat_GlyphChecker $impl, + factory EmojiCompat$GlyphChecker.implement( + $EmojiCompat$GlyphChecker $impl, ) { final $i = jni$_.JImplementer(); implementIn($i, $impl); - return EmojiCompat_GlyphChecker.fromReference( + return EmojiCompat$GlyphChecker.fromReference( $i.implementReference(), ); } } -abstract base mixin class $EmojiCompat_GlyphChecker { - factory $EmojiCompat_GlyphChecker({ +abstract base mixin class $EmojiCompat$GlyphChecker { + factory $EmojiCompat$GlyphChecker({ required bool Function(jni$_.JObject? charSequence, int i, int i1, int i2) hasGlyph, - }) = _$EmojiCompat_GlyphChecker; + }) = _$EmojiCompat$GlyphChecker; bool hasGlyph(jni$_.JObject? charSequence, int i, int i1, int i2); } -final class _$EmojiCompat_GlyphChecker with $EmojiCompat_GlyphChecker { - _$EmojiCompat_GlyphChecker({ +final class _$EmojiCompat$GlyphChecker with $EmojiCompat$GlyphChecker { + _$EmojiCompat$GlyphChecker({ required bool Function(jni$_.JObject? charSequence, int i, int i1, int i2) hasGlyph, }) : _hasGlyph = hasGlyph; @@ -1317,10 +1317,10 @@ final class _$EmojiCompat_GlyphChecker with $EmojiCompat_GlyphChecker { } } -final class $EmojiCompat_GlyphChecker$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$GlyphChecker$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_GlyphChecker$NullableType(); + const $EmojiCompat$GlyphChecker$NullableType(); @jni$_.internal @core$_.override @@ -1328,10 +1328,10 @@ final class $EmojiCompat_GlyphChecker$NullableType @jni$_.internal @core$_.override - EmojiCompat_GlyphChecker? fromReference(jni$_.JReference reference) => + EmojiCompat$GlyphChecker? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_GlyphChecker.fromReference( + : EmojiCompat$GlyphChecker.fromReference( reference, ); @jni$_.internal @@ -1340,26 +1340,26 @@ final class $EmojiCompat_GlyphChecker$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_GlyphChecker$NullableType).hashCode; + int get hashCode => ($EmojiCompat$GlyphChecker$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_GlyphChecker$NullableType) && - other is $EmojiCompat_GlyphChecker$NullableType; + return other.runtimeType == ($EmojiCompat$GlyphChecker$NullableType) && + other is $EmojiCompat$GlyphChecker$NullableType; } } -final class $EmojiCompat_GlyphChecker$Type - extends jni$_.JObjType { +final class $EmojiCompat$GlyphChecker$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_GlyphChecker$Type(); + const $EmojiCompat$GlyphChecker$Type(); @jni$_.internal @core$_.override @@ -1367,8 +1367,8 @@ final class $EmojiCompat_GlyphChecker$Type @jni$_.internal @core$_.override - EmojiCompat_GlyphChecker fromReference(jni$_.JReference reference) => - EmojiCompat_GlyphChecker.fromReference( + EmojiCompat$GlyphChecker fromReference(jni$_.JReference reference) => + EmojiCompat$GlyphChecker.fromReference( reference, ); @jni$_.internal @@ -1377,31 +1377,31 @@ final class $EmojiCompat_GlyphChecker$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_GlyphChecker$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$GlyphChecker$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_GlyphChecker$Type).hashCode; + int get hashCode => ($EmojiCompat$GlyphChecker$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_GlyphChecker$Type) && - other is $EmojiCompat_GlyphChecker$Type; + return other.runtimeType == ($EmojiCompat$GlyphChecker$Type) && + other is $EmojiCompat$GlyphChecker$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$InitCallback` -class EmojiCompat_InitCallback extends jni$_.JObject { +class EmojiCompat$InitCallback extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_InitCallback.fromReference( + EmojiCompat$InitCallback.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -1410,8 +1410,8 @@ class EmojiCompat_InitCallback extends jni$_.JObject { jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$InitCallback'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_InitCallback$NullableType(); - static const type = $EmojiCompat_InitCallback$Type(); + static const nullableType = $EmojiCompat$InitCallback$NullableType(); + static const type = $EmojiCompat$InitCallback$Type(); static final _id_onInitialized = _class.instanceMethodId( r'onInitialized', r'()V', @@ -1462,10 +1462,10 @@ class EmojiCompat_InitCallback extends jni$_.JObject { } } -final class $EmojiCompat_InitCallback$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$InitCallback$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_InitCallback$NullableType(); + const $EmojiCompat$InitCallback$NullableType(); @jni$_.internal @core$_.override @@ -1473,10 +1473,10 @@ final class $EmojiCompat_InitCallback$NullableType @jni$_.internal @core$_.override - EmojiCompat_InitCallback? fromReference(jni$_.JReference reference) => + EmojiCompat$InitCallback? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_InitCallback.fromReference( + : EmojiCompat$InitCallback.fromReference( reference, ); @jni$_.internal @@ -1485,26 +1485,26 @@ final class $EmojiCompat_InitCallback$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_InitCallback$NullableType).hashCode; + int get hashCode => ($EmojiCompat$InitCallback$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_InitCallback$NullableType) && - other is $EmojiCompat_InitCallback$NullableType; + return other.runtimeType == ($EmojiCompat$InitCallback$NullableType) && + other is $EmojiCompat$InitCallback$NullableType; } } -final class $EmojiCompat_InitCallback$Type - extends jni$_.JObjType { +final class $EmojiCompat$InitCallback$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_InitCallback$Type(); + const $EmojiCompat$InitCallback$Type(); @jni$_.internal @core$_.override @@ -1512,8 +1512,8 @@ final class $EmojiCompat_InitCallback$Type @jni$_.internal @core$_.override - EmojiCompat_InitCallback fromReference(jni$_.JReference reference) => - EmojiCompat_InitCallback.fromReference( + EmojiCompat$InitCallback fromReference(jni$_.JReference reference) => + EmojiCompat$InitCallback.fromReference( reference, ); @jni$_.internal @@ -1522,31 +1522,31 @@ final class $EmojiCompat_InitCallback$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_InitCallback$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$InitCallback$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_InitCallback$Type).hashCode; + int get hashCode => ($EmojiCompat$InitCallback$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_InitCallback$Type) && - other is $EmojiCompat_InitCallback$Type; + return other.runtimeType == ($EmojiCompat$InitCallback$Type) && + other is $EmojiCompat$InitCallback$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$LoadStrategy` -class EmojiCompat_LoadStrategy extends jni$_.JObject { +class EmojiCompat$LoadStrategy extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_LoadStrategy.fromReference( + EmojiCompat$LoadStrategy.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -1555,11 +1555,11 @@ class EmojiCompat_LoadStrategy extends jni$_.JObject { jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$LoadStrategy'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_LoadStrategy$NullableType(); - static const type = $EmojiCompat_LoadStrategy$Type(); + static const nullableType = $EmojiCompat$LoadStrategy$NullableType(); + static const type = $EmojiCompat$LoadStrategy$Type(); /// Maps a specific port to the implemented interface. - static final core$_.Map _$impls = {}; + static final core$_.Map _$impls = {}; static jni$_.JObjectPtr _$invoke( int port, jni$_.JObjectPtr descriptor, @@ -1596,7 +1596,7 @@ class EmojiCompat_LoadStrategy extends jni$_.JObject { static void implementIn( jni$_.JImplementer implementer, - $EmojiCompat_LoadStrategy $impl, + $EmojiCompat$LoadStrategy $impl, ) { late final jni$_.RawReceivePort $p; $p = jni$_.RawReceivePort(($m) { @@ -1619,29 +1619,29 @@ class EmojiCompat_LoadStrategy extends jni$_.JObject { _$impls[$a] = $impl; } - factory EmojiCompat_LoadStrategy.implement( - $EmojiCompat_LoadStrategy $impl, + factory EmojiCompat$LoadStrategy.implement( + $EmojiCompat$LoadStrategy $impl, ) { final $i = jni$_.JImplementer(); implementIn($i, $impl); - return EmojiCompat_LoadStrategy.fromReference( + return EmojiCompat$LoadStrategy.fromReference( $i.implementReference(), ); } } -abstract base mixin class $EmojiCompat_LoadStrategy { - factory $EmojiCompat_LoadStrategy() = _$EmojiCompat_LoadStrategy; +abstract base mixin class $EmojiCompat$LoadStrategy { + factory $EmojiCompat$LoadStrategy() = _$EmojiCompat$LoadStrategy; } -final class _$EmojiCompat_LoadStrategy with $EmojiCompat_LoadStrategy { - _$EmojiCompat_LoadStrategy(); +final class _$EmojiCompat$LoadStrategy with $EmojiCompat$LoadStrategy { + _$EmojiCompat$LoadStrategy(); } -final class $EmojiCompat_LoadStrategy$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$LoadStrategy$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_LoadStrategy$NullableType(); + const $EmojiCompat$LoadStrategy$NullableType(); @jni$_.internal @core$_.override @@ -1649,10 +1649,10 @@ final class $EmojiCompat_LoadStrategy$NullableType @jni$_.internal @core$_.override - EmojiCompat_LoadStrategy? fromReference(jni$_.JReference reference) => + EmojiCompat$LoadStrategy? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_LoadStrategy.fromReference( + : EmojiCompat$LoadStrategy.fromReference( reference, ); @jni$_.internal @@ -1661,26 +1661,26 @@ final class $EmojiCompat_LoadStrategy$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_LoadStrategy$NullableType).hashCode; + int get hashCode => ($EmojiCompat$LoadStrategy$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_LoadStrategy$NullableType) && - other is $EmojiCompat_LoadStrategy$NullableType; + return other.runtimeType == ($EmojiCompat$LoadStrategy$NullableType) && + other is $EmojiCompat$LoadStrategy$NullableType; } } -final class $EmojiCompat_LoadStrategy$Type - extends jni$_.JObjType { +final class $EmojiCompat$LoadStrategy$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_LoadStrategy$Type(); + const $EmojiCompat$LoadStrategy$Type(); @jni$_.internal @core$_.override @@ -1688,8 +1688,8 @@ final class $EmojiCompat_LoadStrategy$Type @jni$_.internal @core$_.override - EmojiCompat_LoadStrategy fromReference(jni$_.JReference reference) => - EmojiCompat_LoadStrategy.fromReference( + EmojiCompat$LoadStrategy fromReference(jni$_.JReference reference) => + EmojiCompat$LoadStrategy.fromReference( reference, ); @jni$_.internal @@ -1698,31 +1698,31 @@ final class $EmojiCompat_LoadStrategy$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_LoadStrategy$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$LoadStrategy$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_LoadStrategy$Type).hashCode; + int get hashCode => ($EmojiCompat$LoadStrategy$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_LoadStrategy$Type) && - other is $EmojiCompat_LoadStrategy$Type; + return other.runtimeType == ($EmojiCompat$LoadStrategy$Type) && + other is $EmojiCompat$LoadStrategy$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$MetadataRepoLoader` -class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { +class EmojiCompat$MetadataRepoLoader extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_MetadataRepoLoader.fromReference( + EmojiCompat$MetadataRepoLoader.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -1731,8 +1731,8 @@ class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { r'androidx/emoji2/text/EmojiCompat$MetadataRepoLoader'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_MetadataRepoLoader$NullableType(); - static const type = $EmojiCompat_MetadataRepoLoader$Type(); + static const nullableType = $EmojiCompat$MetadataRepoLoader$NullableType(); + static const type = $EmojiCompat$MetadataRepoLoader$Type(); static final _id_load = _class.instanceMethodId( r'load', r'(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V', @@ -1751,7 +1751,7 @@ class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { /// from: `public abstract void load(androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback metadataRepoLoaderCallback)` void load( - EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback, + EmojiCompat$MetadataRepoLoaderCallback? metadataRepoLoaderCallback, ) { final _$metadataRepoLoaderCallback = metadataRepoLoaderCallback?.reference ?? jni$_.jNullReference; @@ -1761,7 +1761,7 @@ class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { } /// Maps a specific port to the implemented interface. - static final core$_.Map _$impls = {}; + static final core$_.Map _$impls = {}; static jni$_.JObjectPtr _$invoke( int port, jni$_.JObjectPtr descriptor, @@ -1793,7 +1793,7 @@ class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { if ($d == r'load(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoaderCallback;)V') { _$impls[$p]!.load( - $a![0]?.as(const $EmojiCompat_MetadataRepoLoaderCallback$Type(), + $a![0]?.as(const $EmojiCompat$MetadataRepoLoaderCallback$Type(), releaseOriginal: true), ); return jni$_.nullptr; @@ -1806,7 +1806,7 @@ class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { static void implementIn( jni$_.JImplementer implementer, - $EmojiCompat_MetadataRepoLoader $impl, + $EmojiCompat$MetadataRepoLoader $impl, ) { late final jni$_.RawReceivePort $p; $p = jni$_.RawReceivePort(($m) { @@ -1832,52 +1832,52 @@ class EmojiCompat_MetadataRepoLoader extends jni$_.JObject { _$impls[$a] = $impl; } - factory EmojiCompat_MetadataRepoLoader.implement( - $EmojiCompat_MetadataRepoLoader $impl, + factory EmojiCompat$MetadataRepoLoader.implement( + $EmojiCompat$MetadataRepoLoader $impl, ) { final $i = jni$_.JImplementer(); implementIn($i, $impl); - return EmojiCompat_MetadataRepoLoader.fromReference( + return EmojiCompat$MetadataRepoLoader.fromReference( $i.implementReference(), ); } } -abstract base mixin class $EmojiCompat_MetadataRepoLoader { - factory $EmojiCompat_MetadataRepoLoader({ +abstract base mixin class $EmojiCompat$MetadataRepoLoader { + factory $EmojiCompat$MetadataRepoLoader({ required void Function( - EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) + EmojiCompat$MetadataRepoLoaderCallback? metadataRepoLoaderCallback) load, bool load$async, - }) = _$EmojiCompat_MetadataRepoLoader; + }) = _$EmojiCompat$MetadataRepoLoader; - void load(EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback); + void load(EmojiCompat$MetadataRepoLoaderCallback? metadataRepoLoaderCallback); bool get load$async => false; } -final class _$EmojiCompat_MetadataRepoLoader - with $EmojiCompat_MetadataRepoLoader { - _$EmojiCompat_MetadataRepoLoader({ +final class _$EmojiCompat$MetadataRepoLoader + with $EmojiCompat$MetadataRepoLoader { + _$EmojiCompat$MetadataRepoLoader({ required void Function( - EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) + EmojiCompat$MetadataRepoLoaderCallback? metadataRepoLoaderCallback) load, this.load$async = false, }) : _load = load; final void Function( - EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) _load; + EmojiCompat$MetadataRepoLoaderCallback? metadataRepoLoaderCallback) _load; final bool load$async; void load( - EmojiCompat_MetadataRepoLoaderCallback? metadataRepoLoaderCallback) { + EmojiCompat$MetadataRepoLoaderCallback? metadataRepoLoaderCallback) { return _load(metadataRepoLoaderCallback); } } -final class $EmojiCompat_MetadataRepoLoader$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$MetadataRepoLoader$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_MetadataRepoLoader$NullableType(); + const $EmojiCompat$MetadataRepoLoader$NullableType(); @jni$_.internal @core$_.override @@ -1886,10 +1886,10 @@ final class $EmojiCompat_MetadataRepoLoader$NullableType @jni$_.internal @core$_.override - EmojiCompat_MetadataRepoLoader? fromReference(jni$_.JReference reference) => + EmojiCompat$MetadataRepoLoader? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_MetadataRepoLoader.fromReference( + : EmojiCompat$MetadataRepoLoader.fromReference( reference, ); @jni$_.internal @@ -1898,27 +1898,27 @@ final class $EmojiCompat_MetadataRepoLoader$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_MetadataRepoLoader$NullableType).hashCode; + int get hashCode => ($EmojiCompat$MetadataRepoLoader$NullableType).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_MetadataRepoLoader$NullableType) && - other is $EmojiCompat_MetadataRepoLoader$NullableType; + ($EmojiCompat$MetadataRepoLoader$NullableType) && + other is $EmojiCompat$MetadataRepoLoader$NullableType; } } -final class $EmojiCompat_MetadataRepoLoader$Type - extends jni$_.JObjType { +final class $EmojiCompat$MetadataRepoLoader$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_MetadataRepoLoader$Type(); + const $EmojiCompat$MetadataRepoLoader$Type(); @jni$_.internal @core$_.override @@ -1927,8 +1927,8 @@ final class $EmojiCompat_MetadataRepoLoader$Type @jni$_.internal @core$_.override - EmojiCompat_MetadataRepoLoader fromReference(jni$_.JReference reference) => - EmojiCompat_MetadataRepoLoader.fromReference( + EmojiCompat$MetadataRepoLoader fromReference(jni$_.JReference reference) => + EmojiCompat$MetadataRepoLoader.fromReference( reference, ); @jni$_.internal @@ -1937,31 +1937,31 @@ final class $EmojiCompat_MetadataRepoLoader$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_MetadataRepoLoader$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$MetadataRepoLoader$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_MetadataRepoLoader$Type).hashCode; + int get hashCode => ($EmojiCompat$MetadataRepoLoader$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_MetadataRepoLoader$Type) && - other is $EmojiCompat_MetadataRepoLoader$Type; + return other.runtimeType == ($EmojiCompat$MetadataRepoLoader$Type) && + other is $EmojiCompat$MetadataRepoLoader$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback` -class EmojiCompat_MetadataRepoLoaderCallback extends jni$_.JObject { +class EmojiCompat$MetadataRepoLoaderCallback extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_MetadataRepoLoaderCallback.fromReference( + EmojiCompat$MetadataRepoLoaderCallback.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -1971,8 +1971,8 @@ class EmojiCompat_MetadataRepoLoaderCallback extends jni$_.JObject { /// The type which includes information such as the signature of this class. static const nullableType = - $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); - static const type = $EmojiCompat_MetadataRepoLoaderCallback$Type(); + $EmojiCompat$MetadataRepoLoaderCallback$NullableType(); + static const type = $EmojiCompat$MetadataRepoLoaderCallback$Type(); static final _id_onLoaded = _class.instanceMethodId( r'onLoaded', r'(Landroidx/emoji2/text/MetadataRepo;)V', @@ -2026,10 +2026,10 @@ class EmojiCompat_MetadataRepoLoaderCallback extends jni$_.JObject { } } -final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$MetadataRepoLoaderCallback$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); + const $EmojiCompat$MetadataRepoLoaderCallback$NullableType(); @jni$_.internal @core$_.override @@ -2038,11 +2038,11 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType @jni$_.internal @core$_.override - EmojiCompat_MetadataRepoLoaderCallback? fromReference( + EmojiCompat$MetadataRepoLoaderCallback? fromReference( jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_MetadataRepoLoaderCallback.fromReference( + : EmojiCompat$MetadataRepoLoaderCallback.fromReference( reference, ); @jni$_.internal @@ -2051,7 +2051,7 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => + jni$_.JObjType get nullableType => this; @jni$_.internal @@ -2060,20 +2060,20 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$NullableType @core$_.override int get hashCode => - ($EmojiCompat_MetadataRepoLoaderCallback$NullableType).hashCode; + ($EmojiCompat$MetadataRepoLoaderCallback$NullableType).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_MetadataRepoLoaderCallback$NullableType) && - other is $EmojiCompat_MetadataRepoLoaderCallback$NullableType; + ($EmojiCompat$MetadataRepoLoaderCallback$NullableType) && + other is $EmojiCompat$MetadataRepoLoaderCallback$NullableType; } } -final class $EmojiCompat_MetadataRepoLoaderCallback$Type - extends jni$_.JObjType { +final class $EmojiCompat$MetadataRepoLoaderCallback$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_MetadataRepoLoaderCallback$Type(); + const $EmojiCompat$MetadataRepoLoaderCallback$Type(); @jni$_.internal @core$_.override @@ -2082,9 +2082,9 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$Type @jni$_.internal @core$_.override - EmojiCompat_MetadataRepoLoaderCallback fromReference( + EmojiCompat$MetadataRepoLoaderCallback fromReference( jni$_.JReference reference) => - EmojiCompat_MetadataRepoLoaderCallback.fromReference( + EmojiCompat$MetadataRepoLoaderCallback.fromReference( reference, ); @jni$_.internal @@ -2093,32 +2093,32 @@ final class $EmojiCompat_MetadataRepoLoaderCallback$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_MetadataRepoLoaderCallback$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$MetadataRepoLoaderCallback$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_MetadataRepoLoaderCallback$Type).hashCode; + int get hashCode => ($EmojiCompat$MetadataRepoLoaderCallback$Type).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($EmojiCompat_MetadataRepoLoaderCallback$Type) && - other is $EmojiCompat_MetadataRepoLoaderCallback$Type; + ($EmojiCompat$MetadataRepoLoaderCallback$Type) && + other is $EmojiCompat$MetadataRepoLoaderCallback$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$ReplaceStrategy` -class EmojiCompat_ReplaceStrategy extends jni$_.JObject { +class EmojiCompat$ReplaceStrategy extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_ReplaceStrategy.fromReference( + EmojiCompat$ReplaceStrategy.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -2127,11 +2127,11 @@ class EmojiCompat_ReplaceStrategy extends jni$_.JObject { jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$ReplaceStrategy'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_ReplaceStrategy$NullableType(); - static const type = $EmojiCompat_ReplaceStrategy$Type(); + static const nullableType = $EmojiCompat$ReplaceStrategy$NullableType(); + static const type = $EmojiCompat$ReplaceStrategy$Type(); /// Maps a specific port to the implemented interface. - static final core$_.Map _$impls = {}; + static final core$_.Map _$impls = {}; static jni$_.JObjectPtr _$invoke( int port, jni$_.JObjectPtr descriptor, @@ -2168,7 +2168,7 @@ class EmojiCompat_ReplaceStrategy extends jni$_.JObject { static void implementIn( jni$_.JImplementer implementer, - $EmojiCompat_ReplaceStrategy $impl, + $EmojiCompat$ReplaceStrategy $impl, ) { late final jni$_.RawReceivePort $p; $p = jni$_.RawReceivePort(($m) { @@ -2191,29 +2191,29 @@ class EmojiCompat_ReplaceStrategy extends jni$_.JObject { _$impls[$a] = $impl; } - factory EmojiCompat_ReplaceStrategy.implement( - $EmojiCompat_ReplaceStrategy $impl, + factory EmojiCompat$ReplaceStrategy.implement( + $EmojiCompat$ReplaceStrategy $impl, ) { final $i = jni$_.JImplementer(); implementIn($i, $impl); - return EmojiCompat_ReplaceStrategy.fromReference( + return EmojiCompat$ReplaceStrategy.fromReference( $i.implementReference(), ); } } -abstract base mixin class $EmojiCompat_ReplaceStrategy { - factory $EmojiCompat_ReplaceStrategy() = _$EmojiCompat_ReplaceStrategy; +abstract base mixin class $EmojiCompat$ReplaceStrategy { + factory $EmojiCompat$ReplaceStrategy() = _$EmojiCompat$ReplaceStrategy; } -final class _$EmojiCompat_ReplaceStrategy with $EmojiCompat_ReplaceStrategy { - _$EmojiCompat_ReplaceStrategy(); +final class _$EmojiCompat$ReplaceStrategy with $EmojiCompat$ReplaceStrategy { + _$EmojiCompat$ReplaceStrategy(); } -final class $EmojiCompat_ReplaceStrategy$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$ReplaceStrategy$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_ReplaceStrategy$NullableType(); + const $EmojiCompat$ReplaceStrategy$NullableType(); @jni$_.internal @core$_.override @@ -2221,10 +2221,10 @@ final class $EmojiCompat_ReplaceStrategy$NullableType @jni$_.internal @core$_.override - EmojiCompat_ReplaceStrategy? fromReference(jni$_.JReference reference) => + EmojiCompat$ReplaceStrategy? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_ReplaceStrategy.fromReference( + : EmojiCompat$ReplaceStrategy.fromReference( reference, ); @jni$_.internal @@ -2233,26 +2233,26 @@ final class $EmojiCompat_ReplaceStrategy$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_ReplaceStrategy$NullableType).hashCode; + int get hashCode => ($EmojiCompat$ReplaceStrategy$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_ReplaceStrategy$NullableType) && - other is $EmojiCompat_ReplaceStrategy$NullableType; + return other.runtimeType == ($EmojiCompat$ReplaceStrategy$NullableType) && + other is $EmojiCompat$ReplaceStrategy$NullableType; } } -final class $EmojiCompat_ReplaceStrategy$Type - extends jni$_.JObjType { +final class $EmojiCompat$ReplaceStrategy$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_ReplaceStrategy$Type(); + const $EmojiCompat$ReplaceStrategy$Type(); @jni$_.internal @core$_.override @@ -2260,8 +2260,8 @@ final class $EmojiCompat_ReplaceStrategy$Type @jni$_.internal @core$_.override - EmojiCompat_ReplaceStrategy fromReference(jni$_.JReference reference) => - EmojiCompat_ReplaceStrategy.fromReference( + EmojiCompat$ReplaceStrategy fromReference(jni$_.JReference reference) => + EmojiCompat$ReplaceStrategy.fromReference( reference, ); @jni$_.internal @@ -2270,31 +2270,31 @@ final class $EmojiCompat_ReplaceStrategy$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_ReplaceStrategy$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$ReplaceStrategy$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_ReplaceStrategy$Type).hashCode; + int get hashCode => ($EmojiCompat$ReplaceStrategy$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_ReplaceStrategy$Type) && - other is $EmojiCompat_ReplaceStrategy$Type; + return other.runtimeType == ($EmojiCompat$ReplaceStrategy$Type) && + other is $EmojiCompat$ReplaceStrategy$Type; } } /// from: `androidx.emoji2.text.EmojiCompat$SpanFactory` -class EmojiCompat_SpanFactory extends jni$_.JObject { +class EmojiCompat$SpanFactory extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - EmojiCompat_SpanFactory.fromReference( + EmojiCompat$SpanFactory.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -2303,8 +2303,8 @@ class EmojiCompat_SpanFactory extends jni$_.JObject { jni$_.JClass.forName(r'androidx/emoji2/text/EmojiCompat$SpanFactory'); /// The type which includes information such as the signature of this class. - static const nullableType = $EmojiCompat_SpanFactory$NullableType(); - static const type = $EmojiCompat_SpanFactory$Type(); + static const nullableType = $EmojiCompat$SpanFactory$NullableType(); + static const type = $EmojiCompat$SpanFactory$Type(); static final _id_createSpan = _class.instanceMethodId( r'createSpan', r'(Landroidx/emoji2/text/TypefaceEmojiRasterizer;)Landroidx/emoji2/text/EmojiSpan;', @@ -2334,7 +2334,7 @@ class EmojiCompat_SpanFactory extends jni$_.JObject { } /// Maps a specific port to the implemented interface. - static final core$_.Map _$impls = {}; + static final core$_.Map _$impls = {}; static jni$_.JObjectPtr _$invoke( int port, jni$_.JObjectPtr descriptor, @@ -2382,7 +2382,7 @@ class EmojiCompat_SpanFactory extends jni$_.JObject { static void implementIn( jni$_.JImplementer implementer, - $EmojiCompat_SpanFactory $impl, + $EmojiCompat$SpanFactory $impl, ) { late final jni$_.RawReceivePort $p; $p = jni$_.RawReceivePort(($m) { @@ -2405,28 +2405,28 @@ class EmojiCompat_SpanFactory extends jni$_.JObject { _$impls[$a] = $impl; } - factory EmojiCompat_SpanFactory.implement( - $EmojiCompat_SpanFactory $impl, + factory EmojiCompat$SpanFactory.implement( + $EmojiCompat$SpanFactory $impl, ) { final $i = jni$_.JImplementer(); implementIn($i, $impl); - return EmojiCompat_SpanFactory.fromReference( + return EmojiCompat$SpanFactory.fromReference( $i.implementReference(), ); } } -abstract base mixin class $EmojiCompat_SpanFactory { - factory $EmojiCompat_SpanFactory({ +abstract base mixin class $EmojiCompat$SpanFactory { + factory $EmojiCompat$SpanFactory({ required jni$_.JObject? Function(jni$_.JObject? typefaceEmojiRasterizer) createSpan, - }) = _$EmojiCompat_SpanFactory; + }) = _$EmojiCompat$SpanFactory; jni$_.JObject? createSpan(jni$_.JObject? typefaceEmojiRasterizer); } -final class _$EmojiCompat_SpanFactory with $EmojiCompat_SpanFactory { - _$EmojiCompat_SpanFactory({ +final class _$EmojiCompat$SpanFactory with $EmojiCompat$SpanFactory { + _$EmojiCompat$SpanFactory({ required jni$_.JObject? Function(jni$_.JObject? typefaceEmojiRasterizer) createSpan, }) : _createSpan = createSpan; @@ -2439,10 +2439,10 @@ final class _$EmojiCompat_SpanFactory with $EmojiCompat_SpanFactory { } } -final class $EmojiCompat_SpanFactory$NullableType - extends jni$_.JObjType { +final class $EmojiCompat$SpanFactory$NullableType + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_SpanFactory$NullableType(); + const $EmojiCompat$SpanFactory$NullableType(); @jni$_.internal @core$_.override @@ -2450,10 +2450,10 @@ final class $EmojiCompat_SpanFactory$NullableType @jni$_.internal @core$_.override - EmojiCompat_SpanFactory? fromReference(jni$_.JReference reference) => + EmojiCompat$SpanFactory? fromReference(jni$_.JReference reference) => reference.isNull ? null - : EmojiCompat_SpanFactory.fromReference( + : EmojiCompat$SpanFactory.fromReference( reference, ); @jni$_.internal @@ -2462,26 +2462,26 @@ final class $EmojiCompat_SpanFactory$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_SpanFactory$NullableType).hashCode; + int get hashCode => ($EmojiCompat$SpanFactory$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_SpanFactory$NullableType) && - other is $EmojiCompat_SpanFactory$NullableType; + return other.runtimeType == ($EmojiCompat$SpanFactory$NullableType) && + other is $EmojiCompat$SpanFactory$NullableType; } } -final class $EmojiCompat_SpanFactory$Type - extends jni$_.JObjType { +final class $EmojiCompat$SpanFactory$Type + extends jni$_.JObjType { @jni$_.internal - const $EmojiCompat_SpanFactory$Type(); + const $EmojiCompat$SpanFactory$Type(); @jni$_.internal @core$_.override @@ -2489,8 +2489,8 @@ final class $EmojiCompat_SpanFactory$Type @jni$_.internal @core$_.override - EmojiCompat_SpanFactory fromReference(jni$_.JReference reference) => - EmojiCompat_SpanFactory.fromReference( + EmojiCompat$SpanFactory fromReference(jni$_.JReference reference) => + EmojiCompat$SpanFactory.fromReference( reference, ); @jni$_.internal @@ -2499,20 +2499,20 @@ final class $EmojiCompat_SpanFactory$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $EmojiCompat_SpanFactory$NullableType(); + jni$_.JObjType get nullableType => + const $EmojiCompat$SpanFactory$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($EmojiCompat_SpanFactory$Type).hashCode; + int get hashCode => ($EmojiCompat$SpanFactory$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($EmojiCompat_SpanFactory$Type) && - other is $EmojiCompat_SpanFactory$Type; + return other.runtimeType == ($EmojiCompat$SpanFactory$Type) && + other is $EmojiCompat$SpanFactory$Type; } } @@ -2644,7 +2644,7 @@ class EmojiCompat extends jni$_.JObject { /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? init$1( jni$_.JObject? context, - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory? + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory? defaultEmojiCompatConfigFactory, ) { final _$context = context?.reference ?? jni$_.jNullReference; @@ -2674,7 +2674,7 @@ class EmojiCompat extends jni$_.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat init(androidx.emoji2.text.EmojiCompat$Config config)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? init$2( - EmojiCompat_Config? config, + EmojiCompat$Config? config, ) { final _$config = config?.reference ?? jni$_.jNullReference; return _init$2(_class.reference.pointer, _id_init$2 as jni$_.JMethodIDPtr, @@ -2725,7 +2725,7 @@ class EmojiCompat extends jni$_.JObject { /// from: `static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat$Config config)` /// The returned object must be released after use, by calling the [release] method. static EmojiCompat? reset( - EmojiCompat_Config? config, + EmojiCompat$Config? config, ) { final _$config = config?.reference ?? jni$_.jNullReference; return _reset(_class.reference.pointer, _id_reset as jni$_.JMethodIDPtr, @@ -2848,7 +2848,7 @@ class EmojiCompat extends jni$_.JObject { /// from: `public void registerInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void registerInitCallback( - EmojiCompat_InitCallback? initCallback, + EmojiCompat$InitCallback? initCallback, ) { final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; _registerInitCallback( @@ -2876,7 +2876,7 @@ class EmojiCompat extends jni$_.JObject { /// from: `public void unregisterInitCallback(androidx.emoji2.text.EmojiCompat$InitCallback initCallback)` void unregisterInitCallback( - EmojiCompat_InitCallback? initCallback, + EmojiCompat$InitCallback? initCallback, ) { final _$initCallback = initCallback?.reference ?? jni$_.jNullReference; _unregisterInitCallback( @@ -3458,15 +3458,15 @@ final class $EmojiCompat$Type extends jni$_.JObjType { } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory` -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory +class DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType + final jni$_.JObjType $type; @jni$_.internal - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -3476,9 +3476,9 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory /// The type which includes information such as the signature of this class. static const nullableType = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType(); static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$Type(); static final _id_new$ = _class.constructorId( r'(Landroidx/emoji2/text/DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;)V', ); @@ -3496,13 +3496,13 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory /// from: `public void (androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper defaultEmojiCompatConfigHelper)` /// The returned object must be released after use, by calling the [release] method. - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory( - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper? + factory DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper? defaultEmojiCompatConfigHelper, ) { final _$defaultEmojiCompatConfigHelper = defaultEmojiCompatConfigHelper?.reference ?? jni$_.jNullReference; - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory + return DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory .fromReference(_new$( _class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, @@ -3528,21 +3528,21 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory /// from: `public androidx.emoji2.text.EmojiCompat$Config create(android.content.Context context)` /// The returned object must be released after use, by calling the [release] method. - EmojiCompat_Config? create( + EmojiCompat$Config? create( jni$_.JObject? context, ) { final _$context = context?.reference ?? jni$_.jNullReference; return _create(reference.pointer, _id_create as jni$_.JMethodIDPtr, _$context.pointer) - .object(const $EmojiCompat_Config$NullableType()); + .object(const $EmojiCompat$Config$NullableType()); } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType(); @jni$_.internal @core$_.override @@ -3551,11 +3551,11 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableTy @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory? fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory? fromReference( jni$_.JReference reference) => reference.isNull ? null - : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory + : DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory .fromReference( reference, ); @@ -3565,7 +3565,7 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableTy @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => this; @jni$_.internal @@ -3574,23 +3574,23 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableTy @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType) + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType) .hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType) && + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType; + is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType; } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$Type extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$Type(); @jni$_.internal @core$_.override @@ -3599,9 +3599,9 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory fromReference( jni$_.JReference reference) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory.fromReference( reference, ); @jni$_.internal @@ -3610,9 +3610,9 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$NullableType(); @jni$_.internal @core$_.override @@ -3620,26 +3620,26 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type).hashCode; + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$Type).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type) && - other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory$Type; + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$Type) && + other is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper` -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper +class DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType + final jni$_.JObjType $type; @jni$_.internal - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -3649,9 +3649,9 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper /// The type which includes information such as the signature of this class. static const nullableType = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType(); static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$Type(); static final _id_new$ = _class.constructorId( r'()V', ); @@ -3670,8 +3670,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper + factory DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper() { + return DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper .fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); @@ -3790,11 +3790,11 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType(); @jni$_.internal @core$_.override @@ -3803,11 +3803,11 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableTyp @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper? fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper? fromReference( jni$_.JReference reference) => reference.isNull ? null - : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper + : DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper .fromReference( reference, ); @@ -3817,7 +3817,7 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableTyp @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => this; @jni$_.internal @@ -3826,23 +3826,23 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableTyp @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType) + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType) .hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType) && + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType; + is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType; } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$Type extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$Type(); @jni$_.internal @core$_.override @@ -3851,9 +3851,9 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper fromReference( jni$_.JReference reference) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper.fromReference( reference, ); @jni$_.internal @@ -3862,9 +3862,9 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType(); @jni$_.internal @core$_.override @@ -3872,27 +3872,27 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type).hashCode; + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$Type).hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type) && - other is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$Type; + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$Type) && + other is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19` -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 - extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper { +class DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 + extends DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper { @jni$_.internal @core$_.override final jni$_ - .JObjType + .JObjType $type; @jni$_.internal - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19.fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -3902,9 +3902,9 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 /// The type which includes information such as the signature of this class. static const nullableType = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType(); static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$Type(); static final _id_new$ = _class.constructorId( r'()V', ); @@ -3923,8 +3923,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19() { - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 + factory DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19() { + return DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 .fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); @@ -4003,11 +4003,11 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType(); @jni$_.internal @core$_.override @@ -4016,22 +4016,22 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Nulla @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19? fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19? fromReference( jni$_.JReference reference) => reference.isNull ? null - : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 + : DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 .fromReference( reference, ); @jni$_.internal @core$_.override jni$_.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType(); @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => this; @jni$_.internal @@ -4040,23 +4040,23 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Nulla @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType) + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType) .hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType) && + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType; + is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType; } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$Type extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$Type(); @jni$_.internal @core$_.override @@ -4065,22 +4065,22 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 fromReference( jni$_.JReference reference) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 .fromReference( reference, ); @jni$_.internal @core$_.override jni$_.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper$NullableType(); @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType(); @jni$_.internal @core$_.override @@ -4088,29 +4088,29 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type) + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$Type) .hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type) && + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$Type) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$Type; + is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$Type; } } /// from: `androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28` -class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 - extends DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 { +class DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 + extends DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 { @jni$_.internal @core$_.override final jni$_ - .JObjType + .JObjType $type; @jni$_.internal - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28.fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -4120,9 +4120,9 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 /// The type which includes information such as the signature of this class. static const nullableType = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType(); static const type = - $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type(); + $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$Type(); static final _id_new$ = _class.constructorId( r'()V', ); @@ -4141,8 +4141,8 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { - return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 + factory DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28() { + return DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 .fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); @@ -4189,11 +4189,11 @@ class DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType(); @jni$_.internal @core$_.override @@ -4202,22 +4202,22 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Nulla @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28? fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28? fromReference( jni$_.JReference reference) => reference.isNull ? null - : DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 + : DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 .fromReference( reference, ); @jni$_.internal @core$_.override jni$_.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType(); @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => this; @jni$_.internal @@ -4226,23 +4226,23 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Nulla @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType) + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType) .hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType) && + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType; + is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType; } } -final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type +final class $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$Type extends jni$_ - .JObjType { + .JObjType { @jni$_.internal - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$Type(); @jni$_.internal @core$_.override @@ -4251,22 +4251,22 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type @jni$_.internal @core$_.override - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 fromReference( + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 fromReference( jni$_.JReference reference) => - DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 + DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28 .fromReference( reference, ); @jni$_.internal @core$_.override jni$_.JObjType get superType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19$NullableType(); @jni$_.internal @core$_.override - jni$_.JObjType + jni$_.JObjType get nullableType => - const $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$NullableType(); + const $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$NullableType(); @jni$_.internal @core$_.override @@ -4274,15 +4274,15 @@ final class $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type @core$_.override int get hashCode => - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type) + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$Type) .hashCode; @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type) && + ($DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$Type) && other - is $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28$Type; + is $DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API28$Type; } } @@ -4410,13 +4410,13 @@ final class $DefaultEmojiCompatConfig$Type } /// from: `android.os.Build$Partition` -class Build_Partition extends jni$_.JObject { +class Build$Partition extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Build_Partition.fromReference( + Build$Partition.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -4424,8 +4424,8 @@ class Build_Partition extends jni$_.JObject { static final _class = jni$_.JClass.forName(r'android/os/Build$Partition'); /// The type which includes information such as the signature of this class. - static const nullableType = $Build_Partition$NullableType(); - static const type = $Build_Partition$Type(); + static const nullableType = $Build$Partition$NullableType(); + static const type = $Build$Partition$Type(); static final _id_PARTITION_NAME_SYSTEM = _class.staticFieldId( r'PARTITION_NAME_SYSTEM', r'Ljava/lang/String;', @@ -4559,10 +4559,10 @@ class Build_Partition extends jni$_.JObject { } } -final class $Build_Partition$NullableType - extends jni$_.JObjType { +final class $Build$Partition$NullableType + extends jni$_.JObjType { @jni$_.internal - const $Build_Partition$NullableType(); + const $Build$Partition$NullableType(); @jni$_.internal @core$_.override @@ -4570,9 +4570,9 @@ final class $Build_Partition$NullableType @jni$_.internal @core$_.override - Build_Partition? fromReference(jni$_.JReference reference) => reference.isNull + Build$Partition? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Build_Partition.fromReference( + : Build$Partition.fromReference( reference, ); @jni$_.internal @@ -4581,25 +4581,25 @@ final class $Build_Partition$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Build_Partition$NullableType).hashCode; + int get hashCode => ($Build$Partition$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Build_Partition$NullableType) && - other is $Build_Partition$NullableType; + return other.runtimeType == ($Build$Partition$NullableType) && + other is $Build$Partition$NullableType; } } -final class $Build_Partition$Type extends jni$_.JObjType { +final class $Build$Partition$Type extends jni$_.JObjType { @jni$_.internal - const $Build_Partition$Type(); + const $Build$Partition$Type(); @jni$_.internal @core$_.override @@ -4607,8 +4607,8 @@ final class $Build_Partition$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - Build_Partition fromReference(jni$_.JReference reference) => - Build_Partition.fromReference( + Build$Partition fromReference(jni$_.JReference reference) => + Build$Partition.fromReference( reference, ); @jni$_.internal @@ -4617,31 +4617,31 @@ final class $Build_Partition$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Build_Partition$NullableType(); + jni$_.JObjType get nullableType => + const $Build$Partition$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Build_Partition$Type).hashCode; + int get hashCode => ($Build$Partition$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Build_Partition$Type) && - other is $Build_Partition$Type; + return other.runtimeType == ($Build$Partition$Type) && + other is $Build$Partition$Type; } } /// from: `android.os.Build$VERSION` -class Build_VERSION extends jni$_.JObject { +class Build$VERSION extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Build_VERSION.fromReference( + Build$VERSION.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -4649,8 +4649,8 @@ class Build_VERSION extends jni$_.JObject { static final _class = jni$_.JClass.forName(r'android/os/Build$VERSION'); /// The type which includes information such as the signature of this class. - static const nullableType = $Build_VERSION$NullableType(); - static const type = $Build_VERSION$Type(); + static const nullableType = $Build$VERSION$NullableType(); + static const type = $Build$VERSION$Type(); static final _id_BASE_OS = _class.staticFieldId( r'BASE_OS', r'Ljava/lang/String;', @@ -4776,16 +4776,16 @@ class Build_VERSION extends jni$_.JObject { /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory Build_VERSION() { - return Build_VERSION.fromReference( + factory Build$VERSION() { + return Build$VERSION.fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Build_VERSION$NullableType extends jni$_.JObjType { +final class $Build$VERSION$NullableType extends jni$_.JObjType { @jni$_.internal - const $Build_VERSION$NullableType(); + const $Build$VERSION$NullableType(); @jni$_.internal @core$_.override @@ -4793,9 +4793,9 @@ final class $Build_VERSION$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - Build_VERSION? fromReference(jni$_.JReference reference) => reference.isNull + Build$VERSION? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Build_VERSION.fromReference( + : Build$VERSION.fromReference( reference, ); @jni$_.internal @@ -4804,25 +4804,25 @@ final class $Build_VERSION$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Build_VERSION$NullableType).hashCode; + int get hashCode => ($Build$VERSION$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Build_VERSION$NullableType) && - other is $Build_VERSION$NullableType; + return other.runtimeType == ($Build$VERSION$NullableType) && + other is $Build$VERSION$NullableType; } } -final class $Build_VERSION$Type extends jni$_.JObjType { +final class $Build$VERSION$Type extends jni$_.JObjType { @jni$_.internal - const $Build_VERSION$Type(); + const $Build$VERSION$Type(); @jni$_.internal @core$_.override @@ -4830,8 +4830,8 @@ final class $Build_VERSION$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - Build_VERSION fromReference(jni$_.JReference reference) => - Build_VERSION.fromReference( + Build$VERSION fromReference(jni$_.JReference reference) => + Build$VERSION.fromReference( reference, ); @jni$_.internal @@ -4840,31 +4840,31 @@ final class $Build_VERSION$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Build_VERSION$NullableType(); + jni$_.JObjType get nullableType => + const $Build$VERSION$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Build_VERSION$Type).hashCode; + int get hashCode => ($Build$VERSION$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Build_VERSION$Type) && - other is $Build_VERSION$Type; + return other.runtimeType == ($Build$VERSION$Type) && + other is $Build$VERSION$Type; } } /// from: `android.os.Build$VERSION_CODES` -class Build_VERSION_CODES extends jni$_.JObject { +class Build$VERSION_CODES extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Build_VERSION_CODES.fromReference( + Build$VERSION_CODES.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -4872,8 +4872,8 @@ class Build_VERSION_CODES extends jni$_.JObject { static final _class = jni$_.JClass.forName(r'android/os/Build$VERSION_CODES'); /// The type which includes information such as the signature of this class. - static const nullableType = $Build_VERSION_CODES$NullableType(); - static const type = $Build_VERSION_CODES$Type(); + static const nullableType = $Build$VERSION_CODES$NullableType(); + static const type = $Build$VERSION_CODES$Type(); /// from: `static public final int BASE` static const BASE = 1; @@ -5000,17 +5000,17 @@ class Build_VERSION_CODES extends jni$_.JObject { /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory Build_VERSION_CODES() { - return Build_VERSION_CODES.fromReference( + factory Build$VERSION_CODES() { + return Build$VERSION_CODES.fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Build_VERSION_CODES$NullableType - extends jni$_.JObjType { +final class $Build$VERSION_CODES$NullableType + extends jni$_.JObjType { @jni$_.internal - const $Build_VERSION_CODES$NullableType(); + const $Build$VERSION_CODES$NullableType(); @jni$_.internal @core$_.override @@ -5018,10 +5018,10 @@ final class $Build_VERSION_CODES$NullableType @jni$_.internal @core$_.override - Build_VERSION_CODES? fromReference(jni$_.JReference reference) => + Build$VERSION_CODES? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Build_VERSION_CODES.fromReference( + : Build$VERSION_CODES.fromReference( reference, ); @jni$_.internal @@ -5030,26 +5030,26 @@ final class $Build_VERSION_CODES$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Build_VERSION_CODES$NullableType).hashCode; + int get hashCode => ($Build$VERSION_CODES$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Build_VERSION_CODES$NullableType) && - other is $Build_VERSION_CODES$NullableType; + return other.runtimeType == ($Build$VERSION_CODES$NullableType) && + other is $Build$VERSION_CODES$NullableType; } } -final class $Build_VERSION_CODES$Type - extends jni$_.JObjType { +final class $Build$VERSION_CODES$Type + extends jni$_.JObjType { @jni$_.internal - const $Build_VERSION_CODES$Type(); + const $Build$VERSION_CODES$Type(); @jni$_.internal @core$_.override @@ -5057,8 +5057,8 @@ final class $Build_VERSION_CODES$Type @jni$_.internal @core$_.override - Build_VERSION_CODES fromReference(jni$_.JReference reference) => - Build_VERSION_CODES.fromReference( + Build$VERSION_CODES fromReference(jni$_.JReference reference) => + Build$VERSION_CODES.fromReference( reference, ); @jni$_.internal @@ -5067,20 +5067,20 @@ final class $Build_VERSION_CODES$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Build_VERSION_CODES$NullableType(); + jni$_.JObjType get nullableType => + const $Build$VERSION_CODES$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Build_VERSION_CODES$Type).hashCode; + int get hashCode => ($Build$VERSION_CODES$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Build_VERSION_CODES$Type) && - other is $Build_VERSION_CODES$Type; + return other.runtimeType == ($Build$VERSION_CODES$Type) && + other is $Build$VERSION_CODES$Type; } } @@ -5457,12 +5457,12 @@ class Build extends jni$_.JObject { /// from: `static public java.util.List getFingerprintedPartitions()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JList? getFingerprintedPartitions() { + static jni$_.JList? getFingerprintedPartitions() { return _getFingerprintedPartitions(_class.reference.pointer, _id_getFingerprintedPartitions as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JListNullableType( - $Build_Partition$NullableType())); + .object?>( + const jni$_.JListNullableType( + $Build$Partition$NullableType())); } static final _id_getRadioVersion = _class.staticMethodId( diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index 11fbfec83..2020a5cf9 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart @@ -175,11 +175,17 @@ class _ClassRenamer implements Visitor { } node.methodNumsAfterRenaming = {}; - // TODO(https://github.com/dart-lang/native/issues/1516): Nested classes - // should continue to use dollar sign. - // TODO(https://github.com/dart-lang/native/issues/1544): Class names can - // have dollar signs even if not nested. - final className = _preprocess(node.name.replaceAll(r'$', '_')); + final superClass = (node.superclass!.type as DeclaredType).classDecl; + superClass.accept(this); + nameCounts[node]!.addAll(nameCounts[superClass] ?? {}); + + if (node.outerClass case final outerClass?) { + outerClass.accept(this); + } + + final outerClassName = + node.outerClass == null ? '' : '${node.outerClass!.finalName}\$'; + final className = '$outerClassName${_preprocess(node.name)}'; // When generating all the classes in a single file // the names need to be unique. @@ -192,10 +198,6 @@ class _ClassRenamer implements Visitor { node.nullableTypeClassName = '\$${node.finalName}\$NullableType'; log.fine('Class ${node.binaryName} is named ${node.finalName}'); - final superClass = (node.superclass!.type as DeclaredType).classDecl; - superClass.accept(this); - nameCounts[node]!.addAll(nameCounts[superClass] ?? {}); - // Rename fields before renaming methods. In case a method and a field have // identical names, the field will keep its original name and the // method will be renamed. diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart index 970c6bfa3..d1bcaaadd 100644 --- a/pkgs/jnigen/lib/src/elements/elements.dart +++ b/pkgs/jnigen/lib/src/elements/elements.dart @@ -179,8 +179,17 @@ class ClassDecl with ClassMember, Annotated implements Element { @override ClassDecl get classDecl => this; + /// Simple name of this class without the outerclasses. + /// + /// This is not uniquely identifiable from the [binaryName]. For instance, + /// `com.xyz.Foo$Bar` could represent a class named `Bar` that is nested in a + /// class name `Foo` in which case its name is `Bar`. But it can also + /// represent a class named `Foo$Bar`. @override - String get name => binaryName.split('.').last; + String get name => binaryName + .substring((outerClassBinaryName?.length ?? -1) + 1) + .split('.') + .last; bool get isObject => superCount == 0; diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart index a9b078db9..71d30a020 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -58,13 +58,13 @@ import 'JsonParser.dart' as jsonparser$_; /// /// Enumeration that defines all on/off features that can only be /// changed for JsonFactory. -class JsonFactory_Feature extends jni$_.JObject { +class JsonFactory$Feature extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - JsonFactory_Feature.fromReference( + JsonFactory$Feature.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -73,8 +73,8 @@ class JsonFactory_Feature extends jni$_.JObject { jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonFactory$Feature'); /// The type which includes information such as the signature of this class. - static const nullableType = $JsonFactory_Feature$NullableType(); - static const type = $JsonFactory_Feature$Type(); + static const nullableType = $JsonFactory$Feature$NullableType(); + static const type = $JsonFactory$Feature$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;', @@ -94,11 +94,11 @@ class JsonFactory_Feature extends jni$_.JObject { /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JArray? values() { + static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType( - $JsonFactory_Feature$NullableType())); + .object?>( + const jni$_.JArrayNullableType( + $JsonFactory$Feature$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -119,14 +119,14 @@ class JsonFactory_Feature extends jni$_.JObject { /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonFactory_Feature? valueOf( + static JsonFactory$Feature? valueOf( jni$_.JString? name, ) { final _$name = name?.reference ?? jni$_.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) - .object( - const $JsonFactory_Feature$NullableType()); + .object( + const $JsonFactory$Feature$NullableType()); } static final _id_collectDefaults = _class.staticMethodId( @@ -230,10 +230,10 @@ class JsonFactory_Feature extends jni$_.JObject { } } -final class $JsonFactory_Feature$NullableType - extends jni$_.JObjType { +final class $JsonFactory$Feature$NullableType + extends jni$_.JObjType { @jni$_.internal - const $JsonFactory_Feature$NullableType(); + const $JsonFactory$Feature$NullableType(); @jni$_.internal @core$_.override @@ -241,10 +241,10 @@ final class $JsonFactory_Feature$NullableType @jni$_.internal @core$_.override - JsonFactory_Feature? fromReference(jni$_.JReference reference) => + JsonFactory$Feature? fromReference(jni$_.JReference reference) => reference.isNull ? null - : JsonFactory_Feature.fromReference( + : JsonFactory$Feature.fromReference( reference, ); @jni$_.internal @@ -253,26 +253,26 @@ final class $JsonFactory_Feature$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonFactory_Feature$NullableType).hashCode; + int get hashCode => ($JsonFactory$Feature$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonFactory_Feature$NullableType) && - other is $JsonFactory_Feature$NullableType; + return other.runtimeType == ($JsonFactory$Feature$NullableType) && + other is $JsonFactory$Feature$NullableType; } } -final class $JsonFactory_Feature$Type - extends jni$_.JObjType { +final class $JsonFactory$Feature$Type + extends jni$_.JObjType { @jni$_.internal - const $JsonFactory_Feature$Type(); + const $JsonFactory$Feature$Type(); @jni$_.internal @core$_.override @@ -280,8 +280,8 @@ final class $JsonFactory_Feature$Type @jni$_.internal @core$_.override - JsonFactory_Feature fromReference(jni$_.JReference reference) => - JsonFactory_Feature.fromReference( + JsonFactory$Feature fromReference(jni$_.JReference reference) => + JsonFactory$Feature.fromReference( reference, ); @jni$_.internal @@ -290,20 +290,20 @@ final class $JsonFactory_Feature$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $JsonFactory_Feature$NullableType(); + jni$_.JObjType get nullableType => + const $JsonFactory$Feature$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonFactory_Feature$Type).hashCode; + int get hashCode => ($JsonFactory$Feature$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonFactory_Feature$Type) && - other is $JsonFactory_Feature$Type; + return other.runtimeType == ($JsonFactory$Feature$Type) && + other is $JsonFactory$Feature$Type; } } @@ -932,7 +932,7 @@ class JsonFactory extends jni$_.JObject { ///@return This factory instance (to allow call chaining) ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead JsonFactory? configure( - JsonFactory_Feature? f, + JsonFactory$Feature? f, bool state, ) { final _$f = f?.reference ?? jni$_.jNullReference; @@ -966,7 +966,7 @@ class JsonFactory extends jni$_.JObject { ///@return This factory instance (to allow call chaining) ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead JsonFactory? enable( - JsonFactory_Feature? f, + JsonFactory$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _enable( @@ -999,7 +999,7 @@ class JsonFactory extends jni$_.JObject { ///@return This factory instance (to allow call chaining) ///@deprecated since 2.10 use JsonFactoryBuilder\#configure(JsonFactory.Feature, boolean) instead JsonFactory? disable( - JsonFactory_Feature? f, + JsonFactory$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _disable( @@ -1029,7 +1029,7 @@ class JsonFactory extends jni$_.JObject { ///@param f Feature to check ///@return True if the specified feature is enabled bool isEnabled( - JsonFactory_Feature? f, + JsonFactory$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled( @@ -1160,7 +1160,7 @@ class JsonFactory extends jni$_.JObject { ///@param state Whether to enable or disable the feature ///@return This factory instance (to allow call chaining) JsonFactory? configure$1( - jsonparser$_.JsonParser_Feature? f, + jsonparser$_.JsonParser$Feature? f, bool state, ) { final _$f = f?.reference ?? jni$_.jNullReference; @@ -1193,7 +1193,7 @@ class JsonFactory extends jni$_.JObject { ///@param f Feature to enable ///@return This factory instance (to allow call chaining) JsonFactory? enable$1( - jsonparser$_.JsonParser_Feature? f, + jsonparser$_.JsonParser$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _enable$1( @@ -1225,7 +1225,7 @@ class JsonFactory extends jni$_.JObject { ///@param f Feature to disable ///@return This factory instance (to allow call chaining) JsonFactory? disable$1( - jsonparser$_.JsonParser_Feature? f, + jsonparser$_.JsonParser$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _disable$1( @@ -1255,7 +1255,7 @@ class JsonFactory extends jni$_.JObject { ///@param f Feature to check ///@return True if specified feature is enabled bool isEnabled$1( - jsonparser$_.JsonParser_Feature? f, + jsonparser$_.JsonParser$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled$1(reference.pointer, diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart index cedb7cc97..d4cf58115 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -57,13 +57,13 @@ import 'JsonToken.dart' as jsontoken$_; /// from: `com.fasterxml.jackson.core.JsonParser$Feature` /// /// Enumeration that defines all on/off features for parsers. -class JsonParser_Feature extends jni$_.JObject { +class JsonParser$Feature extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - JsonParser_Feature.fromReference( + JsonParser$Feature.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -72,8 +72,8 @@ class JsonParser_Feature extends jni$_.JObject { jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$Feature'); /// The type which includes information such as the signature of this class. - static const nullableType = $JsonParser_Feature$NullableType(); - static const type = $JsonParser_Feature$Type(); + static const nullableType = $JsonParser$Feature$NullableType(); + static const type = $JsonParser$Feature$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonParser$Feature;', @@ -93,11 +93,11 @@ class JsonParser_Feature extends jni$_.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JArray? values() { + static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType( - $JsonParser_Feature$NullableType())); + .object?>( + const jni$_.JArrayNullableType( + $JsonParser$Feature$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -118,13 +118,13 @@ class JsonParser_Feature extends jni$_.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonParser_Feature? valueOf( + static JsonParser$Feature? valueOf( jni$_.JString? name, ) { final _$name = name?.reference ?? jni$_.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) - .object(const $JsonParser_Feature$NullableType()); + .object(const $JsonParser$Feature$NullableType()); } static final _id_collectDefaults = _class.staticMethodId( @@ -228,10 +228,10 @@ class JsonParser_Feature extends jni$_.JObject { } } -final class $JsonParser_Feature$NullableType - extends jni$_.JObjType { +final class $JsonParser$Feature$NullableType + extends jni$_.JObjType { @jni$_.internal - const $JsonParser_Feature$NullableType(); + const $JsonParser$Feature$NullableType(); @jni$_.internal @core$_.override @@ -239,10 +239,10 @@ final class $JsonParser_Feature$NullableType @jni$_.internal @core$_.override - JsonParser_Feature? fromReference(jni$_.JReference reference) => + JsonParser$Feature? fromReference(jni$_.JReference reference) => reference.isNull ? null - : JsonParser_Feature.fromReference( + : JsonParser$Feature.fromReference( reference, ); @jni$_.internal @@ -251,26 +251,26 @@ final class $JsonParser_Feature$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonParser_Feature$NullableType).hashCode; + int get hashCode => ($JsonParser$Feature$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_Feature$NullableType) && - other is $JsonParser_Feature$NullableType; + return other.runtimeType == ($JsonParser$Feature$NullableType) && + other is $JsonParser$Feature$NullableType; } } -final class $JsonParser_Feature$Type - extends jni$_.JObjType { +final class $JsonParser$Feature$Type + extends jni$_.JObjType { @jni$_.internal - const $JsonParser_Feature$Type(); + const $JsonParser$Feature$Type(); @jni$_.internal @core$_.override @@ -278,8 +278,8 @@ final class $JsonParser_Feature$Type @jni$_.internal @core$_.override - JsonParser_Feature fromReference(jni$_.JReference reference) => - JsonParser_Feature.fromReference( + JsonParser$Feature fromReference(jni$_.JReference reference) => + JsonParser$Feature.fromReference( reference, ); @jni$_.internal @@ -288,20 +288,20 @@ final class $JsonParser_Feature$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $JsonParser_Feature$NullableType(); + jni$_.JObjType get nullableType => + const $JsonParser$Feature$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonParser_Feature$Type).hashCode; + int get hashCode => ($JsonParser$Feature$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_Feature$Type) && - other is $JsonParser_Feature$Type; + return other.runtimeType == ($JsonParser$Feature$Type) && + other is $JsonParser$Feature$Type; } } @@ -309,13 +309,13 @@ final class $JsonParser_Feature$Type /// /// Enumeration of possible "native" (optimal) types that can be /// used for numbers. -class JsonParser_NumberType extends jni$_.JObject { +class JsonParser$NumberType extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - JsonParser_NumberType.fromReference( + JsonParser$NumberType.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -324,8 +324,8 @@ class JsonParser_NumberType extends jni$_.JObject { jni$_.JClass.forName(r'com/fasterxml/jackson/core/JsonParser$NumberType'); /// The type which includes information such as the signature of this class. - static const nullableType = $JsonParser_NumberType$NullableType(); - static const type = $JsonParser_NumberType$Type(); + static const nullableType = $JsonParser$NumberType$NullableType(); + static const type = $JsonParser$NumberType$Type(); static final _id_values = _class.staticMethodId( r'values', r'()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;', @@ -345,11 +345,11 @@ class JsonParser_NumberType extends jni$_.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JArray? values() { + static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType( - $JsonParser_NumberType$NullableType())); + .object?>( + const jni$_.JArrayNullableType( + $JsonParser$NumberType$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -370,21 +370,21 @@ class JsonParser_NumberType extends jni$_.JObject { /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. - static JsonParser_NumberType? valueOf( + static JsonParser$NumberType? valueOf( jni$_.JString? name, ) { final _$name = name?.reference ?? jni$_.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$name.pointer) - .object( - const $JsonParser_NumberType$NullableType()); + .object( + const $JsonParser$NumberType$NullableType()); } } -final class $JsonParser_NumberType$NullableType - extends jni$_.JObjType { +final class $JsonParser$NumberType$NullableType + extends jni$_.JObjType { @jni$_.internal - const $JsonParser_NumberType$NullableType(); + const $JsonParser$NumberType$NullableType(); @jni$_.internal @core$_.override @@ -392,10 +392,10 @@ final class $JsonParser_NumberType$NullableType @jni$_.internal @core$_.override - JsonParser_NumberType? fromReference(jni$_.JReference reference) => + JsonParser$NumberType? fromReference(jni$_.JReference reference) => reference.isNull ? null - : JsonParser_NumberType.fromReference( + : JsonParser$NumberType.fromReference( reference, ); @jni$_.internal @@ -404,26 +404,26 @@ final class $JsonParser_NumberType$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonParser_NumberType$NullableType).hashCode; + int get hashCode => ($JsonParser$NumberType$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_NumberType$NullableType) && - other is $JsonParser_NumberType$NullableType; + return other.runtimeType == ($JsonParser$NumberType$NullableType) && + other is $JsonParser$NumberType$NullableType; } } -final class $JsonParser_NumberType$Type - extends jni$_.JObjType { +final class $JsonParser$NumberType$Type + extends jni$_.JObjType { @jni$_.internal - const $JsonParser_NumberType$Type(); + const $JsonParser$NumberType$Type(); @jni$_.internal @core$_.override @@ -431,8 +431,8 @@ final class $JsonParser_NumberType$Type @jni$_.internal @core$_.override - JsonParser_NumberType fromReference(jni$_.JReference reference) => - JsonParser_NumberType.fromReference( + JsonParser$NumberType fromReference(jni$_.JReference reference) => + JsonParser$NumberType.fromReference( reference, ); @jni$_.internal @@ -441,20 +441,20 @@ final class $JsonParser_NumberType$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $JsonParser_NumberType$NullableType(); + jni$_.JObjType get nullableType => + const $JsonParser$NumberType$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonParser_NumberType$Type).hashCode; + int get hashCode => ($JsonParser$NumberType$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonParser_NumberType$Type) && - other is $JsonParser_NumberType$Type; + return other.runtimeType == ($JsonParser$NumberType$Type) && + other is $JsonParser$NumberType$Type; } } @@ -1412,7 +1412,7 @@ class JsonParser extends jni$_.JObject { ///@param f Feature to enable ///@return This parser, to allow call chaining JsonParser? enable( - JsonParser_Feature? f, + JsonParser$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _enable( @@ -1444,7 +1444,7 @@ class JsonParser extends jni$_.JObject { ///@param f Feature to disable ///@return This parser, to allow call chaining JsonParser? disable( - JsonParser_Feature? f, + JsonParser$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _disable( @@ -1478,7 +1478,7 @@ class JsonParser extends jni$_.JObject { ///@param state Whether to enable feature ({@code true}) or disable ({@code false}) ///@return This parser, to allow call chaining JsonParser? configure( - JsonParser_Feature? f, + JsonParser$Feature? f, bool state, ) { final _$f = f?.reference ?? jni$_.jNullReference; @@ -1509,7 +1509,7 @@ class JsonParser extends jni$_.JObject { ///@param f Feature to check ///@return {@code True} if feature is enabled; {@code false} otherwise bool isEnabled( - JsonParser_Feature? f, + JsonParser$Feature? f, ) { final _$f = f?.reference ?? jni$_.jNullReference; return _isEnabled( @@ -2993,11 +2993,11 @@ class JsonParser extends jni$_.JObject { ///@return Type of current number, if parser points to numeric token; {@code null} otherwise ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - JsonParser_NumberType? getNumberType() { + JsonParser$NumberType? getNumberType() { return _getNumberType( reference.pointer, _id_getNumberType as jni$_.JMethodIDPtr) - .object( - const $JsonParser_NumberType$NullableType()); + .object( + const $JsonParser$NumberType$NullableType()); } static final _id_getByteValue = _class.instanceMethodId( diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index a7ba372f5..2d8ea9bc6 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -492,11 +492,11 @@ final class $MeasureUnit$Type extends jni$_.JObjType { } /// from: `com.github.dart_lang.jnigen.Nullability$InnerClass` -class Nullability_InnerClass<$T extends jni$_.JObject?, +class Nullability$InnerClass<$T extends jni$_.JObject?, $U extends jni$_.JObject, $V extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$T> T; @@ -508,7 +508,7 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, final jni$_.JObjType<$V> V; @jni$_.internal - Nullability_InnerClass.fromReference( + Nullability$InnerClass.fromReference( this.T, this.U, this.V, @@ -520,7 +520,7 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, r'com/github/dart_lang/jnigen/Nullability$InnerClass'); /// The type which includes information such as the signature of this class. - static $Nullability_InnerClass$NullableType<$T, $U, $V> nullableType< + static $Nullability$InnerClass$NullableType<$T, $U, $V> nullableType< $T extends jni$_.JObject?, $U extends jni$_.JObject, $V extends jni$_.JObject?>( @@ -528,14 +528,14 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, jni$_.JObjType<$U> U, jni$_.JObjType<$V> V, ) { - return $Nullability_InnerClass$NullableType<$T, $U, $V>( + return $Nullability$InnerClass$NullableType<$T, $U, $V>( T, U, V, ); } - static $Nullability_InnerClass$Type<$T, $U, $V> type< + static $Nullability$InnerClass$Type<$T, $U, $V> type< $T extends jni$_.JObject?, $U extends jni$_.JObject, $V extends jni$_.JObject?>( @@ -543,7 +543,7 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, jni$_.JObjType<$U> U, jni$_.JObjType<$V> V, ) { - return $Nullability_InnerClass$Type<$T, $U, $V>( + return $Nullability$InnerClass$Type<$T, $U, $V>( T, U, V, @@ -567,7 +567,7 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, /// from: `public void (com.github.dart_lang.jnigen.Nullability $outerClass)` /// The returned object must be released after use, by calling the [release] method. - factory Nullability_InnerClass( + factory Nullability$InnerClass( Nullability<$T?, $U> $outerClass, { jni$_.JObjType<$T>? T, jni$_.JObjType<$U>? U, @@ -582,7 +582,7 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, .U, ]) as jni$_.JObjType<$U>; final _$$outerClass = $outerClass.reference; - return Nullability_InnerClass<$T, $U, $V>.fromReference( + return Nullability$InnerClass<$T, $U, $V>.fromReference( T, U, V, @@ -630,9 +630,9 @@ class Nullability_InnerClass<$T extends jni$_.JObject?, } } -final class $Nullability_InnerClass$NullableType<$T extends jni$_.JObject?, +final class $Nullability$InnerClass$NullableType<$T extends jni$_.JObject?, $U extends jni$_.JObject, $V extends jni$_.JObject?> - extends jni$_.JObjType?> { + extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -643,7 +643,7 @@ final class $Nullability_InnerClass$NullableType<$T extends jni$_.JObject?, final jni$_.JObjType<$V> V; @jni$_.internal - const $Nullability_InnerClass$NullableType( + const $Nullability$InnerClass$NullableType( this.T, this.U, this.V, @@ -656,11 +656,11 @@ final class $Nullability_InnerClass$NullableType<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - Nullability_InnerClass<$T, $U, $V>? fromReference( + Nullability$InnerClass<$T, $U, $V>? fromReference( jni$_.JReference reference) => reference.isNull ? null - : Nullability_InnerClass<$T, $U, $V>.fromReference( + : Nullability$InnerClass<$T, $U, $V>.fromReference( T, U, V, @@ -672,7 +672,7 @@ final class $Nullability_InnerClass$NullableType<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => this; + jni$_.JObjType?> get nullableType => this; @jni$_.internal @core$_.override @@ -680,22 +680,22 @@ final class $Nullability_InnerClass$NullableType<$T extends jni$_.JObject?, @core$_.override int get hashCode => - Object.hash($Nullability_InnerClass$NullableType, T, U, V); + Object.hash($Nullability$InnerClass$NullableType, T, U, V); @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($Nullability_InnerClass$NullableType<$T, $U, $V>) && - other is $Nullability_InnerClass$NullableType<$T, $U, $V> && + ($Nullability$InnerClass$NullableType<$T, $U, $V>) && + other is $Nullability$InnerClass$NullableType<$T, $U, $V> && T == other.T && U == other.U && V == other.V; } } -final class $Nullability_InnerClass$Type<$T extends jni$_.JObject?, +final class $Nullability$InnerClass$Type<$T extends jni$_.JObject?, $U extends jni$_.JObject, $V extends jni$_.JObject?> - extends jni$_.JObjType> { + extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -706,7 +706,7 @@ final class $Nullability_InnerClass$Type<$T extends jni$_.JObject?, final jni$_.JObjType<$V> V; @jni$_.internal - const $Nullability_InnerClass$Type( + const $Nullability$InnerClass$Type( this.T, this.U, this.V, @@ -719,9 +719,9 @@ final class $Nullability_InnerClass$Type<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - Nullability_InnerClass<$T, $U, $V> fromReference( + Nullability$InnerClass<$T, $U, $V> fromReference( jni$_.JReference reference) => - Nullability_InnerClass<$T, $U, $V>.fromReference( + Nullability$InnerClass<$T, $U, $V>.fromReference( T, U, V, @@ -733,20 +733,20 @@ final class $Nullability_InnerClass$Type<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $Nullability_InnerClass$NullableType<$T, $U, $V>(T, U, V); + jni$_.JObjType?> get nullableType => + $Nullability$InnerClass$NullableType<$T, $U, $V>(T, U, V); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($Nullability_InnerClass$Type, T, U, V); + int get hashCode => Object.hash($Nullability$InnerClass$Type, T, U, V); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Nullability_InnerClass$Type<$T, $U, $V>) && - other is $Nullability_InnerClass$Type<$T, $U, $V> && + return other.runtimeType == ($Nullability$InnerClass$Type<$T, $U, $V>) && + other is $Nullability$InnerClass$Type<$T, $U, $V> && T == other.T && U == other.U && V == other.V; diff --git a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart index aceef678f..d946df915 100644 --- a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart @@ -235,7 +235,7 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Inner class', () { using((arena) { final obj = testObject(arena); - final innerObj = Nullability_InnerClass( + final innerObj = Nullability$InnerClass( obj, V: JInteger.type); expect( diff --git a/pkgs/jnigen/test/renamer_test.dart b/pkgs/jnigen/test/renamer_test.dart index 5fea38fc6..d2c9bac24 100644 --- a/pkgs/jnigen/test/renamer_test.dart +++ b/pkgs/jnigen/test/renamer_test.dart @@ -177,8 +177,6 @@ void main() { }); test('Names with existing dollar signs', () async { - // TODO(https://github.com/dart-lang/native/issues/1544): Test class names - // containing dollar signs. final classes = Classes({ 'Foo': ClassDecl( binaryName: 'Foo', @@ -295,4 +293,42 @@ void main() { final classRenamedMethods = classes.decls['MyClass']!.methods.finalNames; expect(classRenamedMethods, [r'implement', r'implementIn']); }); + + test('Inner classes vs classes with dollar signs', () async { + final classes = Classes({ + 'Outer': ClassDecl( + binaryName: 'Outer', + declKind: DeclKind.classKind, + superclass: TypeUsage.object, + methods: [], + ), + r'Outer$Inner': ClassDecl( + binaryName: r'Outer$Inner', + declKind: DeclKind.classKind, + superclass: TypeUsage.object, + methods: [], + outerClassBinaryName: 'Outer', + ), + r'Outer$Inner$Innermost': ClassDecl( + binaryName: r'Outer$Inner$Innermost', + declKind: DeclKind.classKind, + superclass: TypeUsage.object, + methods: [], + outerClassBinaryName: r'Outer$Inner', + ), + r'Outer$With$Many$Dollarsigns': ClassDecl( + binaryName: r'Outer$With$Many$Dollarsigns', + declKind: DeclKind.classKind, + superclass: TypeUsage.object, + methods: [], + ), + }); + await rename(classes); + expect(classes.decls['Outer']!.finalName, 'Outer'); + expect(classes.decls[r'Outer$Inner']!.finalName, r'Outer$Inner'); + expect(classes.decls[r'Outer$Inner$Innermost']!.finalName, + r'Outer$Inner$Innermost'); + expect(classes.decls[r'Outer$With$Many$Dollarsigns']!.finalName, + r'Outer$$With$$Many$$Dollarsigns'); + }); } diff --git a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart index 80aa9e5a3..c51518b81 100644 --- a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart @@ -237,13 +237,13 @@ final class $Color$Type extends jni$_.JObjType { } /// from: `com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice` -class Example_Nested_NestedTwice extends jni$_.JObject { +class Example$Nested$NestedTwice extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Example_Nested_NestedTwice.fromReference( + Example$Nested$NestedTwice.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -252,8 +252,8 @@ class Example_Nested_NestedTwice extends jni$_.JObject { r'com/github/dart_lang/jnigen/simple_package/Example$Nested$NestedTwice'); /// The type which includes information such as the signature of this class. - static const nullableType = $Example_Nested_NestedTwice$NullableType(); - static const type = $Example_Nested_NestedTwice$Type(); + static const nullableType = $Example$Nested$NestedTwice$NullableType(); + static const type = $Example$Nested$NestedTwice$Type(); static final _id_ZERO = _class.staticFieldId( r'ZERO', r'I', @@ -284,17 +284,17 @@ class Example_Nested_NestedTwice extends jni$_.JObject { /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory Example_Nested_NestedTwice() { - return Example_Nested_NestedTwice.fromReference( + factory Example$Nested$NestedTwice() { + return Example$Nested$NestedTwice.fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Example_Nested_NestedTwice$NullableType - extends jni$_.JObjType { +final class $Example$Nested$NestedTwice$NullableType + extends jni$_.JObjType { @jni$_.internal - const $Example_Nested_NestedTwice$NullableType(); + const $Example$Nested$NestedTwice$NullableType(); @jni$_.internal @core$_.override @@ -303,10 +303,10 @@ final class $Example_Nested_NestedTwice$NullableType @jni$_.internal @core$_.override - Example_Nested_NestedTwice? fromReference(jni$_.JReference reference) => + Example$Nested$NestedTwice? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Example_Nested_NestedTwice.fromReference( + : Example$Nested$NestedTwice.fromReference( reference, ); @jni$_.internal @@ -315,26 +315,26 @@ final class $Example_Nested_NestedTwice$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Example_Nested_NestedTwice$NullableType).hashCode; + int get hashCode => ($Example$Nested$NestedTwice$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested_NestedTwice$NullableType) && - other is $Example_Nested_NestedTwice$NullableType; + return other.runtimeType == ($Example$Nested$NestedTwice$NullableType) && + other is $Example$Nested$NestedTwice$NullableType; } } -final class $Example_Nested_NestedTwice$Type - extends jni$_.JObjType { +final class $Example$Nested$NestedTwice$Type + extends jni$_.JObjType { @jni$_.internal - const $Example_Nested_NestedTwice$Type(); + const $Example$Nested$NestedTwice$Type(); @jni$_.internal @core$_.override @@ -343,8 +343,8 @@ final class $Example_Nested_NestedTwice$Type @jni$_.internal @core$_.override - Example_Nested_NestedTwice fromReference(jni$_.JReference reference) => - Example_Nested_NestedTwice.fromReference( + Example$Nested$NestedTwice fromReference(jni$_.JReference reference) => + Example$Nested$NestedTwice.fromReference( reference, ); @jni$_.internal @@ -353,31 +353,31 @@ final class $Example_Nested_NestedTwice$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Example_Nested_NestedTwice$NullableType(); + jni$_.JObjType get nullableType => + const $Example$Nested$NestedTwice$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Example_Nested_NestedTwice$Type).hashCode; + int get hashCode => ($Example$Nested$NestedTwice$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested_NestedTwice$Type) && - other is $Example_Nested_NestedTwice$Type; + return other.runtimeType == ($Example$Nested$NestedTwice$Type) && + other is $Example$Nested$NestedTwice$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Example$Nested` -class Example_Nested extends jni$_.JObject { +class Example$Nested extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Example_Nested.fromReference( + Example$Nested.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -386,8 +386,8 @@ class Example_Nested extends jni$_.JObject { r'com/github/dart_lang/jnigen/simple_package/Example$Nested'); /// The type which includes information such as the signature of this class. - static const nullableType = $Example_Nested$NullableType(); - static const type = $Example_Nested$Type(); + static const nullableType = $Example$Nested$NullableType(); + static const type = $Example$Nested$Type(); static final _id_new$ = _class.constructorId( r'(Z)V', ); @@ -404,10 +404,10 @@ class Example_Nested extends jni$_.JObject { /// from: `public void (boolean z)` /// The returned object must be released after use, by calling the [release] method. - factory Example_Nested( + factory Example$Nested( bool z, ) { - return Example_Nested.fromReference(_new$( + return Example$Nested.fromReference(_new$( _class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, z ? 1 : 0) .reference); } @@ -483,10 +483,10 @@ class Example_Nested extends jni$_.JObject { } } -final class $Example_Nested$NullableType - extends jni$_.JObjType { +final class $Example$Nested$NullableType + extends jni$_.JObjType { @jni$_.internal - const $Example_Nested$NullableType(); + const $Example$Nested$NullableType(); @jni$_.internal @core$_.override @@ -495,9 +495,9 @@ final class $Example_Nested$NullableType @jni$_.internal @core$_.override - Example_Nested? fromReference(jni$_.JReference reference) => reference.isNull + Example$Nested? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Example_Nested.fromReference( + : Example$Nested.fromReference( reference, ); @jni$_.internal @@ -506,25 +506,25 @@ final class $Example_Nested$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Example_Nested$NullableType).hashCode; + int get hashCode => ($Example$Nested$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested$NullableType) && - other is $Example_Nested$NullableType; + return other.runtimeType == ($Example$Nested$NullableType) && + other is $Example$Nested$NullableType; } } -final class $Example_Nested$Type extends jni$_.JObjType { +final class $Example$Nested$Type extends jni$_.JObjType { @jni$_.internal - const $Example_Nested$Type(); + const $Example$Nested$Type(); @jni$_.internal @core$_.override @@ -533,8 +533,8 @@ final class $Example_Nested$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - Example_Nested fromReference(jni$_.JReference reference) => - Example_Nested.fromReference( + Example$Nested fromReference(jni$_.JReference reference) => + Example$Nested.fromReference( reference, ); @jni$_.internal @@ -543,31 +543,31 @@ final class $Example_Nested$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Example_Nested$NullableType(); + jni$_.JObjType get nullableType => + const $Example$Nested$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Example_Nested$Type).hashCode; + int get hashCode => ($Example$Nested$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Example_Nested$Type) && - other is $Example_Nested$Type; + return other.runtimeType == ($Example$Nested$Type) && + other is $Example$Nested$Type; } } /// from: `com.github.dart_lang.jnigen.simple_package.Example$NonStaticNested` -class Example_NonStaticNested extends jni$_.JObject { +class Example$NonStaticNested extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Example_NonStaticNested.fromReference( + Example$NonStaticNested.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -576,8 +576,8 @@ class Example_NonStaticNested extends jni$_.JObject { r'com/github/dart_lang/jnigen/simple_package/Example$NonStaticNested'); /// The type which includes information such as the signature of this class. - static const nullableType = $Example_NonStaticNested$NullableType(); - static const type = $Example_NonStaticNested$Type(); + static const nullableType = $Example$NonStaticNested$NullableType(); + static const type = $Example$NonStaticNested$Type(); static final _id_ok = _class.instanceFieldId( r'ok', r'Z', @@ -606,20 +606,20 @@ class Example_NonStaticNested extends jni$_.JObject { /// from: `public void (com.github.dart_lang.jnigen.simple_package.Example $outerClass)` /// The returned object must be released after use, by calling the [release] method. - factory Example_NonStaticNested( + factory Example$NonStaticNested( Example $outerClass, ) { final _$$outerClass = $outerClass.reference; - return Example_NonStaticNested.fromReference(_new$(_class.reference.pointer, + return Example$NonStaticNested.fromReference(_new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$$outerClass.pointer) .reference); } } -final class $Example_NonStaticNested$NullableType - extends jni$_.JObjType { +final class $Example$NonStaticNested$NullableType + extends jni$_.JObjType { @jni$_.internal - const $Example_NonStaticNested$NullableType(); + const $Example$NonStaticNested$NullableType(); @jni$_.internal @core$_.override @@ -628,10 +628,10 @@ final class $Example_NonStaticNested$NullableType @jni$_.internal @core$_.override - Example_NonStaticNested? fromReference(jni$_.JReference reference) => + Example$NonStaticNested? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Example_NonStaticNested.fromReference( + : Example$NonStaticNested.fromReference( reference, ); @jni$_.internal @@ -640,26 +640,26 @@ final class $Example_NonStaticNested$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Example_NonStaticNested$NullableType).hashCode; + int get hashCode => ($Example$NonStaticNested$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Example_NonStaticNested$NullableType) && - other is $Example_NonStaticNested$NullableType; + return other.runtimeType == ($Example$NonStaticNested$NullableType) && + other is $Example$NonStaticNested$NullableType; } } -final class $Example_NonStaticNested$Type - extends jni$_.JObjType { +final class $Example$NonStaticNested$Type + extends jni$_.JObjType { @jni$_.internal - const $Example_NonStaticNested$Type(); + const $Example$NonStaticNested$Type(); @jni$_.internal @core$_.override @@ -668,8 +668,8 @@ final class $Example_NonStaticNested$Type @jni$_.internal @core$_.override - Example_NonStaticNested fromReference(jni$_.JReference reference) => - Example_NonStaticNested.fromReference( + Example$NonStaticNested fromReference(jni$_.JReference reference) => + Example$NonStaticNested.fromReference( reference, ); @jni$_.internal @@ -678,20 +678,20 @@ final class $Example_NonStaticNested$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Example_NonStaticNested$NullableType(); + jni$_.JObjType get nullableType => + const $Example$NonStaticNested$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Example_NonStaticNested$Type).hashCode; + int get hashCode => ($Example$NonStaticNested$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Example_NonStaticNested$Type) && - other is $Example_NonStaticNested$Type; + return other.runtimeType == ($Example$NonStaticNested$Type) && + other is $Example$NonStaticNested$Type; } } @@ -859,10 +859,10 @@ class Example extends jni$_.JObject { /// from: `static public com.github.dart_lang.jnigen.simple_package.Example$Nested getNestedInstance()` /// The returned object must be released after use, by calling the [release] method. - static Example_Nested? getNestedInstance() { + static Example$Nested? getNestedInstance() { return _getNestedInstance(_class.reference.pointer, _id_getNestedInstance as jni$_.JMethodIDPtr) - .object(const $Example_Nested$NullableType()); + .object(const $Example$Nested$NullableType()); } static final _id_setAmount = _class.staticMethodId( @@ -931,7 +931,7 @@ class Example extends jni$_.JObject { /// from: `static public void setNestedInstance(com.github.dart_lang.jnigen.simple_package.Example$Nested nested)` static void setNestedInstance( - Example_Nested? nested, + Example$Nested? nested, ) { final _$nested = nested?.reference ?? jni$_.jNullReference; _setNestedInstance(_class.reference.pointer, @@ -2509,13 +2509,13 @@ final class $Exceptions$Type extends jni$_.JObjType { } /// from: `com.github.dart_lang.jnigen.simple_package.Fields$Nested` -class Fields_Nested extends jni$_.JObject { +class Fields$Nested extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - Fields_Nested.fromReference( + Fields$Nested.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -2524,8 +2524,8 @@ class Fields_Nested extends jni$_.JObject { r'com/github/dart_lang/jnigen/simple_package/Fields$Nested'); /// The type which includes information such as the signature of this class. - static const nullableType = $Fields_Nested$NullableType(); - static const type = $Fields_Nested$Type(); + static const nullableType = $Fields$Nested$NullableType(); + static const type = $Fields$Nested$Type(); static final _id_hundred = _class.instanceFieldId( r'hundred', r'J', @@ -2571,16 +2571,16 @@ class Fields_Nested extends jni$_.JObject { /// from: `public void ()` /// The returned object must be released after use, by calling the [release] method. - factory Fields_Nested() { - return Fields_Nested.fromReference( + factory Fields$Nested() { + return Fields$Nested.fromReference( _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) .reference); } } -final class $Fields_Nested$NullableType extends jni$_.JObjType { +final class $Fields$Nested$NullableType extends jni$_.JObjType { @jni$_.internal - const $Fields_Nested$NullableType(); + const $Fields$Nested$NullableType(); @jni$_.internal @core$_.override @@ -2589,9 +2589,9 @@ final class $Fields_Nested$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - Fields_Nested? fromReference(jni$_.JReference reference) => reference.isNull + Fields$Nested? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Fields_Nested.fromReference( + : Fields$Nested.fromReference( reference, ); @jni$_.internal @@ -2600,25 +2600,25 @@ final class $Fields_Nested$NullableType extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Fields_Nested$NullableType).hashCode; + int get hashCode => ($Fields$Nested$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Fields_Nested$NullableType) && - other is $Fields_Nested$NullableType; + return other.runtimeType == ($Fields$Nested$NullableType) && + other is $Fields$Nested$NullableType; } } -final class $Fields_Nested$Type extends jni$_.JObjType { +final class $Fields$Nested$Type extends jni$_.JObjType { @jni$_.internal - const $Fields_Nested$Type(); + const $Fields$Nested$Type(); @jni$_.internal @core$_.override @@ -2627,8 +2627,8 @@ final class $Fields_Nested$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - Fields_Nested fromReference(jni$_.JReference reference) => - Fields_Nested.fromReference( + Fields$Nested fromReference(jni$_.JReference reference) => + Fields$Nested.fromReference( reference, ); @jni$_.internal @@ -2637,20 +2637,20 @@ final class $Fields_Nested$Type extends jni$_.JObjType { @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $Fields_Nested$NullableType(); + jni$_.JObjType get nullableType => + const $Fields$Nested$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($Fields_Nested$Type).hashCode; + int get hashCode => ($Fields$Nested$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Fields_Nested$Type) && - other is $Fields_Nested$Type; + return other.runtimeType == ($Fields$Nested$Type) && + other is $Fields$Nested$Type; } } @@ -3353,13 +3353,13 @@ final class $GenericTypeParams$Type<$S extends jni$_.JObject?, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child` -class GrandParent_Parent_Child< +class GrandParent$Parent$Child< $T extends jni$_.JObject?, $S extends jni$_.JObject?, $U extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$T> T; @@ -3371,7 +3371,7 @@ class GrandParent_Parent_Child< final jni$_.JObjType<$U> U; @jni$_.internal - GrandParent_Parent_Child.fromReference( + GrandParent$Parent$Child.fromReference( this.T, this.S, this.U, @@ -3383,7 +3383,7 @@ class GrandParent_Parent_Child< r'com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child'); /// The type which includes information such as the signature of this class. - static $GrandParent_Parent_Child$NullableType<$T, $S, $U> nullableType< + static $GrandParent$Parent$Child$NullableType<$T, $S, $U> nullableType< $T extends jni$_.JObject?, $S extends jni$_.JObject?, $U extends jni$_.JObject?>( @@ -3391,14 +3391,14 @@ class GrandParent_Parent_Child< jni$_.JObjType<$S> S, jni$_.JObjType<$U> U, ) { - return $GrandParent_Parent_Child$NullableType<$T, $S, $U>( + return $GrandParent$Parent$Child$NullableType<$T, $S, $U>( T, S, U, ); } - static $GrandParent_Parent_Child$Type<$T, $S, $U> type< + static $GrandParent$Parent$Child$Type<$T, $S, $U> type< $T extends jni$_.JObject?, $S extends jni$_.JObject?, $U extends jni$_.JObject?>( @@ -3406,7 +3406,7 @@ class GrandParent_Parent_Child< jni$_.JObjType<$S> S, jni$_.JObjType<$U> U, ) { - return $GrandParent_Parent_Child$Type<$T, $S, $U>( + return $GrandParent$Parent$Child$Type<$T, $S, $U>( T, S, U, @@ -3477,8 +3477,8 @@ class GrandParent_Parent_Child< /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $outerClass, U object)` /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_Parent_Child( - GrandParent_Parent<$T?, $S?> $outerClass, + factory GrandParent$Parent$Child( + GrandParent$Parent<$T?, $S?> $outerClass, $U? object, { jni$_.JObjType<$T>? T, jni$_.JObjType<$S>? S, @@ -3486,17 +3486,17 @@ class GrandParent_Parent_Child< }) { T ??= jni$_.lowestCommonSuperType([ ($outerClass.$type - as $GrandParent_Parent$Type) + as $GrandParent$Parent$Type) .T, ]) as jni$_.JObjType<$T>; S ??= jni$_.lowestCommonSuperType([ ($outerClass.$type - as $GrandParent_Parent$Type) + as $GrandParent$Parent$Type) .S, ]) as jni$_.JObjType<$S>; final _$$outerClass = $outerClass.reference; final _$object = object?.reference ?? jni$_.jNullReference; - return GrandParent_Parent_Child<$T, $S, $U>.fromReference( + return GrandParent$Parent$Child<$T, $S, $U>.fromReference( T, S, U, @@ -3506,9 +3506,9 @@ class GrandParent_Parent_Child< } } -final class $GrandParent_Parent_Child$NullableType<$T extends jni$_.JObject?, +final class $GrandParent$Parent$Child$NullableType<$T extends jni$_.JObject?, $S extends jni$_.JObject?, $U extends jni$_.JObject?> - extends jni$_.JObjType?> { + extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -3519,7 +3519,7 @@ final class $GrandParent_Parent_Child$NullableType<$T extends jni$_.JObject?, final jni$_.JObjType<$U> U; @jni$_.internal - const $GrandParent_Parent_Child$NullableType( + const $GrandParent$Parent$Child$NullableType( this.T, this.S, this.U, @@ -3532,11 +3532,11 @@ final class $GrandParent_Parent_Child$NullableType<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - GrandParent_Parent_Child<$T, $S, $U>? fromReference( + GrandParent$Parent$Child<$T, $S, $U>? fromReference( jni$_.JReference reference) => reference.isNull ? null - : GrandParent_Parent_Child<$T, $S, $U>.fromReference( + : GrandParent$Parent$Child<$T, $S, $U>.fromReference( T, S, U, @@ -3548,7 +3548,7 @@ final class $GrandParent_Parent_Child$NullableType<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => + jni$_.JObjType?> get nullableType => this; @jni$_.internal @@ -3557,22 +3557,22 @@ final class $GrandParent_Parent_Child$NullableType<$T extends jni$_.JObject?, @core$_.override int get hashCode => - Object.hash($GrandParent_Parent_Child$NullableType, T, S, U); + Object.hash($GrandParent$Parent$Child$NullableType, T, S, U); @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($GrandParent_Parent_Child$NullableType<$T, $S, $U>) && - other is $GrandParent_Parent_Child$NullableType<$T, $S, $U> && + ($GrandParent$Parent$Child$NullableType<$T, $S, $U>) && + other is $GrandParent$Parent$Child$NullableType<$T, $S, $U> && T == other.T && S == other.S && U == other.U; } } -final class $GrandParent_Parent_Child$Type<$T extends jni$_.JObject?, +final class $GrandParent$Parent$Child$Type<$T extends jni$_.JObject?, $S extends jni$_.JObject?, $U extends jni$_.JObject?> - extends jni$_.JObjType> { + extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -3583,7 +3583,7 @@ final class $GrandParent_Parent_Child$Type<$T extends jni$_.JObject?, final jni$_.JObjType<$U> U; @jni$_.internal - const $GrandParent_Parent_Child$Type( + const $GrandParent$Parent$Child$Type( this.T, this.S, this.U, @@ -3596,9 +3596,9 @@ final class $GrandParent_Parent_Child$Type<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - GrandParent_Parent_Child<$T, $S, $U> fromReference( + GrandParent$Parent$Child<$T, $S, $U> fromReference( jni$_.JReference reference) => - GrandParent_Parent_Child<$T, $S, $U>.fromReference( + GrandParent$Parent$Child<$T, $S, $U>.fromReference( T, S, U, @@ -3610,20 +3610,20 @@ final class $GrandParent_Parent_Child$Type<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $GrandParent_Parent_Child$NullableType<$T, $S, $U>(T, S, U); + jni$_.JObjType?> get nullableType => + $GrandParent$Parent$Child$NullableType<$T, $S, $U>(T, S, U); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($GrandParent_Parent_Child$Type, T, S, U); + int get hashCode => Object.hash($GrandParent$Parent$Child$Type, T, S, U); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_Parent_Child$Type<$T, $S, $U>) && - other is $GrandParent_Parent_Child$Type<$T, $S, $U> && + return other.runtimeType == ($GrandParent$Parent$Child$Type<$T, $S, $U>) && + other is $GrandParent$Parent$Child$Type<$T, $S, $U> && T == other.T && S == other.S && U == other.U; @@ -3631,11 +3631,11 @@ final class $GrandParent_Parent_Child$Type<$T extends jni$_.JObject?, } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$Parent` -class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> +class GrandParent$Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$T> T; @@ -3644,7 +3644,7 @@ class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> final jni$_.JObjType<$S> S; @jni$_.internal - GrandParent_Parent.fromReference( + GrandParent$Parent.fromReference( this.T, this.S, jni$_.JReference reference, @@ -3655,23 +3655,23 @@ class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> r'com/github/dart_lang/jnigen/generics/GrandParent$Parent'); /// The type which includes information such as the signature of this class. - static $GrandParent_Parent$NullableType<$T, $S> + static $GrandParent$Parent$NullableType<$T, $S> nullableType<$T extends jni$_.JObject?, $S extends jni$_.JObject?>( jni$_.JObjType<$T> T, jni$_.JObjType<$S> S, ) { - return $GrandParent_Parent$NullableType<$T, $S>( + return $GrandParent$Parent$NullableType<$T, $S>( T, S, ); } - static $GrandParent_Parent$Type<$T, $S> + static $GrandParent$Parent$Type<$T, $S> type<$T extends jni$_.JObject?, $S extends jni$_.JObject?>( jni$_.JObjType<$T> T, jni$_.JObjType<$S> S, ) { - return $GrandParent_Parent$Type<$T, $S>( + return $GrandParent$Parent$Type<$T, $S>( T, S, ); @@ -3727,7 +3727,7 @@ class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $outerClass, S object)` /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_Parent( + factory GrandParent$Parent( GrandParent<$T?> $outerClass, $S? object, { jni$_.JObjType<$T>? T, @@ -3738,7 +3738,7 @@ class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> ]) as jni$_.JObjType<$T>; final _$$outerClass = $outerClass.reference; final _$object = object?.reference ?? jni$_.jNullReference; - return GrandParent_Parent<$T, $S>.fromReference( + return GrandParent$Parent<$T, $S>.fromReference( T, S, _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, @@ -3747,9 +3747,9 @@ class GrandParent_Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> } } -final class $GrandParent_Parent$NullableType<$T extends jni$_.JObject?, +final class $GrandParent$Parent$NullableType<$T extends jni$_.JObject?, $S extends jni$_.JObject?> - extends jni$_.JObjType?> { + extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -3757,7 +3757,7 @@ final class $GrandParent_Parent$NullableType<$T extends jni$_.JObject?, final jni$_.JObjType<$S> S; @jni$_.internal - const $GrandParent_Parent$NullableType( + const $GrandParent$Parent$NullableType( this.T, this.S, ); @@ -3769,10 +3769,10 @@ final class $GrandParent_Parent$NullableType<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - GrandParent_Parent<$T, $S>? fromReference(jni$_.JReference reference) => + GrandParent$Parent<$T, $S>? fromReference(jni$_.JReference reference) => reference.isNull ? null - : GrandParent_Parent<$T, $S>.fromReference( + : GrandParent$Parent<$T, $S>.fromReference( T, S, reference, @@ -3783,27 +3783,27 @@ final class $GrandParent_Parent$NullableType<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => this; + jni$_.JObjType?> get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($GrandParent_Parent$NullableType, T, S); + int get hashCode => Object.hash($GrandParent$Parent$NullableType, T, S); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_Parent$NullableType<$T, $S>) && - other is $GrandParent_Parent$NullableType<$T, $S> && + return other.runtimeType == ($GrandParent$Parent$NullableType<$T, $S>) && + other is $GrandParent$Parent$NullableType<$T, $S> && T == other.T && S == other.S; } } -final class $GrandParent_Parent$Type<$T extends jni$_.JObject?, +final class $GrandParent$Parent$Type<$T extends jni$_.JObject?, $S extends jni$_.JObject?> - extends jni$_.JObjType> { + extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -3811,7 +3811,7 @@ final class $GrandParent_Parent$Type<$T extends jni$_.JObject?, final jni$_.JObjType<$S> S; @jni$_.internal - const $GrandParent_Parent$Type( + const $GrandParent$Parent$Type( this.T, this.S, ); @@ -3823,8 +3823,8 @@ final class $GrandParent_Parent$Type<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - GrandParent_Parent<$T, $S> fromReference(jni$_.JReference reference) => - GrandParent_Parent<$T, $S>.fromReference( + GrandParent$Parent<$T, $S> fromReference(jni$_.JReference reference) => + GrandParent$Parent<$T, $S>.fromReference( T, S, reference, @@ -3835,31 +3835,31 @@ final class $GrandParent_Parent$Type<$T extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $GrandParent_Parent$NullableType<$T, $S>(T, S); + jni$_.JObjType?> get nullableType => + $GrandParent$Parent$NullableType<$T, $S>(T, S); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($GrandParent_Parent$Type, T, S); + int get hashCode => Object.hash($GrandParent$Parent$Type, T, S); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_Parent$Type<$T, $S>) && - other is $GrandParent_Parent$Type<$T, $S> && + return other.runtimeType == ($GrandParent$Parent$Type<$T, $S>) && + other is $GrandParent$Parent$Type<$T, $S> && T == other.T && S == other.S; } } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child` -class GrandParent_StaticParent_Child<$S extends jni$_.JObject?, +class GrandParent$StaticParent$Child<$S extends jni$_.JObject?, $U extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$S> S; @@ -3868,7 +3868,7 @@ class GrandParent_StaticParent_Child<$S extends jni$_.JObject?, final jni$_.JObjType<$U> U; @jni$_.internal - GrandParent_StaticParent_Child.fromReference( + GrandParent$StaticParent$Child.fromReference( this.S, this.U, jni$_.JReference reference, @@ -3879,23 +3879,23 @@ class GrandParent_StaticParent_Child<$S extends jni$_.JObject?, r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent$Child'); /// The type which includes information such as the signature of this class. - static $GrandParent_StaticParent_Child$NullableType<$S, $U> + static $GrandParent$StaticParent$Child$NullableType<$S, $U> nullableType<$S extends jni$_.JObject?, $U extends jni$_.JObject?>( jni$_.JObjType<$S> S, jni$_.JObjType<$U> U, ) { - return $GrandParent_StaticParent_Child$NullableType<$S, $U>( + return $GrandParent$StaticParent$Child$NullableType<$S, $U>( S, U, ); } - static $GrandParent_StaticParent_Child$Type<$S, $U> + static $GrandParent$StaticParent$Child$Type<$S, $U> type<$S extends jni$_.JObject?, $U extends jni$_.JObject?>( jni$_.JObjType<$S> S, jni$_.JObjType<$U> U, ) { - return $GrandParent_StaticParent_Child$Type<$S, $U>( + return $GrandParent$StaticParent$Child$Type<$S, $U>( S, U, ); @@ -3953,20 +3953,20 @@ class GrandParent_StaticParent_Child<$S extends jni$_.JObject?, /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $outerClass, S object, U object1)` /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_StaticParent_Child( - GrandParent_StaticParent<$S?> $outerClass, + factory GrandParent$StaticParent$Child( + GrandParent$StaticParent<$S?> $outerClass, $S? object, $U? object1, { jni$_.JObjType<$S>? S, required jni$_.JObjType<$U> U, }) { S ??= jni$_.lowestCommonSuperType([ - ($outerClass.$type as $GrandParent_StaticParent$Type).S, + ($outerClass.$type as $GrandParent$StaticParent$Type).S, ]) as jni$_.JObjType<$S>; final _$$outerClass = $outerClass.reference; final _$object = object?.reference ?? jni$_.jNullReference; final _$object1 = object1?.reference ?? jni$_.jNullReference; - return GrandParent_StaticParent_Child<$S, $U>.fromReference( + return GrandParent$StaticParent$Child<$S, $U>.fromReference( S, U, _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, @@ -3975,9 +3975,9 @@ class GrandParent_StaticParent_Child<$S extends jni$_.JObject?, } } -final class $GrandParent_StaticParent_Child$NullableType< +final class $GrandParent$StaticParent$Child$NullableType< $S extends jni$_.JObject?, $U extends jni$_.JObject?> - extends jni$_.JObjType?> { + extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$S> S; @@ -3985,7 +3985,7 @@ final class $GrandParent_StaticParent_Child$NullableType< final jni$_.JObjType<$U> U; @jni$_.internal - const $GrandParent_StaticParent_Child$NullableType( + const $GrandParent$StaticParent$Child$NullableType( this.S, this.U, ); @@ -3997,11 +3997,11 @@ final class $GrandParent_StaticParent_Child$NullableType< @jni$_.internal @core$_.override - GrandParent_StaticParent_Child<$S, $U>? fromReference( + GrandParent$StaticParent$Child<$S, $U>? fromReference( jni$_.JReference reference) => reference.isNull ? null - : GrandParent_StaticParent_Child<$S, $U>.fromReference( + : GrandParent$StaticParent$Child<$S, $U>.fromReference( S, U, reference, @@ -4012,7 +4012,7 @@ final class $GrandParent_StaticParent_Child$NullableType< @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => + jni$_.JObjType?> get nullableType => this; @jni$_.internal @@ -4021,21 +4021,21 @@ final class $GrandParent_StaticParent_Child$NullableType< @core$_.override int get hashCode => - Object.hash($GrandParent_StaticParent_Child$NullableType, S, U); + Object.hash($GrandParent$StaticParent$Child$NullableType, S, U); @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($GrandParent_StaticParent_Child$NullableType<$S, $U>) && - other is $GrandParent_StaticParent_Child$NullableType<$S, $U> && + ($GrandParent$StaticParent$Child$NullableType<$S, $U>) && + other is $GrandParent$StaticParent$Child$NullableType<$S, $U> && S == other.S && U == other.U; } } -final class $GrandParent_StaticParent_Child$Type<$S extends jni$_.JObject?, +final class $GrandParent$StaticParent$Child$Type<$S extends jni$_.JObject?, $U extends jni$_.JObject?> - extends jni$_.JObjType> { + extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$S> S; @@ -4043,7 +4043,7 @@ final class $GrandParent_StaticParent_Child$Type<$S extends jni$_.JObject?, final jni$_.JObjType<$U> U; @jni$_.internal - const $GrandParent_StaticParent_Child$Type( + const $GrandParent$StaticParent$Child$Type( this.S, this.U, ); @@ -4055,9 +4055,9 @@ final class $GrandParent_StaticParent_Child$Type<$S extends jni$_.JObject?, @jni$_.internal @core$_.override - GrandParent_StaticParent_Child<$S, $U> fromReference( + GrandParent$StaticParent$Child<$S, $U> fromReference( jni$_.JReference reference) => - GrandParent_StaticParent_Child<$S, $U>.fromReference( + GrandParent$StaticParent$Child<$S, $U>.fromReference( S, U, reference, @@ -4068,38 +4068,38 @@ final class $GrandParent_StaticParent_Child$Type<$S extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $GrandParent_StaticParent_Child$NullableType<$S, $U>(S, U); + jni$_.JObjType?> get nullableType => + $GrandParent$StaticParent$Child$NullableType<$S, $U>(S, U); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($GrandParent_StaticParent_Child$Type, S, U); + int get hashCode => Object.hash($GrandParent$StaticParent$Child$Type, S, U); @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($GrandParent_StaticParent_Child$Type<$S, $U>) && - other is $GrandParent_StaticParent_Child$Type<$S, $U> && + ($GrandParent$StaticParent$Child$Type<$S, $U>) && + other is $GrandParent$StaticParent$Child$Type<$S, $U> && S == other.S && U == other.U; } } /// from: `com.github.dart_lang.jnigen.generics.GrandParent$StaticParent` -class GrandParent_StaticParent<$S extends jni$_.JObject?> +class GrandParent$StaticParent<$S extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$S> S; @jni$_.internal - GrandParent_StaticParent.fromReference( + GrandParent$StaticParent.fromReference( this.S, jni$_.JReference reference, ) : $type = type<$S>(S), @@ -4109,19 +4109,19 @@ class GrandParent_StaticParent<$S extends jni$_.JObject?> r'com/github/dart_lang/jnigen/generics/GrandParent$StaticParent'); /// The type which includes information such as the signature of this class. - static $GrandParent_StaticParent$NullableType<$S> + static $GrandParent$StaticParent$NullableType<$S> nullableType<$S extends jni$_.JObject?>( jni$_.JObjType<$S> S, ) { - return $GrandParent_StaticParent$NullableType<$S>( + return $GrandParent$StaticParent$NullableType<$S>( S, ); } - static $GrandParent_StaticParent$Type<$S> type<$S extends jni$_.JObject?>( + static $GrandParent$StaticParent$Type<$S> type<$S extends jni$_.JObject?>( jni$_.JObjType<$S> S, ) { - return $GrandParent_StaticParent$Type<$S>( + return $GrandParent$StaticParent$Type<$S>( S, ); } @@ -4156,12 +4156,12 @@ class GrandParent_StaticParent<$S extends jni$_.JObject?> /// from: `public void (S object)` /// The returned object must be released after use, by calling the [release] method. - factory GrandParent_StaticParent( + factory GrandParent$StaticParent( $S? object, { required jni$_.JObjType<$S> S, }) { final _$object = object?.reference ?? jni$_.jNullReference; - return GrandParent_StaticParent<$S>.fromReference( + return GrandParent$StaticParent<$S>.fromReference( S, _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, _$object.pointer) @@ -4169,13 +4169,13 @@ class GrandParent_StaticParent<$S extends jni$_.JObject?> } } -final class $GrandParent_StaticParent$NullableType<$S extends jni$_.JObject?> - extends jni$_.JObjType?> { +final class $GrandParent$StaticParent$NullableType<$S extends jni$_.JObject?> + extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$S> S; @jni$_.internal - const $GrandParent_StaticParent$NullableType( + const $GrandParent$StaticParent$NullableType( this.S, ); @@ -4186,10 +4186,10 @@ final class $GrandParent_StaticParent$NullableType<$S extends jni$_.JObject?> @jni$_.internal @core$_.override - GrandParent_StaticParent<$S>? fromReference(jni$_.JReference reference) => + GrandParent$StaticParent<$S>? fromReference(jni$_.JReference reference) => reference.isNull ? null - : GrandParent_StaticParent<$S>.fromReference( + : GrandParent$StaticParent<$S>.fromReference( S, reference, ); @@ -4199,30 +4199,30 @@ final class $GrandParent_StaticParent$NullableType<$S extends jni$_.JObject?> @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => this; + jni$_.JObjType?> get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($GrandParent_StaticParent$NullableType, S); + int get hashCode => Object.hash($GrandParent$StaticParent$NullableType, S); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_StaticParent$NullableType<$S>) && - other is $GrandParent_StaticParent$NullableType<$S> && + return other.runtimeType == ($GrandParent$StaticParent$NullableType<$S>) && + other is $GrandParent$StaticParent$NullableType<$S> && S == other.S; } } -final class $GrandParent_StaticParent$Type<$S extends jni$_.JObject?> - extends jni$_.JObjType> { +final class $GrandParent$StaticParent$Type<$S extends jni$_.JObject?> + extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$S> S; @jni$_.internal - const $GrandParent_StaticParent$Type( + const $GrandParent$StaticParent$Type( this.S, ); @@ -4233,8 +4233,8 @@ final class $GrandParent_StaticParent$Type<$S extends jni$_.JObject?> @jni$_.internal @core$_.override - GrandParent_StaticParent<$S> fromReference(jni$_.JReference reference) => - GrandParent_StaticParent<$S>.fromReference( + GrandParent$StaticParent<$S> fromReference(jni$_.JReference reference) => + GrandParent$StaticParent<$S>.fromReference( S, reference, ); @@ -4244,20 +4244,20 @@ final class $GrandParent_StaticParent$Type<$S extends jni$_.JObject?> @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $GrandParent_StaticParent$NullableType<$S>(S); + jni$_.JObjType?> get nullableType => + $GrandParent$StaticParent$NullableType<$S>(S); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($GrandParent_StaticParent$Type, S); + int get hashCode => Object.hash($GrandParent$StaticParent$Type, S); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($GrandParent_StaticParent$Type<$S>) && - other is $GrandParent_StaticParent$Type<$S> && + return other.runtimeType == ($GrandParent$StaticParent$Type<$S>) && + other is $GrandParent$StaticParent$Type<$S> && S == other.S; } } @@ -4359,11 +4359,11 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent<$T?, jni$_.JString?>? stringParent() { + GrandParent$Parent<$T?, jni$_.JString?>? stringParent() { return _stringParent( reference.pointer, _id_stringParent as jni$_.JMethodIDPtr) - .object?>( - $GrandParent_Parent$NullableType<$T?, jni$_.JString?>( + .object?>( + $GrandParent$Parent$NullableType<$T?, jni$_.JString?>( T.nullableType, const jni$_.JStringNullableType())); } @@ -4385,15 +4385,15 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S object)` /// The returned object must be released after use, by calling the [release] method. - GrandParent_Parent<$T?, $S?>? varParent<$S extends jni$_.JObject?>( + GrandParent$Parent<$T?, $S?>? varParent<$S extends jni$_.JObject?>( $S? object, { required jni$_.JObjType<$S> S, }) { final _$object = object?.reference ?? jni$_.jNullReference; return _varParent(reference.pointer, _id_varParent as jni$_.JMethodIDPtr, _$object.pointer) - .object?>( - $GrandParent_Parent$NullableType<$T?, $S?>( + .object?>( + $GrandParent$Parent$NullableType<$T?, $S?>( T.nullableType, S.nullableType)); } @@ -4416,11 +4416,11 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent stringStaticParent()` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent? stringStaticParent() { + static GrandParent$StaticParent? stringStaticParent() { return _stringStaticParent(_class.reference.pointer, _id_stringStaticParent as jni$_.JMethodIDPtr) - .object?>( - const $GrandParent_StaticParent$NullableType( + .object?>( + const $GrandParent$StaticParent$NullableType( jni$_.JStringNullableType())); } @@ -4442,7 +4442,7 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent varStaticParent(S object)` /// The returned object must be released after use, by calling the [release] method. - static GrandParent_StaticParent<$S?>? + static GrandParent$StaticParent<$S?>? varStaticParent<$S extends jni$_.JObject?>( $S? object, { required jni$_.JObjType<$S> S, @@ -4450,8 +4450,8 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { final _$object = object?.reference ?? jni$_.jNullReference; return _varStaticParent(_class.reference.pointer, _id_varStaticParent as jni$_.JMethodIDPtr, _$object.pointer) - .object?>( - $GrandParent_StaticParent$NullableType<$S?>(S.nullableType)); + .object?>( + $GrandParent$StaticParent$NullableType<$S?>(S.nullableType)); } static final _id_staticParentWithSameType = _class.instanceMethodId( @@ -4473,11 +4473,11 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent staticParentWithSameType()` /// The returned object must be released after use, by calling the [release] method. - GrandParent_StaticParent<$T?>? staticParentWithSameType() { + GrandParent$StaticParent<$T?>? staticParentWithSameType() { return _staticParentWithSameType(reference.pointer, _id_staticParentWithSameType as jni$_.JMethodIDPtr) - .object?>( - $GrandParent_StaticParent$NullableType<$T?>(T.nullableType)); + .object?>( + $GrandParent$StaticParent$NullableType<$T?>(T.nullableType)); } } @@ -4572,11 +4572,11 @@ final class $GrandParent$Type<$T extends jni$_.JObject?> } /// from: `com.github.dart_lang.jnigen.generics.MyMap$MyEntry` -class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> +class MyMap$MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$K> K; @@ -4585,7 +4585,7 @@ class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> final jni$_.JObjType<$V> V; @jni$_.internal - MyMap_MyEntry.fromReference( + MyMap$MyEntry.fromReference( this.K, this.V, jni$_.JReference reference, @@ -4596,23 +4596,23 @@ class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> r'com/github/dart_lang/jnigen/generics/MyMap$MyEntry'); /// The type which includes information such as the signature of this class. - static $MyMap_MyEntry$NullableType<$K, $V> + static $MyMap$MyEntry$NullableType<$K, $V> nullableType<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( jni$_.JObjType<$K> K, jni$_.JObjType<$V> V, ) { - return $MyMap_MyEntry$NullableType<$K, $V>( + return $MyMap$MyEntry$NullableType<$K, $V>( K, V, ); } - static $MyMap_MyEntry$Type<$K, $V> + static $MyMap$MyEntry$Type<$K, $V> type<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( jni$_.JObjType<$K> K, jni$_.JObjType<$V> V, ) { - return $MyMap_MyEntry$Type<$K, $V>( + return $MyMap$MyEntry$Type<$K, $V>( K, V, ); @@ -4669,7 +4669,7 @@ class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $outerClass, K object, V object1)` /// The returned object must be released after use, by calling the [release] method. - factory MyMap_MyEntry( + factory MyMap$MyEntry( MyMap<$K?, $V?> $outerClass, $K? object, $V? object1, { @@ -4685,7 +4685,7 @@ class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> final _$$outerClass = $outerClass.reference; final _$object = object?.reference ?? jni$_.jNullReference; final _$object1 = object1?.reference ?? jni$_.jNullReference; - return MyMap_MyEntry<$K, $V>.fromReference( + return MyMap$MyEntry<$K, $V>.fromReference( K, V, _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr, @@ -4694,8 +4694,8 @@ class MyMap_MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> } } -final class $MyMap_MyEntry$NullableType<$K extends jni$_.JObject?, - $V extends jni$_.JObject?> extends jni$_.JObjType?> { +final class $MyMap$MyEntry$NullableType<$K extends jni$_.JObject?, + $V extends jni$_.JObject?> extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$K> K; @@ -4703,7 +4703,7 @@ final class $MyMap_MyEntry$NullableType<$K extends jni$_.JObject?, final jni$_.JObjType<$V> V; @jni$_.internal - const $MyMap_MyEntry$NullableType( + const $MyMap$MyEntry$NullableType( this.K, this.V, ); @@ -4715,10 +4715,10 @@ final class $MyMap_MyEntry$NullableType<$K extends jni$_.JObject?, @jni$_.internal @core$_.override - MyMap_MyEntry<$K, $V>? fromReference(jni$_.JReference reference) => + MyMap$MyEntry<$K, $V>? fromReference(jni$_.JReference reference) => reference.isNull ? null - : MyMap_MyEntry<$K, $V>.fromReference( + : MyMap$MyEntry<$K, $V>.fromReference( K, V, reference, @@ -4729,26 +4729,26 @@ final class $MyMap_MyEntry$NullableType<$K extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => this; + jni$_.JObjType?> get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($MyMap_MyEntry$NullableType, K, V); + int get hashCode => Object.hash($MyMap$MyEntry$NullableType, K, V); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($MyMap_MyEntry$NullableType<$K, $V>) && - other is $MyMap_MyEntry$NullableType<$K, $V> && + return other.runtimeType == ($MyMap$MyEntry$NullableType<$K, $V>) && + other is $MyMap$MyEntry$NullableType<$K, $V> && K == other.K && V == other.V; } } -final class $MyMap_MyEntry$Type<$K extends jni$_.JObject?, - $V extends jni$_.JObject?> extends jni$_.JObjType> { +final class $MyMap$MyEntry$Type<$K extends jni$_.JObject?, + $V extends jni$_.JObject?> extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$K> K; @@ -4756,7 +4756,7 @@ final class $MyMap_MyEntry$Type<$K extends jni$_.JObject?, final jni$_.JObjType<$V> V; @jni$_.internal - const $MyMap_MyEntry$Type( + const $MyMap$MyEntry$Type( this.K, this.V, ); @@ -4768,8 +4768,8 @@ final class $MyMap_MyEntry$Type<$K extends jni$_.JObject?, @jni$_.internal @core$_.override - MyMap_MyEntry<$K, $V> fromReference(jni$_.JReference reference) => - MyMap_MyEntry<$K, $V>.fromReference( + MyMap$MyEntry<$K, $V> fromReference(jni$_.JReference reference) => + MyMap$MyEntry<$K, $V>.fromReference( K, V, reference, @@ -4780,20 +4780,20 @@ final class $MyMap_MyEntry$Type<$K extends jni$_.JObject?, @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $MyMap_MyEntry$NullableType<$K, $V>(K, V); + jni$_.JObjType?> get nullableType => + $MyMap$MyEntry$NullableType<$K, $V>(K, V); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($MyMap_MyEntry$Type, K, V); + int get hashCode => Object.hash($MyMap$MyEntry$Type, K, V); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($MyMap_MyEntry$Type<$K, $V>) && - other is $MyMap_MyEntry$Type<$K, $V> && + return other.runtimeType == ($MyMap$MyEntry$Type<$K, $V>) && + other is $MyMap$MyEntry$Type<$K, $V> && K == other.K && V == other.V; } @@ -4956,11 +4956,11 @@ class MyMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> /// from: `public com.github.dart_lang.jnigen.generics.MyStack entryStack()` /// The returned object must be released after use, by calling the [release] method. - MyStack?>? entryStack() { + MyStack?>? entryStack() { return _entryStack(reference.pointer, _id_entryStack as jni$_.JMethodIDPtr) - .object?>?>( - $MyStack$NullableType?>( - $MyMap_MyEntry$NullableType<$K?, $V?>( + .object?>?>( + $MyStack$NullableType?>( + $MyMap$MyEntry$NullableType<$K?, $V?>( K.nullableType, V.nullableType))); } } @@ -8668,11 +8668,11 @@ final class $SpecificDerivedClass$Type } /// from: `com.github.dart_lang.jnigen.annotations.Annotated$Nested` -class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, +class Annotated$Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, $W extends jni$_.JObject, $V extends jni$_.JObject?> extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType> $type; + final jni$_.JObjType> $type; @jni$_.internal final jni$_.JObjType<$T> T; @@ -8687,7 +8687,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, final jni$_.JObjType<$V> V; @jni$_.internal - Annotated_Nested.fromReference( + Annotated$Nested.fromReference( this.T, this.U, this.W, @@ -8700,7 +8700,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, r'com/github/dart_lang/jnigen/annotations/Annotated$Nested'); /// The type which includes information such as the signature of this class. - static $Annotated_Nested$NullableType<$T, $U, $W, $V> nullableType< + static $Annotated$Nested$NullableType<$T, $U, $W, $V> nullableType< $T extends jni$_.JObject?, $U extends jni$_.JObject, $W extends jni$_.JObject, @@ -8710,7 +8710,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JObjType<$W> W, jni$_.JObjType<$V> V, ) { - return $Annotated_Nested$NullableType<$T, $U, $W, $V>( + return $Annotated$Nested$NullableType<$T, $U, $W, $V>( T, U, W, @@ -8718,7 +8718,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, ); } - static $Annotated_Nested$Type<$T, $U, $W, $V> type< + static $Annotated$Nested$Type<$T, $U, $W, $V> type< $T extends jni$_.JObject?, $U extends jni$_.JObject, $W extends jni$_.JObject, @@ -8728,7 +8728,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JObjType<$W> W, jni$_.JObjType<$V> V, ) { - return $Annotated_Nested$Type<$T, $U, $W, $V>( + return $Annotated$Nested$Type<$T, $U, $W, $V>( T, U, W, @@ -8785,7 +8785,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, /// from: `public void (com.github.dart_lang.jnigen.annotations.Annotated $outerClass, V object)` /// The returned object must be released after use, by calling the [release] method. - factory Annotated_Nested( + factory Annotated$Nested( Annotated<$T?, $U, $W> $outerClass, $V? object, { jni$_.JObjType<$T>? T, @@ -8810,7 +8810,7 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, ]) as jni$_.JObjType<$W>; final _$$outerClass = $outerClass.reference; final _$object = object?.reference ?? jni$_.jNullReference; - return Annotated_Nested<$T, $U, $W, $V>.fromReference( + return Annotated$Nested<$T, $U, $W, $V>.fromReference( T, U, W, @@ -8821,12 +8821,12 @@ class Annotated_Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, } } -final class $Annotated_Nested$NullableType< +final class $Annotated$Nested$NullableType< $T extends jni$_.JObject?, $U extends jni$_.JObject, $W extends jni$_.JObject, $V extends jni$_.JObject?> - extends jni$_.JObjType?> { + extends jni$_.JObjType?> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -8840,7 +8840,7 @@ final class $Annotated_Nested$NullableType< final jni$_.JObjType<$V> V; @jni$_.internal - const $Annotated_Nested$NullableType( + const $Annotated$Nested$NullableType( this.T, this.U, this.W, @@ -8854,10 +8854,10 @@ final class $Annotated_Nested$NullableType< @jni$_.internal @core$_.override - Annotated_Nested<$T, $U, $W, $V>? fromReference(jni$_.JReference reference) => + Annotated$Nested<$T, $U, $W, $V>? fromReference(jni$_.JReference reference) => reference.isNull ? null - : Annotated_Nested<$T, $U, $W, $V>.fromReference( + : Annotated$Nested<$T, $U, $W, $V>.fromReference( T, U, W, @@ -8870,20 +8870,20 @@ final class $Annotated_Nested$NullableType< @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => this; + jni$_.JObjType?> get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($Annotated_Nested$NullableType, T, U, W, V); + int get hashCode => Object.hash($Annotated$Nested$NullableType, T, U, W, V); @core$_.override bool operator ==(Object other) { return other.runtimeType == - ($Annotated_Nested$NullableType<$T, $U, $W, $V>) && - other is $Annotated_Nested$NullableType<$T, $U, $W, $V> && + ($Annotated$Nested$NullableType<$T, $U, $W, $V>) && + other is $Annotated$Nested$NullableType<$T, $U, $W, $V> && T == other.T && U == other.U && W == other.W && @@ -8891,12 +8891,12 @@ final class $Annotated_Nested$NullableType< } } -final class $Annotated_Nested$Type< +final class $Annotated$Nested$Type< $T extends jni$_.JObject?, $U extends jni$_.JObject, $W extends jni$_.JObject, $V extends jni$_.JObject?> - extends jni$_.JObjType> { + extends jni$_.JObjType> { @jni$_.internal final jni$_.JObjType<$T> T; @@ -8910,7 +8910,7 @@ final class $Annotated_Nested$Type< final jni$_.JObjType<$V> V; @jni$_.internal - const $Annotated_Nested$Type( + const $Annotated$Nested$Type( this.T, this.U, this.W, @@ -8924,8 +8924,8 @@ final class $Annotated_Nested$Type< @jni$_.internal @core$_.override - Annotated_Nested<$T, $U, $W, $V> fromReference(jni$_.JReference reference) => - Annotated_Nested<$T, $U, $W, $V>.fromReference( + Annotated$Nested<$T, $U, $W, $V> fromReference(jni$_.JReference reference) => + Annotated$Nested<$T, $U, $W, $V>.fromReference( T, U, W, @@ -8938,20 +8938,20 @@ final class $Annotated_Nested$Type< @jni$_.internal @core$_.override - jni$_.JObjType?> get nullableType => - $Annotated_Nested$NullableType<$T, $U, $W, $V>(T, U, W, V); + jni$_.JObjType?> get nullableType => + $Annotated$Nested$NullableType<$T, $U, $W, $V>(T, U, W, V); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => Object.hash($Annotated_Nested$Type, T, U, W, V); + int get hashCode => Object.hash($Annotated$Nested$Type, T, U, W, V); @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($Annotated_Nested$Type<$T, $U, $W, $V>) && - other is $Annotated_Nested$Type<$T, $U, $W, $V> && + return other.runtimeType == ($Annotated$Nested$Type<$T, $U, $W, $V>) && + other is $Annotated$Nested$Type<$T, $U, $W, $V> && T == other.T && U == other.U && W == other.W && @@ -10704,10 +10704,10 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, /// from: `public com.github.dart_lang.jnigen.annotations.Annotated.Nested nested()` /// The returned object must be released after use, by calling the [release] method. - Annotated_Nested<$T?, $U, $W, jni$_.JInteger>? nested() { + Annotated$Nested<$T?, $U, $W, jni$_.JInteger>? nested() { return _nested(reference.pointer, _id_nested as jni$_.JMethodIDPtr) - .object?>( - $Annotated_Nested$NullableType<$T?, $U, $W, jni$_.JInteger>( + .object?>( + $Annotated$Nested$NullableType<$T?, $U, $W, jni$_.JInteger>( T.nullableType, U, W, const jni$_.JIntegerType())); } @@ -10857,13 +10857,13 @@ final class $Annotated$Type<$T extends jni$_.JObject?, $U extends jni$_.JObject, } /// from: `com.github.dart_lang.jnigen.annotations.JsonSerializable$Case` -class JsonSerializable_Case extends jni$_.JObject { +class JsonSerializable$Case extends jni$_.JObject { @jni$_.internal @core$_.override - final jni$_.JObjType $type; + final jni$_.JObjType $type; @jni$_.internal - JsonSerializable_Case.fromReference( + JsonSerializable$Case.fromReference( jni$_.JReference reference, ) : $type = type, super.fromReference(reference); @@ -10872,8 +10872,8 @@ class JsonSerializable_Case extends jni$_.JObject { r'com/github/dart_lang/jnigen/annotations/JsonSerializable$Case'); /// The type which includes information such as the signature of this class. - static const nullableType = $JsonSerializable_Case$NullableType(); - static const type = $JsonSerializable_Case$Type(); + static const nullableType = $JsonSerializable$Case$NullableType(); + static const type = $JsonSerializable$Case$Type(); static final _id_SNAKE_CASE = _class.staticFieldId( r'SNAKE_CASE', r'Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;', @@ -10881,8 +10881,8 @@ class JsonSerializable_Case extends jni$_.JObject { /// from: `static public final com.github.dart_lang.jnigen.annotations.JsonSerializable$Case SNAKE_CASE` /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case? get SNAKE_CASE => - _id_SNAKE_CASE.get(_class, const $JsonSerializable_Case$NullableType()); + static JsonSerializable$Case? get SNAKE_CASE => + _id_SNAKE_CASE.get(_class, const $JsonSerializable$Case$NullableType()); static final _id_KEBAB_CASE = _class.staticFieldId( r'KEBAB_CASE', @@ -10891,8 +10891,8 @@ class JsonSerializable_Case extends jni$_.JObject { /// from: `static public final com.github.dart_lang.jnigen.annotations.JsonSerializable$Case KEBAB_CASE` /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case? get KEBAB_CASE => - _id_KEBAB_CASE.get(_class, const $JsonSerializable_Case$NullableType()); + static JsonSerializable$Case? get KEBAB_CASE => + _id_KEBAB_CASE.get(_class, const $JsonSerializable$Case$NullableType()); static final _id_CAMEL_CASE = _class.staticFieldId( r'CAMEL_CASE', @@ -10901,8 +10901,8 @@ class JsonSerializable_Case extends jni$_.JObject { /// from: `static public final com.github.dart_lang.jnigen.annotations.JsonSerializable$Case CAMEL_CASE` /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case? get CAMEL_CASE => - _id_CAMEL_CASE.get(_class, const $JsonSerializable_Case$NullableType()); + static JsonSerializable$Case? get CAMEL_CASE => + _id_CAMEL_CASE.get(_class, const $JsonSerializable$Case$NullableType()); static final _id_values = _class.staticMethodId( r'values', @@ -10923,11 +10923,11 @@ class JsonSerializable_Case extends jni$_.JObject { /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable$Case[] values()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JArray? values() { + static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType( - $JsonSerializable_Case$NullableType())); + .object?>( + const jni$_.JArrayNullableType( + $JsonSerializable$Case$NullableType())); } static final _id_valueOf = _class.staticMethodId( @@ -10948,21 +10948,21 @@ class JsonSerializable_Case extends jni$_.JObject { /// from: `static public com.github.dart_lang.jnigen.annotations.JsonSerializable$Case valueOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. - static JsonSerializable_Case? valueOf( + static JsonSerializable$Case? valueOf( jni$_.JString? string, ) { final _$string = string?.reference ?? jni$_.jNullReference; return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, _$string.pointer) - .object( - const $JsonSerializable_Case$NullableType()); + .object( + const $JsonSerializable$Case$NullableType()); } } -final class $JsonSerializable_Case$NullableType - extends jni$_.JObjType { +final class $JsonSerializable$Case$NullableType + extends jni$_.JObjType { @jni$_.internal - const $JsonSerializable_Case$NullableType(); + const $JsonSerializable$Case$NullableType(); @jni$_.internal @core$_.override @@ -10971,10 +10971,10 @@ final class $JsonSerializable_Case$NullableType @jni$_.internal @core$_.override - JsonSerializable_Case? fromReference(jni$_.JReference reference) => + JsonSerializable$Case? fromReference(jni$_.JReference reference) => reference.isNull ? null - : JsonSerializable_Case.fromReference( + : JsonSerializable$Case.fromReference( reference, ); @jni$_.internal @@ -10983,26 +10983,26 @@ final class $JsonSerializable_Case$NullableType @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => this; + jni$_.JObjType get nullableType => this; @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonSerializable_Case$NullableType).hashCode; + int get hashCode => ($JsonSerializable$Case$NullableType).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_Case$NullableType) && - other is $JsonSerializable_Case$NullableType; + return other.runtimeType == ($JsonSerializable$Case$NullableType) && + other is $JsonSerializable$Case$NullableType; } } -final class $JsonSerializable_Case$Type - extends jni$_.JObjType { +final class $JsonSerializable$Case$Type + extends jni$_.JObjType { @jni$_.internal - const $JsonSerializable_Case$Type(); + const $JsonSerializable$Case$Type(); @jni$_.internal @core$_.override @@ -11011,8 +11011,8 @@ final class $JsonSerializable_Case$Type @jni$_.internal @core$_.override - JsonSerializable_Case fromReference(jni$_.JReference reference) => - JsonSerializable_Case.fromReference( + JsonSerializable$Case fromReference(jni$_.JReference reference) => + JsonSerializable$Case.fromReference( reference, ); @jni$_.internal @@ -11021,20 +11021,20 @@ final class $JsonSerializable_Case$Type @jni$_.internal @core$_.override - jni$_.JObjType get nullableType => - const $JsonSerializable_Case$NullableType(); + jni$_.JObjType get nullableType => + const $JsonSerializable$Case$NullableType(); @jni$_.internal @core$_.override final superCount = 1; @core$_.override - int get hashCode => ($JsonSerializable_Case$Type).hashCode; + int get hashCode => ($JsonSerializable$Case$Type).hashCode; @core$_.override bool operator ==(Object other) { - return other.runtimeType == ($JsonSerializable_Case$Type) && - other is $JsonSerializable_Case$Type; + return other.runtimeType == ($JsonSerializable$Case$Type) && + other is $JsonSerializable$Case$Type; } } @@ -11075,10 +11075,10 @@ class JsonSerializable extends jni$_.JObject { /// from: `public abstract com.github.dart_lang.jnigen.annotations.JsonSerializable$Case value()` /// The returned object must be released after use, by calling the [release] method. - JsonSerializable_Case? value() { + JsonSerializable$Case? value() { return _value(reference.pointer, _id_value as jni$_.JMethodIDPtr) - .object( - const $JsonSerializable_Case$NullableType()); + .object( + const $JsonSerializable$Case$NullableType()); } /// Maps a specific port to the implemented interface. @@ -11164,20 +11164,20 @@ class JsonSerializable extends jni$_.JObject { abstract base mixin class $JsonSerializable { factory $JsonSerializable({ - required JsonSerializable_Case? Function() value, + required JsonSerializable$Case? Function() value, }) = _$JsonSerializable; - JsonSerializable_Case? value(); + JsonSerializable$Case? value(); } final class _$JsonSerializable with $JsonSerializable { _$JsonSerializable({ - required JsonSerializable_Case? Function() value, + required JsonSerializable$Case? Function() value, }) : _value = value; - final JsonSerializable_Case? Function() _value; + final JsonSerializable$Case? Function() _value; - JsonSerializable_Case? value() { + JsonSerializable$Case? value() { return _value(); } } diff --git a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart index 9ad8a39b6..1344d88f0 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart @@ -180,9 +180,9 @@ void registerTests(String groupName, TestRunnerCallback test) { }); test('Fields from nested class', () { - expect(Fields_Nested().hundred, equals(100)); + expect(Fields$Nested().hundred, equals(100)); // Hector of Troy may disagree. - expect(Fields_Nested.BEST_GOD!.toDartString(), equals('Pallas Athena')); + expect(Fields$Nested.BEST_GOD!.toDartString(), equals('Pallas Athena')); }); test('static methods arrays', () { @@ -448,10 +448,10 @@ void registerTests(String groupName, TestRunnerCallback test) { final grandParent = GrandParent(1.toJInteger(), T: JInteger.type) ..releasedBy(arena); final parent = - GrandParent_Parent(grandParent, 2.toJInteger(), S: JInteger.type) + GrandParent$Parent(grandParent, 2.toJInteger(), S: JInteger.type) ..releasedBy(arena); final child = - GrandParent_Parent_Child(parent, 3.toJInteger(), U: JInteger.type) + GrandParent$Parent$Child(parent, 3.toJInteger(), U: JInteger.type) ..releasedBy(arena); expect(grandParent.value!.intValue(releaseOriginal: true), 1); expect(parent.parentValue!.intValue(releaseOriginal: true), 1); diff --git a/pkgs/jnigen/test/summary_test.dart b/pkgs/jnigen/test/summary_test.dart index 93922f6ed..6987af425 100644 --- a/pkgs/jnigen/test/summary_test.dart +++ b/pkgs/jnigen/test/summary_test.dart @@ -19,7 +19,7 @@ const simplePackage = '$jnigenPackage.simple_package'; extension on Classes { ClassDecl getClassBySimpleName(String simpleName) { - return decls.values.firstWhere((c) => c.name == simpleName); + return decls.values.firstWhere((c) => c.binaryName.endsWith(simpleName)); } ClassDecl getClass(String dirName, String className) { From 00aae9e073b652a2f2a8f0ca3197a23a10b4b996 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Tue, 10 Dec 2024 21:44:18 +0100 Subject: [PATCH 39/50] [native_assets_cli] Move `BuildMode` to [native_toolchain_c] (#1800) The first in a series of refactorings to address: * https://github.com/dart-lang/native/issues/1738 We align `BuildMode` with `OptimizationLevel`, it's configured by the hook author in the build hook. Likely, every package should ship with max optimization level and build mode set to release. Only while developing a package (when it is the root package or path-depsed in) would the build mode be set to debug. This will require a manual roll into dartdev and flutter tools due to the removal of `BuildMode` from the `native_assets_builder` API. The native assets builder will still emit the field in the JSON, until we can bump the `native_assets_cli` SDK constraint to 3.7 stable. Then only people with older versions of the `native_assets_cli` package but a newer SDK break. --- .../lib/src/build_runner/build_runner.dart | 4 - .../build_runner_reusability_test.dart | 2 - .../concurrency_shared_test_helper.dart | 1 - .../build_runner/concurrency_test_helper.dart | 1 - .../test/build_runner/helpers.dart | 4 - .../native_dynamic_linking_test.dart | 15 +- .../test/test_data/transformer_test.dart | 15 +- .../native_dynamic_linking/hook/build.dart | 3 + pkgs/native_assets_cli/CHANGELOG.md | 4 + pkgs/native_assets_cli/lib/code_assets.dart | 1 - .../lib/native_assets_cli.dart | 1 - .../lib/src/code_assets/testing.dart | 2 - pkgs/native_assets_cli/lib/src/config.dart | 34 ++--- .../lib/src/model/build_config_CHANGELOG.md | 5 + pkgs/native_assets_cli/lib/test.dart | 2 - .../test/api/build_test.dart | 1 - .../test/build_config_test.dart | 5 - .../native_assets_cli/test/checksum_test.dart | 130 +++++++----------- .../test/code_assets/config_test.dart | 5 - .../test/code_assets/validation_test.dart | 1 - .../test/data_assets/validation_test.dart | 1 - .../test/example/local_asset_test.dart | 10 +- .../test/example/native_add_library_test.dart | 10 +- .../example/native_dynamic_linking_test.dart | 1 - .../test/link_config_test.dart | 3 - .../test/validation_test.dart | 1 - .../lib/native_toolchain_c.dart | 1 + .../lib/src/cbuilder}/build_mode.dart | 0 .../lib/src/cbuilder/cbuilder.dart | 10 +- .../cbuilder/cbuilder_build_failure_test.dart | 2 +- .../cbuilder/cbuilder_cross_android_test.dart | 2 +- .../cbuilder/cbuilder_cross_ios_test.dart | 4 +- .../cbuilder_cross_linux_host_test.dart | 2 +- .../cbuilder_cross_macos_host_test.dart | 4 +- .../cbuilder_cross_windows_host_test.dart | 2 +- .../test/cbuilder/cbuilder_test.dart | 18 +-- .../test/cbuilder/compiler_resolver_test.dart | 2 - .../test/cbuilder/objective_c_test.dart | 2 +- .../test/clinker/build_testfiles.dart | 2 +- .../test/clinker/objects_test.dart | 1 - .../test/clinker/throws_test.dart | 1 - .../test/clinker/treeshake_helper.dart | 2 - 42 files changed, 122 insertions(+), 195 deletions(-) rename pkgs/{native_assets_cli/lib/src => native_toolchain_c/lib/src/cbuilder}/build_mode.dart (100%) diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index 3fccab6c1..b3a20931f 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -93,7 +93,6 @@ class NativeAssetsBuildRunner { required BuildValidator buildValidator, required ApplicationAssetValidator applicationAssetValidator, required OS targetOS, - required BuildMode buildMode, required Uri workingDirectory, PackageLayout? packageLayout, String? runPackageName, @@ -124,7 +123,6 @@ class NativeAssetsBuildRunner { ..setupHookConfig( targetOS: targetOS, buildAssetTypes: buildAssetTypes, - buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), ) @@ -200,7 +198,6 @@ class NativeAssetsBuildRunner { required LinkConfigValidator configValidator, required LinkValidator linkValidator, required OS targetOS, - required BuildMode buildMode, required Uri workingDirectory, required ApplicationAssetValidator applicationAssetValidator, PackageLayout? packageLayout, @@ -225,7 +222,6 @@ class NativeAssetsBuildRunner { ..setupHookConfig( targetOS: targetOS, buildAssetTypes: buildAssetTypes, - buildMode: buildMode, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), ); diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index 548276f29..d279a12ae 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -36,7 +36,6 @@ void main() async { await buildRunner.build( configCreator: configCreator, targetOS: OS.current, - buildMode: BuildMode.release, workingDirectory: packageUri, linkingEnabled: false, buildAssetTypes: [], @@ -46,7 +45,6 @@ void main() async { ); await buildRunner.build( configCreator: configCreator, - buildMode: BuildMode.release, targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart index afb2c0fb8..e741bfa13 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -21,7 +21,6 @@ void main(List args) async { dartExecutable: dartExecutable, ).build( configCreator: BuildConfigBuilder.new, - buildMode: BuildMode.release, targetOS: target.os, workingDirectory: packageUri, linkingEnabled: false, diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart index 870edec6d..9a680232b 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart @@ -32,7 +32,6 @@ void main(List args) async { cCompilerConfig: dartCICompilerConfig, targetMacOSVersion: OS.current == OS.macOS ? defaultMacOSVersion : null, ), - buildMode: BuildMode.release, targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index 56a54c445..275ec9c9a 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -71,7 +71,6 @@ Future build( return configBuilder; }, configValidator: configValidator, - buildMode: BuildMode.release, targetOS: targetOS, workingDirectory: packageUri, packageLayout: packageLayout, @@ -137,7 +136,6 @@ Future link( return configBuilder; }, configValidator: configValidator, - buildMode: BuildMode.release, targetOS: target?.os ?? OS.current, workingDirectory: packageUri, packageLayout: packageLayout, @@ -195,7 +193,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( targetAndroidNdkApi: targetAndroidNdkApi, ), configValidator: buildConfigValidator, - buildMode: BuildMode.release, targetOS: target?.os ?? OS.current, workingDirectory: packageUri, packageLayout: packageLayout, @@ -228,7 +225,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( targetAndroidNdkApi: targetAndroidNdkApi, ), configValidator: linkConfigValidator, - buildMode: BuildMode.release, targetOS: target?.os ?? OS.current, workingDirectory: packageUri, packageLayout: packageLayout, diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index eacf9e375..a2b167d12 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -32,15 +32,16 @@ void main() async { final configBuilder = BuildConfigBuilder() ..setupHookConfig( - packageName: name, - packageRoot: testPackageUri, - targetOS: OS.current, - buildAssetTypes: [CodeAsset.type], - buildMode: BuildMode.debug) + packageName: name, + packageRoot: testPackageUri, + targetOS: OS.current, + buildAssetTypes: [CodeAsset.type], + ) ..setupBuildConfig(dryRun: false, linkingEnabled: false) ..setupBuildRunConfig( - outputDirectory: outputDirectory, - outputDirectoryShared: outputDirectoryShared) + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, + ) ..setupCodeConfig( targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, diff --git a/pkgs/native_assets_builder/test/test_data/transformer_test.dart b/pkgs/native_assets_builder/test/test_data/transformer_test.dart index 67c89eaa1..c965e136d 100644 --- a/pkgs/native_assets_builder/test/test_data/transformer_test.dart +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -47,15 +47,16 @@ void main() async { Future runBuild(Architecture architecture) async { final configBuilder = BuildConfigBuilder() ..setupHookConfig( - packageName: packageName, - packageRoot: packageUri, - targetOS: OS.current, - buildAssetTypes: [DataAsset.type], - buildMode: BuildMode.debug) + packageName: packageName, + packageRoot: packageUri, + targetOS: OS.current, + buildAssetTypes: [DataAsset.type], + ) ..setupBuildConfig(dryRun: false, linkingEnabled: false) ..setupBuildRunConfig( - outputDirectory: outputDirectory, - outputDirectoryShared: outputDirectoryShared) + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, + ) ..setupCodeConfig( targetArchitecture: architecture, linkModePreference: LinkModePreference.dynamic, diff --git a/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart b/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart index 0713eab62..ee718dfcb 100644 --- a/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/native_dynamic_linking/hook/build.dart @@ -19,6 +19,7 @@ void main(List args) async { sources: [ 'src/debug.c', ], + buildMode: BuildMode.debug, ), CBuilder.library( name: 'math', @@ -27,6 +28,7 @@ void main(List args) async { 'src/math.c', ], libraries: ['debug'], + buildMode: BuildMode.debug, ), CBuilder.library( name: 'add', @@ -35,6 +37,7 @@ void main(List args) async { 'src/add.c', ], libraries: ['math'], + buildMode: BuildMode.debug, ) ]; diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index 3b7baec21..03e05bb5f 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -5,6 +5,10 @@ missing. This enables (1) code to run if an asset is missing but that code is not invoked at runtime, and (2) doing fallback implementations in Dart if an asset is missing. +- **Breaking change** Move `BuildMode` to `package:native_toolchain_c`. This way + it can be controlled in the build hook together with the `OptimizationLevel`. + Most likely, every package should ship with `release`. `BuildMode.debug` + should only be used while developing the package locally. - Update pubspec.yaml of examples to use 0.9.0 of `package:native_assets_cli`. - Consolidate [CodeAsset] specific things into `lib/src/code_assets/*` diff --git a/pkgs/native_assets_cli/lib/code_assets.dart b/pkgs/native_assets_cli/lib/code_assets.dart index c6637cecf..0e84016a7 100644 --- a/pkgs/native_assets_cli/lib/code_assets.dart +++ b/pkgs/native_assets_cli/lib/code_assets.dart @@ -10,7 +10,6 @@ export 'native_assets_cli.dart' EncodedAsset, EncodedAssetBuildOutputBuilder, EncodedAssetLinkOutputBuilder; -export 'src/build_mode.dart' show BuildMode; export 'src/code_assets/architecture.dart' show Architecture; export 'src/code_assets/c_compiler_config.dart' show CCompilerConfig; export 'src/code_assets/code_asset.dart' show CodeAsset, OSLibraryNaming; diff --git a/pkgs/native_assets_cli/lib/native_assets_cli.dart b/pkgs/native_assets_cli/lib/native_assets_cli.dart index f1ef16f3d..a484fe804 100644 --- a/pkgs/native_assets_cli/lib/native_assets_cli.dart +++ b/pkgs/native_assets_cli/lib/native_assets_cli.dart @@ -10,7 +10,6 @@ export 'src/api/build.dart' show build; export 'src/api/builder.dart' show Builder; export 'src/api/link.dart' show link; export 'src/api/linker.dart' show Linker; -export 'src/build_mode.dart' show BuildMode; export 'src/config.dart' show BuildConfig, diff --git a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart index 7bb8ef9f9..01a8a8c2d 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart @@ -16,7 +16,6 @@ Future testCodeBuildHook({ // ignore: inference_failure_on_function_return_type required Function(List arguments) mainMethod, required FutureOr Function(BuildConfig, BuildOutput) check, - BuildMode? buildMode, Architecture? targetArchitecture, OS? targetOS, IOSSdk? targetIOSSdk, @@ -46,7 +45,6 @@ Future testCodeBuildHook({ expect(await validateCodeAssetBuildOutput(config, output), isEmpty); await check(config, output); }, - buildMode: buildMode, targetOS: targetOS, buildAssetTypes: buildAssetTypes, linkingEnabled: linkingEnabled, diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index 093a7dcc5..27d66de18 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -9,7 +9,6 @@ import 'package:crypto/crypto.dart' show sha256; import 'package:pub_semver/pub_semver.dart'; import 'api/deprecation_messages.dart'; -import 'build_mode.dart'; import 'code_assets/architecture.dart'; import 'encoded_asset.dart'; import 'json_utils.dart'; @@ -65,13 +64,6 @@ sealed class HookConfig { /// The operating system being compiled for. final OS targetOS; - /// The [BuildMode] that the code should be compiled in. - /// - /// Currently [BuildMode.debug] and [BuildMode.release] are the only modes. - /// - /// Not available during a dry run. - final BuildMode? _buildMode; - /// The asset types that the invoker of this hook supports. final List buildAssetTypes; @@ -91,18 +83,7 @@ sealed class HookConfig { targetOS = OS.fromString(json.string(_targetOSConfigKey)), buildAssetTypes = json.optionalStringList(_buildAssetTypesKey) ?? json.optionalStringList(_supportedAssetTypesKey) ?? - const [], - _buildMode = switch (json.optionalString(_buildModeConfigKey)) { - String value => BuildMode.fromString(value), - null => null, - }; - - BuildMode get buildMode { - if (_buildMode == null) { - throw StateError('Build mode should not be accessed in dry-run mode.'); - } - return _buildMode; - } + const []; @override String toString() => const JsonEncoder.withIndent(' ').convert(json); @@ -118,16 +99,12 @@ sealed class HookConfigBuilder { required String packageName, required OS targetOS, required List buildAssetTypes, - required BuildMode? buildMode, }) { json[_packageNameConfigKey] = packageName; json[_packageRootConfigKey] = packageRoot.toFilePath(); json[_targetOSConfigKey] = targetOS.toString(); json[_buildAssetTypesKey] = buildAssetTypes; json[_supportedAssetTypesKey] = buildAssetTypes; - if (buildMode != null) { - json[_buildModeConfigKey] = buildMode.toString(); - } } /// Constructs a checksum for a [BuildConfig]. @@ -159,7 +136,8 @@ sealed class HookConfigBuilder { } const _targetOSConfigKey = 'target_os'; -const _buildModeConfigKey = 'build_mode'; +// TODO: Bump min-SDK constraint to 3.7 and remove once stable. +const _buildModeConfigKeyDeprecated = 'build_mode'; const _metadataConfigKey = 'metadata'; const _outDirConfigKey = 'out_dir'; const _outDirSharedConfigKey = 'out_dir_shared'; @@ -207,6 +185,10 @@ final class BuildConfigBuilder extends HookConfigBuilder { json[_dependencyMetadataKey] = { for (final key in metadata.keys) key: metadata[key]!.toJson(), }; + // TODO: Bump min-SDK constraint to 3.7 and remove once stable. + if (!dryRun) { + json[_buildModeConfigKeyDeprecated] = 'release'; + } } void setupBuildRunConfig({ @@ -237,6 +219,8 @@ final class LinkConfigBuilder extends HookConfigBuilder { required List assets, }) { json[_assetsKey] = [for (final asset in assets) asset.toJson()]; + // TODO: Bump min-SDK constraint to 3.7 and remove once stable. + json[_buildModeConfigKeyDeprecated] = 'release'; } void setupLinkRunConfig({ diff --git a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md index c89032d80..77c5947e0 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md +++ b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md @@ -7,6 +7,11 @@ Compatibility with older SDKs: Create a sibling dir next to the output directory. This does not facilitate caching, but should not break the hook. Compatibility with older hooks: These will not read this field. +- `BuildConfig.buildMode` is removed. Instead it is specified by hook writers + in the `CBuilder` constructors. + Compatibility with older SDKs: The new hooks will not read the field. + Compatibility with older hooks: The field is now always passed as 'release' + until we can bump the SDK constraint in `package:native_assets_cli`. ## 1.5.0 diff --git a/pkgs/native_assets_cli/lib/test.dart b/pkgs/native_assets_cli/lib/test.dart index a9e4c289a..3f23d35bc 100644 --- a/pkgs/native_assets_cli/lib/test.dart +++ b/pkgs/native_assets_cli/lib/test.dart @@ -22,7 +22,6 @@ Future testBuildHook({ required FutureOr Function(List arguments) mainMethod, required FutureOr Function(BuildConfig config, BuildOutput output) check, - BuildMode? buildMode, OS? targetOS, List? buildAssetTypes, bool? linkingEnabled, @@ -44,7 +43,6 @@ Future testBuildHook({ packageName: _readPackageNameFromPubspec(), targetOS: targetOS ?? OS.current, buildAssetTypes: buildAssetTypes ?? [], - buildMode: buildMode ?? BuildMode.release, ) ..setupBuildConfig( dryRun: false, diff --git a/pkgs/native_assets_cli/test/api/build_test.dart b/pkgs/native_assets_cli/test/api/build_test.dart index f43c44e32..b10d9adb1 100644 --- a/pkgs/native_assets_cli/test/api/build_test.dart +++ b/pkgs/native_assets_cli/test/api/build_test.dart @@ -36,7 +36,6 @@ void main() async { packageName: packageName, targetOS: OS.iOS, buildAssetTypes: ['foo'], - buildMode: BuildMode.release, ) ..setupBuildConfig( dryRun: false, diff --git a/pkgs/native_assets_cli/test/build_config_test.dart b/pkgs/native_assets_cli/test/build_config_test.dart index 4479eb1d1..61fdf685a 100644 --- a/pkgs/native_assets_cli/test/build_config_test.dart +++ b/pkgs/native_assets_cli/test/build_config_test.dart @@ -41,7 +41,6 @@ void main() async { packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, - buildMode: BuildMode.release, buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( @@ -87,7 +86,6 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); - expect(config.buildMode, BuildMode.release); expect(config.buildAssetTypes, ['my-asset-type']); expect(config.linkingEnabled, false); @@ -101,7 +99,6 @@ void main() async { packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, - buildMode: null, // not available in dry run buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( @@ -138,7 +135,6 @@ void main() async { expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); expect(config.buildAssetTypes, ['my-asset-type']); - expect(() => config.buildMode, throwsStateError); expect(config.linkingEnabled, true); expect(config.dryRun, true); @@ -210,7 +206,6 @@ void main() async { 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', 'linking_enabled': true, - 'build_mode': BuildMode.release.name, 'build_asset_types': ['my-asset-type'], 'dependency_metadata': { 'bar': {'key': 'value'}, diff --git a/pkgs/native_assets_cli/test/checksum_test.dart b/pkgs/native_assets_cli/test/checksum_test.dart index 92740e812..aee34b710 100644 --- a/pkgs/native_assets_cli/test/checksum_test.dart +++ b/pkgs/native_assets_cli/test/checksum_test.dart @@ -14,24 +14,21 @@ void main() { final configs = []; final checksums = []; for (final os in [OS.linux, OS.macOS]) { - for (final buildMode in [BuildMode.release, BuildMode.debug]) { - for (final packageName in ['foo', 'bar']) { - for (final assetType in [CodeAsset.type, DataAsset.type]) { - for (final dryRun in [true, false]) { - for (final linking in [true, false]) { - final builder = BuildConfigBuilder() - ..setupHookConfig( - packageRoot: Uri.file('foo'), - packageName: packageName, - targetOS: os, - buildAssetTypes: [assetType], - buildMode: buildMode, - ) - ..setupBuildConfig(dryRun: dryRun, linkingEnabled: linking); - configs.add( - const JsonEncoder.withIndent(' ').convert(builder.json)); - checksums.add(builder.computeChecksum()); - } + for (final packageName in ['foo', 'bar']) { + for (final assetType in [CodeAsset.type, DataAsset.type]) { + for (final dryRun in [true, false]) { + for (final linking in [true, false]) { + final builder = BuildConfigBuilder() + ..setupHookConfig( + packageRoot: Uri.file('foo'), + packageName: packageName, + targetOS: os, + buildAssetTypes: [assetType], + ) + ..setupBuildConfig(dryRun: dryRun, linkingEnabled: linking); + configs + .add(const JsonEncoder.withIndent(' ').convert(builder.json)); + checksums.add(builder.computeChecksum()); } } } @@ -43,71 +40,40 @@ void main() { // If format or algorithm for checksumming changes we'd like to know (by // needing to update this list). + final expectedChecksums = [ - '10d9fce0028fdbb72b5994307ebf227c', - '4116af41354c68fd64b58cb6a308ebbb', - '157fda96bdf938d4fe055180bf4dbabc', - 'c5507af2f5f7e8601710c5c2fffb6188', - '2ab19c5f0f4c8f6c17826f6fabca2e6e', - 'c7c3e28d58191051c70c2748aa1377ef', - 'f81cf883235927d5cca9d510c2446a3a', - '8396b8b2541fe6ee9f39ece6aede06b6', - '9e092722bb54a9bdc6434119786a538c', - 'd2d421c2c497ff6a16bbd43f4ba27152', - '6c45154e7e0be87367fd000a9386aa2a', - '4b1257c34a3de0ce91171eadb84be35f', - '7a9a8d4a6e226dbd08e3c591e379d967', - '996f318e4d30a472358d7f21eb14585b', - '7adf24fb2f2cac19d41f439fed3fa5d8', - '99574fa166e54a5c740d0e85f46bc5af', - '2c592c067f97ed13d900bc2bb8c16f86', - 'e5b8f39328001ed0417e8cd70aad4fa8', - '923b4534ee62e50b596e04aaf1392901', - '4df91b08cd288e9a5069a5fe55c64395', - 'dde8372e52f886b8293f6b691a7b76f1', - 'bfeb49adc617a567671c78936130af4c', - 'de7b54bfd2d9ab26796951592967dca2', - 'f3e73bb91a351c1743e81cd32babf90c', - 'ac98097f3d916d7bde50d9c67b2a8d9e', - 'c87086e206e304191a13baed3f29da9e', - 'c85ced6ed90adc35f0dd03b27486d66e', - 'aed9f8805210068380e2556b1bab0a99', - 'e4314b23825c872590bbb384c1072cb8', - '3f9b69de7a31c609a4b6ec125adcaca5', - '0102baa7f1f5071aefa90a18179d0d7d', - '40f84eefd62ff9062b78b655ad3ee6b1', - '723e2805985a094838464d4ab4e0af7d', - 'f5ca710868b73059ce61ded27bd0faac', - '1b0e1ad58ff192d204ca9750505b2d55', - 'a2def75febdaa8a332fc588ee3ef8014', - '59a936e9e646387fcf322a794b753b54', - '8f5945499965afcb5d6eebf30bbacb77', - '4ed56caadaf9079c96dcec668624bf2a', - '0f2a4864df014a824034f9e29ed48ee8', - '0aed524d105e71a3bfd432ade52ed132', - '6ba03bd61a4d8979fcd64e5b6ae245b6', - 'cd70cfa54dad2b6859d5c1d23b83b074', - '2aa7bf1eda6a6fb1bf3edaadcbb9a804', - 'b6fd8e4dc466f8aa1b758134d454b191', - '22c71b4626f3f59463e1276afccfd2fb', - '70ff946f65f2d46be9b323d45e4edf0e', - '7862c709b255bde8debb5ee06ddbcd74', - 'b948929ac5fd276c69ab9f76e5b280f0', - 'aa479a711b010893b3bfb46d68028ed7', - '74c9bf5365c62bd9655f7b773b5e5113', - 'bc6224160b985a2c338f414899eed664', - '78ec380b3257d8b4ca35006e922978bd', - 'c0656028d1e11a2b6cd972464e23cd30', - '11b75baa322bd7cb1362852fc4238a0e', - '6eff070403ac6171ff42fdfbdc1a36ea', - '9d026a26c3788e9d2606ee0c5e0e0e10', - '2dcc623fce0dfc380761b9e2f396d955', - '9ce27557bb269768d25b5f1bd8ffdfa4', - 'e9b1c4c9511c02c64c2112dc16924598', - 'b38af392d228d193ba3d3943d7bb189a', - 'ab5753aa337cf91a224fe89e53173324', - 'a99ffcf470d3b570fed923bbf7257d37', - '630d35827f0193efbb1b439d792ebe23', + '4cfa5fbd14f8d73d04014ee5b453b000', + '365e989ba01bac43d654981fec67205d', + '2191c07f18b5ef13999eb6f8356ae02e', + '257890f33b84d191746a378fb0db4eba', + 'c22d663cde074a6722c2d5253b8e0619', + 'f520e2f4fd0f2fd76da0c6c18db9559b', + '7cc71dd803c24a424db70444002df999', + 'a5774f32e91551e8dfdcc3f63e45f3ed', + '0f361f3a5072f66f68eb4d7a7e4b92d6', + '5cc8e330ea24c647a1dbf2d82497c73c', + '97b5dbdf7a76cf5839de3bd0cac63b6d', + 'ccc846104ddc0dbd700190638b756435', + '0fca1f77969d6e24602cf44c28695c2b', + '683be025644ff73c5eba9d1f99f9808c', + '7a6982964efcf50507669706e31bdab5', + 'd2b17c98c64e750d8bd2ed5beb907401', + 'de3ac273831822414783f0d72acf9d82', + '09c17c21bd277ea2709c35205a2fdfa6', + 'f07b3399888444bc2b7fa837c0c1dddb', + '6e92bc3271d65229793d8bd1ed4e00be', + 'd353ae01cf04e201180edf8c5e4dac37', + '25044b641a83b33860cf8f79154652bb', + 'afc5e24300cf70245146148111b8a746', + '8023595c2343952c02e2aa47f6ee809f', + '226d39440aa5380bbcf71fb9a804a4b0', + '26cab023910889c0c96cbba2bb04ad97', + '32bea1c49326ae259fe97a6fc7b1e08d', + 'a0cccc3aa7069efc86a84b0299dba682', + '28280ef1dfe5e5922eb97577e8a85c40', + '69595125d5987c952355903deaa87684', + 'b5328455769192919339d0e6158d728d', + 'ed827ce888b9929ba83e04af8d5b7a37', ]; printOnFailure('final expectedChecksums = ['); printOnFailure(checksums.map((e) => " '$e',").join('\n')); diff --git a/pkgs/native_assets_cli/test/code_assets/config_test.dart b/pkgs/native_assets_cli/test/code_assets/config_test.dart index cb63f5916..b205e5b40 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -92,7 +92,6 @@ void main() async { packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, - buildMode: null, // not available in dry run buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( @@ -118,7 +117,6 @@ void main() async { packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, - buildMode: BuildMode.release, buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( @@ -151,7 +149,6 @@ void main() async { packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, - buildMode: BuildMode.release, buildAssetTypes: [CodeAsset.type], ) ..setupLinkConfig(assets: assets) @@ -179,7 +176,6 @@ void main() async { test('BuildConfig.codeConfig: invalid architecture', () { final config = { - 'build_mode': 'release', 'dry_run': false, 'linking_enabled': false, 'link_mode_preference': 'prefer-static', @@ -202,7 +198,6 @@ void main() async { test('LinkConfig.codeConfig: invalid architecture', () { final config = { 'build_asset_types': [CodeAsset.type], - 'build_mode': 'release', 'dry_run': false, 'link_mode_preference': 'prefer-static', 'out_dir': outDirUri.toFilePath(), diff --git a/pkgs/native_assets_cli/test/code_assets/validation_test.dart b/pkgs/native_assets_cli/test/code_assets/validation_test.dart index 7bcbe225a..4365f1712 100644 --- a/pkgs/native_assets_cli/test/code_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/validation_test.dart @@ -35,7 +35,6 @@ void main() { packageName: packageName, packageRoot: tempUri, targetOS: os, - buildMode: BuildMode.release, buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/data_assets/validation_test.dart b/pkgs/native_assets_cli/test/data_assets/validation_test.dart index 45712ddf1..422b2e6c9 100644 --- a/pkgs/native_assets_cli/test/data_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/data_assets/validation_test.dart @@ -35,7 +35,6 @@ void main() { packageName: packageName, packageRoot: tempUri, targetOS: OS.iOS, - buildMode: BuildMode.release, buildAssetTypes: [DataAsset.type]) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_assets_cli/test/example/local_asset_test.dart b/pkgs/native_assets_cli/test/example/local_asset_test.dart index 96207c559..5c9de1312 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -42,11 +42,11 @@ void main() async { final configBuilder = BuildConfigBuilder() ..setupHookConfig( - packageRoot: testPackageUri, - packageName: name, - targetOS: OS.current, - buildAssetTypes: [CodeAsset.type], - buildMode: dryRun ? null : BuildMode.debug) + packageRoot: testPackageUri, + packageName: name, + targetOS: OS.current, + buildAssetTypes: [CodeAsset.type], + ) ..setupBuildRunConfig( outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared) diff --git a/pkgs/native_assets_cli/test/example/native_add_library_test.dart b/pkgs/native_assets_cli/test/example/native_add_library_test.dart index c2df4cea6..3d9c9b14c 100644 --- a/pkgs/native_assets_cli/test/example/native_add_library_test.dart +++ b/pkgs/native_assets_cli/test/example/native_add_library_test.dart @@ -42,11 +42,11 @@ void main() async { final configBuilder = BuildConfigBuilder() ..setupHookConfig( - packageRoot: testPackageUri, - packageName: name, - targetOS: OS.current, - buildAssetTypes: [CodeAsset.type], - buildMode: dryRun ? null : BuildMode.debug) + packageRoot: testPackageUri, + packageName: name, + targetOS: OS.current, + buildAssetTypes: [CodeAsset.type], + ) ..setupBuildRunConfig( outputDirectory: outputDirectory, outputDirectoryShared: outputDirectoryShared) diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index b70e28274..64b3f50de 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -50,7 +50,6 @@ void main() async { packageName: name, targetOS: OS.current, buildAssetTypes: [CodeAsset.type], - buildMode: dryRun ? null : BuildMode.debug, ) ..setupBuildRunConfig( outputDirectory: outputDirectory, diff --git a/pkgs/native_assets_cli/test/link_config_test.dart b/pkgs/native_assets_cli/test/link_config_test.dart index 7ce676bc0..dc87cc772 100644 --- a/pkgs/native_assets_cli/test/link_config_test.dart +++ b/pkgs/native_assets_cli/test/link_config_test.dart @@ -34,7 +34,6 @@ void main() async { packageName: packageName, packageRoot: packageRootUri, targetOS: OS.android, - buildMode: BuildMode.release, buildAssetTypes: ['asset-type-1', 'asset-type-2'], ) ..setupLinkConfig(assets: assets) @@ -66,7 +65,6 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); expect(config.targetOS, OS.android); - expect(config.buildMode, BuildMode.release); expect(config.buildAssetTypes, ['asset-type-1', 'asset-type-2']); expect(config.encodedAssets, assets); }); @@ -132,7 +130,6 @@ void main() async { 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'target_os': 'android', - 'build_mode': BuildMode.release.name, 'assets': 'astring', }), throwsA(predicate( diff --git a/pkgs/native_assets_cli/test/validation_test.dart b/pkgs/native_assets_cli/test/validation_test.dart index a64e2f635..8a45a1b96 100644 --- a/pkgs/native_assets_cli/test/validation_test.dart +++ b/pkgs/native_assets_cli/test/validation_test.dart @@ -35,7 +35,6 @@ void main() { packageName: packageName, packageRoot: tempUri, targetOS: OS.iOS, - buildMode: BuildMode.release, buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( diff --git a/pkgs/native_toolchain_c/lib/native_toolchain_c.dart b/pkgs/native_toolchain_c/lib/native_toolchain_c.dart index 2d4580f1d..4efdfa5fd 100644 --- a/pkgs/native_toolchain_c/lib/native_toolchain_c.dart +++ b/pkgs/native_toolchain_c/lib/native_toolchain_c.dart @@ -5,6 +5,7 @@ /// A library to invoke the native C compiler installed on the host machine. library; +export 'src/cbuilder/build_mode.dart'; export 'src/cbuilder/cbuilder.dart' show CBuilder; export 'src/cbuilder/clinker.dart' show CLinker; export 'src/cbuilder/language.dart' show Language; diff --git a/pkgs/native_assets_cli/lib/src/build_mode.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/build_mode.dart similarity index 100% rename from pkgs/native_assets_cli/lib/src/build_mode.dart rename to pkgs/native_toolchain_c/lib/src/cbuilder/build_mode.dart diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart index 8e99e7ebc..9fda6b34f 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart @@ -8,6 +8,7 @@ import 'package:logging/logging.dart'; import 'package:meta/meta.dart'; import 'package:native_assets_cli/code_assets_builder.dart'; +import 'build_mode.dart'; import 'ctool.dart'; import 'language.dart'; import 'linkmode.dart'; @@ -47,6 +48,8 @@ class CBuilder extends CTool implements Builder { /// Defaults to `true`. final bool ndebugDefine; + final BuildMode buildMode; + CBuilder.library({ required super.name, super.assetName, @@ -71,6 +74,7 @@ class CBuilder extends CTool implements Builder { super.cppLinkStdLib, super.linkModePreference, super.optimizationLevel = OptimizationLevel.o3, + this.buildMode = BuildMode.release, }) : super(type: OutputType.library); CBuilder.executable({ @@ -94,6 +98,7 @@ class CBuilder extends CTool implements Builder { super.language = Language.c, super.cppLinkStdLib, super.optimizationLevel = OptimizationLevel.o3, + this.buildMode = BuildMode.release, }) : super( type: OutputType.executable, assetName: null, @@ -164,9 +169,8 @@ class CBuilder extends CTool implements Builder { flags: flags, defines: { ...defines, - if (buildModeDefine) config.buildMode.name.toUpperCase(): null, - if (ndebugDefine && config.buildMode != BuildMode.debug) - 'NDEBUG': null, + if (buildModeDefine) buildMode.name.toUpperCase(): null, + if (ndebugDefine && buildMode != BuildMode.debug) 'NDEBUG': null, }, pic: pic, std: std, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index f9648e9f4..164dde262 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -35,7 +35,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -58,6 +57,7 @@ void main() { sources: [addCUri.toFilePath()], name: name, assetName: name, + buildMode: BuildMode.release, ); expect( () => cbuilder.run( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index a2c64cbda..6b3002c75 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -150,7 +150,6 @@ Future buildLib( packageName: name, packageRoot: tempUri, targetOS: OS.android, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -177,6 +176,7 @@ Future buildLib( assetName: name, sources: [addCUri.toFilePath()], flags: flags, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index 7456f37d2..29e78e72f 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -76,7 +76,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.iOS, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -105,6 +104,7 @@ void main() { installName: installName, language: language, optimizationLevel: optimizationLevel, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -234,7 +234,6 @@ Future buildLib( packageName: name, packageRoot: tempUri, targetOS: OS.iOS, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -261,6 +260,7 @@ Future buildLib( name: name, assetName: name, sources: [addCUri.toFilePath()], + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index 7b58957eb..c39d398d0 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -48,7 +48,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.linux, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -74,6 +73,7 @@ void main() { assetName: name, sources: [addCUri.toFilePath()], optimizationLevel: optimizationLevel, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index 5e89ca115..129c8bec3 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -63,7 +63,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.macOS, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -89,6 +88,7 @@ void main() { sources: [sourceUri.toFilePath()], language: language, optimizationLevel: optimizationLevel, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -164,7 +164,6 @@ Future buildLib( packageName: name, packageRoot: tempUri, targetOS: OS.macOS, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -190,6 +189,7 @@ Future buildLib( name: name, assetName: name, sources: [addCUri.toFilePath()], + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index b256b9c5a..6c9532653 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -67,7 +67,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.windows, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -93,6 +92,7 @@ void main() { assetName: name, sources: [addCUri.toFilePath()], optimizationLevel: optimizationLevel, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index d076c7fd9..4b0a30793 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -49,7 +49,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: buildMode, ) ..setupBuildConfig( linkingEnabled: false, @@ -73,6 +72,7 @@ void main() { name: name, sources: [helloWorldCUri.toFilePath()], pie: pic, + buildMode: buildMode, ); await cbuilder.run( config: buildConfig, @@ -131,7 +131,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -154,6 +153,7 @@ void main() { name: name, assetName: name, pic: pic, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -232,7 +232,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -260,6 +259,7 @@ void main() { name: name, sources: [definesCUri.toFilePath()], flags: [flag], + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -299,7 +299,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -323,6 +322,7 @@ void main() { assetName: name, includes: [includeDirectoryUri.toFilePath()], sources: [includesCUri.toFilePath()], + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -355,7 +355,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -384,6 +383,7 @@ void main() { name: name, assetName: name, std: std, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -423,7 +423,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -453,6 +452,7 @@ void main() { name: name, sources: [helloWorldCppUri.toFilePath()], language: Language.cpp, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, @@ -496,7 +496,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -520,6 +519,7 @@ void main() { sources: [helloWorldCppUri.toFilePath()], language: Language.cpp, cppLinkStdLib: 'stdc++', + buildMode: BuildMode.release, ); if (buildConfig.targetOS == OS.windows) { @@ -580,7 +580,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -604,6 +603,7 @@ void main() { assetName: 'debug', includes: [dynamicallyLinkedSrcUri.toFilePath()], sources: [debugCUri.toFilePath()], + buildMode: BuildMode.release, ); await debugBuilder.run( @@ -681,7 +681,6 @@ Future testDefines({ packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: buildMode, ) ..setupBuildConfig( linkingEnabled: false, @@ -709,6 +708,7 @@ Future testDefines({ }, buildModeDefine: buildModeDefine, ndebugDefine: ndebugDefine, + buildMode: buildMode, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index 1ee88a7ac..b4c1ddf01 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -47,7 +47,6 @@ void main() { packageName: 'dummy', packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -87,7 +86,6 @@ void main() { packageName: 'dummy', packageRoot: tempUri, targetOS: OS.windows, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index 0027cbd93..23f8fe9ca 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -41,7 +41,6 @@ void main() { packageName: name, packageRoot: tempUri, targetOS: OS.current, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -65,6 +64,7 @@ void main() { assetName: name, sources: [addMUri.toFilePath()], language: Language.objectiveC, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index a01c949b8..fe183eb09 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -31,7 +31,6 @@ Future buildTestArchive( packageName: name, packageRoot: tempUri, targetOS: os, - buildMode: BuildMode.release, ) ..setupBuildConfig( linkingEnabled: false, @@ -55,6 +54,7 @@ Future buildTestArchive( assetName: '', sources: [test1Uri.toFilePath(), test2Uri.toFilePath()], linkModePreference: LinkModePreference.static, + buildMode: BuildMode.release, ); await cbuilder.run( config: buildConfig, diff --git a/pkgs/native_toolchain_c/test/clinker/objects_test.dart b/pkgs/native_toolchain_c/test/clinker/objects_test.dart index b4f17841f..d080e984a 100644 --- a/pkgs/native_toolchain_c/test/clinker/objects_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/objects_test.dart @@ -37,7 +37,6 @@ Future main() async { packageName: 'testpackage', packageRoot: tempUri, targetOS: os, - buildMode: BuildMode.debug, ) ..setupLinkConfig( assets: [], diff --git a/pkgs/native_toolchain_c/test/clinker/throws_test.dart b/pkgs/native_toolchain_c/test/clinker/throws_test.dart index 7370cbe91..149f09001 100644 --- a/pkgs/native_toolchain_c/test/clinker/throws_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/throws_test.dart @@ -28,7 +28,6 @@ Future main() async { packageName: 'testpackage', packageRoot: tempUri, targetOS: os, - buildMode: BuildMode.debug, ) ..setupLinkConfig( assets: [], diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart index 7862b4ff1..322d9ba04 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart @@ -67,8 +67,6 @@ Future runTests(List architectures) async { packageName: 'testpackage', packageRoot: tempUri, targetOS: os, - buildMode: BuildMode.release, - //outputDirectoryShared: tempUri2, ) ..setupLinkConfig( assets: [], From cb477002e2d2559975d76165210eeca98821688d Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Tue, 10 Dec 2024 13:28:00 -0800 Subject: [PATCH 40/50] [native_assets_cli] Make package:test dev dep (#1799) - refactor the package:native_assets_cli dep on package:test; make the dep a dev_dependency instead of a regular dependency - rename `testBuildHook` to `validateBuildHook` and `testCodeBuildHook` to `validateCodeBuildHook - update the changelog When doing an investigation into the deps of the `dart` cli tool, I found that this was bringing `package:test` all all its dependencies into the transitive closure of used packages. This refactors the package to still provide testing facilities but to no longer use package:test as a regular dep. ---
Contribution guidelines:
- See our [contributor guide](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md) for general expectations for PRs. - Larger or significant changes should be discussed in an issue before creating a PR. - Contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`. - Most changes should add an entry to the changelog and may need to [rev the pubspec package version](https://github.com/dart-lang/sdk/blob/main/docs/External-Package-Maintenance.md#making-a-change). - Changes to packages require [corresponding tests](https://github.com/dart-lang/.github/blob/main/CONTRIBUTING.md#Testing). Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
--- pkgs/native_assets_cli/CHANGELOG.md | 5 + .../build/local_asset/test/build_test.dart | 25 ++-- .../lib/src/code_assets/testing.dart | 27 +++- .../native_assets_cli/lib/src/validation.dart | 10 ++ pkgs/native_assets_cli/lib/test.dart | 129 +++++++++--------- pkgs/native_assets_cli/pubspec.yaml | 2 +- 6 files changed, 116 insertions(+), 82 deletions(-) diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index 03e05bb5f..20a84d7d7 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -9,6 +9,11 @@ it can be controlled in the build hook together with the `OptimizationLevel`. Most likely, every package should ship with `release`. `BuildMode.debug` should only be used while developing the package locally. +- **Breaking change**: Change the behavior of `testBuildHook` and + `testCodeBuildHook`; instead of defining tests, these methods should now be + called from within tests. +- Move the `package:test` dependency from a regular dependency (exported to + calling packages) to a dev_dependency. - Update pubspec.yaml of examples to use 0.9.0 of `package:native_assets_cli`. - Consolidate [CodeAsset] specific things into `lib/src/code_assets/*` diff --git a/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart b/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart index 8f2ea6180..7b8ad34d6 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart +++ b/pkgs/native_assets_cli/example/build/local_asset/test/build_test.dart @@ -8,16 +8,17 @@ import 'package:test/test.dart'; import '../hook/build.dart' as build; void main() async { - await testCodeBuildHook( - description: 'test my build hook', - mainMethod: build.main, - check: (_, output) { - expect(output.codeAssets, isNotEmpty); - expect( - output.codeAssets.first.id, - 'package:local_asset/asset.txt', - ); - }, - buildAssetTypes: [CodeAsset.type], - ); + test('test my build hook', () async { + await testCodeBuildHook( + mainMethod: build.main, + check: (_, output) { + expect(output.codeAssets, isNotEmpty); + expect( + output.codeAssets.first.id, + 'package:local_asset/asset.txt', + ); + }, + buildAssetTypes: [CodeAsset.type], + ); + }); } diff --git a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart index 01a8a8c2d..25f3741f1 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart @@ -4,15 +4,23 @@ import 'dart:async'; -import 'package:meta/meta.dart' show isTest; -import 'package:test/test.dart'; - import '../../code_assets_builder.dart'; import '../../test.dart'; +import '../validation.dart'; -@isTest +/// Validate a code build hook; this will throw an exception on validation +/// errors. +/// +/// This is intended to be used from tests, e.g.: +/// +/// ``` +/// test('test my build hook', () async { +/// await testCodeBuildHook( +/// ... +/// ); +/// }); +/// ``` Future testCodeBuildHook({ - required String description, // ignore: inference_failure_on_function_return_type required Function(List arguments) mainMethod, required FutureOr Function(BuildConfig, BuildOutput) check, @@ -28,7 +36,6 @@ Future testCodeBuildHook({ bool? linkingEnabled, }) async { await testBuildHook( - description: description, mainMethod: mainMethod, extraConfigSetup: (config) { config.setupCodeConfig( @@ -42,7 +49,13 @@ Future testCodeBuildHook({ ); }, check: (config, output) async { - expect(await validateCodeAssetBuildOutput(config, output), isEmpty); + final validationErrors = + await validateCodeAssetBuildOutput(config, output); + if (validationErrors.isNotEmpty) { + throw ValidationFailure( + 'encountered build output validation issues: $validationErrors'); + } + await check(config, output); }, targetOS: targetOS, diff --git a/pkgs/native_assets_cli/lib/src/validation.dart b/pkgs/native_assets_cli/lib/src/validation.dart index c20edd3fd..72c01c7a3 100644 --- a/pkgs/native_assets_cli/lib/src/validation.dart +++ b/pkgs/native_assets_cli/lib/src/validation.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. import 'dart:io'; + import '../native_assets_cli_builder.dart'; typedef ValidationErrors = List; @@ -99,3 +100,12 @@ List _validateAssetsForLinking( } return errors; } + +class ValidationFailure implements Exception { + final String? message; + + ValidationFailure(this.message); + + @override + String toString() => message.toString(); +} diff --git a/pkgs/native_assets_cli/lib/test.dart b/pkgs/native_assets_cli/lib/test.dart index 3f23d35bc..21deb2490 100644 --- a/pkgs/native_assets_cli/lib/test.dart +++ b/pkgs/native_assets_cli/lib/test.dart @@ -6,18 +6,26 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:meta/meta.dart' show isTest; -import 'package:test/test.dart'; import 'package:yaml/yaml.dart'; import 'native_assets_cli_builder.dart'; import 'native_assets_cli_internal.dart' show Hook; +import 'src/validation.dart'; export 'native_assets_cli_builder.dart'; -@isTest +/// Validate a build hook; this will throw an exception on validation errors. +/// +/// This is intended to be used from tests, e.g.: +/// +/// ``` +/// test('test my build hook', () async { +/// await testCodeBuildHook( +/// ... +/// ); +/// }); +/// ``` Future testBuildHook({ - required String description, required void Function(BuildConfigBuilder) extraConfigSetup, required FutureOr Function(List arguments) mainMethod, required FutureOr Function(BuildConfig config, BuildOutput output) @@ -26,49 +34,61 @@ Future testBuildHook({ List? buildAssetTypes, bool? linkingEnabled, }) async { - test( - description, - () async { - final tempDir = await _tempDirForTest(); - final outputDirectory = tempDir.resolve('output/'); - final outputDirectoryShared = tempDir.resolve('output_shared/'); - - await Directory.fromUri(outputDirectory).create(); - await Directory.fromUri(outputDirectoryShared).create(); - - final configBuilder = BuildConfigBuilder(); - configBuilder - ..setupHookConfig( - packageRoot: Directory.current.uri, - packageName: _readPackageNameFromPubspec(), - targetOS: targetOS ?? OS.current, - buildAssetTypes: buildAssetTypes ?? [], - ) - ..setupBuildConfig( - dryRun: false, - linkingEnabled: true, - ) - ..setupBuildRunConfig( - outputDirectory: outputDirectory, - outputDirectoryShared: outputDirectoryShared, - ); - extraConfigSetup(configBuilder); - - final config = BuildConfig(configBuilder.json); - - final configUri = tempDir.resolve(Hook.build.outputName); - _writeJsonTo(configUri, config.json); - await mainMethod(['--config=${configUri.toFilePath()}']); - final output = BuildOutput( - _readJsonFrom(config.outputDirectory.resolve(Hook.build.outputName))); - - // Test conformance of protocol invariants. - expect(await validateBuildOutput(config, output), isEmpty); - - // Run user-defined tests. - check(config, output); - }, - ); + const keepTempKey = 'KEEP_TEMPORARY_DIRECTORIES'; + + final tempDir = await Directory.systemTemp.createTemp(); + + try { + // Deal with Windows temp folder aliases. + final tempUri = + Directory(await tempDir.resolveSymbolicLinks()).uri.normalizePath(); + final outputDirectory = tempUri.resolve('output/'); + final outputDirectoryShared = tempUri.resolve('output_shared/'); + + await Directory.fromUri(outputDirectory).create(); + await Directory.fromUri(outputDirectoryShared).create(); + + final configBuilder = BuildConfigBuilder(); + configBuilder + ..setupHookConfig( + packageRoot: Directory.current.uri, + packageName: _readPackageNameFromPubspec(), + targetOS: targetOS ?? OS.current, + buildAssetTypes: buildAssetTypes ?? [], + ) + ..setupBuildConfig( + dryRun: false, + linkingEnabled: true, + ) + ..setupBuildRunConfig( + outputDirectory: outputDirectory, + outputDirectoryShared: outputDirectoryShared, + ); + extraConfigSetup(configBuilder); + + final config = BuildConfig(configBuilder.json); + + final configUri = tempUri.resolve(Hook.build.outputName); + _writeJsonTo(configUri, config.json); + await mainMethod(['--config=${configUri.toFilePath()}']); + final output = BuildOutput( + _readJsonFrom(config.outputDirectory.resolve(Hook.build.outputName))); + + // Test conformance of protocol invariants. + final validationErrors = await validateBuildOutput(config, output); + if (validationErrors.isNotEmpty) { + throw ValidationFailure( + 'encountered build output validation issues: $validationErrors'); + } + + // Run user-defined tests. + await check(config, output); + } finally { + final keepTempDir = (Platform.environment[keepTempKey] ?? '').isNotEmpty; + if (!keepTempDir) { + tempDir.deleteSync(recursive: true); + } + } } void _writeJsonTo(Uri uri, Map json) { @@ -88,18 +108,3 @@ String _readPackageNameFromPubspec() { final yaml = loadYaml(readAsString) as YamlMap; return yaml['name'] as String; } - -const keepTempKey = 'KEEP_TEMPORARY_DIRECTORIES'; - -Future _tempDirForTest({String? prefix, bool keepTemp = false}) async { - final tempDir = await Directory.systemTemp.createTemp(prefix); - // Deal with Windows temp folder aliases. - final tempUri = - Directory(await tempDir.resolveSymbolicLinks()).uri.normalizePath(); - if ((!Platform.environment.containsKey(keepTempKey) || - Platform.environment[keepTempKey]!.isEmpty) && - !keepTemp) { - addTearDown(() => tempDir.delete(recursive: true)); - } - return tempUri; -} diff --git a/pkgs/native_assets_cli/pubspec.yaml b/pkgs/native_assets_cli/pubspec.yaml index 193e6783e..d72d7b095 100644 --- a/pkgs/native_assets_cli/pubspec.yaml +++ b/pkgs/native_assets_cli/pubspec.yaml @@ -23,10 +23,10 @@ dependencies: logging: ^1.2.0 meta: ^1.15.0 pub_semver: ^2.1.3 - test: ^1.25.7 yaml: ^3.1.2 # Used for reading pubspec.yaml to obtain the package name dev_dependencies: dart_flutter_team_lints: ^2.1.1 file_testing: ^3.0.0 glob: any + test: ^1.25.7 From 2cecc8846e0d0183dac29edf6931d0c2a2c5775a Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Wed, 11 Dec 2024 16:04:57 +0100 Subject: [PATCH 41/50] Separate java primitive arrays and implement Iterable (#1798) It was not possible to implement Dart's `Iterable` in a generic way for both primitive arrays and object arrays. Now the primitive arrays are separate and they all implement `Iterable`. --- pkgs/jni/CHANGELOG.md | 9 + pkgs/jni/lib/_internal.dart | 1 - pkgs/jni/lib/jni.dart | 2 +- pkgs/jni/lib/src/jarray.dart | 1195 +++++++++++++++-- pkgs/jni/lib/src/jprimitives.dart | 101 +- pkgs/jni/lib/src/method_invocation.dart | 2 +- pkgs/jni/lib/src/nio/jbyte_buffer.dart | 7 +- pkgs/jni/lib/src/types.dart | 32 +- pkgs/jni/test/jarray_test.dart | 81 +- pkgs/jni/test/jbyte_buffer_test.dart | 4 +- pkgs/jni/test/type_test.dart | 11 +- .../org/apache/pdfbox/pdmodel/PDDocument.dart | 8 +- .../lib/src/bindings/dart_generator.dart | 11 +- .../fasterxml/jackson/core/JsonFactory.dart | 12 +- .../fasterxml/jackson/core/JsonParser.dart | 17 +- .../com/fasterxml/jackson/core/JsonToken.dart | 10 +- .../bindings/simple_package.dart | 19 +- 17 files changed, 1192 insertions(+), 330 deletions(-) diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 7faae37d9..6de5b92dd 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,5 +1,14 @@ ## 0.13.0-wip +- **Breaking Change**: Separated primitive arrays from object arrays. + Previously, a primitive array like an array of bytes was typed + `JArray`. Now `JArray` only accepts `JObject`s as types and + primitive arrays like arrays of bytes have their own types such as + `JByteArray`. + + This enables all arrays to implement `Iterable` which makes it possible to use + them in a for-loop or use methods such as `map` on them. + - Added nullable type classes for all Java objects. ## 0.12.2 diff --git a/pkgs/jni/lib/_internal.dart b/pkgs/jni/lib/_internal.dart index 768be191f..9b5ce9aad 100644 --- a/pkgs/jni/lib/_internal.dart +++ b/pkgs/jni/lib/_internal.dart @@ -34,7 +34,6 @@ export 'src/method_invocation.dart'; export 'src/types.dart' show JAccessible, - JArrayElementType, JCallable, JConstructable, JObjType, diff --git a/pkgs/jni/lib/jni.dart b/pkgs/jni/lib/jni.dart index cb069dc21..2ebe0c375 100644 --- a/pkgs/jni/lib/jni.dart +++ b/pkgs/jni/lib/jni.dart @@ -63,6 +63,7 @@ library; export 'package:ffi/ffi.dart' show Arena, using; export 'src/errors.dart'; +export 'src/jarray.dart'; export 'src/jimplementer.dart'; export 'src/jni.dart' hide ProtectedJniExtensions, StringMethodsForJni; export 'src/jobject.dart'; @@ -75,7 +76,6 @@ export 'src/third_party/generated_bindings.dart' export 'src/types.dart' hide JAccessible, - JArrayElementType, JCallable, JConstructable, JObjType, diff --git a/pkgs/jni/lib/src/jarray.dart b/pkgs/jni/lib/src/jarray.dart index 60dca97c1..f3eea8cb8 100644 --- a/pkgs/jni/lib/src/jarray.dart +++ b/pkgs/jni/lib/src/jarray.dart @@ -4,11 +4,22 @@ // ignore_for_file: unnecessary_cast, overridden_fields -part of 'types.dart'; +import 'dart:ffi'; +import 'dart:typed_data'; -final class JArrayNullableType extends JObjType?> { +import 'package:ffi/ffi.dart'; +import 'package:meta/meta.dart'; + +import 'jni.dart'; +import 'jobject.dart'; +import 'jreference.dart'; +import 'third_party/generated_bindings.dart'; +import 'types.dart'; + +final class JArrayNullableType + extends JObjType?> { @internal - final JArrayElementType elementType; + final JObjType elementType; @internal const JArrayNullableType(this.elementType); @@ -20,7 +31,7 @@ final class JArrayNullableType extends JObjType?> { @internal @override JArray? fromReference(JReference reference) => - reference.isNull ? null : JArray.fromReference(elementType, reference); + reference.isNull ? null : JArray.fromReference(elementType, reference); @internal @override @@ -45,9 +56,9 @@ final class JArrayNullableType extends JObjType?> { } } -final class JArrayType extends JObjType> { +final class JArrayType extends JObjType> { @internal - final JArrayElementType elementType; + final JObjType elementType; @internal const JArrayType(this.elementType); @@ -59,7 +70,7 @@ final class JArrayType extends JObjType> { @internal @override JArray fromReference(JReference reference) => - JArray.fromReference(elementType, reference); + JArray.fromReference(elementType, reference); @internal @override @@ -84,26 +95,26 @@ final class JArrayType extends JObjType> { } } -class JArray extends JObject { +class JArray extends JObject with Iterable { @internal - final JArrayElementType elementType; + final JObjType elementType; @internal @override final JArrayType $type; /// The type which includes information such as the signature of this class. - static JArrayType type(JArrayElementType innerType) => - JArrayType(innerType); + static JArrayType type(JObjType innerType) => + JArrayType(innerType); /// The type which includes information such as the signature of this class. - static JArrayNullableType nullableType( - JArrayElementType innerType) => - JArrayNullableType(innerType); + static JArrayNullableType nullableType( + JObjType innerType) => + JArrayNullableType(innerType); /// Construct a new [JArray] with [reference] as its underlying reference. JArray.fromReference(this.elementType, JReference reference) - : $type = type(elementType), + : $type = type(elementType), super.fromReference(reference); /// Creates a [JArray] of the given length from the given [elementType]. @@ -111,15 +122,31 @@ class JArray extends JObject { /// The [length] must be a non-negative integer. /// For objects, [elementType] must be a nullable type as this constructor /// initializes all elements with `null`. - factory JArray(JArrayElementType elementType, int length) { + factory JArray(JObjType elementType, int length) { RangeError.checkNotNegative(length); - if (elementType is JObjType && - !(elementType as JObjType).isNullable) { + if (!elementType.isNullable) { throw StateError('Element type of JArray must be nullable when ' 'all elements with null\n\n' 'Try using .nullableType instead'); } - return elementType._newArray(length); + return _newArray(elementType, length); + } + + static JArray<$E> _newArray<$E extends JObject?>( + JObjType<$E> elementType, int length, + [$E? fill]) { + final classRef = elementType.jClass.reference; + final fillRef = fill?.reference ?? jNullReference; + final array = JArray<$E>.fromReference( + elementType, + JGlobalReference(Jni.env.NewObjectArray( + length, + classRef.pointer, + fillRef.pointer, + )), + ); + classRef.release(); + return array; } /// Creates a [JArray] of the given length with [fill] at each position. @@ -129,29 +156,88 @@ class JArray extends JObject { {JObjType<$E>? E}) { RangeError.checkNotNegative(length); E ??= fill.$type as JObjType<$E>; - return E._newArray(length, fill); + return _newArray<$E>(E, length, fill); } - int? _length; - /// The number of elements in this array. - int get length { - return _length ??= Jni.env.GetArrayLength(reference.pointer); + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + E elementAt(int index) { + RangeError.checkValidIndex(index, this); + final pointer = Jni.env.GetObjectArrayElement(reference.pointer, index); + if (pointer == nullptr) { + return null as E; + } + return (elementType as JObjType) + .fromReference(JGlobalReference(pointer)); + } + + E operator [](int index) { + return elementAt(index); + } + + void operator []=(int index, E value) { + RangeError.checkValidIndex(index, this); + final valueRef = value?.reference ?? jNullReference; + Jni.env.SetObjectArrayElement(reference.pointer, index, valueRef.pointer); + } + + void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { + RangeError.checkValidRange(start, end, length); + final rangeLength = end - start; + final it = iterable.skip(skipCount).take(rangeLength); + for (final (index, element) in it.indexed) { + this[index] = element; + } } + + @override + Iterator get iterator => _JArrayIterator(this); } -extension NativeArray on JArray { - void _allocate( - int byteCount, - void Function(Pointer ptr) use, - ) { - using((arena) { - final ptr = arena.allocate(byteCount); - use(ptr); - }, malloc); +class _JArrayIterator implements Iterator { + final Iterable _iterable; + final int _length; + int _index; + E? _current; + + _JArrayIterator(Iterable iterable) + : _iterable = iterable, + _length = iterable.length, + _index = 0; + + @override + E get current => _current as E; + + @override + @pragma('vm:prefer-inline') + bool moveNext() { + final length = _iterable.length; + if (_length != length) { + throw ConcurrentModificationError(_iterable); + } + if (_index >= length) { + _current = null; + return false; + } + _current = _iterable.elementAt(_index); + _index++; + return true; } } +void _allocate( + int byteCount, + void Function(Pointer ptr) use, +) { + using((arena) { + final ptr = arena.allocate(byteCount); + use(ptr); + }, malloc); +} + extension on Allocator { Pointer? get _nativeFree { return switch (this) { @@ -162,12 +248,117 @@ extension on Allocator { } } -extension BoolArray on JArray { - bool operator [](int index) { +final class JBooleanArrayNullableType extends JObjType { + @internal + const JBooleanArrayNullableType(); + + @internal + @override + String get signature => '[Z'; + + @internal + @override + JBooleanArray? fromReference(JReference reference) => + reference.isNull ? null : JBooleanArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JBooleanArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JBooleanArrayNullableType && + other is JBooleanArrayNullableType; + } +} + +final class JBooleanArrayType extends JObjType { + @internal + const JBooleanArrayType(); + + @internal + @override + String get signature => '[Z'; + + @internal + @override + JBooleanArray fromReference(JReference reference) => + JBooleanArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => + const JBooleanArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JBooleanArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JBooleanArrayType && other is JBooleanArrayType; + } +} + +class JBooleanArray extends JObject with Iterable { + @internal + @override + final JBooleanArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JBooleanArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JBooleanArrayNullableType(); + + /// Construct a new [JBooleanArray] with [reference] as its underlying + /// reference. + JBooleanArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JBooleanArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JBooleanArray(int length) { + RangeError.checkNotNegative(length); + return JBooleanArray.fromReference( + JGlobalReference(Jni.env.NewBooleanArray(length)), + ); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + bool elementAt(int index) { RangeError.checkValidIndex(index, this); return Jni.env.GetBooleanArrayElement(reference.pointer, index); } + bool operator [](int index) { + return elementAt(index); + } + void operator []=(int index, bool value) { RangeError.checkValidIndex(index, this); Jni.env.SetBooleanArrayElement(reference.pointer, index, value); @@ -193,92 +384,130 @@ extension BoolArray on JArray { Jni.env.SetBooleanArrayRegion(reference.pointer, start, rangeLength, ptr); }); } + + @override + Iterator get iterator => _JArrayIterator(this); } -extension ByteArray on JArray { - int operator [](int index) { - RangeError.checkValidIndex(index, this); - return Jni.env.GetByteArrayElement(reference.pointer, index); - } +final class JByteArrayNullableType extends JObjType { + @internal + const JByteArrayNullableType(); - void operator []=(int index, int value) { - RangeError.checkValidIndex(index, this); - Jni.env.SetByteArrayElement(reference.pointer, index, value); - } + @internal + @override + String get signature => '[B'; - Int8List getRange(int start, int end, {Allocator allocator = malloc}) { - RangeError.checkValidRange(start, end, length); - final rangeLength = end - start; - final buffer = allocator(rangeLength); - Jni.env.GetByteArrayRegion(reference.pointer, start, rangeLength, buffer); - return buffer.asTypedList(rangeLength, finalizer: allocator._nativeFree); - } + @internal + @override + JByteArray? fromReference(JReference reference) => + reference.isNull ? null : JByteArray.fromReference(reference); - void setRange(int start, int end, Iterable iterable, - [int skipCount = 0]) { - RangeError.checkValidRange(start, end, length); - final rangeLength = end - start; - _allocate(sizeOf() * rangeLength, (ptr) { - ptr - .asTypedList(rangeLength) - .setRange(0, rangeLength, iterable, skipCount); - Jni.env.SetByteArrayRegion(reference.pointer, start, rangeLength, ptr); - }); + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JByteArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JByteArrayNullableType && + other is JByteArrayNullableType; } } -/// `JArray` is a 16-bit integer array. -/// -/// Due to variable length encoding, the number of code units is not equal to -/// the number of characters. -extension CharArray on JArray { - int operator [](int index) { - RangeError.checkValidIndex(index, this); - return Jni.env.GetCharArrayElement(reference.pointer, index); - } +final class JByteArrayType extends JObjType { + @internal + const JByteArrayType(); - void operator []=(int index, int value) { - RangeError.checkValidIndex(index, this); - Jni.env.SetCharArrayElement(reference.pointer, index, value); + @internal + @override + String get signature => '[B'; + + @internal + @override + JByteArray fromReference(JReference reference) => + JByteArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JByteArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JByteArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JByteArrayType && other is JByteArrayType; } +} - Uint16List getRange(int start, int end, {Allocator allocator = malloc}) { - RangeError.checkValidRange(start, end, length); - final rangeLength = end - start; - final buffer = allocator(rangeLength); - Jni.env.GetCharArrayRegion(reference.pointer, start, rangeLength, buffer); - return buffer.asTypedList(rangeLength, finalizer: allocator._nativeFree); +class JByteArray extends JObject with Iterable { + @internal + @override + final JByteArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JByteArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JByteArrayNullableType(); + + /// Construct a new [JByteArray] with [reference] as its underlying + /// reference. + JByteArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JByteArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JByteArray(int length) { + RangeError.checkNotNegative(length); + return JByteArray.fromReference( + JGlobalReference(Jni.env.NewByteArray(length))); } - void setRange(int start, int end, Iterable iterable, - [int skipCount = 0]) { - RangeError.checkValidRange(start, end, length); - final rangeLength = end - start; - _allocate(sizeOf() * rangeLength, (ptr) { - ptr - .asTypedList(rangeLength) - .setRange(0, rangeLength, iterable, skipCount); - Jni.env.SetCharArrayRegion(reference.pointer, start, rangeLength, ptr); - }); + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + int elementAt(int index) { + RangeError.checkValidIndex(index, this); + return Jni.env.GetByteArrayElement(reference.pointer, index); } -} -extension ShortArray on JArray { int operator [](int index) { - RangeError.checkValidIndex(index, this); - return Jni.env.GetShortArrayElement(reference.pointer, index); + return elementAt(index); } void operator []=(int index, int value) { RangeError.checkValidIndex(index, this); - Jni.env.SetShortArrayElement(reference.pointer, index, value); + Jni.env.SetByteArrayElement(reference.pointer, index, value); } - Int16List getRange(int start, int end, {Allocator allocator = malloc}) { + Int8List getRange(int start, int end, {Allocator allocator = malloc}) { RangeError.checkValidRange(start, end, length); final rangeLength = end - start; - final buffer = allocator(rangeLength); - Jni.env.GetShortArrayRegion(reference.pointer, start, rangeLength, buffer); + final buffer = allocator(rangeLength); + Jni.env.GetByteArrayRegion(reference.pointer, start, rangeLength, buffer); return buffer.asTypedList(rangeLength, finalizer: allocator._nativeFree); } @@ -286,29 +515,415 @@ extension ShortArray on JArray { [int skipCount = 0]) { RangeError.checkValidRange(start, end, length); final rangeLength = end - start; - _allocate(sizeOf() * rangeLength, (ptr) { + _allocate(sizeOf() * rangeLength, (ptr) { ptr .asTypedList(rangeLength) .setRange(0, rangeLength, iterable, skipCount); - Jni.env.SetShortArrayRegion(reference.pointer, start, rangeLength, ptr); + Jni.env.SetByteArrayRegion(reference.pointer, start, rangeLength, ptr); }); } + + @override + Iterator get iterator => _JArrayIterator(this); } -extension IntArray on JArray { - int operator [](int index) { - RangeError.checkValidIndex(index, this); - return Jni.env.GetIntArrayElement(reference.pointer, index); - } +final class JCharArrayNullableType extends JObjType { + @internal + const JCharArrayNullableType(); - void operator []=(int index, int value) { - RangeError.checkValidIndex(index, this); - Jni.env.SetIntArrayElement(reference.pointer, index, value); - } + @internal + @override + String get signature => '[C'; - Int32List getRange(int start, int end, {Allocator allocator = malloc}) { - RangeError.checkValidRange(start, end, length); - final rangeLength = end - start; + @internal + @override + JCharArray? fromReference(JReference reference) => + reference.isNull ? null : JCharArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JCharArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JCharArrayNullableType && + other is JCharArrayNullableType; + } +} + +final class JCharArrayType extends JObjType { + @internal + const JCharArrayType(); + + @internal + @override + String get signature => '[C'; + + @internal + @override + JCharArray fromReference(JReference reference) => + JCharArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JCharArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JCharArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JCharArrayType && other is JCharArrayType; + } +} + +/// `JCharArray` is a 16-bit integer array. +/// +/// Due to variable length encoding, the number of code units is not equal to +/// the number of characters. +class JCharArray extends JObject with Iterable { + @internal + @override + final JCharArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JCharArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JCharArrayNullableType(); + + /// Construct a new [JCharArray] with [reference] as its underlying + /// reference. + JCharArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JCharArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JCharArray(int length) { + RangeError.checkNotNegative(length); + return JCharArray.fromReference( + JGlobalReference(Jni.env.NewCharArray(length))); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + int elementAt(int index) { + RangeError.checkValidIndex(index, this); + return Jni.env.GetCharArrayElement(reference.pointer, index); + } + + int operator [](int index) { + return elementAt(index); + } + + void operator []=(int index, int value) { + RangeError.checkValidIndex(index, this); + Jni.env.SetCharArrayElement(reference.pointer, index, value); + } + + Uint16List getRange(int start, int end, {Allocator allocator = malloc}) { + RangeError.checkValidRange(start, end, length); + final rangeLength = end - start; + final buffer = allocator(rangeLength); + Jni.env.GetCharArrayRegion(reference.pointer, start, rangeLength, buffer); + return buffer.asTypedList(rangeLength, finalizer: allocator._nativeFree); + } + + void setRange(int start, int end, Iterable iterable, + [int skipCount = 0]) { + RangeError.checkValidRange(start, end, length); + final rangeLength = end - start; + _allocate(sizeOf() * rangeLength, (ptr) { + ptr + .asTypedList(rangeLength) + .setRange(0, rangeLength, iterable, skipCount); + Jni.env.SetCharArrayRegion(reference.pointer, start, rangeLength, ptr); + }); + } + + @override + Iterator get iterator => _JArrayIterator(this); +} + +final class JShortArrayNullableType extends JObjType { + @internal + const JShortArrayNullableType(); + + @internal + @override + String get signature => '[S'; + + @internal + @override + JShortArray? fromReference(JReference reference) => + reference.isNull ? null : JShortArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JShortArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JShortArrayNullableType && + other is JShortArrayNullableType; + } +} + +final class JShortArrayType extends JObjType { + @internal + const JShortArrayType(); + + @internal + @override + String get signature => '[S'; + + @internal + @override + JShortArray fromReference(JReference reference) => + JShortArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JShortArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JShortArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JShortArrayType && other is JShortArrayType; + } +} + +class JShortArray extends JObject with Iterable { + @internal + @override + final JShortArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JShortArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JShortArrayNullableType(); + + /// Construct a new [JShortArray] with [reference] as its underlying + /// reference. + JShortArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JShortArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JShortArray(int length) { + RangeError.checkNotNegative(length); + return JShortArray.fromReference( + JGlobalReference(Jni.env.NewShortArray(length))); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + int elementAt(int index) { + RangeError.checkValidIndex(index, this); + return Jni.env.GetShortArrayElement(reference.pointer, index); + } + + int operator [](int index) { + return elementAt(index); + } + + void operator []=(int index, int value) { + RangeError.checkValidIndex(index, this); + Jni.env.SetShortArrayElement(reference.pointer, index, value); + } + + Int16List getRange(int start, int end, {Allocator allocator = malloc}) { + RangeError.checkValidRange(start, end, length); + final rangeLength = end - start; + final buffer = allocator(rangeLength); + Jni.env.GetShortArrayRegion(reference.pointer, start, rangeLength, buffer); + return buffer.asTypedList(rangeLength, finalizer: allocator._nativeFree); + } + + void setRange(int start, int end, Iterable iterable, + [int skipCount = 0]) { + RangeError.checkValidRange(start, end, length); + final rangeLength = end - start; + _allocate(sizeOf() * rangeLength, (ptr) { + ptr + .asTypedList(rangeLength) + .setRange(0, rangeLength, iterable, skipCount); + Jni.env.SetShortArrayRegion(reference.pointer, start, rangeLength, ptr); + }); + } + + @override + Iterator get iterator => _JArrayIterator(this); +} + +final class JIntArrayNullableType extends JObjType { + @internal + const JIntArrayNullableType(); + + @internal + @override + String get signature => '[I'; + + @internal + @override + JIntArray? fromReference(JReference reference) => + reference.isNull ? null : JIntArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JIntArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JIntArrayNullableType && + other is JIntArrayNullableType; + } +} + +final class JIntArrayType extends JObjType { + @internal + const JIntArrayType(); + + @internal + @override + String get signature => '[I'; + + @internal + @override + JIntArray fromReference(JReference reference) => + JIntArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JIntArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JIntArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JIntArrayType && other is JIntArrayType; + } +} + +class JIntArray extends JObject with Iterable { + @internal + @override + final JIntArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JIntArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JIntArrayNullableType(); + + /// Construct a new [JIntArray] with [reference] as its underlying + /// reference. + JIntArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JIntArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JIntArray(int length) { + RangeError.checkNotNegative(length); + return JIntArray.fromReference( + JGlobalReference(Jni.env.NewIntArray(length))); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + int elementAt(int index) { + RangeError.checkValidIndex(index, this); + return Jni.env.GetIntArrayElement(reference.pointer, index); + } + + int operator [](int index) { + return elementAt(index); + } + + void operator []=(int index, int value) { + RangeError.checkValidIndex(index, this); + Jni.env.SetIntArrayElement(reference.pointer, index, value); + } + + Int32List getRange(int start, int end, {Allocator allocator = malloc}) { + RangeError.checkValidRange(start, end, length); + final rangeLength = end - start; final buffer = allocator(rangeLength); Jni.env.GetIntArrayRegion(reference.pointer, start, rangeLength, buffer); return buffer.asTypedList(rangeLength, finalizer: allocator._nativeFree); @@ -325,14 +940,120 @@ extension IntArray on JArray { Jni.env.SetIntArrayRegion(reference.pointer, start, rangeLength, ptr); }); } + + @override + Iterator get iterator => _JArrayIterator(this); } -extension LongArray on JArray { - int operator [](int index) { +final class JLongArrayNullableType extends JObjType { + @internal + const JLongArrayNullableType(); + + @internal + @override + String get signature => '[J'; + + @internal + @override + JLongArray? fromReference(JReference reference) => + reference.isNull ? null : JLongArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JLongArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JLongArrayNullableType && + other is JLongArrayNullableType; + } +} + +final class JLongArrayType extends JObjType { + @internal + const JLongArrayType(); + + @internal + @override + String get signature => '[J'; + + @internal + @override + JLongArray fromReference(JReference reference) => + JLongArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JLongArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JLongArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JLongArrayType && other is JLongArrayType; + } +} + +class JLongArray extends JObject with Iterable { + @internal + @override + final JLongArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JLongArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JLongArrayNullableType(); + + /// Construct a new [JLongArray] with [reference] as its underlying + /// reference. + JLongArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JLongArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JLongArray(int length) { + RangeError.checkNotNegative(length); + return JLongArray.fromReference( + JGlobalReference(Jni.env.NewLongArray(length))); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + int elementAt(int index) { RangeError.checkValidIndex(index, this); return Jni.env.GetLongArrayElement(reference.pointer, index); } + int operator [](int index) { + return elementAt(index); + } + void operator []=(int index, int value) { RangeError.checkValidIndex(index, this); Jni.env.SetLongArrayElement(reference.pointer, index, value); @@ -357,14 +1078,120 @@ extension LongArray on JArray { Jni.env.SetLongArrayRegion(reference.pointer, start, rangeLength, ptr); }); } + + @override + Iterator get iterator => _JArrayIterator(this); } -extension FloatArray on JArray { - double operator [](int index) { +final class JFloatArrayNullableType extends JObjType { + @internal + const JFloatArrayNullableType(); + + @internal + @override + String get signature => '[F'; + + @internal + @override + JFloatArray? fromReference(JReference reference) => + reference.isNull ? null : JFloatArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JFloatArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JFloatArrayNullableType && + other is JFloatArrayNullableType; + } +} + +final class JFloatArrayType extends JObjType { + @internal + const JFloatArrayType(); + + @internal + @override + String get signature => '[F'; + + @internal + @override + JFloatArray fromReference(JReference reference) => + JFloatArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JFloatArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JFloatArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JFloatArrayType && other is JFloatArrayType; + } +} + +class JFloatArray extends JObject with Iterable { + @internal + @override + final JFloatArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JFloatArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JFloatArrayNullableType(); + + /// Construct a new [JFloatArray] with [reference] as its underlying + /// reference. + JFloatArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JFloatArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JFloatArray(int length) { + RangeError.checkNotNegative(length); + return JFloatArray.fromReference( + JGlobalReference(Jni.env.NewFloatArray(length))); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + double elementAt(int index) { RangeError.checkValidIndex(index, this); return Jni.env.GetFloatArrayElement(reference.pointer, index); } + double operator [](int index) { + return elementAt(index); + } + void operator []=(int index, double value) { RangeError.checkValidIndex(index, this); Jni.env.SetFloatArrayElement(reference.pointer, index, value); @@ -389,14 +1216,120 @@ extension FloatArray on JArray { Jni.env.SetFloatArrayRegion(reference.pointer, start, rangeLength, ptr); }); } + + @override + Iterator get iterator => _JArrayIterator(this); } -extension DoubleArray on JArray { - double operator [](int index) { +final class JDoubleArrayNullableType extends JObjType { + @internal + const JDoubleArrayNullableType(); + + @internal + @override + String get signature => '[D'; + + @internal + @override + JDoubleArray? fromReference(JReference reference) => + reference.isNull ? null : JDoubleArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectNullableType(); + + @internal + @override + JObjType get nullableType => this; + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JDoubleArrayNullableType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JDoubleArrayNullableType && + other is JDoubleArrayNullableType; + } +} + +final class JDoubleArrayType extends JObjType { + @internal + const JDoubleArrayType(); + + @internal + @override + String get signature => '[D'; + + @internal + @override + JDoubleArray fromReference(JReference reference) => + JDoubleArray.fromReference(reference); + + @internal + @override + JObjType get superType => const JObjectType(); + + @internal + @override + JObjType get nullableType => const JDoubleArrayNullableType(); + + @internal + @override + final int superCount = 1; + + @override + int get hashCode => (JDoubleArrayType).hashCode; + + @override + bool operator ==(Object other) { + return other.runtimeType == JDoubleArrayType && other is JDoubleArrayType; + } +} + +class JDoubleArray extends JObject with Iterable { + @internal + @override + final JDoubleArrayType $type; + + /// The type which includes information such as the signature of this class. + static const type = JDoubleArrayType(); + + /// The type which includes information such as the signature of this class. + static const nullableType = JDoubleArrayNullableType(); + + /// Construct a new [JDoubleArray] with [reference] as its underlying + /// reference. + JDoubleArray.fromReference(super.reference) + : $type = type, + super.fromReference(); + + /// Creates a [JDoubleArray] of the given [length]. + /// + /// The [length] must be a non-negative integer. + factory JDoubleArray(int length) { + RangeError.checkNotNegative(length); + return JDoubleArray.fromReference( + JGlobalReference(Jni.env.NewDoubleArray(length))); + } + + /// The number of elements in this array. + @override + late final length = Jni.env.GetArrayLength(reference.pointer); + + @override + double elementAt(int index) { RangeError.checkValidIndex(index, this); return Jni.env.GetDoubleArrayElement(reference.pointer, index); } + double operator [](int index) { + return elementAt(index); + } + void operator []=(int index, double value) { RangeError.checkValidIndex(index, this); Jni.env.SetDoubleArrayElement(reference.pointer, index, value); @@ -421,31 +1354,7 @@ extension DoubleArray on JArray { Jni.env.SetDoubleArrayRegion(reference.pointer, start, rangeLength, ptr); }); } -} - -extension ObjectArray on JArray { - T operator [](int index) { - RangeError.checkValidIndex(index, this); - final pointer = Jni.env.GetObjectArrayElement(reference.pointer, index); - if (pointer == nullptr) { - return null as T; - } - return (elementType as JObjType) - .fromReference(JGlobalReference(pointer)); - } - - void operator []=(int index, T value) { - RangeError.checkValidIndex(index, this); - final valueRef = value?.reference ?? jNullReference; - Jni.env.SetObjectArrayElement(reference.pointer, index, valueRef.pointer); - } - void setRange(int start, int end, Iterable iterable, [int skipCount = 0]) { - RangeError.checkValidRange(start, end, length); - final rangeLength = end - start; - final it = iterable.skip(skipCount).take(rangeLength); - for (final (index, element) in it.indexed) { - this[index] = element; - } - } + @override + Iterator get iterator => _JArrayIterator(this); } diff --git a/pkgs/jni/lib/src/jprimitives.dart b/pkgs/jni/lib/src/jprimitives.dart index 7e0997120..c63210e96 100644 --- a/pkgs/jni/lib/src/jprimitives.dart +++ b/pkgs/jni/lib/src/jprimitives.dart @@ -15,10 +15,7 @@ abstract final class jbyte extends JPrimitive { } final class jbyteType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jbyteType(); @@ -57,14 +54,6 @@ final class jbyteType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, int val) { return Jni.env.SetStaticByteField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewByteArray(length)), - ); - } } abstract final class jboolean extends JPrimitive { @@ -72,10 +61,7 @@ abstract final class jboolean extends JPrimitive { } final class jbooleanType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jbooleanType(); @@ -114,14 +100,6 @@ final class jbooleanType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, bool val) { return Jni.env.SetStaticBooleanField(clazz, fieldID, val ? 1 : 0); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewBooleanArray(length)), - ); - } } abstract final class jchar extends JPrimitive { @@ -129,10 +107,7 @@ abstract final class jchar extends JPrimitive { } final class jcharType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jcharType(); @@ -171,14 +146,6 @@ final class jcharType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, int val) { return Jni.env.SetStaticCharField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewCharArray(length)), - ); - } } abstract final class jshort extends JPrimitive { @@ -186,10 +153,7 @@ abstract final class jshort extends JPrimitive { } final class jshortType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jshortType(); @@ -228,14 +192,6 @@ final class jshortType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, int val) { return Jni.env.SetStaticShortField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewShortArray(length)), - ); - } } abstract final class jint extends JPrimitive { @@ -243,7 +199,7 @@ abstract final class jint extends JPrimitive { } final class jintType extends JType - with JCallable, JAccessible, JArrayElementType { + with JCallable, JAccessible { @internal const jintType(); @@ -281,14 +237,6 @@ final class jintType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, int val) { return Jni.env.SetStaticIntField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewIntArray(length)), - ); - } } abstract final class jlong extends JPrimitive { @@ -296,10 +244,7 @@ abstract final class jlong extends JPrimitive { } final class jlongType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jlongType(); @@ -337,14 +282,6 @@ final class jlongType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, int val) { return Jni.env.SetStaticLongField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewLongArray(length)), - ); - } } abstract final class jfloat extends JPrimitive { @@ -352,10 +289,7 @@ abstract final class jfloat extends JPrimitive { } final class jfloatType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jfloatType(); @@ -394,14 +328,6 @@ final class jfloatType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, double val) { return Jni.env.SetStaticFloatField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewFloatArray(length)), - ); - } } abstract final class jdouble extends JPrimitive { @@ -409,10 +335,7 @@ abstract final class jdouble extends JPrimitive { } final class jdoubleType extends JType - with - JCallable, - JAccessible, - JArrayElementType { + with JCallable, JAccessible { @internal const jdoubleType(); @@ -451,14 +374,6 @@ final class jdoubleType extends JType void _staticSet(JClassPtr clazz, JFieldIDPtr fieldID, double val) { return Jni.env.SetStaticDoubleField(clazz, fieldID, val); } - - @override - JArray _newArray(int length) { - return JArray.fromReference( - this, - JGlobalReference(Jni.env.NewDoubleArray(length)), - ); - } } abstract final class jvoid extends JPrimitive { diff --git a/pkgs/jni/lib/src/method_invocation.dart b/pkgs/jni/lib/src/method_invocation.dart index 9c42237d9..8c1f47170 100644 --- a/pkgs/jni/lib/src/method_invocation.dart +++ b/pkgs/jni/lib/src/method_invocation.dart @@ -6,11 +6,11 @@ import 'dart:ffi'; import 'package:meta/meta.dart' show internal; +import 'jarray.dart'; import 'jobject.dart'; import 'jreference.dart'; import 'lang/jstring.dart'; import 'third_party/generated_bindings.dart'; -import 'types.dart'; @internal class MethodInvocation { diff --git a/pkgs/jni/lib/src/nio/jbyte_buffer.dart b/pkgs/jni/lib/src/nio/jbyte_buffer.dart index b0154d68c..5251c5c6a 100644 --- a/pkgs/jni/lib/src/nio/jbyte_buffer.dart +++ b/pkgs/jni/lib/src/nio/jbyte_buffer.dart @@ -7,6 +7,7 @@ import 'dart:typed_data'; import 'package:meta/meta.dart' show internal; +import '../jarray.dart'; import '../jni.dart'; import '../jobject.dart'; import '../jreference.dart'; @@ -184,7 +185,7 @@ class JByteBuffer extends JBuffer { /// modifications to the buffer will cause the array to be modified /// and vice versa. static JByteBuffer wrap( - JArray array, [ + JByteArray array, [ int? offset, int? length, ]) { @@ -268,8 +269,8 @@ class JByteBuffer extends JBuffer { static final _arrayId = _class.instanceMethodId(r'array', r'()[B'); @override - JArray get array { - return _arrayId(this, const JArrayType(jbyteType()), [])!; + JByteArray get array { + return _arrayId(this, JByteArray.type, [])!; } void _ensureIsDirect() { diff --git a/pkgs/jni/lib/src/types.dart b/pkgs/jni/lib/src/types.dart index 5b0bf2781..466e825b8 100644 --- a/pkgs/jni/lib/src/types.dart +++ b/pkgs/jni/lib/src/types.dart @@ -2,9 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'dart:ffi'; -import 'dart:typed_data'; - import 'package:ffi/ffi.dart'; import '../_internal.dart'; @@ -13,7 +10,6 @@ import 'jobject.dart'; import 'jvalues.dart'; import 'third_party/generated_bindings.dart'; -part 'jarray.dart'; part 'jclass.dart'; part 'jprimitives.dart'; @@ -49,12 +45,6 @@ mixin JAccessible on JType { void _instanceSet(JObjectPtr obj, JFieldIDPtr fieldID, DartT val); } -/// Able to be the type of array elements. -@internal -mixin JArrayElementType on JType { - JArray _newArray(int length); -} - /// Only used for jnigen. /// /// Makes constructing objects easier inside the generated bindings by allowing @@ -80,11 +70,7 @@ final class _ReferenceType extends JType @internal abstract class JObjType extends JType - with - JCallable, - JConstructable, - JAccessible, - JArrayElementType { + with JCallable, JConstructable, JAccessible { /// Number of super types. Distance to the root type. int get superCount; @@ -147,22 +133,6 @@ abstract class JObjType extends JType final valRef = val?.reference ?? jNullReference; Jni.env.SetStaticObjectField(clazz, fieldID, valRef.pointer); } - - @override - JArray _newArray(int length, [T? fill]) { - final classRef = jClass.reference; - final fillRef = fill?.reference ?? jNullReference; - final array = JArray.fromReference( - this, - JGlobalReference(Jni.env.NewObjectArray( - length, - classRef.pointer, - fillRef.pointer, - )), - ); - classRef.release(); - return array; - } } /// Lowest common ancestor of two types in the inheritance tree. diff --git a/pkgs/jni/test/jarray_test.dart b/pkgs/jni/test/jarray_test.dart index d62184562..d64b7353a 100644 --- a/pkgs/jni/test/jarray_test.dart +++ b/pkgs/jni/test/jarray_test.dart @@ -22,7 +22,13 @@ void main() { void run({required TestRunnerCallback testRunner}) { testRunner('Java boolean array', () { using((arena) { - final array = JArray(jboolean.type, 3)..releasedBy(arena); + final array = JBooleanArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = true; array[1] = false; @@ -58,7 +64,13 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java char array', () { using((arena) { - final array = JArray(jchar.type, 3)..releasedBy(arena); + final array = JCharArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -94,7 +106,13 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java byte array', () { using((arena) { - final array = JArray(jbyte.type, 3)..releasedBy(arena); + final array = JByteArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -130,7 +148,13 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java short array', () { using((arena) { - final array = JArray(jshort.type, 3)..releasedBy(arena); + final array = JShortArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -166,7 +190,13 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java int array', () { using((arena) { - final array = JArray(jint.type, 3)..releasedBy(arena); + final array = JIntArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -202,7 +232,13 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java long array', () { using((arena) { - final array = JArray(jlong.type, 3)..releasedBy(arena); + final array = JLongArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -239,7 +275,13 @@ void run({required TestRunnerCallback testRunner}) { const epsilon = 1e-6; testRunner('Java float array', () { using((arena) { - final array = JArray(jfloat.type, 3)..releasedBy(arena); + final array = JFloatArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 0.5; array[1] = 2; @@ -275,7 +317,13 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java double array', () { using((arena) { - final array = JArray(jdouble.type, 3)..releasedBy(arena); + final array = JDoubleArray(3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 0.5; array[1] = 2; @@ -312,6 +360,12 @@ void run({required TestRunnerCallback testRunner}) { testRunner('Java string array', () { using((arena) { final array = JArray(JString.nullableType, 3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); array[0] = 'حس'.toJString()..releasedBy(arena); array[1] = '\$'.toJString()..releasedBy(arena); @@ -347,6 +401,12 @@ void run({required TestRunnerCallback testRunner}) { testRunner('Java object array', () { using((arena) { final array = JArray(JObject.nullableType, 3)..releasedBy(arena); + var counter = 0; + for (final element in array) { + expect(element, array[counter]); + ++counter; + } + expect(counter, array.length); expect(array.length, 3); expect(array[0], isNull); expect(array[1], isNull); @@ -355,12 +415,11 @@ void run({required TestRunnerCallback testRunner}) { }); testRunner('Java 2d array', () { using((arena) { - final array = JArray(jint.type, 3)..releasedBy(arena); + final array = JIntArray(3)..releasedBy(arena); array[0] = 1; array[1] = 2; array[2] = 3; - final twoDimArray = JArray(JArray.nullableType(jint.type), 3) - ..releasedBy(arena); + final twoDimArray = JArray(JIntArray.nullableType, 3)..releasedBy(arena); expect(twoDimArray.length, 3); twoDimArray[0] = array; twoDimArray[1] = array; diff --git a/pkgs/jni/test/jbyte_buffer_test.dart b/pkgs/jni/test/jbyte_buffer_test.dart index a26126d73..666479dcb 100644 --- a/pkgs/jni/test/jbyte_buffer_test.dart +++ b/pkgs/jni/test/jbyte_buffer_test.dart @@ -32,7 +32,7 @@ void run({required TestRunnerCallback testRunner}) { testRunner('wrap whole array', () { using((arena) { - final array = JArray(jbyte.type, 3)..releasedBy(arena); + final array = JByteArray(3)..releasedBy(arena); array[0] = 1; array[1] = 2; array[2] = 3; @@ -43,7 +43,7 @@ void run({required TestRunnerCallback testRunner}) { testRunner('wrap partial array', () { using((arena) { - final array = JArray(jbyte.type, 3)..releasedBy(arena); + final array = JByteArray(3)..releasedBy(arena); array[0] = 1; array[1] = 2; array[2] = 3; diff --git a/pkgs/jni/test/type_test.dart b/pkgs/jni/test/type_test.dart index 333945946..2182281ac 100644 --- a/pkgs/jni/test/type_test.dart +++ b/pkgs/jni/test/type_test.dart @@ -4,7 +4,6 @@ import 'package:jni/_internal.dart'; import 'package:jni/jni.dart'; -import 'package:jni/src/types.dart'; import 'package:test/test.dart'; import 'test_util/test_util.dart'; @@ -452,7 +451,7 @@ void run({required TestRunnerCallback testRunner}) { expect(lowestCommonSuperType([JString.type]), JString.type); expect(lowestCommonSuperType([JObject.type, JObject.type]), JObject.type); expect(lowestCommonSuperType([JString.type, JString.type]), JString.type); - expect(lowestCommonSuperType([JString.type, JArray.type(jlong.type)]), + expect(lowestCommonSuperType([JString.type, JArray.type(JString.type)]), JObject.type); }); @@ -490,10 +489,10 @@ void run({required TestRunnerCallback testRunner}) { using((arena) { expect( lowestCommonSuperType([ - JArray.type(jint.type), - JArray.type(jint.type), + JIntArray.type, + JIntArray.type, ]), - JArray.type(jint.type), + JIntArray.type, ); expect( lowestCommonSuperType([ @@ -505,7 +504,7 @@ void run({required TestRunnerCallback testRunner}) { expect( lowestCommonSuperType([ JArray.type(JObject.type), - JArray.type(jint.type), + JIntArray.type, ]), JObject.type, ); diff --git a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart index 0a3c445e2..4e10e9804 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/lib/src/third_party/org/apache/pdfbox/pdmodel/PDDocument.dart @@ -1565,7 +1565,7 @@ class PDDocument extends jni$_.JObject { ///@throws InvalidPasswordException If the PDF required a non-empty password. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$12( - jni$_.JArray? input, + jni$_.JByteArray? input, ) { final _$input = input?.reference ?? jni$_.jNullReference; return _load$12(_class.reference.pointer, _id_load$12 as jni$_.JMethodIDPtr, @@ -1605,7 +1605,7 @@ class PDDocument extends jni$_.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$13( - jni$_.JArray? input, + jni$_.JByteArray? input, jni$_.JString? password, ) { final _$input = input?.reference ?? jni$_.jNullReference; @@ -1653,7 +1653,7 @@ class PDDocument extends jni$_.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$14( - jni$_.JArray? input, + jni$_.JByteArray? input, jni$_.JString? password, jni$_.JObject? keyStore, jni$_.JString? alias, @@ -1713,7 +1713,7 @@ class PDDocument extends jni$_.JObject { ///@throws InvalidPasswordException If the password is incorrect. ///@throws IOException In case of a reading or parsing error. static PDDocument? load$15( - jni$_.JArray? input, + jni$_.JByteArray? input, jni$_.JString? password, jni$_.JObject? keyStore, jni$_.JString? alias, diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index afa9d7363..56c88d772 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart @@ -733,6 +733,9 @@ class _TypeGenerator extends TypeVisitor { includeNullability: true, arrayType: true, ); + if (innerType.kind == Kind.primitive) { + return '$_jni.J${innerType.accept(typeGenerator)}Array$nullable'; + } return '$_jArray<${innerType.accept(typeGenerator)}>$nullable'; } @@ -785,7 +788,7 @@ class _TypeGenerator extends TypeVisitor { @override String visitPrimitiveType(PrimitiveType node) { if (arrayType) { - return '$_jni.j${node.name}'; + return node.name.capitalize(); } return node.dartType; } @@ -886,6 +889,12 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { final ifConst = innerTypeClass.canBeConst && isConst ? 'const ' : ''; final type = includeNullability && node.isNullable ? 'NullableType' : 'Type'; + if (node.elementType.kind == Kind.primitive) { + return _TypeClass( + '$ifConst$_jni.J${innerType}Array$type()', + innerTypeClass.canBeConst, + ); + } return _TypeClass( '$ifConst$_jArray$type<$innerType>(${innerTypeClass.name})', innerTypeClass.canBeConst, diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart index 71d30a020..65477c199 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -1953,7 +1953,7 @@ class JsonFactory extends jni$_.JObject { /// the contents of given byte array. ///@since 2.1 jsonparser$_.JsonParser? createParser$4( - jni$_.JArray? data, + jni$_.JByteArray? data, ) { final _$data = data?.reference ?? jni$_.jNullReference; return _createParser$4(reference.pointer, @@ -1992,7 +1992,7 @@ class JsonFactory extends jni$_.JObject { ///@param len Length of contents to parse within buffer ///@since 2.1 jsonparser$_.JsonParser? createParser$5( - jni$_.JArray? data, + jni$_.JByteArray? data, int offset, int len, ) { @@ -2062,7 +2062,7 @@ class JsonFactory extends jni$_.JObject { /// contents of given char array. ///@since 2.4 jsonparser$_.JsonParser? createParser$7( - jni$_.JArray? content, + jni$_.JCharArray? content, ) { final _$content = content?.reference ?? jni$_.jNullReference; return _createParser$7(reference.pointer, @@ -2097,7 +2097,7 @@ class JsonFactory extends jni$_.JObject { /// Method for constructing parser for parsing contents of given char array. ///@since 2.4 jsonparser$_.JsonParser? createParser$8( - jni$_.JArray? content, + jni$_.JCharArray? content, int offset, int len, ) { @@ -2653,7 +2653,7 @@ class JsonFactory extends jni$_.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[]) instead. jsonparser$_.JsonParser? createJsonParser$4( - jni$_.JArray? data, + jni$_.JByteArray? data, ) { final _$data = data?.reference ?? jni$_.jNullReference; return _createJsonParser$4(reference.pointer, @@ -2695,7 +2695,7 @@ class JsonFactory extends jni$_.JObject { ///@throws JsonParseException if parser initialization fails due to content decoding problem ///@deprecated Since 2.2, use \#createParser(byte[],int,int) instead. jsonparser$_.JsonParser? createJsonParser$5( - jni$_.JArray? data, + jni$_.JByteArray? data, int offset, int len, ) { diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart index d4cf58115..3f5e313c1 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -643,7 +643,7 @@ class JsonParser extends jni$_.JObject { ///@param charset Character encoding for (lazily) decoding payload ///@since 2.8 void setRequestPayloadOnError$1( - jni$_.JArray? payload, + jni$_.JByteArray? payload, jni$_.JString? charset, ) { final _$payload = payload?.reference ?? jni$_.jNullReference; @@ -2780,11 +2780,10 @@ class JsonParser extends jni$_.JObject { /// at offset 0, and not necessarily until the end of buffer) ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni$_.JArray? getTextCharacters() { + jni$_.JCharArray? getTextCharacters() { return _getTextCharacters( reference.pointer, _id_getTextCharacters as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jcharType())); + .object(const jni$_.JCharArrayNullableType()); } static final _id_getTextLength = _class.instanceMethodId( @@ -3432,14 +3431,13 @@ class JsonParser extends jni$_.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni$_.JArray? getBinaryValue( + jni$_.JByteArray? getBinaryValue( jni$_.JObject? bv, ) { final _$bv = bv?.reference ?? jni$_.jNullReference; return _getBinaryValue(reference.pointer, _id_getBinaryValue as jni$_.JMethodIDPtr, _$bv.pointer) - .object?>( - const jni$_.JArrayNullableType(jni$_.jbyteType())); + .object(const jni$_.JByteArrayNullableType()); } static final _id_getBinaryValue$1 = _class.instanceMethodId( @@ -3468,11 +3466,10 @@ class JsonParser extends jni$_.JObject { ///@return Decoded binary data ///@throws IOException for low-level read issues, or /// JsonParseException for decoding problems - jni$_.JArray? getBinaryValue$1() { + jni$_.JByteArray? getBinaryValue$1() { return _getBinaryValue$1( reference.pointer, _id_getBinaryValue$1 as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jbyteType())); + .object(const jni$_.JByteArrayNullableType()); } static final _id_readBinaryValue = _class.instanceMethodId( diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart index 88f09cde7..45e61549d 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart @@ -191,11 +191,10 @@ class JsonToken extends jni$_.JObject { /// from: `public final char[] asCharArray()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JArray? asCharArray() { + jni$_.JCharArray? asCharArray() { return _asCharArray( reference.pointer, _id_asCharArray as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jcharType())); + .object(const jni$_.JCharArrayNullableType()); } static final _id_asByteArray = _class.instanceMethodId( @@ -217,11 +216,10 @@ class JsonToken extends jni$_.JObject { /// from: `public final byte[] asByteArray()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JArray? asByteArray() { + jni$_.JByteArray? asByteArray() { return _asByteArray( reference.pointer, _id_asByteArray as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jbyteType())); + .object(const jni$_.JByteArrayNullableType()); } static final _id_isNumeric = _class.instanceMethodId( diff --git a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart index c51518b81..0e7178234 100644 --- a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart @@ -1452,7 +1452,7 @@ class Example extends jni$_.JObject { void methodWithSeveralParams<$T extends jni$_.JObject?>( int c, jni$_.JString? string, - jni$_.JArray? is$, + jni$_.JIntArray? is$, $T? charSequence, jni$_.JList<$T?>? list, jni$_.JMap? map, { @@ -1691,10 +1691,9 @@ class Example extends jni$_.JObject { /// from: `static public int[] getArr()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JArray? getArr() { + static jni$_.JIntArray? getArr() { return _getArr(_class.reference.pointer, _id_getArr as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jintType())); + .object(const jni$_.JIntArrayNullableType()); } static final _id_addAll = _class.staticMethodId( @@ -1715,7 +1714,7 @@ class Example extends jni$_.JObject { /// from: `static public int addAll(int[] is)` static int addAll( - jni$_.JArray? is$, + jni$_.JIntArray? is$, ) { final _$is$ = is$?.reference ?? jni$_.jNullReference; return _addAll(_class.reference.pointer, _id_addAll as jni$_.JMethodIDPtr, @@ -2177,11 +2176,10 @@ class Exceptions extends jni$_.JObject { /// from: `static public int[] staticIntArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JArray? staticIntArrayMethod() { + static jni$_.JIntArray? staticIntArrayMethod() { return _staticIntArrayMethod(_class.reference.pointer, _id_staticIntArrayMethod as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jintType())); + .object(const jni$_.JIntArrayNullableType()); } static final _id_objectMethod = _class.instanceMethodId( @@ -2278,11 +2276,10 @@ class Exceptions extends jni$_.JObject { /// from: `public int[] intArrayMethod()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JArray? intArrayMethod() { + jni$_.JIntArray? intArrayMethod() { return _intArrayMethod( reference.pointer, _id_intArrayMethod as jni$_.JMethodIDPtr) - .object?>( - const jni$_.JArrayNullableType(jni$_.jintType())); + .object(const jni$_.JIntArrayNullableType()); } static final _id_throwNullPointerException = _class.instanceMethodId( From 25421083e8be79ec6e64fd06ff3a2a6399f2f0f8 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 11 Dec 2024 21:20:58 +0100 Subject: [PATCH 42/50] [native_assets_cli] Move `targetOS` to `CodeConfig` (#1806) Next refactoring in: * https://github.com/dart-lang/native/issues/1738 We move `config.targetOS` to `config.codeConfig.targetOS`. Other asset types might not get access on the target OS. This will require a manual roll into dartdev and flutter tools due to the targetOS now having to be passed in via `setupCodeConfig` instead of the base config. The native assets builder will still emit the same JSON if code assets are supported. Since both Dart and Flutter support code assets currently, this will not break anything. Once data assets for web in Flutter are added, all existing build hooks that assume code assets are always supported will break. --- pkgs/native_assets_builder/CHANGELOG.md | 2 + .../lib/src/build_runner/build_runner.dart | 4 - .../build_runner_reusability_test.dart | 3 +- .../concurrency_shared_test_helper.dart | 10 +- .../build_runner/concurrency_test_helper.dart | 2 +- .../test/build_runner/helpers.dart | 8 +- .../native_dynamic_linking_test.dart | 2 +- .../test/test_data/transformer_test.dart | 2 +- .../fail_on_os_sdk_version/hook/build.dart | 6 +- .../hook/link.dart | 6 +- pkgs/native_assets_cli/CHANGELOG.md | 2 + .../example/build/local_asset/hook/build.dart | 2 +- pkgs/native_assets_cli/lib/code_assets.dart | 1 + .../lib/native_assets_cli.dart | 1 - pkgs/native_assets_cli/lib/src/api/build.dart | 2 +- .../lib/src/code_assets/code_asset.dart | 3 +- .../lib/src/code_assets/config.dart | 13 +- .../lib/src/{ => code_assets}/os.dart | 0 .../lib/src/code_assets/testing.dart | 2 +- .../lib/src/code_assets/validation.dart | 8 +- pkgs/native_assets_cli/lib/src/config.dart | 9 +- .../lib/src/model/build_config_CHANGELOG.md | 8 ++ pkgs/native_assets_cli/lib/src/target.dart | 2 +- pkgs/native_assets_cli/lib/test.dart | 2 - .../test/api/build_test.dart | 1 - .../test/build_config_test.dart | 6 - .../native_assets_cli/test/checksum_test.dart | 136 ++++++++++++------ .../test/code_assets/config_test.dart | 6 +- .../test/code_assets/validation_test.dart | 52 ++++--- .../test/data_assets/validation_test.dart | 1 - .../test/example/local_asset_test.dart | 9 +- .../test/example/native_add_library_test.dart | 9 +- .../example/native_dynamic_linking_test.dart | 2 +- .../test/link_config_test.dart | 3 - .../test/validation_test.dart | 1 - .../lib/src/cbuilder/cbuilder.dart | 9 +- .../lib/src/cbuilder/clinker.dart | 8 +- .../lib/src/cbuilder/compiler_resolver.dart | 14 +- .../lib/src/cbuilder/ctool.dart | 2 +- .../lib/src/cbuilder/run_cbuilder.dart | 30 ++-- .../cbuilder/cbuilder_build_failure_test.dart | 2 +- .../cbuilder/cbuilder_cross_android_test.dart | 2 +- .../cbuilder/cbuilder_cross_ios_test.dart | 4 +- .../cbuilder_cross_linux_host_test.dart | 2 +- .../cbuilder_cross_macos_host_test.dart | 4 +- .../cbuilder_cross_windows_host_test.dart | 2 +- .../test/cbuilder/cbuilder_test.dart | 30 ++-- .../test/cbuilder/compiler_resolver_test.dart | 11 +- .../test/cbuilder/objective_c_test.dart | 2 +- .../test/clinker/build_testfiles.dart | 2 +- .../test/clinker/objects_test.dart | 2 +- .../test/clinker/throws_test.dart | 2 +- .../test/clinker/treeshake_helper.dart | 2 +- 53 files changed, 251 insertions(+), 205 deletions(-) rename pkgs/native_assets_cli/lib/src/{ => code_assets}/os.dart (100%) diff --git a/pkgs/native_assets_builder/CHANGELOG.md b/pkgs/native_assets_builder/CHANGELOG.md index 97f2bf472..d10ec539d 100644 --- a/pkgs/native_assets_builder/CHANGELOG.md +++ b/pkgs/native_assets_builder/CHANGELOG.md @@ -2,6 +2,8 @@ - Removed support for dry run (Flutter no long requires it). - Various fixes to caching. +- **Breaking change** `BuildConfig.targetOS` is now only provided if + `buildAssetTypes` contains the code asset. ## 0.9.0 diff --git a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart index b3a20931f..8f86b49f9 100644 --- a/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart +++ b/pkgs/native_assets_builder/lib/src/build_runner/build_runner.dart @@ -92,7 +92,6 @@ class NativeAssetsBuildRunner { required BuildConfigValidator configValidator, required BuildValidator buildValidator, required ApplicationAssetValidator applicationAssetValidator, - required OS targetOS, required Uri workingDirectory, PackageLayout? packageLayout, String? runPackageName, @@ -121,7 +120,6 @@ class NativeAssetsBuildRunner { final configBuilder = configCreator() ..setupHookConfig( - targetOS: targetOS, buildAssetTypes: buildAssetTypes, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), @@ -197,7 +195,6 @@ class NativeAssetsBuildRunner { required LinkConfigCreator configCreator, required LinkConfigValidator configValidator, required LinkValidator linkValidator, - required OS targetOS, required Uri workingDirectory, required ApplicationAssetValidator applicationAssetValidator, PackageLayout? packageLayout, @@ -220,7 +217,6 @@ class NativeAssetsBuildRunner { for (final package in buildPlan) { final configBuilder = configCreator() ..setupHookConfig( - targetOS: targetOS, buildAssetTypes: buildAssetTypes, packageName: package.name, packageRoot: packageLayout.packageRoot(package.name), diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index d279a12ae..aa7356a6c 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -30,12 +30,12 @@ void main() async { BuildConfigBuilder configCreator() => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: Architecture.current, + targetOS: OS.current, linkModePreference: LinkModePreference.dynamic, ); await buildRunner.build( configCreator: configCreator, - targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, buildAssetTypes: [], @@ -45,7 +45,6 @@ void main() async { ); await buildRunner.build( configCreator: configCreator, - targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, buildAssetTypes: [], diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart index e741bfa13..d31b8c434 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -20,8 +20,14 @@ void main(List args) async { logger: logger, dartExecutable: dartExecutable, ).build( - configCreator: BuildConfigBuilder.new, - targetOS: target.os, + // Set up the code config, so that the builds for different targets are + // in different directories. + configCreator: () => BuildConfigBuilder() + ..setupCodeConfig( + targetArchitecture: target.architecture, + targetOS: target.os, + linkModePreference: LinkModePreference.dynamic, + ), workingDirectory: packageUri, linkingEnabled: false, buildAssetTypes: [DataAsset.type], diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart index 9a680232b..75d2cb096 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart @@ -28,11 +28,11 @@ void main(List args) async { configCreator: () => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: Architecture.current, + targetOS: OS.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dartCICompilerConfig, targetMacOSVersion: OS.current == OS.macOS ? defaultMacOSVersion : null, ), - targetOS: OS.current, workingDirectory: packageUri, linkingEnabled: false, buildAssetTypes: [CodeAsset.type, DataAsset.type], diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index 275ec9c9a..6be66afea 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -59,6 +59,7 @@ Future build( if (buildAssetTypes.contains(CodeAsset.type)) { configBuilder.setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, + targetOS: targetOS, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig, targetIOSSdk: targetIOSSdk, @@ -71,7 +72,6 @@ Future build( return configBuilder; }, configValidator: configValidator, - targetOS: targetOS, workingDirectory: packageUri, packageLayout: packageLayout, runPackageName: runPackageName, @@ -124,6 +124,7 @@ Future link( if (buildAssetTypes.contains(CodeAsset.type)) { configBuilder.setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, + targetOS: target?.os ?? OS.current, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig, targetIOSSdk: targetIOSSdk, @@ -136,7 +137,6 @@ Future link( return configBuilder; }, configValidator: configValidator, - targetOS: target?.os ?? OS.current, workingDirectory: packageUri, packageLayout: packageLayout, buildResult: buildResult, @@ -185,6 +185,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( configCreator: () => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, + targetOS: target?.os ?? OS.current, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig, targetIOSSdk: targetIOSSdk, @@ -193,7 +194,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( targetAndroidNdkApi: targetAndroidNdkApi, ), configValidator: buildConfigValidator, - targetOS: target?.os ?? OS.current, workingDirectory: packageUri, packageLayout: packageLayout, runPackageName: runPackageName, @@ -217,6 +217,7 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( configCreator: () => LinkConfigBuilder() ..setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, + targetOS: target?.os ?? OS.current, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig, targetIOSSdk: targetIOSSdk, @@ -225,7 +226,6 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( targetAndroidNdkApi: targetAndroidNdkApi, ), configValidator: linkConfigValidator, - targetOS: target?.os ?? OS.current, workingDirectory: packageUri, packageLayout: packageLayout, buildResult: buildResult, diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index a2b167d12..2e35c3b13 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -34,7 +34,6 @@ void main() async { ..setupHookConfig( packageName: name, packageRoot: testPackageUri, - targetOS: OS.current, buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig(dryRun: false, linkingEnabled: false) @@ -44,6 +43,7 @@ void main() async { ) ..setupCodeConfig( targetArchitecture: Architecture.current, + targetOS: OS.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, ); diff --git a/pkgs/native_assets_builder/test/test_data/transformer_test.dart b/pkgs/native_assets_builder/test/test_data/transformer_test.dart index c965e136d..05d2b868c 100644 --- a/pkgs/native_assets_builder/test/test_data/transformer_test.dart +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -49,7 +49,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageUri, - targetOS: OS.current, buildAssetTypes: [DataAsset.type], ) ..setupBuildConfig(dryRun: false, linkingEnabled: false) @@ -59,6 +58,7 @@ void main() async { ) ..setupCodeConfig( targetArchitecture: architecture, + targetOS: OS.current, linkModePreference: LinkModePreference.dynamic, ); diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart index 177b2d794..d774f5e13 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart @@ -14,7 +14,7 @@ const minMacOSVersionForThisPackage = 13; void main(List arguments) async { await build(arguments, (config, output) async { - if (config.targetOS == OS.android) { + if (config.codeConfig.targetOS == OS.android) { if (config.codeConfig.targetAndroidNdkApi! < minNdkApiVersionForThisPackage) { throw UnsupportedError( @@ -22,7 +22,7 @@ void main(List arguments) async { 'least Android NDK API level $minNdkApiVersionForThisPackage.', ); } - } else if (config.targetOS == OS.iOS) { + } else if (config.codeConfig.targetOS == OS.iOS) { final iosVersion = config.codeConfig.targetIOSVersion; // iosVersion is nullable to deal with version skew. if (iosVersion != null && iosVersion < minIosVersionForThisPackage) { @@ -31,7 +31,7 @@ void main(List arguments) async { 'least iOS version $minIosVersionForThisPackage.', ); } - } else if (config.targetOS == OS.macOS) { + } else if (config.codeConfig.targetOS == OS.macOS) { final macosVersion = config.codeConfig.targetMacOSVersion; // macosVersion is nullable to deal with version skew. if (macosVersion != null && diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart index 27aec5e37..a4603499f 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart @@ -14,7 +14,7 @@ const minMacOSVersionForThisPackage = 13; void main(List arguments) async { await link(arguments, (config, output) async { - if (config.targetOS == OS.android) { + if (config.codeConfig.targetOS == OS.android) { if (config.codeConfig.targetAndroidNdkApi! < minNdkApiVersionForThisPackage) { throw UnsupportedError( @@ -22,7 +22,7 @@ void main(List arguments) async { 'least Android NDK API level $minNdkApiVersionForThisPackage.', ); } - } else if (config.targetOS == OS.iOS) { + } else if (config.codeConfig.targetOS == OS.iOS) { final iosVersion = config.codeConfig.targetIOSVersion; // iosVersion is nullable to deal with version skew. if (iosVersion != null && iosVersion < minIosVersionForThisPackage) { @@ -31,7 +31,7 @@ void main(List arguments) async { 'least iOS version $minIosVersionForThisPackage.', ); } - } else if (config.targetOS == OS.macOS) { + } else if (config.codeConfig.targetOS == OS.macOS) { final macosVersion = config.codeConfig.targetMacOSVersion; // macosVersion is nullable to deal with version skew. if (macosVersion != null && diff --git a/pkgs/native_assets_cli/CHANGELOG.md b/pkgs/native_assets_cli/CHANGELOG.md index 20a84d7d7..4d01bed7a 100644 --- a/pkgs/native_assets_cli/CHANGELOG.md +++ b/pkgs/native_assets_cli/CHANGELOG.md @@ -9,6 +9,8 @@ it can be controlled in the build hook together with the `OptimizationLevel`. Most likely, every package should ship with `release`. `BuildMode.debug` should only be used while developing the package locally. +- **Breaking change** Move `HookConfig.targetOS` to `CodeConfig`. `DataAsset`s + and other asset types might now support varying on the target OS. - **Breaking change**: Change the behavior of `testBuildHook` and `testCodeBuildHook`; instead of defining tests, these methods should now be called from within tests. diff --git a/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart b/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart index 3e61c0c4a..9547ac51b 100644 --- a/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart +++ b/pkgs/native_assets_cli/example/build/local_asset/hook/build.dart @@ -38,7 +38,7 @@ Future main(List args) async { name: 'asset.txt', file: assetPath, linkMode: DynamicLoadingBundled(), - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: // ignore: deprecated_member_use config.dryRun ? null : config.codeConfig.targetArchitecture, diff --git a/pkgs/native_assets_cli/lib/code_assets.dart b/pkgs/native_assets_cli/lib/code_assets.dart index 0e84016a7..82c32b6d5 100644 --- a/pkgs/native_assets_cli/lib/code_assets.dart +++ b/pkgs/native_assets_cli/lib/code_assets.dart @@ -32,3 +32,4 @@ export 'src/code_assets/link_mode.dart' LookupInProcess, StaticLinking; export 'src/code_assets/link_mode_preference.dart' show LinkModePreference; +export 'src/code_assets/os.dart' show OS; diff --git a/pkgs/native_assets_cli/lib/native_assets_cli.dart b/pkgs/native_assets_cli/lib/native_assets_cli.dart index a484fe804..be4d880a3 100644 --- a/pkgs/native_assets_cli/lib/native_assets_cli.dart +++ b/pkgs/native_assets_cli/lib/native_assets_cli.dart @@ -21,4 +21,3 @@ export 'src/config.dart' LinkOutputBuilder; export 'src/encoded_asset.dart' show EncodedAsset; export 'src/metadata.dart'; -export 'src/os.dart' show OS; diff --git a/pkgs/native_assets_cli/lib/src/api/build.dart b/pkgs/native_assets_cli/lib/src/api/build.dart index c033a8c58..cd7cc063f 100644 --- a/pkgs/native_assets_cli/lib/src/api/build.dart +++ b/pkgs/native_assets_cli/lib/src/api/build.dart @@ -82,7 +82,7 @@ import '../validation.dart'; /// name: 'asset.txt', /// file: assetPath, /// linkMode: DynamicLoadingBundled(), -/// os: config.targetOS, +/// os: config.codeConfig.targetOS, /// architecture: config.codeConfig.targetArchitecture, /// ), /// ); diff --git a/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart b/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart index dcfeaf4ff..4a65875ae 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/code_asset.dart @@ -5,12 +5,11 @@ import '../config.dart'; import '../encoded_asset.dart'; import '../json_utils.dart'; -import '../os.dart'; import '../utils/json.dart'; import '../utils/map.dart'; - import 'architecture.dart'; import 'link_mode.dart'; +import 'os.dart'; /// A code asset which respects the native application binary interface (ABI). /// diff --git a/pkgs/native_assets_cli/lib/src/code_assets/config.dart b/pkgs/native_assets_cli/lib/src/code_assets/config.dart index f9a3d97e8..6f749a106 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/config.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/config.dart @@ -4,12 +4,12 @@ import '../config.dart'; import '../json_utils.dart'; - import 'architecture.dart'; import 'c_compiler_config.dart'; import 'code_asset.dart'; import 'ios_sdk.dart'; import 'link_mode_preference.dart'; +import 'os.dart'; /// Extension to the [BuildConfig] providing access to configuration specific to /// code assets (only available if code assets are supported). @@ -48,6 +48,9 @@ class CodeConfig { final int? targetAndroidNdkApi; final IOSSdk? targetIOSSdk; + /// The operating system being compiled for. + final OS targetOS; + CodeConfig(HookConfig config) : linkModePreference = LinkModePreference.fromString( config.json.string(_linkModePreferenceKey)), @@ -56,6 +59,7 @@ class CodeConfig { ? null : Architecture.fromString(config.json.string(_targetArchitectureKey, validValues: Architecture.values.map((a) => a.name))), + targetOS = OS.fromString(config.json.string(_targetOSConfigKey)), cCompiler = switch (config.json.optionalMap(_compilerKey)) { final Map map => CCompilerConfig.fromJson(map), null => CCompilerConfig(), @@ -121,6 +125,7 @@ extension type CodeAssetLinkOutputBuilderAdd._(LinkOutputBuilder _output) { extension CodeAssetBuildConfigBuilder on HookConfigBuilder { void setupCodeConfig({ required Architecture? targetArchitecture, + required OS targetOS, required LinkModePreference linkModePreference, CCompilerConfig? cCompilerConfig, int? targetIOSVersion, @@ -131,6 +136,7 @@ extension CodeAssetBuildConfigBuilder on HookConfigBuilder { if (targetArchitecture != null) { json[_targetArchitectureKey] = targetArchitecture.toString(); } + json[_targetOSConfigKey] = targetOS.toString(); json[_linkModePreferenceKey] = linkModePreference.toString(); if (cCompilerConfig != null) { json[_compilerKey] = cCompilerConfig.toJson(); @@ -170,9 +176,10 @@ extension CodeAssetLinkOutput on LinkOutput { } const String _compilerKey = 'c_compiler'; +const String _linkModePreferenceKey = 'link_mode_preference'; +const String _targetAndroidNdkApiKey = 'target_android_ndk_api'; const String _targetArchitectureKey = 'target_architecture'; const String _targetIOSSdkKey = 'target_ios_sdk'; -const String _linkModePreferenceKey = 'link_mode_preference'; const String _targetIOSVersionKey = 'target_ios_version'; const String _targetMacOSVersionKey = 'target_macos_version'; -const String _targetAndroidNdkApiKey = 'target_android_ndk_api'; +const String _targetOSConfigKey = 'target_os'; diff --git a/pkgs/native_assets_cli/lib/src/os.dart b/pkgs/native_assets_cli/lib/src/code_assets/os.dart similarity index 100% rename from pkgs/native_assets_cli/lib/src/os.dart rename to pkgs/native_assets_cli/lib/src/code_assets/os.dart diff --git a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart index 25f3741f1..3d2648273 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart @@ -42,6 +42,7 @@ Future testCodeBuildHook({ linkModePreference: linkModePreference ?? LinkModePreference.dynamic, cCompilerConfig: cCompiler, targetArchitecture: targetArchitecture ?? Architecture.current, + targetOS: targetOS ?? OS.current, targetIOSSdk: targetIOSSdk, targetIOSVersion: targetIOSVersion, targetMacOSVersion: targetMacOSVersion, @@ -58,7 +59,6 @@ Future testCodeBuildHook({ await check(config, output); }, - targetOS: targetOS, buildAssetTypes: buildAssetTypes, linkingEnabled: linkingEnabled, ); diff --git a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart index 8361824b5..b01dcc559 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart @@ -12,7 +12,7 @@ Future validateCodeAssetBuildConfig( BuildConfig config) async => _validateCodeConfig( 'BuildConfig', - config.targetOS, + config.codeConfig.targetOS, // ignore: deprecated_member_use_from_same_package config.dryRun, config.codeConfig, @@ -20,7 +20,7 @@ Future validateCodeAssetBuildConfig( Future validateCodeAssetLinkConfig(LinkConfig config) async => _validateCodeConfig( - 'LinkConfig', config.targetOS, false, config.codeConfig); + 'LinkConfig', config.codeConfig.targetOS, false, config.codeConfig); ValidationErrors _validateCodeConfig( String configName, OS targetOS, bool dryRun, CodeConfig codeConfig) { @@ -169,9 +169,9 @@ void _validateCodeAssets( } final os = codeAsset.os; - if (config.targetOS != os) { + if (codeConfig.targetOS != os) { final error = 'CodeAsset "$id" has a os "$os", which ' - 'is not the target os "${config.targetOS}".'; + 'is not the target os "${codeConfig.targetOS}".'; errors.add(error); } diff --git a/pkgs/native_assets_cli/lib/src/config.dart b/pkgs/native_assets_cli/lib/src/config.dart index 27d66de18..ff1912306 100644 --- a/pkgs/native_assets_cli/lib/src/config.dart +++ b/pkgs/native_assets_cli/lib/src/config.dart @@ -10,10 +10,10 @@ import 'package:pub_semver/pub_semver.dart'; import 'api/deprecation_messages.dart'; import 'code_assets/architecture.dart'; +import 'code_assets/os.dart'; import 'encoded_asset.dart'; import 'json_utils.dart'; import 'metadata.dart'; -import 'os.dart'; import 'utils/datetime.dart'; import 'utils/json.dart'; @@ -61,9 +61,6 @@ sealed class HookConfig { /// another. For this it is convenient to know the packageRoot. final Uri packageRoot; - /// The operating system being compiled for. - final OS targetOS; - /// The asset types that the invoker of this hook supports. final List buildAssetTypes; @@ -80,7 +77,6 @@ sealed class HookConfig { outputDirectoryShared = json.path(_outDirSharedConfigKey), packageRoot = json.path(_packageRootConfigKey), packageName = json.string(_packageNameConfigKey), - targetOS = OS.fromString(json.string(_targetOSConfigKey)), buildAssetTypes = json.optionalStringList(_buildAssetTypesKey) ?? json.optionalStringList(_supportedAssetTypesKey) ?? const []; @@ -97,12 +93,10 @@ sealed class HookConfigBuilder { void setupHookConfig({ required Uri packageRoot, required String packageName, - required OS targetOS, required List buildAssetTypes, }) { json[_packageNameConfigKey] = packageName; json[_packageRootConfigKey] = packageRoot.toFilePath(); - json[_targetOSConfigKey] = targetOS.toString(); json[_buildAssetTypesKey] = buildAssetTypes; json[_supportedAssetTypesKey] = buildAssetTypes; } @@ -135,7 +129,6 @@ sealed class HookConfigBuilder { } } -const _targetOSConfigKey = 'target_os'; // TODO: Bump min-SDK constraint to 3.7 and remove once stable. const _buildModeConfigKeyDeprecated = 'build_mode'; const _metadataConfigKey = 'metadata'; diff --git a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md index 77c5947e0..c460ecc8a 100644 --- a/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md +++ b/pkgs/native_assets_cli/lib/src/model/build_config_CHANGELOG.md @@ -3,6 +3,14 @@ - `BuildConfig.supportedAssetTypes` renamed to `BuildConfig.buildAssetTypes`. Compatibility with older SDKs: Look for the old key. Compatibility with older hooks: Also provide the old hook in the config. +- `BuildConfig.targetOS` is now only provided if `buildAssetTypes` contains the + code asset. + Compatibility with older SDKs: Fine, they always provide it. + Compatibility with older hooks: Currently, no embedders call hooks without + support for code assets. Once they do (data assets on web), existing hooks + will break. Mitigation: Update existing hooks to check for `buildAssetTypes` + and/or change `CBuilder` to be a no-op if `buildAssetTypes` does not contain + code assets. - `BuildConfig.outputDirectoryShared` for sharing between hook invocations. Compatibility with older SDKs: Create a sibling dir next to the output directory. This does not facilitate caching, but should not break the hook. diff --git a/pkgs/native_assets_cli/lib/src/target.dart b/pkgs/native_assets_cli/lib/src/target.dart index fc595fed6..39cc5687e 100644 --- a/pkgs/native_assets_cli/lib/src/target.dart +++ b/pkgs/native_assets_cli/lib/src/target.dart @@ -6,7 +6,7 @@ import 'dart:ffi' show Abi; import 'dart:io'; import 'code_assets/architecture.dart'; -import 'os.dart'; +import 'code_assets/os.dart'; final class Target implements Comparable { final Abi abi; diff --git a/pkgs/native_assets_cli/lib/test.dart b/pkgs/native_assets_cli/lib/test.dart index 21deb2490..e18210a4b 100644 --- a/pkgs/native_assets_cli/lib/test.dart +++ b/pkgs/native_assets_cli/lib/test.dart @@ -30,7 +30,6 @@ Future testBuildHook({ required FutureOr Function(List arguments) mainMethod, required FutureOr Function(BuildConfig config, BuildOutput output) check, - OS? targetOS, List? buildAssetTypes, bool? linkingEnabled, }) async { @@ -53,7 +52,6 @@ Future testBuildHook({ ..setupHookConfig( packageRoot: Directory.current.uri, packageName: _readPackageNameFromPubspec(), - targetOS: targetOS ?? OS.current, buildAssetTypes: buildAssetTypes ?? [], ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/api/build_test.dart b/pkgs/native_assets_cli/test/api/build_test.dart index b10d9adb1..aa2801b37 100644 --- a/pkgs/native_assets_cli/test/api/build_test.dart +++ b/pkgs/native_assets_cli/test/api/build_test.dart @@ -34,7 +34,6 @@ void main() async { ..setupHookConfig( packageRoot: tempUri, packageName: packageName, - targetOS: OS.iOS, buildAssetTypes: ['foo'], ) ..setupBuildConfig( diff --git a/pkgs/native_assets_cli/test/build_config_test.dart b/pkgs/native_assets_cli/test/build_config_test.dart index 61fdf685a..10e844ab0 100644 --- a/pkgs/native_assets_cli/test/build_config_test.dart +++ b/pkgs/native_assets_cli/test/build_config_test.dart @@ -40,7 +40,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageRootUri, - targetOS: OS.android, buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( @@ -73,7 +72,6 @@ void main() async { 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'supported_asset_types': ['my-asset-type'], - 'target_os': 'android', 'version': latestVersion.toString(), }; @@ -85,7 +83,6 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); - expect(config.targetOS, OS.android); expect(config.buildAssetTypes, ['my-asset-type']); expect(config.linkingEnabled, false); @@ -98,7 +95,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageRootUri, - targetOS: OS.android, buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( @@ -121,7 +117,6 @@ void main() async { 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'supported_asset_types': ['my-asset-type'], - 'target_os': 'android', 'version': latestVersion.toString(), }; @@ -133,7 +128,6 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); - expect(config.targetOS, OS.android); expect(config.buildAssetTypes, ['my-asset-type']); expect(config.linkingEnabled, true); diff --git a/pkgs/native_assets_cli/test/checksum_test.dart b/pkgs/native_assets_cli/test/checksum_test.dart index aee34b710..3b2376d28 100644 --- a/pkgs/native_assets_cli/test/checksum_test.dart +++ b/pkgs/native_assets_cli/test/checksum_test.dart @@ -14,21 +14,31 @@ void main() { final configs = []; final checksums = []; for (final os in [OS.linux, OS.macOS]) { - for (final packageName in ['foo', 'bar']) { - for (final assetType in [CodeAsset.type, DataAsset.type]) { - for (final dryRun in [true, false]) { - for (final linking in [true, false]) { - final builder = BuildConfigBuilder() - ..setupHookConfig( - packageRoot: Uri.file('foo'), - packageName: packageName, - targetOS: os, - buildAssetTypes: [assetType], - ) - ..setupBuildConfig(dryRun: dryRun, linkingEnabled: linking); - configs - .add(const JsonEncoder.withIndent(' ').convert(builder.json)); - checksums.add(builder.computeChecksum()); + for (final architecture in [Architecture.arm64, Architecture.x64]) { + for (final packageName in ['foo', 'bar']) { + for (final assetType in [CodeAsset.type, DataAsset.type]) { + for (final dryRun in [true, false]) { + for (final linking in [true, false]) { + final builder = BuildConfigBuilder() + ..setupHookConfig( + packageRoot: Uri.file('foo'), + packageName: packageName, + buildAssetTypes: [assetType], + ) + ..setupBuildConfig( + dryRun: dryRun, + linkingEnabled: linking, + ) + ..setupCodeConfig( + targetArchitecture: architecture, + targetOS: os, + linkModePreference: LinkModePreference.dynamic, + ); + configs.add( + const JsonEncoder.withIndent(' ').convert(builder.json), + ); + checksums.add(builder.computeChecksum()); + } } } } @@ -42,38 +52,70 @@ void main() { // needing to update this list). final expectedChecksums = [ - '4cfa5fbd14f8d73d04014ee5b453b000', - '365e989ba01bac43d654981fec67205d', - '2191c07f18b5ef13999eb6f8356ae02e', - '257890f33b84d191746a378fb0db4eba', - 'c22d663cde074a6722c2d5253b8e0619', - 'f520e2f4fd0f2fd76da0c6c18db9559b', - '7cc71dd803c24a424db70444002df999', - 'a5774f32e91551e8dfdcc3f63e45f3ed', - '0f361f3a5072f66f68eb4d7a7e4b92d6', - '5cc8e330ea24c647a1dbf2d82497c73c', - '97b5dbdf7a76cf5839de3bd0cac63b6d', - 'ccc846104ddc0dbd700190638b756435', - '0fca1f77969d6e24602cf44c28695c2b', - '683be025644ff73c5eba9d1f99f9808c', - '7a6982964efcf50507669706e31bdab5', - 'd2b17c98c64e750d8bd2ed5beb907401', - 'de3ac273831822414783f0d72acf9d82', - '09c17c21bd277ea2709c35205a2fdfa6', - 'f07b3399888444bc2b7fa837c0c1dddb', - '6e92bc3271d65229793d8bd1ed4e00be', - 'd353ae01cf04e201180edf8c5e4dac37', - '25044b641a83b33860cf8f79154652bb', - 'afc5e24300cf70245146148111b8a746', - '8023595c2343952c02e2aa47f6ee809f', - '226d39440aa5380bbcf71fb9a804a4b0', - '26cab023910889c0c96cbba2bb04ad97', - '32bea1c49326ae259fe97a6fc7b1e08d', - 'a0cccc3aa7069efc86a84b0299dba682', - '28280ef1dfe5e5922eb97577e8a85c40', - '69595125d5987c952355903deaa87684', - 'b5328455769192919339d0e6158d728d', - 'ed827ce888b9929ba83e04af8d5b7a37', + 'd666127fab5478b736d505c0cbd2e08e', + '5d5cf5cf7916bd7adc26f5d5611f23ec', + '29cb9cf638acac26c1e7eb20bf4e359a', + '2214edee21375319f5612344dfe6acbc', + '40b61c96feff406659bc35e24875744b', + 'a0492f5322cea695e3bc1522d66a20ce', + '9f5269a2c0c663023af449e77ac39980', + 'c9add26b586b1fb897f9ff0d2edb235d', + '95ec14e605b3519f00ea8816b328e0ad', + 'fc5792f6beb3c0e0f7894537a3fa4850', + 'bbf84c44fb1ce09636a70d3e9a8590be', + '9c83dfb94b98c6f4ec79cbabc95e6198', + 'af8712f4857423f455d2912c55fe6766', + '99d1eba44f3e914b58768c210d139cc1', + '12cc255c3fc076d3550ac32b43166631', + '2188cca31e8306cbacb9c3d799b5513c', + '65ad5d4fb66745aad4e5a2969a1e45b1', + '29da0a967b9cfd5e4d21d61c97d2a99e', + 'efef4a8ab871ed05a9358a2e4d6d4e03', + '672a07ce5b6f82204ba92b45c287781c', + '4bcdd217687c15fb108dc9a9b8f8537c', + 'c0593c4282d42a659d66d8b72e44b2a6', + 'dd428de57da1d45149f4ff8a27fa3ea0', + 'c04f80b8be73bcfe435c586ef8a979bc', + '1056f2bf80b3c1979952af1e62e34576', + 'b7d943b4bab492e10c582bdd58aced0e', + 'ed56d7afbd306393c3206685e6d1ba81', + '1463940666f69e3b132f3766570ef83b', + '5451c1a2a24bc5e1206b245b028e0078', + '5f2c169a71039d3d6b2ae74e3c2723d7', + '67759625e5a0908dabcaeeb2b1264f84', + '921b2b7012548949e9b465addccc2e71', + '94bc85e935634df06e208ac8ab9643d3', + 'ee4cd19fc3ac5d4a85ceaf2e80e44682', + '661bf4e49dff3c104784a0d75cf45204', + '0b3529f1337b3759e97733095a868d29', + '1522580f1e96c5ea5dc68ca7a720adee', + '5c08a30f498edf9962c8ff20a1ab4fba', + '69f4f6640eba043f4df2e6f109f07b90', + '62db9da306210856e44bb7f8a75a15fd', + '125f6fa99282a3b7e8937030a3aa2c6d', + '1cf817dd1a1710bfacb82ef71da94e4f', + '1eccd6e8e62985cb9955db4fd8c22d2f', + '4becc04d3263f2b362dd76c0e0eb6d7b', + '74ecd3c74beb88f2f7f02921a8de1143', + 'ad6bf3865f8addf4233e3a83192f5464', + 'edf54995d97ad818449f09d9b2fc86e2', + '89014c91ebb4075bdea2d52f2d35b4ae', + 'cb59b4041a0a7bbf636ed4e3b30d06be', + '3dd69a72235c9b45e1f85c143e8f97bc', + 'b08bec82fca775aeec2e4f400b20a4a0', + '79381e4fd8c1191f2fceb7ad30b3fd64', + 'b8e5434a62d4b0a381363dca1152a0d5', + 'f70e0798fa96df0b6e1d14d69fd0deaa', + '3d807e9c6306c16f2ee61a32e8081e2f', + '0646eefc0cfd913506051f0c8a900983', + 'b5adb85aeaf88a23e7bafd29e63c03ac', + '7b269c3e21fe9e29285daba8c370073f', + '1a47af48f1e3158000d44ef59ab597da', + '2665c64ac2a9d919fff7420c0e770db3', + '27c0acf56ef48f3855fc20ea8810ff8d', + '2a9a03940008cdd6f9231f1f54dd94bf', + '86d87e3cb682646e5d1158898ed7913f', + '6a7b30ccd5a35694c515d22f165be589', ]; printOnFailure('final expectedChecksums = ['); printOnFailure(checksums.map((e) => " '$e',").join('\n')); diff --git a/pkgs/native_assets_cli/test/code_assets/config_test.dart b/pkgs/native_assets_cli/test/code_assets/config_test.dart index b205e5b40..fe7943afa 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -91,7 +91,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageRootUri, - targetOS: OS.android, buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( @@ -103,6 +102,7 @@ void main() async { outputDirectoryShared: outputDirectoryShared, ) ..setupCodeConfig( + targetOS: OS.android, targetArchitecture: null, // not available in dry run cCompilerConfig: null, // not available in dry run linkModePreference: LinkModePreference.preferStatic, @@ -116,7 +116,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageRootUri, - targetOS: OS.android, buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( @@ -128,6 +127,7 @@ void main() async { outputDirectoryShared: outputDirectoryShared, ) ..setupCodeConfig( + targetOS: OS.android, targetArchitecture: Architecture.arm64, targetAndroidNdkApi: 30, linkModePreference: LinkModePreference.preferStatic, @@ -148,7 +148,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageRootUri, - targetOS: OS.android, buildAssetTypes: [CodeAsset.type], ) ..setupLinkConfig(assets: assets) @@ -158,6 +157,7 @@ void main() async { recordedUsesFile: null, ) ..setupCodeConfig( + targetOS: OS.android, targetArchitecture: Architecture.arm64, targetAndroidNdkApi: 30, linkModePreference: LinkModePreference.preferStatic, diff --git a/pkgs/native_assets_cli/test/code_assets/validation_test.dart b/pkgs/native_assets_cli/test/code_assets/validation_test.dart index 4365f1712..09aa23571 100644 --- a/pkgs/native_assets_cli/test/code_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/validation_test.dart @@ -29,12 +29,11 @@ void main() { await Directory.fromUri(tempUri).delete(recursive: true); }); - BuildConfigBuilder makeBuildConfigBuilder({OS os = OS.iOS}) { + BuildConfigBuilder makeBuildConfigBuilder() { final configBuilder = BuildConfigBuilder() ..setupHookConfig( packageName: packageName, packageRoot: tempUri, - targetOS: os, buildAssetTypes: [CodeAsset.type], ) ..setupBuildConfig( @@ -48,12 +47,14 @@ void main() { return configBuilder; } - BuildConfig makeCodeBuildConfig( - {LinkModePreference linkModePreference = LinkModePreference.dynamic}) { + BuildConfig makeCodeBuildConfig({ + LinkModePreference linkModePreference = LinkModePreference.dynamic, + OS os = OS.iOS, + }) { final builder = makeBuildConfigBuilder() ..setupCodeConfig( + targetOS: os, targetArchitecture: Architecture.arm64, - targetIOSSdk: IOSSdk.iPhoneOS, linkModePreference: linkModePreference, ); return BuildConfig(builder.json); @@ -66,7 +67,7 @@ void main() { package: config.packageName, name: 'foo.dylib', architecture: config.codeConfig.targetArchitecture, - os: config.targetOS, + os: config.codeConfig.targetOS, linkMode: DynamicLoadingBundled(), )); final errors = await validateCodeAssetBuildOutput( @@ -93,7 +94,7 @@ void main() { name: 'foo.dart', file: assetFile.uri, linkMode: linkMode, - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: config.codeConfig.targetArchitecture, ), ); @@ -119,7 +120,7 @@ void main() { name: 'foo.dart', file: assetFile.uri, linkMode: DynamicLoadingBundled(), - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: Architecture.x64, ), ); @@ -144,7 +145,7 @@ void main() { name: 'foo.dart', file: assetFile.uri, linkMode: DynamicLoadingBundled(), - os: config.targetOS, + os: config.codeConfig.targetOS, ), ); final errors = await validateCodeAssetBuildOutput( @@ -185,7 +186,7 @@ void main() { test('duplicate dylib name', () async { final config = makeCodeBuildConfig(); final outputBuilder = BuildOutputBuilder(); - final fileName = config.targetOS.dylibFileName('foo'); + final fileName = config.codeConfig.targetOS.dylibFileName('foo'); final assetFile = File.fromUri(outDirUri.resolve(fileName)); await assetFile.writeAsBytes([1, 2, 3]); outputBuilder.codeAssets.addAll([ @@ -194,7 +195,7 @@ void main() { name: 'src/foo.dart', file: assetFile.uri, linkMode: DynamicLoadingBundled(), - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: config.codeConfig.targetArchitecture, ), CodeAsset( @@ -202,7 +203,7 @@ void main() { name: 'src/bar.dart', file: assetFile.uri, linkMode: DynamicLoadingBundled(), - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: config.codeConfig.targetArchitecture, ), ]); @@ -216,10 +217,12 @@ void main() { group('BuildConfig.codeConfig validation', () { test('Missing targetIOSVersion', () async { - final builder = makeBuildConfigBuilder(os: OS.iOS) + final builder = makeBuildConfigBuilder() ..setupCodeConfig( - targetArchitecture: Architecture.arm64, - linkModePreference: LinkModePreference.dynamic); + targetOS: OS.iOS, + targetArchitecture: Architecture.arm64, + linkModePreference: LinkModePreference.dynamic, + ); final errors = await validateCodeAssetBuildConfig(BuildConfig(builder.json)); expect( @@ -232,20 +235,24 @@ void main() { contains('BuildConfig.codeConfig.targetIOSSdk was missing'))); }); test('Missing targetAndroidNdkApi', () async { - final builder = makeBuildConfigBuilder(os: OS.android) + final builder = makeBuildConfigBuilder() ..setupCodeConfig( - targetArchitecture: Architecture.arm64, - linkModePreference: LinkModePreference.dynamic); + targetOS: OS.android, + targetArchitecture: Architecture.arm64, + linkModePreference: LinkModePreference.dynamic, + ); expect( await validateCodeAssetBuildConfig(BuildConfig(builder.json)), contains(contains( 'BuildConfig.codeConfig.targetAndroidNdkApi was missing'))); }); test('Missing targetMacOSVersion', () async { - final builder = makeBuildConfigBuilder(os: OS.macOS) + final builder = makeBuildConfigBuilder() ..setupCodeConfig( - targetArchitecture: Architecture.arm64, - linkModePreference: LinkModePreference.dynamic); + targetOS: OS.macOS, + targetArchitecture: Architecture.arm64, + linkModePreference: LinkModePreference.dynamic, + ); expect( await validateCodeAssetBuildConfig(BuildConfig(builder.json)), contains(contains( @@ -253,8 +260,9 @@ void main() { }); test('Nonexisting compiler/archiver/linker/envScript', () async { final nonExistent = outDirUri.resolve('foo baz'); - final builder = makeBuildConfigBuilder(os: OS.linux) + final builder = makeBuildConfigBuilder() ..setupCodeConfig( + targetOS: OS.linux, targetArchitecture: Architecture.arm64, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: CCompilerConfig( diff --git a/pkgs/native_assets_cli/test/data_assets/validation_test.dart b/pkgs/native_assets_cli/test/data_assets/validation_test.dart index 422b2e6c9..f38180203 100644 --- a/pkgs/native_assets_cli/test/data_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/data_assets/validation_test.dart @@ -34,7 +34,6 @@ void main() { ..setupHookConfig( packageName: packageName, packageRoot: tempUri, - targetOS: OS.iOS, buildAssetTypes: [DataAsset.type]) ..setupBuildConfig( linkingEnabled: false, diff --git a/pkgs/native_assets_cli/test/example/local_asset_test.dart b/pkgs/native_assets_cli/test/example/local_asset_test.dart index 5c9de1312..ce57a4b62 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -44,7 +44,6 @@ void main() async { ..setupHookConfig( packageRoot: testPackageUri, packageName: name, - targetOS: OS.current, buildAssetTypes: [CodeAsset.type], ) ..setupBuildRunConfig( @@ -52,9 +51,11 @@ void main() async { outputDirectoryShared: outputDirectoryShared) ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( - targetArchitecture: dryRun ? null : Architecture.current, - linkModePreference: LinkModePreference.dynamic, - cCompilerConfig: dryRun ? null : cCompiler); + targetOS: OS.current, + targetArchitecture: dryRun ? null : Architecture.current, + linkModePreference: LinkModePreference.dynamic, + cCompilerConfig: dryRun ? null : cCompiler, + ); final buildConfigUri = testTempUri.resolve('build_config.json'); await File.fromUri(buildConfigUri) diff --git a/pkgs/native_assets_cli/test/example/native_add_library_test.dart b/pkgs/native_assets_cli/test/example/native_add_library_test.dart index 3d9c9b14c..2a3415901 100644 --- a/pkgs/native_assets_cli/test/example/native_add_library_test.dart +++ b/pkgs/native_assets_cli/test/example/native_add_library_test.dart @@ -44,7 +44,6 @@ void main() async { ..setupHookConfig( packageRoot: testPackageUri, packageName: name, - targetOS: OS.current, buildAssetTypes: [CodeAsset.type], ) ..setupBuildRunConfig( @@ -52,9 +51,11 @@ void main() async { outputDirectoryShared: outputDirectoryShared) ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( - targetArchitecture: dryRun ? null : Architecture.current, - linkModePreference: LinkModePreference.dynamic, - cCompilerConfig: dryRun ? null : cCompiler); + targetOS: OS.current, + targetArchitecture: dryRun ? null : Architecture.current, + linkModePreference: LinkModePreference.dynamic, + cCompilerConfig: dryRun ? null : cCompiler, + ); final buildConfigUri = testTempUri.resolve('build_config.json'); await File.fromUri(buildConfigUri) diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index 64b3f50de..f90d91f15 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -48,7 +48,6 @@ void main() async { ..setupHookConfig( packageRoot: testPackageUri, packageName: name, - targetOS: OS.current, buildAssetTypes: [CodeAsset.type], ) ..setupBuildRunConfig( @@ -57,6 +56,7 @@ void main() async { ) ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: dryRun ? null : Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dryRun ? null : cCompiler, diff --git a/pkgs/native_assets_cli/test/link_config_test.dart b/pkgs/native_assets_cli/test/link_config_test.dart index dc87cc772..2cf9616ea 100644 --- a/pkgs/native_assets_cli/test/link_config_test.dart +++ b/pkgs/native_assets_cli/test/link_config_test.dart @@ -33,7 +33,6 @@ void main() async { ..setupHookConfig( packageName: packageName, packageRoot: packageRootUri, - targetOS: OS.android, buildAssetTypes: ['asset-type-1', 'asset-type-2'], ) ..setupLinkConfig(assets: assets) @@ -53,7 +52,6 @@ void main() async { 'package_name': packageName, 'package_root': packageRootUri.toFilePath(), 'supported_asset_types': ['asset-type-1', 'asset-type-2'], - 'target_os': 'android', 'version': latestVersion.toString(), }; expect(config.json, expectedConfigJson); @@ -64,7 +62,6 @@ void main() async { expect(config.packageName, packageName); expect(config.packageRoot, packageRootUri); - expect(config.targetOS, OS.android); expect(config.buildAssetTypes, ['asset-type-1', 'asset-type-2']); expect(config.encodedAssets, assets); }); diff --git a/pkgs/native_assets_cli/test/validation_test.dart b/pkgs/native_assets_cli/test/validation_test.dart index 8a45a1b96..fae2834d1 100644 --- a/pkgs/native_assets_cli/test/validation_test.dart +++ b/pkgs/native_assets_cli/test/validation_test.dart @@ -34,7 +34,6 @@ void main() { ..setupHookConfig( packageName: packageName, packageRoot: tempUri, - targetOS: OS.iOS, buildAssetTypes: ['my-asset-type'], ) ..setupBuildConfig( diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart index 9fda6b34f..c2e3c0a34 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/cbuilder.dart @@ -126,9 +126,10 @@ class CBuilder extends CTool implements Builder { await Directory.fromUri(outDir).create(recursive: true); final linkMode = getLinkMode(linkModePreference ?? config.codeConfig.linkModePreference); - final libUri = - outDir.resolve(config.targetOS.libraryFileName(name, linkMode)); - final exeUri = outDir.resolve(config.targetOS.executableFileName(name)); + final libUri = outDir + .resolve(config.codeConfig.targetOS.libraryFileName(name, linkMode)); + final exeUri = + outDir.resolve(config.codeConfig.targetOS.executableFileName(name)); final sources = [ for (final source in this.sources) packageRoot.resolveUri(Uri.file(source)), @@ -188,7 +189,7 @@ class CBuilder extends CTool implements Builder { name: assetName!, file: libUri, linkMode: linkMode, - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: // ignore: deprecated_member_use config.dryRun ? null : config.codeConfig.targetArchitecture, diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart index aa804863e..425944630 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/clinker.dart @@ -51,7 +51,7 @@ class CLinker extends CTool implements Linker { required LinkOutputBuilder output, required Logger? logger, }) async { - if (OS.current != OS.linux || config.targetOS != OS.linux) { + if (OS.current != OS.linux || config.codeConfig.targetOS != OS.linux) { throw UnsupportedError('Currently, only linux is supported for this ' 'feature. See also https://github.com/dart-lang/native/issues/1376'); } @@ -60,8 +60,8 @@ class CLinker extends CTool implements Linker { await Directory.fromUri(outDir).create(recursive: true); final linkMode = getLinkMode(linkModePreference ?? config.codeConfig.linkModePreference); - final libUri = - outDir.resolve(config.targetOS.libraryFileName(name, linkMode)); + final libUri = outDir + .resolve(config.codeConfig.targetOS.libraryFileName(name, linkMode)); final sources = [ for (final source in this.sources) packageRoot.resolveUri(Uri.file(source)), @@ -104,7 +104,7 @@ class CLinker extends CTool implements Linker { name: assetName!, file: libUri, linkMode: linkMode, - os: config.targetOS, + os: config.codeConfig.targetOS, architecture: config.codeConfig.targetArchitecture, )); } diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart index 149b64df2..3e4854764 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart @@ -20,14 +20,12 @@ import '../tool/tool_instance.dart'; // TODO(dacoharkes): This should support alternatives. // For example use Clang or MSVC on Windows. class CompilerResolver { - final HookConfig hookConfig; final CodeConfig codeConfig; final Logger? logger; final OS hostOS; final Architecture hostArchitecture; CompilerResolver({ - required this.hookConfig, required this.codeConfig, required this.logger, OS? hostOS, // Only visible for testing. @@ -49,7 +47,7 @@ class CompilerResolver { return result; } - final targetOS = hookConfig.targetOS; + final targetOS = codeConfig.targetOS; final targetArchitecture = codeConfig.targetArchitecture; final errorMessage = "No tools configured on host '${hostOS}_$hostArchitecture' with target " @@ -60,7 +58,7 @@ class CompilerResolver { /// Select the right compiler for cross compiling to the specified target. Tool? _selectCompiler() { - final targetOS = hookConfig.targetOS; + final targetOS = codeConfig.targetOS; final targetArch = codeConfig.targetArchitecture; // TODO(dacoharkes): Support falling back on other tools. @@ -135,7 +133,7 @@ class CompilerResolver { return result; } - final targetOS = hookConfig.targetOS; + final targetOS = codeConfig.targetOS; final targetArchitecture = codeConfig.targetArchitecture; final errorMessage = "No tools configured on host '${hostOS}_$hostArchitecture' with target " @@ -146,7 +144,7 @@ class CompilerResolver { /// Select the right archiver for cross compiling to the specified target. Tool? _selectArchiver() { - final targetOS = hookConfig.targetOS; + final targetOS = codeConfig.targetOS; final targetArchitecture = codeConfig.targetArchitecture; // TODO(dacoharkes): Support falling back on other tools. @@ -224,7 +222,7 @@ class CompilerResolver { } Future resolveLinker() async { - final targetOS = hookConfig.targetOS; + final targetOS = codeConfig.targetOS; final targetArchitecture = codeConfig.targetArchitecture; // First, check if the launcher provided a direct path to the compiler. var result = await _tryLoadLinkerFromConfig(); @@ -261,7 +259,7 @@ class CompilerResolver { /// Select the right compiler for cross compiling to the specified target. Tool? _selectLinker() { - final targetOS = hookConfig.targetOS; + final targetOS = codeConfig.targetOS; final targetArchitecture = codeConfig.targetArchitecture; if (targetOS == OS.macOS || targetOS == OS.iOS) return appleLd; diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart index 13e9ff0ad..4234337e2 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/ctool.dart @@ -18,7 +18,7 @@ abstract class CTool { /// Name of the library or executable to build or link. /// - /// The filename will be decided by [LinkConfig.targetOS] and + /// The filename will be decided by [CodeConfig.targetOS] and /// [OSLibraryNaming.libraryFileName] or /// [OSLibraryNaming.executableFileName]. /// diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart index a4b8197c1..23d61225c 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart @@ -76,7 +76,7 @@ class RunCBuilder { .whereType() .length == 1) { - if (config.targetOS == OS.windows && cppLinkStdLib != null) { + if (codeConfig.targetOS == OS.windows && cppLinkStdLib != null) { throw ArgumentError.value( cppLinkStdLib, 'cppLinkStdLib', @@ -85,8 +85,8 @@ class RunCBuilder { } } - late final _resolver = CompilerResolver( - hookConfig: config, codeConfig: codeConfig, logger: logger); + late final _resolver = + CompilerResolver(codeConfig: codeConfig, logger: logger); Future compiler() async => await _resolver.resolveCompiler(); @@ -139,7 +139,7 @@ class RunCBuilder { } final IOSSdk? targetIosSdk; - if (config.targetOS == OS.iOS) { + if (codeConfig.targetOS == OS.iOS) { targetIosSdk = codeConfig.targetIOSSdk; } else { targetIosSdk = null; @@ -149,7 +149,7 @@ class RunCBuilder { // invoking clang. Mimic that behavior here. // See https://github.com/dart-lang/native/issues/171. final int? targetAndroidNdkApi; - if (config.targetOS == OS.android) { + if (codeConfig.targetOS == OS.android) { final minimumApi = codeConfig.targetArchitecture == Architecture.riscv64 ? 35 : 21; targetAndroidNdkApi = max(codeConfig.targetAndroidNdkApi!, minimumApi); @@ -158,9 +158,9 @@ class RunCBuilder { } final targetIOSVersion = - config.targetOS == OS.iOS ? codeConfig.targetIOSVersion : null; + codeConfig.targetOS == OS.iOS ? codeConfig.targetIOSVersion : null; final targetMacOSVersion = - config.targetOS == OS.macOS ? codeConfig.targetMacOSVersion : null; + codeConfig.targetOS == OS.macOS ? codeConfig.targetMacOSVersion : null; final architecture = codeConfig.targetArchitecture; final sourceFiles = sources.map((e) => e.toFilePath()).toList(); @@ -219,24 +219,24 @@ class RunCBuilder { await runProcess( executable: toolInstance.uri, arguments: [ - if (config.targetOS == OS.android) ...[ + if (codeConfig.targetOS == OS.android) ...[ '--target=' '${androidNdkClangTargetFlags[architecture]!}' '${targetAndroidNdkApi!}', '--sysroot=${androidSysroot(toolInstance).toFilePath()}', ], - if (config.targetOS == OS.macOS) + if (codeConfig.targetOS == OS.macOS) '--target=${appleClangMacosTargetFlags[architecture]!}', - if (config.targetOS == OS.iOS) + if (codeConfig.targetOS == OS.iOS) '--target=${appleClangIosTargetFlags[architecture]![targetIosSdk]!}', if (targetIOSVersion != null) '-mios-version-min=$targetIOSVersion', if (targetMacOSVersion != null) '-mmacos-version-min=$targetMacOSVersion', - if (config.targetOS == OS.iOS) ...[ + if (codeConfig.targetOS == OS.iOS) ...[ '-isysroot', (await iosSdk(targetIosSdk!, logger: logger)).toFilePath(), ], - if (config.targetOS == OS.macOS) ...[ + if (codeConfig.targetOS == OS.macOS) ...[ '-isysroot', (await macosSdk(logger: logger)).toFilePath(), ], @@ -280,14 +280,14 @@ class RunCBuilder { '-x', 'c++', '-l', - cppLinkStdLib ?? defaultCppLinkStdLib[config.targetOS]! + cppLinkStdLib ?? defaultCppLinkStdLib[codeConfig.targetOS]! ], if (optimizationLevel != OptimizationLevel.unspecified) optimizationLevel.clangFlag(), ...linkerOptions?.preSourcesFlags(toolInstance.tool, sourceFiles) ?? [], // Support Android 15 page size by default, can be overridden by // passing [flags]. - if (config.targetOS == OS.android) '-Wl,-z,max-page-size=16384', + if (codeConfig.targetOS == OS.android) '-Wl,-z,max-page-size=16384', ...flags, for (final MapEntry(key: name, :value) in defines.entries) if (value == null) '-D$name' else '-D$name=$value', @@ -314,7 +314,7 @@ class RunCBuilder { ...linkerOptions?.postSourcesFlags(toolInstance.tool, sourceFiles) ?? [], if (executable != null || dynamicLibrary != null) ...[ - if (config.targetOS case OS.android || OS.linux) + if (codeConfig.targetOS case OS.android || OS.linux) // During bundling code assets are all placed in the same directory. // Setting this rpath allows the binary to find other code assets // it is linked against. diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index 164dde262..7e906878d 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -34,13 +34,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index 6b3002c75..cb8e80201 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -149,13 +149,13 @@ Future buildLib( buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.android, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.android, targetArchitecture: targetArchitecture, cCompilerConfig: cCompiler, targetAndroidNdkApi: androidNdkApi, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index 29e78e72f..90e358aa5 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -75,13 +75,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.iOS, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.iOS, targetArchitecture: target, linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic @@ -233,13 +233,13 @@ Future buildLib( buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.iOS, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.iOS, targetArchitecture: targetArchitecture, linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart index c39d398d0..d0be152b7 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_linux_host_test.dart @@ -47,13 +47,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.linux, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.linux, targetArchitecture: target, linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index 129c8bec3..9df36f3ad 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -62,13 +62,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.macOS, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.macOS, targetArchitecture: target, linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic @@ -163,13 +163,13 @@ Future buildLib( buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.macOS, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.macOS, targetArchitecture: targetArchitecture, linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart index 6c9532653..92109a604 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_windows_host_test.dart @@ -66,13 +66,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.windows, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.windows, targetArchitecture: target, linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index 4b0a30793..3873a5b85 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -48,13 +48,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -97,7 +97,7 @@ void main() { (message) => message.contains(helloWorldCUri.toFilePath()), ); - switch ((buildConfig.targetOS, pic)) { + switch ((buildConfig.codeConfig.targetOS, pic)) { case (OS.windows, _) || (_, null): expect(compilerInvocation, isNot(contains('-fPIC'))); expect(compilerInvocation, isNot(contains('-fPIE'))); @@ -130,13 +130,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: dryRun, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dryRun ? null : cCompiler, @@ -172,7 +172,7 @@ void main() { final compilerInvocation = logMessages.singleWhere( (message) => message.contains(addCUri.toFilePath()), ); - switch ((buildConfig.targetOS, pic)) { + switch ((buildConfig.codeConfig.targetOS, pic)) { case (OS.windows, _) || (_, null): expect(compilerInvocation, isNot(contains('-fPIC'))); expect(compilerInvocation, isNot(contains('-fPIE'))); @@ -231,13 +231,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -250,7 +250,7 @@ void main() { final buildConfig = BuildConfig(buildConfigBuilder.json); final buildOutput = BuildOutputBuilder(); - final flag = switch (buildConfig.targetOS) { + final flag = switch (buildConfig.codeConfig.targetOS) { OS.windows => '/DFOO=USER_FLAG', _ => '-DFOO=USER_FLAG', }; @@ -298,13 +298,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -354,13 +354,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -373,7 +373,7 @@ void main() { final buildConfig = BuildConfig(buildConfigBuilder.json); final buildOutput = BuildOutputBuilder(); - final stdFlag = switch (buildConfig.targetOS) { + final stdFlag = switch (buildConfig.codeConfig.targetOS) { OS.windows => '/std:$std', _ => '-std=$std', }; @@ -422,13 +422,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -441,7 +441,7 @@ void main() { final buildConfig = BuildConfig(buildConfigBuilder.json); final buildOutput = BuildOutputBuilder(); - final defaultStdLibLinkFlag = switch (buildConfig.targetOS) { + final defaultStdLibLinkFlag = switch (buildConfig.codeConfig.targetOS) { OS.windows => null, OS.linux => '-l stdc++', OS.macOS => '-l c++', @@ -495,13 +495,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -522,7 +522,7 @@ void main() { buildMode: BuildMode.release, ); - if (buildConfig.targetOS == OS.windows) { + if (buildConfig.codeConfig.targetOS == OS.windows) { await expectLater( () => cbuilder.run( config: buildConfig, @@ -579,13 +579,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -680,13 +680,13 @@ Future testDefines({ buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index b4c1ddf01..929312368 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -46,13 +46,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: 'dummy', packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: CCompilerConfig( @@ -67,10 +67,8 @@ void main() { outputDirectoryShared: tempUri2, ); final buildConfig = BuildConfig(buildConfigBuilder.json); - final resolver = CompilerResolver( - hookConfig: buildConfig, - codeConfig: buildConfig.codeConfig, - logger: logger); + final resolver = + CompilerResolver(codeConfig: buildConfig.codeConfig, logger: logger); final compiler = await resolver.resolveCompiler(); final archiver = await resolver.resolveArchiver(); expect(compiler.uri, buildConfig.codeConfig.cCompiler.compiler); @@ -85,13 +83,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: 'dummy', packageRoot: tempUri, - targetOS: OS.windows, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.windows, targetArchitecture: Architecture.arm64, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, @@ -104,7 +102,6 @@ void main() { final buildConfig = BuildConfig(buildConfigBuilder.json); final resolver = CompilerResolver( - hookConfig: buildConfig, codeConfig: buildConfig.codeConfig, logger: logger, hostOS: OS.android, // This is never a host. diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index 23f8fe9ca..e251080a2 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -40,13 +40,13 @@ void main() { buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: OS.current, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: OS.current, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index fe183eb09..2dbc32946 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -30,13 +30,13 @@ Future buildTestArchive( buildAssetTypes: [CodeAsset.type], packageName: name, packageRoot: tempUri, - targetOS: os, ) ..setupBuildConfig( linkingEnabled: false, dryRun: false, ) ..setupCodeConfig( + targetOS: os, targetArchitecture: architecture, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/clinker/objects_test.dart b/pkgs/native_toolchain_c/test/clinker/objects_test.dart index d080e984a..0797b194c 100644 --- a/pkgs/native_toolchain_c/test/clinker/objects_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/objects_test.dart @@ -36,12 +36,12 @@ Future main() async { buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, - targetOS: os, ) ..setupLinkConfig( assets: [], ) ..setupCodeConfig( + targetOS: os, targetArchitecture: architecture, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/clinker/throws_test.dart b/pkgs/native_toolchain_c/test/clinker/throws_test.dart index 149f09001..9a1c2a633 100644 --- a/pkgs/native_toolchain_c/test/clinker/throws_test.dart +++ b/pkgs/native_toolchain_c/test/clinker/throws_test.dart @@ -27,12 +27,12 @@ Future main() async { buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, - targetOS: os, ) ..setupLinkConfig( assets: [], ) ..setupCodeConfig( + targetOS: os, targetArchitecture: Architecture.x64, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart index 322d9ba04..d8d55c88b 100644 --- a/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart +++ b/pkgs/native_toolchain_c/test/clinker/treeshake_helper.dart @@ -66,12 +66,12 @@ Future runTests(List architectures) async { buildAssetTypes: [CodeAsset.type], packageName: 'testpackage', packageRoot: tempUri, - targetOS: os, ) ..setupLinkConfig( assets: [], ) ..setupCodeConfig( + targetOS: os, targetArchitecture: architecture, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, From f617a3749bfdfdbe76477a874db362046cbf5a3c Mon Sep 17 00:00:00 2001 From: Prerak Mann Date: Thu, 12 Dec 2024 04:12:36 +0530 Subject: [PATCH 43/50] Handle dart typedefs in import/export of symbol files. (#1790) --- pkgs/ffigen/CHANGELOG.md | 1 + .../example/shared_bindings/headers/a.h | 7 ++ .../example/shared_bindings/headers/base.h | 4 ++ .../shared_bindings/lib/generated/a_gen.dart | 55 +++++++++++++- .../lib/generated/a_shared_b_gen.dart | 42 +++++++++++ .../lib/generated/base_gen.dart | 16 ++++- .../lib/generated/base_symbols.yaml | 9 +++ .../lib/src/code_generator/imports.dart | 72 +++++++++++++------ .../lib/src/code_generator/typealias.dart | 16 ++--- .../ffigen/lib/src/code_generator/writer.dart | 15 +++- .../lib/src/config_provider/spec_utils.dart | 6 +- pkgs/ffigen/lib/src/strings.dart | 1 + 12 files changed, 205 insertions(+), 39 deletions(-) diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index fbb1224a8..964eaee34 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md @@ -2,6 +2,7 @@ - Ensure that required symbols are available to FFI even when the final binary is linked with `-dead_strip`. +- Handle dart typedefs in import/export of symbol files. ## 16.0.0 diff --git a/pkgs/ffigen/example/shared_bindings/headers/a.h b/pkgs/ffigen/example/shared_bindings/headers/a.h index ef3bbea37..b2088985f 100644 --- a/pkgs/ffigen/example/shared_bindings/headers/a.h +++ b/pkgs/ffigen/example/shared_bindings/headers/a.h @@ -19,3 +19,10 @@ enum A_Enum{ void a_func1(); void a_func2(struct BaseStruct2 s, union BaseUnion2 u, BaseTypedef2 t); + +void a_func3(BaseNativeTypedef1 i); + +void a_func4(BaseNativeTypedef2 i); + +void a_func5(BaseNativeTypedef3 i); + diff --git a/pkgs/ffigen/example/shared_bindings/headers/base.h b/pkgs/ffigen/example/shared_bindings/headers/base.h index 345cac64e..61909a3fd 100644 --- a/pkgs/ffigen/example/shared_bindings/headers/base.h +++ b/pkgs/ffigen/example/shared_bindings/headers/base.h @@ -20,6 +20,9 @@ union BaseUnion2{ typedef struct BaseStruct1 BaseTypedef1; typedef struct BaseStruct2 BaseTypedef2; +typedef int BaseNativeTypedef1; +typedef BaseNativeTypedef1 BaseNativeTypedef2; +typedef BaseNativeTypedef2 BaseNativeTypedef3; enum BaseEnum{ BASE_ENUM_1, @@ -29,3 +32,4 @@ enum BaseEnum{ #define BASE_MACRO_1 1; void base_func1(BaseTypedef1 t1, BaseTypedef2 t2); + diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart index 8f92d2216..bfcf7bbde 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_gen.dart @@ -63,6 +63,45 @@ class NativeLibraryA { ffi.Void Function(BaseStruct2, BaseUnion2, BaseTypedef2)>>('a_func2'); late final _a_func2 = _a_func2Ptr .asFunction(); + + void a_func3( + int i, + ) { + return _a_func3( + i, + ); + } + + late final _a_func3Ptr = + _lookup>( + 'a_func3'); + late final _a_func3 = _a_func3Ptr.asFunction(); + + void a_func4( + int i, + ) { + return _a_func4( + i, + ); + } + + late final _a_func4Ptr = + _lookup>( + 'a_func4'); + late final _a_func4 = _a_func4Ptr.asFunction(); + + void a_func5( + int i, + ) { + return _a_func5( + i, + ); + } + + late final _a_func5Ptr = + _lookup>( + 'a_func5'); + late final _a_func5 = _a_func5Ptr.asFunction(); } final class BaseStruct1 extends ffi.Struct { @@ -85,16 +124,26 @@ final class BaseUnion2 extends ffi.Union { external int a; } +typedef BaseTypedef1 = BaseStruct1; +typedef BaseTypedef2 = BaseStruct2; +typedef BaseNativeTypedef1 = ffi.Int; +typedef DartBaseNativeTypedef1 = int; +typedef BaseNativeTypedef2 = BaseNativeTypedef1; +typedef BaseNativeTypedef3 = BaseNativeTypedef2; + enum BaseEnum { BASE_ENUM_1(0), BASE_ENUM_2(1); final int value; const BaseEnum(this.value); -} -typedef BaseTypedef1 = BaseStruct1; -typedef BaseTypedef2 = BaseStruct2; + static BaseEnum fromValue(int value) => switch (value) { + 0 => BASE_ENUM_1, + 1 => BASE_ENUM_2, + _ => throw ArgumentError("Unknown value for BaseEnum: $value"), + }; +} final class A_Struct1 extends ffi.Struct { @ffi.Int() diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart index c220cab4f..730cd57cd 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/a_shared_b_gen.dart @@ -49,6 +49,48 @@ class NativeLibraryASharedB { imp1.BaseTypedef2)>>('a_func2'); late final _a_func2 = _a_func2Ptr.asFunction< void Function(imp1.BaseStruct2, imp1.BaseUnion2, imp1.BaseTypedef2)>(); + + void a_func3( + imp1.DartBaseNativeTypedef1 i, + ) { + return _a_func3( + i, + ); + } + + late final _a_func3Ptr = + _lookup>( + 'a_func3'); + late final _a_func3 = + _a_func3Ptr.asFunction(); + + void a_func4( + imp1.DartBaseNativeTypedef1 i, + ) { + return _a_func4( + i, + ); + } + + late final _a_func4Ptr = + _lookup>( + 'a_func4'); + late final _a_func4 = + _a_func4Ptr.asFunction(); + + void a_func5( + imp1.DartBaseNativeTypedef1 i, + ) { + return _a_func5( + i, + ); + } + + late final _a_func5Ptr = + _lookup>( + 'a_func5'); + late final _a_func5 = + _a_func5Ptr.asFunction(); } final class A_Struct1 extends ffi.Struct { diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart index 729765a92..224400fd1 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_gen.dart @@ -59,15 +59,25 @@ final class BaseUnion2 extends ffi.Union { external int a; } +typedef BaseTypedef1 = BaseStruct1; +typedef BaseTypedef2 = BaseStruct2; +typedef BaseNativeTypedef1 = ffi.Int; +typedef DartBaseNativeTypedef1 = int; +typedef BaseNativeTypedef2 = BaseNativeTypedef1; +typedef BaseNativeTypedef3 = BaseNativeTypedef2; + enum BaseEnum { BASE_ENUM_1(0), BASE_ENUM_2(1); final int value; const BaseEnum(this.value); -} -typedef BaseTypedef1 = BaseStruct1; -typedef BaseTypedef2 = BaseStruct2; + static BaseEnum fromValue(int value) => switch (value) { + 0 => BASE_ENUM_1, + 1 => BASE_ENUM_2, + _ => throw ArgumentError("Unknown value for BaseEnum: $value"), + }; +} const int BASE_MACRO_1 = 1; diff --git a/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml b/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml index ad455faa4..4d9ef56a5 100644 --- a/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml +++ b/pkgs/ffigen/example/shared_bindings/lib/generated/base_symbols.yaml @@ -16,6 +16,15 @@ files: name: BaseUnion1 c:@U@BaseUnion2: name: BaseUnion2 + c:base.h@T@BaseNativeTypedef1: + name: BaseNativeTypedef1 + dart-name: DartBaseNativeTypedef1 + c:base.h@T@BaseNativeTypedef2: + name: BaseNativeTypedef2 + dart-name: DartBaseNativeTypedef1 + c:base.h@T@BaseNativeTypedef3: + name: BaseNativeTypedef3 + dart-name: DartBaseNativeTypedef1 c:base.h@T@BaseTypedef1: name: BaseTypedef1 c:base.h@T@BaseTypedef2: diff --git a/pkgs/ffigen/lib/src/code_generator/imports.dart b/pkgs/ffigen/lib/src/code_generator/imports.dart index a71bbf38a..046b2c5fe 100644 --- a/pkgs/ffigen/lib/src/code_generator/imports.dart +++ b/pkgs/ffigen/lib/src/code_generator/imports.dart @@ -45,8 +45,17 @@ class ImportedType extends Type { final String nativeType; final String? defaultValue; - ImportedType(this.libraryImport, this.cType, this.dartType, this.nativeType, - [this.defaultValue]); + /// Whether the [dartType] is an import from the [libraryImport]. + final bool importedDartType; + + ImportedType( + this.libraryImport, + this.cType, + this.dartType, + this.nativeType, { + this.defaultValue, + this.importedDartType = false, + }); @override String getCType(Writer w) { @@ -55,7 +64,14 @@ class ImportedType extends Type { } @override - String getFfiDartType(Writer w) => cType == dartType ? getCType(w) : dartType; + String getFfiDartType(Writer w) { + if (importedDartType) { + w.markImportUsed(libraryImport); + return '${libraryImport.prefix}.$dartType'; + } else { + return cType == dartType ? getCType(w) : dartType; + } + } @override String getNativeType({String varName = ''}) => '$nativeType $varName'; @@ -107,30 +123,42 @@ final self = LibraryImport('self', ''); final voidType = ImportedType(ffiImport, 'Void', 'void', 'void'); -final unsignedCharType = - ImportedType(ffiImport, 'UnsignedChar', 'int', 'unsigned char', '0'); +final unsignedCharType = ImportedType( + ffiImport, 'UnsignedChar', 'int', 'unsigned char', + defaultValue: '0'); final signedCharType = - ImportedType(ffiImport, 'SignedChar', 'int', 'char', '0'); -final charType = ImportedType(ffiImport, 'Char', 'int', 'char', '0'); -final unsignedShortType = - ImportedType(ffiImport, 'UnsignedShort', 'int', 'unsigned short', '0'); -final shortType = ImportedType(ffiImport, 'Short', 'int', 'short', '0'); -final unsignedIntType = - ImportedType(ffiImport, 'UnsignedInt', 'int', 'unsigned', '0'); -final intType = ImportedType(ffiImport, 'Int', 'int', 'int', '0'); -final unsignedLongType = - ImportedType(ffiImport, 'UnsignedLong', 'int', 'unsigned long', '0'); -final longType = ImportedType(ffiImport, 'Long', 'int', 'long', '0'); + ImportedType(ffiImport, 'SignedChar', 'int', 'char', defaultValue: '0'); +final charType = + ImportedType(ffiImport, 'Char', 'int', 'char', defaultValue: '0'); +final unsignedShortType = ImportedType( + ffiImport, 'UnsignedShort', 'int', 'unsigned short', + defaultValue: '0'); +final shortType = + ImportedType(ffiImport, 'Short', 'int', 'short', defaultValue: '0'); +final unsignedIntType = ImportedType( + ffiImport, 'UnsignedInt', 'int', 'unsigned', + defaultValue: '0'); +final intType = ImportedType(ffiImport, 'Int', 'int', 'int', defaultValue: '0'); +final unsignedLongType = ImportedType( + ffiImport, 'UnsignedLong', 'int', 'unsigned long', + defaultValue: '0'); +final longType = + ImportedType(ffiImport, 'Long', 'int', 'long', defaultValue: '0'); final unsignedLongLongType = ImportedType( - ffiImport, 'UnsignedLongLong', 'int', 'unsigned long long', '0'); + ffiImport, 'UnsignedLongLong', 'int', 'unsigned long long', + defaultValue: '0'); final longLongType = - ImportedType(ffiImport, 'LongLong', 'int', 'long long', '0'); + ImportedType(ffiImport, 'LongLong', 'int', 'long long', defaultValue: '0'); -final floatType = ImportedType(ffiImport, 'Float', 'double', 'float', '0.0'); -final doubleType = ImportedType(ffiImport, 'Double', 'double', 'double', '0.0'); +final floatType = + ImportedType(ffiImport, 'Float', 'double', 'float', defaultValue: '0.0'); +final doubleType = + ImportedType(ffiImport, 'Double', 'double', 'double', defaultValue: '0.0'); -final sizeType = ImportedType(ffiImport, 'Size', 'int', 'size_t', '0'); -final wCharType = ImportedType(ffiImport, 'WChar', 'int', 'wchar_t', '0'); +final sizeType = + ImportedType(ffiImport, 'Size', 'int', 'size_t', defaultValue: '0'); +final wCharType = + ImportedType(ffiImport, 'WChar', 'int', 'wchar_t', defaultValue: '0'); final objCObjectType = ImportedType(objcPkgImport, 'ObjCObject', 'ObjCObject', 'void'); diff --git a/pkgs/ffigen/lib/src/code_generator/typealias.dart b/pkgs/ffigen/lib/src/code_generator/typealias.dart index 739e00d47..aa5110eb7 100644 --- a/pkgs/ffigen/lib/src/code_generator/typealias.dart +++ b/pkgs/ffigen/lib/src/code_generator/typealias.dart @@ -19,7 +19,7 @@ import 'writer.dart'; class Typealias extends BindingType { final Type type; String? _ffiDartAliasName; - String? _dartAliasName; + String? dartAliasName; /// Creates a Typealias. /// @@ -75,7 +75,7 @@ class Typealias extends BindingType { bool genFfiDartType = false, super.isInternal, }) : _ffiDartAliasName = genFfiDartType ? 'Dart$name' : null, - _dartAliasName = + dartAliasName = (!genFfiDartType && type is! Typealias && !type.sameDartAndCType) ? 'Dart$name' : null, @@ -95,8 +95,8 @@ class Typealias extends BindingType { if (_ffiDartAliasName != null) { _ffiDartAliasName = w.topLevelUniqueNamer.makeUnique(_ffiDartAliasName!); } - if (_dartAliasName != null) { - _dartAliasName = w.topLevelUniqueNamer.makeUnique(_dartAliasName!); + if (dartAliasName != null) { + dartAliasName = w.topLevelUniqueNamer.makeUnique(dartAliasName!); } final sb = StringBuffer(); @@ -107,8 +107,8 @@ class Typealias extends BindingType { if (_ffiDartAliasName != null) { sb.write('typedef $_ffiDartAliasName = ${type.getFfiDartType(w)};\n'); } - if (_dartAliasName != null) { - sb.write('typedef $_dartAliasName = ${type.getDartType(w)};\n'); + if (dartAliasName != null) { + sb.write('typedef $dartAliasName = ${type.getDartType(w)};\n'); } return BindingString( type: BindingStringType.typeDef, string: sb.toString()); @@ -142,8 +142,8 @@ class Typealias extends BindingType { @override String getDartType(Writer w) { if (generateBindings) { - if (_dartAliasName != null) { - return _dartAliasName!; + if (dartAliasName != null) { + return dartAliasName!; } else if (type.sameDartAndCType) { return getFfiDartType(w); } diff --git a/pkgs/ffigen/lib/src/code_generator/writer.dart b/pkgs/ffigen/lib/src/code_generator/writer.dart index 338d8b3eb..65537720f 100644 --- a/pkgs/ffigen/lib/src/code_generator/writer.dart +++ b/pkgs/ffigen/lib/src/code_generator/writer.dart @@ -390,13 +390,26 @@ class Writer { strings.ffiNative: usesFfiNative, }, strings.symbols: { - for (final b in bindings) b.usr: {strings.name: b.name}, + for (final b in bindings) b.usr: _makeSymbolMapValue(b), }, }, }, }; } + Map _makeSymbolMapValue(Binding b) { + final dartName = b is Typealias ? getTypedefDartAliasName(b) : null; + return { + strings.name: b.name, + if (dartName != null) strings.dartName: dartName, + }; + } + + String? getTypedefDartAliasName(Type b) { + if (b is! Typealias) return null; + return b.dartAliasName ?? getTypedefDartAliasName(b.type); + } + static String _objcImport(String entryPoint, String outDir) { final frameworkHeader = parseObjCFrameworkHeader(entryPoint); diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart index c76bec386..646d737f6 100644 --- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart +++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart @@ -58,8 +58,10 @@ void loadImportedTypes(YamlMap fileConfig, for (final key in symbols.keys) { final usr = key as String; final value = symbols[usr]! as YamlMap; - final name = value['name'] as String; - usrTypeMappings[usr] = ImportedType(libraryImport, name, name, name); + final name = value[strings.name] as String; + final dartName = (value[strings.dartName] as String?) ?? name; + usrTypeMappings[usr] = ImportedType(libraryImport, name, dartName, name, + importedDartType: true); } } diff --git a/pkgs/ffigen/lib/src/strings.dart b/pkgs/ffigen/lib/src/strings.dart index 3dbb936ef..c6e1c65aa 100644 --- a/pkgs/ffigen/lib/src/strings.dart +++ b/pkgs/ffigen/lib/src/strings.dart @@ -170,6 +170,7 @@ const formatVersion = 'format_version'; const symbolFileFormatVersion = '1.0.0'; const files = 'files'; const usedConfig = 'used-config'; +const dartName = 'dart-name'; const import = 'import'; const defaultSymbolFileImportPrefix = 'imp'; From 49ce69089af88eb2bcc351d221e7644fb9da7219 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Thu, 12 Dec 2024 03:38:29 +0100 Subject: [PATCH 44/50] [jnigen] Run object default methods for interfaces (#1804) Closes #1801 --- pkgs/jni/CHANGELOG.md | 2 + .../dart_lang/jni/PortProxyBuilder.java | 21 ++++++++ .../runtime_test_registrant.dart | 51 +++++++++++-------- 3 files changed, 53 insertions(+), 21 deletions(-) diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 6de5b92dd..9458b1645 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -10,6 +10,8 @@ them in a for-loop or use methods such as `map` on them. - Added nullable type classes for all Java objects. +- Fixed a problem where interfaces implemented in Dart would crash when calling + the default object methods: `equals`, `hashCode`, and `toString`. ## 0.12.2 diff --git a/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java b/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java index 2f70b2b5d..178d25115 100644 --- a/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java +++ b/pkgs/jni/java/src/main/java/com/github/dart_lang/jni/PortProxyBuilder.java @@ -9,8 +9,20 @@ public class PortProxyBuilder implements InvocationHandler { private static final PortCleaner cleaner = new PortCleaner(); + private static final Method equals; + private static final Method hashCode; + private static final Method toString; static { + Class object = Object.class; + try { + equals = object.getDeclaredMethod("equals", object); + hashCode = object.getDeclaredMethod("hashCode"); + toString = object.getDeclaredMethod("toString"); + } catch (NoSuchMethodException e) { + // Never happens. + throw new Error(); + } System.loadLibrary("dartjni"); } @@ -115,6 +127,15 @@ private static native Object[] _invoke( @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + if (method.equals(equals)) { + return proxy == args[0]; + } + if (method.equals(hashCode)) { + return System.identityHashCode(proxy); + } + if (method.equals(toString)) { + return proxy.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(proxy)); + } DartImplementation implementation = implementations.get(method.getDeclaringClass().getName()); String descriptor = getDescriptor(method); boolean isBlocking = !asyncMethods.contains(descriptor); diff --git a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart index 1344d88f0..b410005a2 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart @@ -33,6 +33,15 @@ void _runJavaGC() { } while (result.exitCode != 0); } +Future _waitUntil(bool Function() predicate) async { + for (var i = 0; i < 8; ++i) { + await Future.delayed(Duration(milliseconds: (1 << i) * 100)); + if (predicate()) { + return; + } + } +} + void registerTests(String groupName, TestRunnerCallback test) { group(groupName, () { test('static final fields - int', () { @@ -636,14 +645,7 @@ void registerTests(String groupName, TestRunnerCallback test) { // Running garbage collection does not work on Android. Skipping this // test for android. _runJavaGC(); - for (var i = 0; i < 8; ++i) { - await Future.delayed(Duration(milliseconds: (1 << i) * 100)); - if (MyInterface.$impls.isEmpty) { - break; - } - } - // Since the interface is now deleted, the cleaner must signal to Dart - // to clean up. + await _waitUntil(() => MyInterface.$impls.isEmpty); expect(MyInterface.$impls, isEmpty); } }); @@ -688,12 +690,7 @@ void registerTests(String groupName, TestRunnerCallback test) { // Running garbage collection does not work on Android. Skipping this // test for android. _runJavaGC(); - for (var i = 0; i < 8; ++i) { - await Future.delayed(Duration(milliseconds: (1 << i) * 100)); - if (MyInterface.$impls.isEmpty) { - break; - } - } + await _waitUntil(() => MyInterface.$impls.isEmpty); // Since the interface is now deleted, the cleaner must signal to Dart // to clean up. expect(MyInterface.$impls, isEmpty); @@ -741,19 +738,31 @@ void registerTests(String groupName, TestRunnerCallback test) { // Running garbage collection does not work on Android. Skipping // this test for android. _runJavaGC(); - for (var i = 0; i < 8; ++i) { - await Future.delayed( - Duration(milliseconds: (1 << i) * 100)); - if (MyInterface.$impls.isEmpty) { - break; - } - } + await _waitUntil(() => MyInterface.$impls.isEmpty); // Since the interface is now deleted, the cleaner must signal to // Dart to clean up. expect(MyRunnable.$impls, isEmpty); } }); } + test('Object methods work', () async { + final runnable = MyRunnable.implement($MyRunnable( + run: () {}, + )); + expect(runnable == runnable, true); + expect(runnable != runnable, false); + expect(runnable.hashCode, runnable.hashCode); + expect(runnable.toString(), runnable.toString()); + expect(MyRunnable.$impls, hasLength(1)); + runnable.release(); + if (!Platform.isAndroid) { + // Running garbage collection does not work on Android. Skipping + // this test for android. + _runJavaGC(); + await _waitUntil(() => MyInterface.$impls.isEmpty); + expect(MyRunnable.$impls, isEmpty); + } + }); } group('Dart exceptions are handled', () { for (final exception in [UnimplementedError(), 'Hello!']) { From 4d81ce6c5e17164ef63d8a3f5144e5def0702207 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Thu, 12 Dec 2024 04:17:36 +0100 Subject: [PATCH 45/50] Rename top-level Kotlin functions and properties correctly (#1807) Closes #1658 --- pkgs/jnigen/lib/src/bindings/renamer.dart | 11 ++- .../test/kotlin_test/bindings/kotlin.dart | 74 +++++++++++++++++++ .../dart_lang/jnigen/subpackage/TopLevel.kt | 14 ++++ .../kotlin_test/runtime_test_registrant.dart | 4 + 4 files changed, 99 insertions(+), 4 deletions(-) create mode 100644 pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/subpackage/TopLevel.kt diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index 2020a5cf9..572a2eb96 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart @@ -155,7 +155,7 @@ class Renamer implements Visitor { class _ClassRenamer implements Visitor { final Config config; final Set renamed; - final Map classNameCounts = {}; + final Map topLevelNameCounts = {}; final Map> nameCounts = {}; _ClassRenamer( @@ -192,7 +192,7 @@ class _ClassRenamer implements Visitor { final uniquifyName = config.outputConfig.dartConfig.structure == OutputStructure.singleFile; node.finalName = uniquifyName - ? _renameConflict(classNameCounts, className, _ElementKind.klass) + ? _renameConflict(topLevelNameCounts, className, _ElementKind.klass) : className; node.typeClassName = '\$${node.finalName}\$Type'; node.nullableTypeClassName = '\$${node.finalName}\$NullableType'; @@ -201,14 +201,17 @@ class _ClassRenamer implements Visitor { // Rename fields before renaming methods. In case a method and a field have // identical names, the field will keep its original name and the // method will be renamed. - final fieldRenamer = _FieldRenamer(config, nameCounts[node]!); + final fieldRenamer = _FieldRenamer( + config, + uniquifyName && node.isTopLevel ? topLevelNameCounts : nameCounts[node]!, + ); for (final field in node.fields) { field.accept(fieldRenamer); } final methodRenamer = _MethodRenamer( config, - nameCounts[node]!, + uniquifyName && node.isTopLevel ? topLevelNameCounts : nameCounts[node]!, ); for (final method in node.methods) { method.accept(methodRenamer); diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index 2d8ea9bc6..6b1ab86c6 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -2396,3 +2396,77 @@ int topLevelSum( _id_topLevelSum as jni$_.JMethodIDPtr, i, i1) .integer; } + +final _TopLevelKt$1Class = + jni$_.JClass.forName(r'com/github/dart_lang/jnigen/subpackage/TopLevelKt'); + +final _id_getTopLevelField$1 = _TopLevelKt$1Class.staticMethodId( + r'getTopLevelField', + r'()I', +); + +final _getTopLevelField$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + +/// from: `static public final int getTopLevelField()` +int getTopLevelField$1() { + return _getTopLevelField$1(_TopLevelKt$1Class.reference.pointer, + _id_getTopLevelField$1 as jni$_.JMethodIDPtr) + .integer; +} + +final _id_setTopLevelField$1 = _TopLevelKt$1Class.staticMethodId( + r'setTopLevelField', + r'(I)V', +); + +final _setTopLevelField$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( + 'globalEnv_CallStaticVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + +/// from: `static public final void setTopLevelField(int i)` +void setTopLevelField$1( + int i, +) { + _setTopLevelField$1(_TopLevelKt$1Class.reference.pointer, + _id_setTopLevelField$1 as jni$_.JMethodIDPtr, i) + .check(); +} + +final _id_topLevel$1 = _TopLevelKt$1Class.staticMethodId( + r'topLevel', + r'()I', +); + +final _topLevel$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + +/// from: `static public final int topLevel()` +int topLevel$1() { + return _topLevel$1(_TopLevelKt$1Class.reference.pointer, + _id_topLevel$1 as jni$_.JMethodIDPtr) + .integer; +} diff --git a/pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/subpackage/TopLevel.kt b/pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/subpackage/TopLevel.kt new file mode 100644 index 000000000..6505f8715 --- /dev/null +++ b/pkgs/jnigen/test/kotlin_test/kotlin/src/main/kotlin/com/github/dart_lang/jnigen/subpackage/TopLevel.kt @@ -0,0 +1,14 @@ +/* Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file + * for details. All rights reserved. Use of this source code is governed by a + * BSD-style license that can be found in the LICENSE file. + */ + +package com.github.dart_lang.jnigen.subpackage + +// The same property and function defined in `../TopLevel.kt` to test renaming. + +var topLevelField: Int = 42 + +fun topLevel(): Int { + return 42 +} diff --git a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart index d946df915..827579ec5 100644 --- a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart @@ -24,10 +24,14 @@ void registerTests(String groupName, TestRunnerCallback test) { test('Top levels', () { expect(topLevel(), 42); + expect(topLevel$1(), 42); expect(topLevelSum(10, 20), 30); expect(getTopLevelField(), 42); + expect(getTopLevelField$1(), 42); setTopLevelField(30); + setTopLevelField$1(30); expect(getTopLevelField(), 30); + expect(getTopLevelField$1(), 30); }); test('Generics', () { From b86e34d518033c55e141ffd47e489aa6c45352a7 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 12 Dec 2024 17:10:36 +0100 Subject: [PATCH 46/50] [native_assets_cli] Make `CCompilerConfig` fields less nullable (#1809) Addressing: * https://github.com/dart-lang/native/issues/1738#issuecomment-2535959430 Currently on Flutter and the Dart CI provide this information, and they always provide all 3. So this should not be a breaking change on the protocol level. It is a breaking change on the API level. --- .../test/build_runner/helpers.dart | 12 +++---- pkgs/native_assets_builder/test/helpers.dart | 16 +++++---- .../src/code_assets/c_compiler_config.dart | 24 +++++++------- .../lib/src/code_assets/config.dart | 4 +-- .../lib/src/code_assets/validation.dart | 33 ++++++++++--------- .../test/code_assets/config_test.dart | 10 +++--- pkgs/native_assets_cli/test/helpers.dart | 16 +++++---- .../lib/src/cbuilder/compiler_resolver.dart | 10 +++--- .../test/cbuilder/compiler_resolver_test.dart | 4 +-- pkgs/native_toolchain_c/test/helpers.dart | 16 +++++---- 10 files changed, 74 insertions(+), 71 deletions(-) diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index 6be66afea..432b5dade 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -299,17 +299,13 @@ final CCompilerConfig? dartCICompilerConfig = (() { .toList(); final hasEnvScriptArgs = envScriptArgs != null && envScriptArgs.isNotEmpty; - if (cc != null || - ar != null || - ld != null || - envScript != null || - hasEnvScriptArgs) { + if (cc != null && ar != null && ld != null) { return CCompilerConfig( - archiver: ar != null ? Uri.file(ar) : null, - compiler: cc != null ? Uri.file(cc) : null, + archiver: Uri.file(ar), + compiler: Uri.file(cc), envScript: envScript != null ? Uri.file(envScript) : null, envScriptArgs: hasEnvScriptArgs ? envScriptArgs : null, - linker: ld != null ? Uri.file(ld) : null, + linker: Uri.file(ld), ); } return null; diff --git a/pkgs/native_assets_builder/test/helpers.dart b/pkgs/native_assets_builder/test/helpers.dart index ba864da71..0242bcd06 100644 --- a/pkgs/native_assets_builder/test/helpers.dart +++ b/pkgs/native_assets_builder/test/helpers.dart @@ -161,13 +161,15 @@ final List? _envScriptArgs = Platform /// Configuration for the native toolchain. /// /// Provided on Dart CI. -final cCompiler = CCompilerConfig( - compiler: _cc, - archiver: _ar, - linker: _ld, - envScript: _envScript, - envScriptArgs: _envScriptArgs, -); +final cCompiler = (_cc == null || _ar == null || _ld == null) + ? null + : CCompilerConfig( + compiler: _cc!, + archiver: _ar!, + linker: _ld!, + envScript: _envScript, + envScriptArgs: _envScriptArgs, + ); extension on String { Uri asFileUri() => Uri.file(this); diff --git a/pkgs/native_assets_cli/lib/src/code_assets/c_compiler_config.dart b/pkgs/native_assets_cli/lib/src/code_assets/c_compiler_config.dart index 9c23236a2..32384f282 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/c_compiler_config.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/c_compiler_config.dart @@ -10,13 +10,13 @@ import '../utils/map.dart'; /// The configuration for a C toolchain. final class CCompilerConfig { /// Path to a C compiler. - late final Uri? compiler; + late final Uri compiler; /// Path to a native linker. - late final Uri? linker; + late final Uri linker; /// Path to a native archiver. - late final Uri? archiver; + late final Uri archiver; /// Path to script that sets environment variables for [compiler], [linker], /// and [archiver]. @@ -27,9 +27,9 @@ final class CCompilerConfig { /// Constructs a new [CCompilerConfig] based on the given toolchain tools. CCompilerConfig({ - this.archiver, - this.compiler, - this.linker, + required this.archiver, + required this.compiler, + required this.linker, this.envScript, this.envScriptArgs, }); @@ -40,11 +40,11 @@ final class CCompilerConfig { /// [CCompilerConfig.toJson]. factory CCompilerConfig.fromJson(Map json) => CCompilerConfig( - archiver: json.optionalPath(_arConfigKey), - compiler: json.optionalPath(_ccConfigKey), + archiver: json.path(_arConfigKey), + compiler: json.path(_ccConfigKey), envScript: json.optionalPath(_envScriptConfigKey), envScriptArgs: json.optionalStringList(_envScriptArgsConfigKey), - linker: json.optionalPath(_ldConfigKey), + linker: json.path(_ldConfigKey), ); /// The json representation of this [CCompilerConfig]. @@ -52,9 +52,9 @@ final class CCompilerConfig { /// The returned json can be used in [CCompilerConfig.fromJson] to /// obtain a [CCompilerConfig] again. Map toJson() => { - if (archiver != null) _arConfigKey: archiver!.toFilePath(), - if (compiler != null) _ccConfigKey: compiler!.toFilePath(), - if (linker != null) _ldConfigKey: linker!.toFilePath(), + _arConfigKey: archiver.toFilePath(), + _ccConfigKey: compiler.toFilePath(), + _ldConfigKey: linker.toFilePath(), if (envScript != null) _envScriptConfigKey: envScript!.toFilePath(), if (envScriptArgs != null) _envScriptArgsConfigKey: envScriptArgs!, }.sortOnKey(); diff --git a/pkgs/native_assets_cli/lib/src/code_assets/config.dart b/pkgs/native_assets_cli/lib/src/code_assets/config.dart index 6f749a106..9ae1fe9f4 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/config.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/config.dart @@ -42,7 +42,7 @@ class CodeConfig { final Architecture? _targetArchitecture; final LinkModePreference linkModePreference; - final CCompilerConfig cCompiler; + final CCompilerConfig? cCompiler; final int? targetIOSVersion; final int? targetMacOSVersion; final int? targetAndroidNdkApi; @@ -62,7 +62,7 @@ class CodeConfig { targetOS = OS.fromString(config.json.string(_targetOSConfigKey)), cCompiler = switch (config.json.optionalMap(_compilerKey)) { final Map map => CCompilerConfig.fromJson(map), - null => CCompilerConfig(), + null => null, }, targetIOSVersion = config.json.optionalInt(_targetIOSVersionKey), targetMacOSVersion = config.json.optionalInt(_targetMacOSVersionKey), diff --git a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart index b01dcc559..40b17f8ec 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart @@ -53,21 +53,24 @@ ValidationErrors _validateCodeConfig( break; } final compilerConfig = codeConfig.cCompiler; - final compiler = compilerConfig.compiler?.toFilePath(); - if (compiler != null && !File(compiler).existsSync()) { - errors.add('$configName.codeConfig.compiler ($compiler) does not exist.'); - } - final linker = compilerConfig.linker?.toFilePath(); - if (linker != null && !File(linker).existsSync()) { - errors.add('$configName.codeConfig.linker ($linker) does not exist.'); - } - final archiver = compilerConfig.archiver?.toFilePath(); - if (archiver != null && !File(archiver).existsSync()) { - errors.add('$configName.codeConfig.archiver ($archiver) does not exist.'); - } - final envScript = compilerConfig.envScript?.toFilePath(); - if (envScript != null && !File(envScript).existsSync()) { - errors.add('$configName.codeConfig.envScript ($envScript) does not exist.'); + if (compilerConfig != null) { + final compiler = compilerConfig.compiler.toFilePath(); + if (!File(compiler).existsSync()) { + errors.add('$configName.codeConfig.compiler ($compiler) does not exist.'); + } + final linker = compilerConfig.linker.toFilePath(); + if (!File(linker).existsSync()) { + errors.add('$configName.codeConfig.linker ($linker) does not exist.'); + } + final archiver = compilerConfig.archiver.toFilePath(); + if (!File(archiver).existsSync()) { + errors.add('$configName.codeConfig.archiver ($archiver) does not exist.'); + } + final envScript = compilerConfig.envScript?.toFilePath(); + if (envScript != null && !File(envScript).existsSync()) { + errors + .add('$configName.codeConfig.envScript ($envScript) does not exist.'); + } } return errors; } diff --git a/pkgs/native_assets_cli/test/code_assets/config_test.dart b/pkgs/native_assets_cli/test/code_assets/config_test.dart index fe7943afa..74ce351d3 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -55,9 +55,7 @@ void main() async { expect(() => codeConfig.targetArchitecture, throwsStateError); expect(codeConfig.targetAndroidNdkApi, null); expect(codeConfig.linkModePreference, LinkModePreference.preferStatic); - expect(codeConfig.cCompiler.compiler, null); - expect(codeConfig.cCompiler.linker, null); - expect(codeConfig.cCompiler.archiver, null); + expect(codeConfig.cCompiler, null); } void expectCorrectCodeConfig( @@ -81,9 +79,9 @@ void main() async { expect(codeConfig.targetArchitecture, Architecture.arm64); expect(codeConfig.targetAndroidNdkApi, 30); expect(codeConfig.linkModePreference, LinkModePreference.preferStatic); - expect(codeConfig.cCompiler.compiler, fakeClang); - expect(codeConfig.cCompiler.linker, fakeLd); - expect(codeConfig.cCompiler.archiver, fakeAr); + expect(codeConfig.cCompiler?.compiler, fakeClang); + expect(codeConfig.cCompiler?.linker, fakeLd); + expect(codeConfig.cCompiler?.archiver, fakeAr); } test('BuildConfig.codeConfig (dry-run)', () { diff --git a/pkgs/native_assets_cli/test/helpers.dart b/pkgs/native_assets_cli/test/helpers.dart index 6fbc01635..cdd9c5d2b 100644 --- a/pkgs/native_assets_cli/test/helpers.dart +++ b/pkgs/native_assets_cli/test/helpers.dart @@ -115,13 +115,15 @@ final List? _envScriptArgs = Platform /// Configuration for the native toolchain. /// /// Provided on Dart CI. -final cCompiler = CCompilerConfig( - compiler: _cc, - archiver: _ar, - linker: _ld, - envScript: _envScript, - envScriptArgs: _envScriptArgs, -); +final cCompiler = (_cc == null || _ar == null || _ld == null) + ? null + : CCompilerConfig( + compiler: _cc!, + archiver: _ar!, + linker: _ld!, + envScript: _envScript, + envScriptArgs: _envScriptArgs, + ); extension on String { Uri asFileUri() => Uri.file(this); diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart index 3e4854764..e329435eb 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/compiler_resolver.dart @@ -99,7 +99,7 @@ class CompilerResolver { } Future _tryLoadCompilerFromConfig() async { - final configCcUri = codeConfig.cCompiler.compiler; + final configCcUri = codeConfig.cCompiler?.compiler; if (configCcUri != null) { assert(await File.fromUri(configCcUri).exists()); logger?.finer('Using compiler ${configCcUri.toFilePath()} ' @@ -184,7 +184,7 @@ class CompilerResolver { } Future _tryLoadArchiverFromConfig() async { - final configArUri = codeConfig.cCompiler.archiver; + final configArUri = codeConfig.cCompiler?.archiver; if (configArUri != null) { assert(await File.fromUri(configArUri).exists()); logger?.finer('Using archiver ${configArUri.toFilePath()} ' @@ -197,7 +197,7 @@ class CompilerResolver { } Future toolchainEnvironmentScript(ToolInstance compiler) async { - final fromConfig = codeConfig.cCompiler.envScript; + final fromConfig = codeConfig.cCompiler?.envScript; if (fromConfig != null) { logger?.fine('Using envScript from config: $fromConfig'); return fromConfig; @@ -211,7 +211,7 @@ class CompilerResolver { } List? toolchainEnvironmentScriptArguments() { - final fromConfig = codeConfig.cCompiler.envScriptArgs; + final fromConfig = codeConfig.cCompiler?.envScriptArgs; if (fromConfig != null) { logger?.fine('Using envScriptArgs from config: $fromConfig'); return fromConfig; @@ -245,7 +245,7 @@ class CompilerResolver { } Future _tryLoadLinkerFromConfig() async { - final configLdUri = codeConfig.cCompiler.linker; + final configLdUri = codeConfig.cCompiler?.linker; if (configLdUri != null) { assert(await File.fromUri(configLdUri).exists()); logger?.finer('Using linker ${configLdUri.toFilePath()} ' diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index 929312368..8578f2893 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -71,8 +71,8 @@ void main() { CompilerResolver(codeConfig: buildConfig.codeConfig, logger: logger); final compiler = await resolver.resolveCompiler(); final archiver = await resolver.resolveArchiver(); - expect(compiler.uri, buildConfig.codeConfig.cCompiler.compiler); - expect(archiver.uri, buildConfig.codeConfig.cCompiler.archiver); + expect(compiler.uri, buildConfig.codeConfig.cCompiler?.compiler); + expect(archiver.uri, buildConfig.codeConfig.cCompiler?.archiver); }); test('No compiler found', () async { diff --git a/pkgs/native_toolchain_c/test/helpers.dart b/pkgs/native_toolchain_c/test/helpers.dart index ac5a51034..b2c647259 100644 --- a/pkgs/native_toolchain_c/test/helpers.dart +++ b/pkgs/native_toolchain_c/test/helpers.dart @@ -155,13 +155,15 @@ final List? _envScriptArgs = Platform /// Configuration for the native toolchain. /// /// Provided on Dart CI. -final cCompiler = CCompilerConfig( - compiler: _cc, - archiver: _ar, - linker: _ld, - envScript: _envScript, - envScriptArgs: _envScriptArgs, -); +final cCompiler = (_cc == null || _ar == null || _ld == null) + ? null + : CCompilerConfig( + compiler: _cc!, + archiver: _ar!, + linker: _ld!, + envScript: _envScript, + envScriptArgs: _envScriptArgs, + ); extension on String { Uri asFileUri() => Uri.file(this); From a70c1a2f97958e27d8cd725538f33929a86407d3 Mon Sep 17 00:00:00 2001 From: Hossein Yousefi Date: Sun, 15 Dec 2024 23:35:39 +0100 Subject: [PATCH 47/50] [jnigen][jni] 0.13.0 (#1812) --- pkgs/jni/CHANGELOG.md | 2 +- pkgs/jni/pubspec.yaml | 2 +- pkgs/jnigen/CHANGELOG.md | 2 +- pkgs/jnigen/pubspec.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 9458b1645..db31af1ea 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.13.0-wip +## 0.13.0 - **Breaking Change**: Separated primitive arrays from object arrays. Previously, a primitive array like an array of bytes was typed diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index 23ac046ba..dfabbfd1d 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml @@ -4,7 +4,7 @@ name: jni description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. -version: 0.13.0-wip +version: 0.13.0 repository: https://github.com/dart-lang/native/tree/main/pkgs/jni issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajni diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index a1838deaf..e187a40d3 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md @@ -1,4 +1,4 @@ -## 0.13.0-wip +## 0.13.0 - **Breaking Change**([#1516](https://github.com/dart-lang/native/issues/1516)): Inner classes are now generated as `OuterClass$InnerClass`. diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index 4585b5feb..00accf350 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml @@ -4,7 +4,7 @@ name: jnigen description: A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. -version: 0.13.0-wip +version: 0.13.0 repository: https://github.com/dart-lang/native/tree/main/pkgs/jnigen issue_tracker: https://github.com/dart-lang/native/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajnigen From f2a0e28dca61bb37fac6b352db9ade98f45deb6b Mon Sep 17 00:00:00 2001 From: nikeokoronkwo <150845642+nikeokoronkwo@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:22:48 -0500 Subject: [PATCH 48/50] [swift2objc] Filtering Support (#1730) --- pkgs/swift2objc/lib/src/config.dart | 23 +- pkgs/swift2objc/lib/src/generate_wrapper.dart | 4 +- .../parser/parsers/parse_declarations.dart | 1 + .../src/transformer/_core/dependencies.dart | 259 ++++++++++++++++++ .../lib/src/transformer/transform.dart | 26 +- pkgs/swift2objc/test/unit/filter_test.dart | 116 ++++++++ .../test/unit/filter_test_input.swift | 135 +++++++++ .../test/unit/filter_test_output_a.swift | 33 +++ .../test/unit/filter_test_output_b.swift | 230 ++++++++++++++++ .../test/unit/filter_test_output_c.swift | 4 + pkgs/swift2objc/test/utils/utils.dart | 8 + 11 files changed, 826 insertions(+), 13 deletions(-) create mode 100644 pkgs/swift2objc/lib/src/transformer/_core/dependencies.dart create mode 100644 pkgs/swift2objc/test/unit/filter_test.dart create mode 100644 pkgs/swift2objc/test/unit/filter_test_input.swift create mode 100644 pkgs/swift2objc/test/unit/filter_test_output_a.swift create mode 100644 pkgs/swift2objc/test/unit/filter_test_output_b.swift create mode 100644 pkgs/swift2objc/test/unit/filter_test_output_c.swift create mode 100644 pkgs/swift2objc/test/utils/utils.dart diff --git a/pkgs/swift2objc/lib/src/config.dart b/pkgs/swift2objc/lib/src/config.dart index 2f05353c2..30847e745 100644 --- a/pkgs/swift2objc/lib/src/config.dart +++ b/pkgs/swift2objc/lib/src/config.dart @@ -1,5 +1,7 @@ import 'package:path/path.dart' as path; +import 'ast/_core/interfaces/declaration.dart'; + const defaultTempDirPrefix = 'swift2objc_temp_'; const symbolgraphFileSuffix = '.symbols.json'; @@ -32,12 +34,21 @@ class Config { /// intermediate files after generating the wrapper. final Uri? tempDir; - const Config({ - required this.input, - required this.outputFile, - this.tempDir, - this.preamble, - }); + /// Filter function to filter APIs + /// + /// APIs can be filtered by name + /// + /// Includes all declarations by default + final bool Function(Declaration declaration) include; + + static bool _defaultInclude(_) => true; + + const Config( + {required this.input, + required this.outputFile, + this.tempDir, + this.preamble, + this.include = Config._defaultInclude}); } /// Used to specify the inputs in the `config` object. diff --git a/pkgs/swift2objc/lib/src/generate_wrapper.dart b/pkgs/swift2objc/lib/src/generate_wrapper.dart index 4ae8c7e51..bfe84aa70 100644 --- a/pkgs/swift2objc/lib/src/generate_wrapper.dart +++ b/pkgs/swift2objc/lib/src/generate_wrapper.dart @@ -46,8 +46,8 @@ Future generateWrapper(Config config) async { }; final declarations = parseAst(symbolgraphJson); - final transformedDeclarations = transform(declarations); - + final transformedDeclarations = + transform(declarations, filter: config.include); final wrapperCode = generate( transformedDeclarations, moduleName: sourceModule, diff --git a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart index 5036bba8d..36b74c4f4 100644 --- a/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart +++ b/pkgs/swift2objc/lib/src/parser/parsers/parse_declarations.dart @@ -25,6 +25,7 @@ List parseDeclarations(ParsedSymbolgraph symbolgraph) { return declarations.topLevelOnly; } +// TODO(https://github.com/dart-lang/native/issues/1815): Support for extensions Declaration parseDeclaration( ParsedSymbol parsedSymbol, ParsedSymbolgraph symbolgraph, diff --git a/pkgs/swift2objc/lib/src/transformer/_core/dependencies.dart b/pkgs/swift2objc/lib/src/transformer/_core/dependencies.dart new file mode 100644 index 000000000..30e693d88 --- /dev/null +++ b/pkgs/swift2objc/lib/src/transformer/_core/dependencies.dart @@ -0,0 +1,259 @@ +import '../../ast/_core/interfaces/declaration.dart'; +import '../../ast/_core/interfaces/enum_declaration.dart'; +import '../../ast/_core/interfaces/function_declaration.dart'; +import '../../ast/_core/interfaces/variable_declaration.dart'; +import '../../ast/_core/shared/parameter.dart'; +import '../../ast/_core/shared/referred_type.dart'; +import '../../ast/declarations/compounds/class_declaration.dart'; +import '../../ast/declarations/compounds/members/initializer_declaration.dart'; +import '../../ast/declarations/compounds/protocol_declaration.dart'; +import '../../ast/declarations/compounds/struct_declaration.dart'; + +// TODO(https://github.com/dart-lang/native/issues/1814): Type restrictions have not yet been implemented in system +class DependencyVisitor { + final Iterable declarations; + Set visitedDeclarations = {}; + + DependencyVisitor(this.declarations); + + Set visit(Declaration dec) { + final dependencies = {}; + + Iterable d = [dec]; + + while (true) { + final deps = d.fold>( + {}, (previous, element) => previous.union(visitDeclaration(element))); + final depDecls = declarations.where((d) => deps.contains(d.id)); + if (depDecls.isEmpty || + (dependencies.union(depDecls.toSet()).length) == + dependencies.length) { + break; + } else { + dependencies.addAll(depDecls); + d = depDecls; + } + } + + visitedDeclarations.addAll(dependencies); + + return dependencies; + } + + Set visitDeclaration(Declaration decl, [Set? context]) { + final cont = context ??= {}; + + // switch between declarations + if (decl is ClassDeclaration) { + visitClass(decl, cont); + } else if (decl is ProtocolDeclaration) { + visitProtocol(decl, cont); + } else if (decl is StructDeclaration) { + visitStruct(decl, cont); + } else if (decl is FunctionDeclaration) { + visitFunction(decl, cont); + } else if (decl is VariableDeclaration) { + visitVariable(decl, cont); + } else if (decl is EnumDeclaration) { + visitEnum(decl, cont); + } + + return cont; + } + + Set visitEnum(EnumDeclaration decl, [Set? context]) { + final cont = context ??= {}; + + // visit nested declarations + for (var n in decl.nestedDeclarations) { + visitDeclaration(n, cont); + } + + // visit protocols + for (var p in decl.conformedProtocols) { + visitProtocol(p.declaration, cont); + } + + // ensure generic types do not enter + cont.removeWhere( + (t) => decl.typeParams.map((type) => type.name).contains(t)); + + return cont; + } + + Set visitStruct(StructDeclaration decl, [Set? context]) { + final cont = context ??= {}; + + // visit variables + for (var d in decl.properties) { + visitVariable(d, cont); + } + + // visit methods + for (var m in decl.methods) { + visitFunction(m, cont); + } + + // visit initializers + for (var i in decl.initializers) { + visitInitializer(i, cont); + } + + // visit nested declarations + for (var n in decl.nestedDeclarations) { + visitDeclaration(n, cont); + } + + // visit protocols + for (var p in decl.conformedProtocols) { + visitProtocol(p.declaration, cont); + } + + // ensure generic types do not enter + cont.removeWhere( + (t) => decl.typeParams.map((type) => type.name).contains(t)); + + return cont; + } + + Set visitClass(ClassDeclaration decl, [Set? context]) { + final cont = context ??= {}; + + // visit variables + for (var d in decl.properties) { + visitVariable(d, cont); + } + + // visit methods + for (var m in decl.methods) { + visitFunction(m, cont); + } + + // visit initializers + for (var i in decl.initializers) { + visitInitializer(i, cont); + } + + // visit super if any + if (decl.superClass != null) { + visitDeclaration(decl.superClass!.declaration, cont); + } + + // visit nested declarations + for (var n in decl.nestedDeclarations) { + visitDeclaration(n, cont); + } + + // visit protocols + for (var p in decl.conformedProtocols) { + visitProtocol(p.declaration, cont); + } + + // ensure generic types do not enter + cont.removeWhere( + (t) => decl.typeParams.map((type) => type.name).contains(t)); + + return cont; + } + + Set visitProtocol(ProtocolDeclaration decl, [Set? context]) { + final cont = context ??= {}; + + // visit variables + for (var d in decl.properties) { + visitVariable(d, cont); + } + + // visit methods + for (var m in decl.methods) { + visitFunction(m, cont); + } + + // visit initializers + for (var i in decl.initializers) { + visitInitializer(i, cont); + } + + // visit nested declarations + for (var n in decl.nestedDeclarations) { + visitDeclaration(n, cont); + } + + // visit protocols + for (var p in decl.conformedProtocols) { + visitProtocol(p.declaration, cont); + } + + // ensure generic types do not enter + cont.removeWhere( + (t) => decl.typeParams.map((type) => type.name).contains(t)); + + return cont; + } + + Set visitInitializer(InitializerDeclaration decl, + [Set? context]) { + final cont = context ??= {}; + + // similar to `visitMethod`, except no return type + for (var p in decl.params) { + visitParameter(p, cont); + } + + return cont; + } + + Set visitFunction(FunctionDeclaration decl, [Set? context]) { + final cont = context ??= {}; + + // visit parameters + for (var p in decl.params) { + visitParameter(p, cont); + } + + // ensure generic types do not enter + cont.removeWhere( + (t) => decl.typeParams.map((type) => type.name).contains(t)); + + // visit return type + visitType(decl.returnType, cont); + + return cont; + } + + Set visitParameter(Parameter decl, [Set? context]) { + final cont = context ??= {}; + + // just visit type of parameter + visitType(decl.type, cont); + + return cont; + } + + Set visitVariable(VariableDeclaration decl, [Set? context]) { + final cont = context ??= {}; + + // just return property type + visitType(decl.type, cont); + + return cont; + } + + Set visitType(ReferredType type, [Set? context]) { + final cont = context ??= {}; + + // we need to confirm the types located + // check what kind of type [type] is + switch (type) { + case DeclaredType(): + cont.add(type.id); + break; + case GenericType(): + // do nothing + break; + case OptionalType(): + visitType(type.child, cont); + } + return cont; + } +} diff --git a/pkgs/swift2objc/lib/src/transformer/transform.dart b/pkgs/swift2objc/lib/src/transformer/transform.dart index 4322dd366..750d2efcd 100644 --- a/pkgs/swift2objc/lib/src/transformer/transform.dart +++ b/pkgs/swift2objc/lib/src/transformer/transform.dart @@ -8,24 +8,40 @@ import '../ast/_core/interfaces/nestable_declaration.dart'; import '../ast/declarations/compounds/class_declaration.dart'; import '../ast/declarations/compounds/struct_declaration.dart'; import '../ast/declarations/globals/globals.dart'; +import '_core/dependencies.dart'; import '_core/unique_namer.dart'; import 'transformers/transform_compound.dart'; import 'transformers/transform_globals.dart'; typedef TransformationMap = Map; -List transform(List declarations) { +Set generateDependencies( + Iterable decls, Iterable allDecls) { + final visitor = DependencyVisitor(allDecls); + for (final dec in decls) { + visitor.visit(dec); + } + + return visitor.visitedDeclarations; +} + +/// Transforms the given declarations into the desired ObjC wrapped declarations +List transform(List declarations, + {required bool Function(Declaration) filter}) { final transformationMap = {}; + final declarations0 = declarations.where(filter).toSet(); + declarations0.addAll(generateDependencies(declarations0, declarations)); + final globalNamer = UniqueNamer( - declarations.map((declaration) => declaration.name), + declarations0.map((declaration) => declaration.name), ); final globals = Globals( - functions: declarations.whereType().toList(), - variables: declarations.whereType().toList(), + functions: declarations0.whereType().toList(), + variables: declarations0.whereType().toList(), ); - final nonGlobals = declarations + final nonGlobals = declarations0 .where( (declaration) => declaration is! GlobalFunctionDeclaration && diff --git a/pkgs/swift2objc/test/unit/filter_test.dart b/pkgs/swift2objc/test/unit/filter_test.dart new file mode 100644 index 000000000..3b7828c14 --- /dev/null +++ b/pkgs/swift2objc/test/unit/filter_test.dart @@ -0,0 +1,116 @@ +// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +import 'dart:io'; + +import 'package:path/path.dart' as p; +import 'package:swift2objc/src/ast/declarations/compounds/class_declaration.dart'; +import 'package:swift2objc/swift2objc.dart'; +import 'package:test/test.dart'; + +import '../utils/utils.dart'; + +void main() { + group('Unit test for filter', () { + final thisDir = p.join(Directory.current.path, 'test/unit'); + + final file = p.join(thisDir, 'filter_test_input.swift'); + test('A: Specific Files', () async { + final output = p.join(thisDir, 'filter_test_output_a.swift'); + final actualOutputFile = p.join(thisDir, + '${p.basenameWithoutExtension(output)}.test${p.extension(output)}'); + + await generateWrapper(Config( + input: FilesInputConfig( + files: [Uri.file(file)], + ), + outputFile: Uri.file(actualOutputFile), + tempDir: Directory(thisDir).uri, + preamble: '// Test preamble text', + include: (declaration) => declaration.name == 'Engine', + )); + + final actualOutput = await File(actualOutputFile).readAsString(); + final expectedOutput = File(output).readAsStringSync(); + + expectString(actualOutput, expectedOutput); + }); + + test('B: Declarations of a specific type', () async { + final output = p.join(thisDir, 'filter_test_output_b.swift'); + final actualOutputFile = p.join(thisDir, + '${p.basenameWithoutExtension(output)}.test${p.extension(output)}'); + + await generateWrapper(Config( + input: FilesInputConfig( + files: [Uri.file(file)], + ), + outputFile: Uri.file(actualOutputFile), + tempDir: Directory(thisDir).uri, + preamble: '// Test preamble text', + include: (declaration) => declaration is ClassDeclaration, + )); + + final actualOutput = await File(actualOutputFile).readAsString(); + final expectedOutput = File(output).readAsStringSync(); + + expectString(actualOutput, expectedOutput); + }); + + test('C: Nonexistent declaration', () async { + final output = p.join(thisDir, 'filter_test_output_c.swift'); + final actualOutputFile = p.join(thisDir, + '${p.basenameWithoutExtension(output)}.test${p.extension(output)}'); + + await generateWrapper(Config( + input: FilesInputConfig( + files: [Uri.file(file)], + ), + outputFile: Uri.file(actualOutputFile), + tempDir: Directory(thisDir).uri, + preamble: '// Test preamble text', + // The following declaration does not exist, + // so none are produced in output + include: (declaration) => declaration.name == 'Ship', + )); + + final actualOutput = await File(actualOutputFile).readAsString(); + final expectedOutput = File(output).readAsStringSync(); + + expectString(actualOutput, expectedOutput); + }); + + tearDown(() { + if (File(p.join(thisDir, 'symbolgraph_module.abi.json')).existsSync()) { + File(p.join(thisDir, 'symbolgraph_module.abi.json')).deleteSync(); + } + if (File(p.join(thisDir, 'symbolgraph_module.swiftdoc')).existsSync()) { + File(p.join(thisDir, 'symbolgraph_module.swiftdoc')).deleteSync(); + } + if (File(p.join(thisDir, 'symbolgraph_module.swiftmodule')) + .existsSync()) { + File(p.join(thisDir, 'symbolgraph_module.swiftmodule')).deleteSync(); + } + if (File(p.join(thisDir, 'symbolgraph_module.swiftsource')) + .existsSync()) { + File(p.join(thisDir, 'symbolgraph_module.swiftsource')).deleteSync(); + } + if (File(p.join(thisDir, 'symbolgraph_module.symbols.json')) + .existsSync()) { + File(p.join(thisDir, 'symbolgraph_module.symbols.json')).deleteSync(); + } + if (File(p.join(thisDir, 'symbolgraph_module.swiftsourceinfo')) + .existsSync()) { + File(p.join(thisDir, 'symbolgraph_module.swiftsourceinfo')) + .deleteSync(); + } + + for (final file in Directory(thisDir) + .listSync() + .where((t) => p.extension(t.path, 2) == '.test.swift')) { + if (file is File) file.deleteSync(); + } + }); + }); +} diff --git a/pkgs/swift2objc/test/unit/filter_test_input.swift b/pkgs/swift2objc/test/unit/filter_test_input.swift new file mode 100644 index 000000000..40992e06a --- /dev/null +++ b/pkgs/swift2objc/test/unit/filter_test_input.swift @@ -0,0 +1,135 @@ +import Foundation + +public struct Engine { + public let type: String + public let horsepower: Int + + public init(type: String, horsepower: Int) { + self.type = type + self.horsepower = horsepower + } + + public func displaySpecs() { + print("Engine: \(type), \(horsepower) HP") + } +} + + +public struct Tire { + public let brand: String + public let size: Int + + public init(brand: String, size: Int) { + self.brand = brand + self.size = size + } + + public func displayInfo() { + print("Tire: \(brand), size \(size)") + } +} + + +public struct Dimensions { + public let length: Double + public let width: Double + public let height: Double + + public init(length: Double, width: Double, height: Double) { + self.length = length + self.width = width + self.height = height + } + + public func displayDimensions() { + print("Dimensions (LxWxH): \(length) x \(width) x \(height) meters") + } +} + + +public class Vehicle { + public var make: String + public var model: String + public var engine: Engine + public var dimensions: Dimensions + + public init(make: String, model: String, engine: Engine, dimensions: Dimensions) { + self.make = make + self.model = model + self.engine = engine + self.dimensions = dimensions + } + + public func displayInfo() { + print("Vehicle: \(make) \(model)") + engine.displaySpecs() + dimensions.displayDimensions() + } +} + + +public class Car: Vehicle { + public var numberOfDoors: Int + public var tires: [Tire] + + public init(make: String, model: String, engine: Engine, dimensions: Dimensions, numberOfDoors: Int, tires: [Tire]) { + self.numberOfDoors = numberOfDoors + self.tires = tires + super.init(make: make, model: model, engine: engine, dimensions: dimensions) + } + + public func honk() { + print("Car \(make) \(model) goes 'Beep Beep!'") + } +} + + +public class ElectricCar: Car { + public var batteryCapacity: Int // in kWh + + public init(make: String, model: String, dimensions: Dimensions, numberOfDoors: Int, tires: [Tire], batteryCapacity: Int) { + self.batteryCapacity = batteryCapacity + let electricEngine = Engine(type: "Electric", horsepower: batteryCapacity * 3) // Example calculation + super.init(make: make, model: model, engine: electricEngine, dimensions: dimensions, numberOfDoors: numberOfDoors, tires: tires) + } + + public func chargeBattery() { + print("Charging \(make) \(model)... Battery capacity: \(batteryCapacity) kWh") + } +} + +public class Bicycle { + public var brand: String + public var gearCount: Int + public var dimensions: Dimensions + + public init(brand: String, gearCount: Int, dimensions: Dimensions) { + self.brand = brand + self.gearCount = gearCount + self.dimensions = dimensions + } + + public func pedal() { + print("\(brand) bicycle is pedaling with \(gearCount) gears.") + dimensions.displayDimensions() + } +} + + +public class Garage { + private var vehicles: [Vehicle] = [] + + public init() {} + + public func addVehicle(_ vehicle: Vehicle) { + vehicles.append(vehicle) + print("Added \(vehicle.make) \(vehicle.model) to the garage.") + } + + public func listVehicles() { + print("Garage contains:") + for vehicle in vehicles { + print("- \(vehicle.make) \(vehicle.model)") + } + } +} diff --git a/pkgs/swift2objc/test/unit/filter_test_output_a.swift b/pkgs/swift2objc/test/unit/filter_test_output_a.swift new file mode 100644 index 000000000..55f24df43 --- /dev/null +++ b/pkgs/swift2objc/test/unit/filter_test_output_a.swift @@ -0,0 +1,33 @@ +// Test preamble text + +import Foundation + +@objc public class EngineWrapper: NSObject { + var wrappedInstance: Engine + + @objc public var horsepower: Int { + get { + wrappedInstance.horsepower + } + } + + @objc public var type: String { + get { + wrappedInstance.type + } + } + + init(_ wrappedInstance: Engine) { + self.wrappedInstance = wrappedInstance + } + + @objc init(type: String, horsepower: Int) { + wrappedInstance = Engine(type: type, horsepower: horsepower) + } + + @objc public func displaySpecs() { + return wrappedInstance.displaySpecs() + } + +} + diff --git a/pkgs/swift2objc/test/unit/filter_test_output_b.swift b/pkgs/swift2objc/test/unit/filter_test_output_b.swift new file mode 100644 index 000000000..1d0251927 --- /dev/null +++ b/pkgs/swift2objc/test/unit/filter_test_output_b.swift @@ -0,0 +1,230 @@ +// Test preamble text + +import Foundation + +@objc public class DimensionsWrapper: NSObject { + var wrappedInstance: Dimensions + + @objc public var width: Double { + get { + wrappedInstance.width + } + } + + @objc public var height: Double { + get { + wrappedInstance.height + } + } + + @objc public var length: Double { + get { + wrappedInstance.length + } + } + + init(_ wrappedInstance: Dimensions) { + self.wrappedInstance = wrappedInstance + } + + @objc init(length: Double, width: Double, height: Double) { + wrappedInstance = Dimensions(length: length, width: width, height: height) + } + + @objc public func displayDimensions() { + return wrappedInstance.displayDimensions() + } + +} + +@objc public class ElectricCarWrapper: NSObject { + var wrappedInstance: ElectricCar + + @objc public var batteryCapacity: Int { + get { + wrappedInstance.batteryCapacity + } + set { + wrappedInstance.batteryCapacity = newValue + } + } + + init(_ wrappedInstance: ElectricCar) { + self.wrappedInstance = wrappedInstance + } + + @objc public func chargeBattery() { + return wrappedInstance.chargeBattery() + } + +} + +@objc public class CarWrapper: NSObject { + var wrappedInstance: Car + + @objc public var numberOfDoors: Int { + get { + wrappedInstance.numberOfDoors + } + set { + wrappedInstance.numberOfDoors = newValue + } + } + + init(_ wrappedInstance: Car) { + self.wrappedInstance = wrappedInstance + } + + @objc public func honk() { + return wrappedInstance.honk() + } + +} + +@objc public class EngineWrapper: NSObject { + var wrappedInstance: Engine + + @objc public var horsepower: Int { + get { + wrappedInstance.horsepower + } + } + + @objc public var type: String { + get { + wrappedInstance.type + } + } + + init(_ wrappedInstance: Engine) { + self.wrappedInstance = wrappedInstance + } + + @objc init(type: String, horsepower: Int) { + wrappedInstance = Engine(type: type, horsepower: horsepower) + } + + @objc public func displaySpecs() { + return wrappedInstance.displaySpecs() + } + +} + +@objc public class GarageWrapper: NSObject { + var wrappedInstance: Garage + + init(_ wrappedInstance: Garage) { + self.wrappedInstance = wrappedInstance + } + + @objc override init() { + wrappedInstance = Garage() + } + + @objc public func addVehicle(_ vehicle: VehicleWrapper) { + return wrappedInstance.addVehicle(vehicle.wrappedInstance) + } + + @objc public func listVehicles() { + return wrappedInstance.listVehicles() + } + +} + +@objc public class BicycleWrapper: NSObject { + var wrappedInstance: Bicycle + + @objc public var dimensions: DimensionsWrapper { + get { + DimensionsWrapper(wrappedInstance.dimensions) + } + set { + wrappedInstance.dimensions = newValue.wrappedInstance + } + } + + @objc public var brand: String { + get { + wrappedInstance.brand + } + set { + wrappedInstance.brand = newValue + } + } + + @objc public var gearCount: Int { + get { + wrappedInstance.gearCount + } + set { + wrappedInstance.gearCount = newValue + } + } + + init(_ wrappedInstance: Bicycle) { + self.wrappedInstance = wrappedInstance + } + + @objc init(brand: String, gearCount: Int, dimensions: DimensionsWrapper) { + wrappedInstance = Bicycle(brand: brand, gearCount: gearCount, dimensions: dimensions.wrappedInstance) + } + + @objc public func pedal() { + return wrappedInstance.pedal() + } + +} + +@objc public class VehicleWrapper: NSObject { + var wrappedInstance: Vehicle + + @objc public var dimensions: DimensionsWrapper { + get { + DimensionsWrapper(wrappedInstance.dimensions) + } + set { + wrappedInstance.dimensions = newValue.wrappedInstance + } + } + + @objc public var make: String { + get { + wrappedInstance.make + } + set { + wrappedInstance.make = newValue + } + } + + @objc public var model: String { + get { + wrappedInstance.model + } + set { + wrappedInstance.model = newValue + } + } + + @objc public var engine: EngineWrapper { + get { + EngineWrapper(wrappedInstance.engine) + } + set { + wrappedInstance.engine = newValue.wrappedInstance + } + } + + init(_ wrappedInstance: Vehicle) { + self.wrappedInstance = wrappedInstance + } + + @objc init(make: String, model: String, engine: EngineWrapper, dimensions: DimensionsWrapper) { + wrappedInstance = Vehicle(make: make, model: model, engine: engine.wrappedInstance, dimensions: dimensions.wrappedInstance) + } + + @objc public func displayInfo() { + return wrappedInstance.displayInfo() + } + +} + diff --git a/pkgs/swift2objc/test/unit/filter_test_output_c.swift b/pkgs/swift2objc/test/unit/filter_test_output_c.swift new file mode 100644 index 000000000..fd38b9f0e --- /dev/null +++ b/pkgs/swift2objc/test/unit/filter_test_output_c.swift @@ -0,0 +1,4 @@ +// Test preamble text + +import Foundation + diff --git a/pkgs/swift2objc/test/utils/utils.dart b/pkgs/swift2objc/test/utils/utils.dart new file mode 100644 index 000000000..27ea25ad4 --- /dev/null +++ b/pkgs/swift2objc/test/utils/utils.dart @@ -0,0 +1,8 @@ +import 'package:test/test.dart'; + +void expectString(String a, String b) { + final trimmedA = a.replaceAll(RegExp(r'\s+'), ''); + final trimmedB = b.replaceAll(RegExp(r'\s+'), ''); + + expect(trimmedA, trimmedB); +} From acc55341efd7be3c1e36b0def0c1abfc458b4932 Mon Sep 17 00:00:00 2001 From: Liam Appelbe Date: Wed, 18 Dec 2024 18:58:34 +1100 Subject: [PATCH 49/50] [ffigen] Fix nit in readme (#1823) --- pkgs/ffigen/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md index 5077f7139..b2438c3ff 100644 --- a/pkgs/ffigen/README.md +++ b/pkgs/ffigen/README.md @@ -747,7 +747,7 @@ objc-protocols: include: # Generates bindings for a specific protocol. - MyProtocol -objc-category: +objc-categories: include: # Generates bindings for a specific category. - MyCategory From 8c16b6c68da9589de2c57794fb861536c4f9279b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 18 Dec 2024 16:59:24 +0100 Subject: [PATCH 50/50] [native_assets_cli] Nest `CodeConfig` OS-specific config (#1824) Dart and Flutter have been passing the minimum OS SDK versions for a while (in non-dry-run), which means we can mark these fields non-optional if the target OS is used. This PR changes the `CodeConfig` to nest the OS versions (and iOS target SDK: device or simulator) to be nested under the OS and required. Other side effects of this PR: * Many unit tests where missing these (now) mandatory fields * `native_toolchain_c` can no longer test without the minimum OS versions, which changed the iOS test `otool` output. Addressing: * https://github.com/dart-lang/native/issues/1738#issuecomment-2535921222 --- .../build_runner_reusability_test.dart | 5 + .../concurrency_shared_test_helper.dart | 8 +- .../build_runner/concurrency_test_helper.dart | 7 +- .../test/build_runner/helpers.dart | 75 ++++++--- .../native_dynamic_linking_test.dart | 8 +- .../test/test_data/transformer_test.dart | 6 +- .../fail_on_os_sdk_version/hook/build.dart | 11 +- .../hook/link.dart | 11 +- pkgs/native_assets_cli/lib/code_assets.dart | 5 +- .../lib/src/code_assets/config.dart | 157 ++++++++++++++---- .../lib/src/code_assets/testing.dart | 16 +- .../lib/src/code_assets/validation.dart | 28 ++-- .../native_assets_cli/test/checksum_test.dart | 69 ++++---- .../test/code_assets/config_test.dart | 9 +- .../test/code_assets/validation_test.dart | 16 +- .../test/example/local_asset_test.dart | 6 +- .../test/example/native_add_library_test.dart | 4 + .../example/native_dynamic_linking_test.dart | 6 +- pkgs/native_assets_cli/test/helpers.dart | 2 + .../lib/src/cbuilder/run_cbuilder.dart | 15 +- .../cbuilder/cbuilder_build_failure_test.dart | 6 +- .../cbuilder/cbuilder_cross_android_test.dart | 2 +- .../cbuilder/cbuilder_cross_ios_test.dart | 40 +++-- .../cbuilder_cross_macos_host_test.dart | 3 +- .../test/cbuilder/cbuilder_test.dart | 38 ++++- .../test/cbuilder/compiler_resolver_test.dart | 6 +- .../test/cbuilder/objective_c_test.dart | 6 +- .../test/clinker/build_testfiles.dart | 1 + pkgs/native_toolchain_c/test/helpers.dart | 2 + 29 files changed, 403 insertions(+), 165 deletions(-) diff --git a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart index aa7356a6c..53c7988f2 100644 --- a/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart +++ b/pkgs/native_assets_builder/test/build_runner/build_runner_reusability_test.dart @@ -27,10 +27,15 @@ void main() async { dartExecutable: dartExecutable, ); + final targetOS = OS.current; + const defaultMacOSVersion = 13; BuildConfigBuilder configCreator() => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: Architecture.current, targetOS: OS.current, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, linkModePreference: LinkModePreference.dynamic, ); diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart index d31b8c434..7c958fc44 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_shared_test_helper.dart @@ -16,6 +16,7 @@ void main(List args) async { ..level = Level.ALL ..onRecord.listen((event) => print(event.message)); + final targetOS = target.os; final result = await NativeAssetsBuildRunner( logger: logger, dartExecutable: dartExecutable, @@ -25,7 +26,10 @@ void main(List args) async { configCreator: () => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: target.architecture, - targetOS: target.os, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, linkModePreference: LinkModePreference.dynamic, ), workingDirectory: packageUri, @@ -41,3 +45,5 @@ void main(List args) async { } print('done'); } + +int defaultMacOSVersion = 13; diff --git a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart index 75d2cb096..366459dd1 100644 --- a/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart +++ b/pkgs/native_assets_builder/test/build_runner/concurrency_test_helper.dart @@ -20,6 +20,7 @@ void main(List args) async { ..level = Level.ALL ..onRecord.listen((event) => print(event.message)); + final targetOS = OS.current; final result = await NativeAssetsBuildRunner( logger: logger, dartExecutable: dartExecutable, @@ -28,10 +29,12 @@ void main(List args) async { configCreator: () => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: Architecture.current, - targetOS: OS.current, + targetOS: targetOS, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dartCICompilerConfig, - targetMacOSVersion: OS.current == OS.macOS ? defaultMacOSVersion : null, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, ), workingDirectory: packageUri, linkingEnabled: false, diff --git a/pkgs/native_assets_builder/test/build_runner/helpers.dart b/pkgs/native_assets_builder/test/build_runner/helpers.dart index 432b5dade..ad73355c7 100644 --- a/pkgs/native_assets_builder/test/build_runner/helpers.dart +++ b/pkgs/native_assets_builder/test/build_runner/helpers.dart @@ -62,11 +62,19 @@ Future build( targetOS: targetOS, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig, - targetIOSSdk: targetIOSSdk, - targetIOSVersion: targetIOSVersion, - targetMacOSVersion: targetMacOSVersion ?? - (targetOS == OS.macOS ? defaultMacOSVersion : null), - targetAndroidNdkApi: targetAndroidNdkApi, + iOSConfig: targetOS == OS.iOS + ? IOSConfig( + targetSdk: targetIOSSdk!, + targetVersion: targetIOSVersion!, + ) + : null, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig( + targetVersion: targetMacOSVersion ?? defaultMacOSVersion) + : null, + androidConfig: targetOS == OS.android + ? AndroidConfig(targetNdkApi: targetAndroidNdkApi!) + : null, ); } return configBuilder; @@ -127,11 +135,19 @@ Future link( targetOS: target?.os ?? OS.current, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig, - targetIOSSdk: targetIOSSdk, - targetIOSVersion: targetIOSVersion, - targetMacOSVersion: targetMacOSVersion ?? - (targetOS == OS.macOS ? defaultMacOSVersion : null), - targetAndroidNdkApi: targetAndroidNdkApi, + iOSConfig: targetOS == OS.iOS + ? IOSConfig( + targetSdk: targetIOSSdk!, + targetVersion: targetIOSVersion!, + ) + : null, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig( + targetVersion: targetMacOSVersion ?? defaultMacOSVersion) + : null, + androidConfig: targetOS == OS.android + ? AndroidConfig(targetNdkApi: targetAndroidNdkApi!) + : null, ); } return configBuilder; @@ -181,17 +197,27 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( logger: logger, dartExecutable: dartExecutable, ); + final targetOS = target?.os ?? OS.current; final buildResult = await buildRunner.build( configCreator: () => BuildConfigBuilder() ..setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, - targetOS: target?.os ?? OS.current, + targetOS: targetOS, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig ?? dartCICompilerConfig, - targetIOSSdk: targetIOSSdk, - targetIOSVersion: targetIOSVersion, - targetMacOSVersion: targetMacOSVersion, - targetAndroidNdkApi: targetAndroidNdkApi, + iOSConfig: targetOS == OS.iOS + ? IOSConfig( + targetSdk: targetIOSSdk!, + targetVersion: targetIOSVersion!, + ) + : null, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig( + targetVersion: targetMacOSVersion ?? defaultMacOSVersion) + : null, + androidConfig: targetOS == OS.android + ? AndroidConfig(targetNdkApi: targetAndroidNdkApi!) + : null, ), configValidator: buildConfigValidator, workingDirectory: packageUri, @@ -217,13 +243,22 @@ Future<(BuildResult?, LinkResult?)> buildAndLink( configCreator: () => LinkConfigBuilder() ..setupCodeConfig( targetArchitecture: target?.architecture ?? Architecture.current, - targetOS: target?.os ?? OS.current, + targetOS: targetOS, linkModePreference: linkModePreference, cCompilerConfig: cCompilerConfig, - targetIOSSdk: targetIOSSdk, - targetIOSVersion: targetIOSVersion, - targetMacOSVersion: targetMacOSVersion, - targetAndroidNdkApi: targetAndroidNdkApi, + iOSConfig: targetOS == OS.iOS + ? IOSConfig( + targetSdk: targetIOSSdk!, + targetVersion: targetIOSVersion!, + ) + : null, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig( + targetVersion: targetMacOSVersion ?? defaultMacOSVersion) + : null, + androidConfig: targetOS == OS.android + ? AndroidConfig(targetNdkApi: targetAndroidNdkApi!) + : null, ), configValidator: linkConfigValidator, workingDirectory: packageUri, diff --git a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart index 2e35c3b13..e0f042c29 100644 --- a/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_builder/test/test_data/native_dynamic_linking_test.dart @@ -30,6 +30,7 @@ void main() async { final testPackageUri = testDataUri.resolve('$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); + final targetOS = OS.current; final configBuilder = BuildConfigBuilder() ..setupHookConfig( packageName: name, @@ -43,7 +44,10 @@ void main() async { ) ..setupCodeConfig( targetArchitecture: Architecture.current, - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, ); @@ -125,3 +129,5 @@ void main() async { }), ); } + +int defaultMacOSVersion = 13; diff --git a/pkgs/native_assets_builder/test/test_data/transformer_test.dart b/pkgs/native_assets_builder/test/test_data/transformer_test.dart index 05d2b868c..42b8eb404 100644 --- a/pkgs/native_assets_builder/test/test_data/transformer_test.dart +++ b/pkgs/native_assets_builder/test/test_data/transformer_test.dart @@ -44,6 +44,7 @@ void main() async { late String stdout; late BuildOutput output; + final targetOS = OS.current; Future runBuild(Architecture architecture) async { final configBuilder = BuildConfigBuilder() ..setupHookConfig( @@ -58,7 +59,10 @@ void main() async { ) ..setupCodeConfig( targetArchitecture: architecture, - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, linkModePreference: LinkModePreference.dynamic, ); diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart index d774f5e13..ac2f821f2 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version/hook/build.dart @@ -15,7 +15,7 @@ const minMacOSVersionForThisPackage = 13; void main(List arguments) async { await build(arguments, (config, output) async { if (config.codeConfig.targetOS == OS.android) { - if (config.codeConfig.targetAndroidNdkApi! < + if (config.codeConfig.androidConfig.targetNdkApi < minNdkApiVersionForThisPackage) { throw UnsupportedError( 'The native assets for this package require at ' @@ -23,19 +23,18 @@ void main(List arguments) async { ); } } else if (config.codeConfig.targetOS == OS.iOS) { - final iosVersion = config.codeConfig.targetIOSVersion; + final iosVersion = config.codeConfig.iOSConfig.targetVersion; // iosVersion is nullable to deal with version skew. - if (iosVersion != null && iosVersion < minIosVersionForThisPackage) { + if (iosVersion < minIosVersionForThisPackage) { throw UnsupportedError( 'The native assets for this package require at ' 'least iOS version $minIosVersionForThisPackage.', ); } } else if (config.codeConfig.targetOS == OS.macOS) { - final macosVersion = config.codeConfig.targetMacOSVersion; + final macosVersion = config.codeConfig.macOSConfig.targetVersion; // macosVersion is nullable to deal with version skew. - if (macosVersion != null && - macosVersion < minMacOSVersionForThisPackage) { + if (macosVersion < minMacOSVersionForThisPackage) { throw UnsupportedError( 'The native assets for this package require at ' 'least MacOS version $minMacOSVersionForThisPackage.', diff --git a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart index a4603499f..852c89f47 100644 --- a/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart +++ b/pkgs/native_assets_builder/test_data/fail_on_os_sdk_version_linker/hook/link.dart @@ -15,7 +15,7 @@ const minMacOSVersionForThisPackage = 13; void main(List arguments) async { await link(arguments, (config, output) async { if (config.codeConfig.targetOS == OS.android) { - if (config.codeConfig.targetAndroidNdkApi! < + if (config.codeConfig.androidConfig.targetNdkApi < minNdkApiVersionForThisPackage) { throw UnsupportedError( 'The native assets for this package require at ' @@ -23,19 +23,18 @@ void main(List arguments) async { ); } } else if (config.codeConfig.targetOS == OS.iOS) { - final iosVersion = config.codeConfig.targetIOSVersion; + final iosVersion = config.codeConfig.iOSConfig.targetVersion; // iosVersion is nullable to deal with version skew. - if (iosVersion != null && iosVersion < minIosVersionForThisPackage) { + if (iosVersion < minIosVersionForThisPackage) { throw UnsupportedError( 'The native assets for this package require at ' 'least iOS version $minIosVersionForThisPackage.', ); } } else if (config.codeConfig.targetOS == OS.macOS) { - final macosVersion = config.codeConfig.targetMacOSVersion; + final macosVersion = config.codeConfig.macOSConfig.targetVersion; // macosVersion is nullable to deal with version skew. - if (macosVersion != null && - macosVersion < minMacOSVersionForThisPackage) { + if (macosVersion < minMacOSVersionForThisPackage) { throw UnsupportedError( 'The native assets for this package require at ' 'least MacOS version $minMacOSVersionForThisPackage.', diff --git a/pkgs/native_assets_cli/lib/code_assets.dart b/pkgs/native_assets_cli/lib/code_assets.dart index 82c32b6d5..f173dad88 100644 --- a/pkgs/native_assets_cli/lib/code_assets.dart +++ b/pkgs/native_assets_cli/lib/code_assets.dart @@ -15,13 +15,16 @@ export 'src/code_assets/c_compiler_config.dart' show CCompilerConfig; export 'src/code_assets/code_asset.dart' show CodeAsset, OSLibraryNaming; export 'src/code_assets/config.dart' show + AndroidConfig, CodeAssetBuildConfig, CodeAssetBuildOutputBuilder, CodeAssetBuildOutputBuilderAdd, CodeAssetLinkConfig, CodeAssetLinkOutputBuilder, CodeAssetLinkOutputBuilderAdd, - CodeConfig; + CodeConfig, + IOSConfig, + MacOSConfig; export 'src/code_assets/ios_sdk.dart' show IOSSdk; export 'src/code_assets/link_mode.dart' show diff --git a/pkgs/native_assets_cli/lib/src/code_assets/config.dart b/pkgs/native_assets_cli/lib/src/code_assets/config.dart index 9ae1fe9f4..3d2c2cf1f 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/config.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/config.dart @@ -43,14 +43,14 @@ class CodeConfig { final LinkModePreference linkModePreference; final CCompilerConfig? cCompiler; - final int? targetIOSVersion; - final int? targetMacOSVersion; - final int? targetAndroidNdkApi; - final IOSSdk? targetIOSSdk; /// The operating system being compiled for. final OS targetOS; + late final IOSConfig? _iOSConfig; + late final AndroidConfig? _androidConfig; + late final MacOSConfig? _macOSConfig; + CodeConfig(HookConfig config) : linkModePreference = LinkModePreference.fromString( config.json.string(_linkModePreferenceKey)), @@ -63,21 +63,125 @@ class CodeConfig { cCompiler = switch (config.json.optionalMap(_compilerKey)) { final Map map => CCompilerConfig.fromJson(map), null => null, - }, - targetIOSVersion = config.json.optionalInt(_targetIOSVersionKey), - targetMacOSVersion = config.json.optionalInt(_targetMacOSVersionKey), - targetAndroidNdkApi = config.json.optionalInt(_targetAndroidNdkApiKey), - targetIOSSdk = switch (config.json.optionalString(_targetIOSSdkKey)) { - final String value => IOSSdk.fromString(value), - null => null, - }; + } { + // ignore: deprecated_member_use_from_same_package + _iOSConfig = (config is BuildConfig && config.dryRun) || targetOS != OS.iOS + ? null + : IOSConfig.fromHookConfig(config); + _androidConfig = + // ignore: deprecated_member_use_from_same_package + (config is BuildConfig && config.dryRun) || targetOS != OS.android + ? null + : AndroidConfig.fromHookConfig(config); + _macOSConfig = + // ignore: deprecated_member_use_from_same_package + (config is BuildConfig && config.dryRun) || targetOS != OS.macOS + ? null + : MacOSConfig.fromHookConfig(config); + } Architecture get targetArchitecture { + // TODO: Remove once Dart 3.7 stable is out and we bump the minimum SDK to + // 3.7. if (_targetArchitecture == null) { - throw StateError('Cannot access target architecture in dry runs'); + throw StateError('Cannot access target architecture in dry runs.'); } return _targetArchitecture; } + + /// Configuration provided when [CodeConfig.targetOS] is [OS.macOS]. + IOSConfig get iOSConfig => switch (_iOSConfig) { + null => + throw StateError('Cannot access iOSConfig if targetOS is not iOS' + ' or in dry runs.'), + final c => c, + }; + + /// Configuration provided when [CodeConfig.targetOS] is [OS.android]. + AndroidConfig get androidConfig => switch (_androidConfig) { + null => throw StateError( + 'Cannot access androidConfig if targetOS is not android' + ' or in dry runs.'), + final c => c, + }; + + /// Configuration provided when [CodeConfig.targetOS] is [OS.macOS]. + MacOSConfig get macOSConfig => switch (_macOSConfig) { + null => + throw StateError('Cannot access macOSConfig if targetOS is not MacOS' + ' or in dry runs.'), + final c => c, + }; +} + +/// Configuration provided when [CodeConfig.targetOS] is [OS.iOS]. +class IOSConfig { + /// Whether to target device or simulator. + IOSSdk get targetSdk => _targetSdk!; + + final IOSSdk? _targetSdk; + + /// The lowest iOS version that the compiled code will be compatible with. + int get targetVersion => _targetVersion!; + + final int? _targetVersion; + + IOSConfig({ + required IOSSdk targetSdk, + required int targetVersion, + }) : _targetSdk = targetSdk, + _targetVersion = targetVersion; + + IOSConfig.fromHookConfig(HookConfig config) + : _targetVersion = config.json.optionalInt(_targetIOSVersionKey), + _targetSdk = switch (config.json.optionalString(_targetIOSSdkKey)) { + null => null, + String e => IOSSdk.fromString(e) + }; +} + +extension IOSConfigSyntactic on IOSConfig { + IOSSdk? get targetSdkSyntactic => _targetSdk; + int? get targetVersionSyntactic => _targetVersion; +} + +/// Configuration provided when [CodeConfig.targetOS] is [OS.macOS]. +class AndroidConfig { + /// The minimum Android SDK API version to that the compiled code will be + /// compatible with. + int get targetNdkApi => _targetNdkApi!; + + final int? _targetNdkApi; + + AndroidConfig({ + required int targetNdkApi, + }) : _targetNdkApi = targetNdkApi; + + AndroidConfig.fromHookConfig(HookConfig config) + : _targetNdkApi = config.json.optionalInt(_targetAndroidNdkApiKey); +} + +extension AndroidConfigSyntactic on AndroidConfig { + int? get targetNdkApiSyntactic => _targetNdkApi; +} + +//// Configuration provided when [CodeConfig.targetOS] is [OS.macOS]. +class MacOSConfig { + /// The lowest MacOS version that the compiled code will be compatible with. + int get targetVersion => _targetVersion!; + + final int? _targetVersion; + + MacOSConfig({ + required int targetVersion, + }) : _targetVersion = targetVersion; + + MacOSConfig.fromHookConfig(HookConfig config) + : _targetVersion = config.json.optionalInt(_targetMacOSVersionKey); +} + +extension MacOSConfigSyntactic on MacOSConfig { + int? get targetVersionSyntactic => _targetVersion; } /// Extension to the [BuildOutputBuilder] providing access to emitting code @@ -128,10 +232,9 @@ extension CodeAssetBuildConfigBuilder on HookConfigBuilder { required OS targetOS, required LinkModePreference linkModePreference, CCompilerConfig? cCompilerConfig, - int? targetIOSVersion, - int? targetMacOSVersion, - int? targetAndroidNdkApi, - IOSSdk? targetIOSSdk, + AndroidConfig? androidConfig, + IOSConfig? iOSConfig, + MacOSConfig? macOSConfig, }) { if (targetArchitecture != null) { json[_targetArchitectureKey] = targetArchitecture.toString(); @@ -142,17 +245,15 @@ extension CodeAssetBuildConfigBuilder on HookConfigBuilder { json[_compilerKey] = cCompilerConfig.toJson(); } - if (targetIOSVersion != null) { - json[_targetIOSVersionKey] = targetIOSVersion; - } - if (targetMacOSVersion != null) { - json[_targetMacOSVersionKey] = targetMacOSVersion; - } - if (targetAndroidNdkApi != null) { - json[_targetAndroidNdkApiKey] = targetAndroidNdkApi; - } - if (targetIOSSdk != null) { - json[_targetIOSSdkKey] = targetIOSSdk.toString(); + // Note, using ?. instead of !. makes missing data be a semantic error + // rather than a syntactic error to be caught in the validation. + if (targetOS == OS.android) { + json[_targetAndroidNdkApiKey] = androidConfig?.targetNdkApi; + } else if (targetOS == OS.iOS) { + json[_targetIOSSdkKey] = iOSConfig?.targetSdk.toString(); + json[_targetIOSVersionKey] = iOSConfig?.targetVersion; + } else if (targetOS == OS.macOS) { + json[_targetMacOSVersionKey] = macOSConfig?.targetVersion; } } } diff --git a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart index 3d2648273..0ad67ba96 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/testing.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/testing.dart @@ -43,10 +43,18 @@ Future testCodeBuildHook({ cCompilerConfig: cCompiler, targetArchitecture: targetArchitecture ?? Architecture.current, targetOS: targetOS ?? OS.current, - targetIOSSdk: targetIOSSdk, - targetIOSVersion: targetIOSVersion, - targetMacOSVersion: targetMacOSVersion, - targetAndroidNdkApi: targetAndroidNdkApi, + iOSConfig: targetOS == OS.iOS + ? IOSConfig( + targetSdk: targetIOSSdk!, + targetVersion: targetIOSVersion!, + ) + : null, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: targetMacOSVersion!) + : null, + androidConfig: targetOS == OS.android + ? AndroidConfig(targetNdkApi: targetAndroidNdkApi!) + : null, ); }, check: (config, output) async { diff --git a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart index 40b17f8ec..fb9c1ad1d 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart @@ -5,14 +5,13 @@ import 'dart:io'; import '../../code_assets_builder.dart'; - +import 'config.dart'; import 'link_mode.dart'; Future validateCodeAssetBuildConfig( BuildConfig config) async => _validateCodeConfig( 'BuildConfig', - config.codeConfig.targetOS, // ignore: deprecated_member_use_from_same_package config.dryRun, config.codeConfig, @@ -20,35 +19,42 @@ Future validateCodeAssetBuildConfig( Future validateCodeAssetLinkConfig(LinkConfig config) async => _validateCodeConfig( - 'LinkConfig', config.codeConfig.targetOS, false, config.codeConfig); + 'LinkConfig', + false, + config.codeConfig, + ); ValidationErrors _validateCodeConfig( - String configName, OS targetOS, bool dryRun, CodeConfig codeConfig) { + String configName, + bool dryRun, + CodeConfig codeConfig, +) { // The dry run will be removed soon. if (dryRun) return const []; final errors = []; + final targetOS = codeConfig.targetOS; switch (targetOS) { case OS.macOS: - if (codeConfig.targetMacOSVersion == null) { + if (codeConfig.macOSConfig.targetVersionSyntactic == null) { errors.add('$configName.targetOS is OS.macOS but ' - '$configName.codeConfig.targetMacOSVersion was missing'); + '$configName.codeConfig.macOSConfig.targetVersion was missing'); } break; case OS.iOS: - if (codeConfig.targetIOSSdk == null) { + if (codeConfig.iOSConfig.targetSdkSyntactic == null) { errors.add('$configName.targetOS is OS.iOS but ' '$configName.codeConfig.targetIOSSdk was missing'); } - if (codeConfig.targetIOSVersion == null) { + if (codeConfig.iOSConfig.targetVersionSyntactic == null) { errors.add('$configName.targetOS is OS.iOS but ' - '$configName.codeConfig.targetIOSVersion was missing'); + '$configName.codeConfig.iOSConfig.targetVersion was missing'); } break; case OS.android: - if (codeConfig.targetAndroidNdkApi == null) { + if (codeConfig.androidConfig.targetNdkApiSyntactic == null) { errors.add('$configName.targetOS is OS.android but ' - '$configName.codeConfig.targetAndroidNdkApi was missing'); + '$configName.codeConfig.androidConfig.targetNdkApi was missing'); } break; } diff --git a/pkgs/native_assets_cli/test/checksum_test.dart b/pkgs/native_assets_cli/test/checksum_test.dart index 3b2376d28..c4691e4aa 100644 --- a/pkgs/native_assets_cli/test/checksum_test.dart +++ b/pkgs/native_assets_cli/test/checksum_test.dart @@ -8,6 +8,8 @@ import 'package:native_assets_cli/code_assets_builder.dart'; import 'package:native_assets_cli/data_assets_builder.dart'; import 'package:test/test.dart'; +import 'helpers.dart'; + void main() { test('checksum', () async { // metadata, cc, link vs build, metadata, haslink @@ -32,6 +34,9 @@ void main() { ..setupCodeConfig( targetArchitecture: architecture, targetOS: os, + macOSConfig: os == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, linkModePreference: LinkModePreference.dynamic, ); configs.add( @@ -84,38 +89,38 @@ void main() { '5f2c169a71039d3d6b2ae74e3c2723d7', '67759625e5a0908dabcaeeb2b1264f84', '921b2b7012548949e9b465addccc2e71', - '94bc85e935634df06e208ac8ab9643d3', - 'ee4cd19fc3ac5d4a85ceaf2e80e44682', - '661bf4e49dff3c104784a0d75cf45204', - '0b3529f1337b3759e97733095a868d29', - '1522580f1e96c5ea5dc68ca7a720adee', - '5c08a30f498edf9962c8ff20a1ab4fba', - '69f4f6640eba043f4df2e6f109f07b90', - '62db9da306210856e44bb7f8a75a15fd', - '125f6fa99282a3b7e8937030a3aa2c6d', - '1cf817dd1a1710bfacb82ef71da94e4f', - '1eccd6e8e62985cb9955db4fd8c22d2f', - '4becc04d3263f2b362dd76c0e0eb6d7b', - '74ecd3c74beb88f2f7f02921a8de1143', - 'ad6bf3865f8addf4233e3a83192f5464', - 'edf54995d97ad818449f09d9b2fc86e2', - '89014c91ebb4075bdea2d52f2d35b4ae', - 'cb59b4041a0a7bbf636ed4e3b30d06be', - '3dd69a72235c9b45e1f85c143e8f97bc', - 'b08bec82fca775aeec2e4f400b20a4a0', - '79381e4fd8c1191f2fceb7ad30b3fd64', - 'b8e5434a62d4b0a381363dca1152a0d5', - 'f70e0798fa96df0b6e1d14d69fd0deaa', - '3d807e9c6306c16f2ee61a32e8081e2f', - '0646eefc0cfd913506051f0c8a900983', - 'b5adb85aeaf88a23e7bafd29e63c03ac', - '7b269c3e21fe9e29285daba8c370073f', - '1a47af48f1e3158000d44ef59ab597da', - '2665c64ac2a9d919fff7420c0e770db3', - '27c0acf56ef48f3855fc20ea8810ff8d', - '2a9a03940008cdd6f9231f1f54dd94bf', - '86d87e3cb682646e5d1158898ed7913f', - '6a7b30ccd5a35694c515d22f165be589', + 'b1bddc0ed6904d52d8455779ea22ca7e', + 'ddc148493501a29584b859bbad703dc8', + 'f61b611c5cdf32c1251547c63773be4b', + '754258bb3497d76670f306c3bdcfb72e', + '9d7f0c3ea090c5c9a50bc68970b691de', + '2fb6a652e863e63b877bcf4d0f9c18ee', + 'e6c27bf9b26cd1b9e093d8df3eb701f1', + '21b14473b8f4513afc07b10fc49b3a42', + '755e4a51021d2f06f81800d06005d3e8', + '18739efa01630bfb69b359f3471813e3', + '6532e84b2020034445983b4aaca63cf6', + '400486e5b7fd7bcee2cca005d9e365ef', + 'ca9415247d3caf7469f7ef256dbfec7d', + '5f7e1b8477f41b8676d076375edc4160', + '79440103b796d05d7f2e3fe6a7eaaa3c', + '291e0f37d19c0b59abeeb96577f98295', + '266de1a05af22f800e9018dcacf5f9d5', + '899d2db19759e703b5093f4919db72b4', + 'ba8fa2cfec652f80588ce5080cb8e0d7', + 'aa946213d19406fa2db5ba89be7037ba', + '7e29bcee52269e094cf7645dba7b2257', + 'c423ef2466bd1370d04ef82a7676e82c', + '7b258ea5c87c103e12968ea979339e13', + '344189c289fceff30a21681b28be98fb', + '1bfafa1611cef338271a338500a49d13', + 'e59b31a6d8a958f1b894b6e536043b18', + '39c6bf2b59d2e335b444638352967969', + '672fe8c89974fbc794bf992da475b264', + '0690975592703ed47f236c8815d115f0', + '51d7e1b0c5b4a855d070f409150d2bcf', + '3299a12d5041c50fbe81167bf0aca0ff', + '46007e911efe370c1774c3a1d6c35ddd', ]; printOnFailure('final expectedChecksums = ['); printOnFailure(checksums.map((e) => " '$e',").join('\n')); diff --git a/pkgs/native_assets_cli/test/code_assets/config_test.dart b/pkgs/native_assets_cli/test/code_assets/config_test.dart index 74ce351d3..aa40204ab 100644 --- a/pkgs/native_assets_cli/test/code_assets/config_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/config_test.dart @@ -53,7 +53,7 @@ void main() async { }); expect(() => codeConfig.targetArchitecture, throwsStateError); - expect(codeConfig.targetAndroidNdkApi, null); + expect(() => codeConfig.androidConfig.targetNdkApi, throwsStateError); expect(codeConfig.linkModePreference, LinkModePreference.preferStatic); expect(codeConfig.cCompiler, null); } @@ -77,7 +77,7 @@ void main() async { }); expect(codeConfig.targetArchitecture, Architecture.arm64); - expect(codeConfig.targetAndroidNdkApi, 30); + expect(codeConfig.androidConfig.targetNdkApi, 30); expect(codeConfig.linkModePreference, LinkModePreference.preferStatic); expect(codeConfig.cCompiler?.compiler, fakeClang); expect(codeConfig.cCompiler?.linker, fakeLd); @@ -101,6 +101,7 @@ void main() async { ) ..setupCodeConfig( targetOS: OS.android, + androidConfig: null, // not available in dry run targetArchitecture: null, // not available in dry run cCompilerConfig: null, // not available in dry run linkModePreference: LinkModePreference.preferStatic, @@ -127,7 +128,7 @@ void main() async { ..setupCodeConfig( targetOS: OS.android, targetArchitecture: Architecture.arm64, - targetAndroidNdkApi: 30, + androidConfig: AndroidConfig(targetNdkApi: 30), linkModePreference: LinkModePreference.preferStatic, cCompilerConfig: CCompilerConfig( compiler: fakeClang, @@ -157,7 +158,7 @@ void main() async { ..setupCodeConfig( targetOS: OS.android, targetArchitecture: Architecture.arm64, - targetAndroidNdkApi: 30, + androidConfig: AndroidConfig(targetNdkApi: 30), linkModePreference: LinkModePreference.preferStatic, cCompilerConfig: CCompilerConfig( compiler: fakeClang, diff --git a/pkgs/native_assets_cli/test/code_assets/validation_test.dart b/pkgs/native_assets_cli/test/code_assets/validation_test.dart index 09aa23571..7b5e6731b 100644 --- a/pkgs/native_assets_cli/test/code_assets/validation_test.dart +++ b/pkgs/native_assets_cli/test/code_assets/validation_test.dart @@ -49,11 +49,10 @@ void main() { BuildConfig makeCodeBuildConfig({ LinkModePreference linkModePreference = LinkModePreference.dynamic, - OS os = OS.iOS, }) { final builder = makeBuildConfigBuilder() ..setupCodeConfig( - targetOS: os, + targetOS: OS.linux, targetArchitecture: Architecture.arm64, linkModePreference: linkModePreference, ); @@ -227,8 +226,8 @@ void main() { await validateCodeAssetBuildConfig(BuildConfig(builder.json)); expect( errors, - contains( - contains('BuildConfig.codeConfig.targetIOSVersion was missing'))); + contains(contains( + 'BuildConfig.codeConfig.iOSConfig.targetVersion was missing'))); expect( errors, contains( @@ -242,9 +241,10 @@ void main() { linkModePreference: LinkModePreference.dynamic, ); expect( - await validateCodeAssetBuildConfig(BuildConfig(builder.json)), - contains(contains( - 'BuildConfig.codeConfig.targetAndroidNdkApi was missing'))); + await validateCodeAssetBuildConfig(BuildConfig(builder.json)), + contains(contains( + 'BuildConfig.codeConfig.androidConfig.targetNdkApi was missing')), + ); }); test('Missing targetMacOSVersion', () async { final builder = makeBuildConfigBuilder() @@ -256,7 +256,7 @@ void main() { expect( await validateCodeAssetBuildConfig(BuildConfig(builder.json)), contains(contains( - 'BuildConfig.codeConfig.targetMacOSVersion was missing'))); + 'BuildConfig.codeConfig.macOSConfig.targetVersion was missing'))); }); test('Nonexisting compiler/archiver/linker/envScript', () async { final nonExistent = outDirUri.resolve('foo baz'); diff --git a/pkgs/native_assets_cli/test/example/local_asset_test.dart b/pkgs/native_assets_cli/test/example/local_asset_test.dart index ce57a4b62..cf830d47a 100644 --- a/pkgs/native_assets_cli/test/example/local_asset_test.dart +++ b/pkgs/native_assets_cli/test/example/local_asset_test.dart @@ -40,6 +40,7 @@ void main() async { final testPackageUri = packageUri.resolve('example/build/$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); + final targetOS = OS.current; final configBuilder = BuildConfigBuilder() ..setupHookConfig( packageRoot: testPackageUri, @@ -51,7 +52,10 @@ void main() async { outputDirectoryShared: outputDirectoryShared) ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: dryRun ? null : Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dryRun ? null : cCompiler, diff --git a/pkgs/native_assets_cli/test/example/native_add_library_test.dart b/pkgs/native_assets_cli/test/example/native_add_library_test.dart index 2a3415901..32ab57a1d 100644 --- a/pkgs/native_assets_cli/test/example/native_add_library_test.dart +++ b/pkgs/native_assets_cli/test/example/native_add_library_test.dart @@ -40,6 +40,7 @@ void main() async { final testPackageUri = packageUri.resolve('example/build/$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); + final targetOS = OS.current; final configBuilder = BuildConfigBuilder() ..setupHookConfig( packageRoot: testPackageUri, @@ -52,6 +53,9 @@ void main() async { ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( targetOS: OS.current, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: dryRun ? null : Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dryRun ? null : cCompiler, diff --git a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart index f90d91f15..9e97551d4 100644 --- a/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart +++ b/pkgs/native_assets_cli/test/example/native_dynamic_linking_test.dart @@ -44,6 +44,7 @@ void main() async { final testPackageUri = packageUri.resolve('example/build/$name/'); final dartUri = Uri.file(Platform.resolvedExecutable); + final targetOS = OS.current; final configBuilder = BuildConfigBuilder() ..setupHookConfig( packageRoot: testPackageUri, @@ -56,7 +57,10 @@ void main() async { ) ..setupBuildConfig(linkingEnabled: false, dryRun: dryRun) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: dryRun ? null : Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dryRun ? null : cCompiler, diff --git a/pkgs/native_assets_cli/test/helpers.dart b/pkgs/native_assets_cli/test/helpers.dart index cdd9c5d2b..371038af7 100644 --- a/pkgs/native_assets_cli/test/helpers.dart +++ b/pkgs/native_assets_cli/test/helpers.dart @@ -187,3 +187,5 @@ Logger _createTestLogger({ }); final dartExecutable = File(Platform.resolvedExecutable).uri; + +int defaultMacOSVersion = 13; diff --git a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart index 23d61225c..d593033e7 100644 --- a/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart +++ b/pkgs/native_toolchain_c/lib/src/cbuilder/run_cbuilder.dart @@ -140,7 +140,7 @@ class RunCBuilder { final IOSSdk? targetIosSdk; if (codeConfig.targetOS == OS.iOS) { - targetIosSdk = codeConfig.targetIOSSdk; + targetIosSdk = codeConfig.iOSConfig.targetSdk; } else { targetIosSdk = null; } @@ -152,15 +152,18 @@ class RunCBuilder { if (codeConfig.targetOS == OS.android) { final minimumApi = codeConfig.targetArchitecture == Architecture.riscv64 ? 35 : 21; - targetAndroidNdkApi = max(codeConfig.targetAndroidNdkApi!, minimumApi); + targetAndroidNdkApi = + max(codeConfig.androidConfig.targetNdkApi, minimumApi); } else { targetAndroidNdkApi = null; } - final targetIOSVersion = - codeConfig.targetOS == OS.iOS ? codeConfig.targetIOSVersion : null; - final targetMacOSVersion = - codeConfig.targetOS == OS.macOS ? codeConfig.targetMacOSVersion : null; + final targetIOSVersion = codeConfig.targetOS == OS.iOS + ? codeConfig.iOSConfig.targetVersion + : null; + final targetMacOSVersion = codeConfig.targetOS == OS.macOS + ? codeConfig.macOSConfig.targetVersion + : null; final architecture = codeConfig.targetArchitecture; final sourceFiles = sources.map((e) => e.toFilePath()).toList(); diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart index 7e906878d..c8f1961c9 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_build_failure_test.dart @@ -29,6 +29,7 @@ void main() { await File.fromUri(addCUri).writeAsString(addCBrokenContents); const name = 'add'; + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -40,7 +41,10 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart index cb8e80201..bafad7c78 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_android_test.dart @@ -158,7 +158,7 @@ Future buildLib( targetOS: OS.android, targetArchitecture: targetArchitecture, cCompilerConfig: cCompiler, - targetAndroidNdkApi: androidNdkApi, + androidConfig: AndroidConfig(targetNdkApi: androidNdkApi), linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic : LinkModePreference.static, diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart index 90e358aa5..d8cba0401 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_ios_test.dart @@ -16,6 +16,9 @@ import 'package:test/test.dart'; import '../helpers.dart'; +const flutteriOSHighestBestEffort = 16; +const flutteriOSHighestSupported = 17; + void main() { if (!Platform.isMacOS) { // Avoid needing status files on Dart SDK CI. @@ -86,7 +89,10 @@ void main() { linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic : LinkModePreference.static, - targetIOSSdk: targetIOSSdk, + iOSConfig: IOSConfig( + targetSdk: targetIOSSdk, + targetVersion: flutteriOSHighestBestEffort, + ), cCompilerConfig: cCompiler, ); buildConfigBuilder.setupBuildRunConfig( @@ -130,19 +136,18 @@ void main() { logger: logger, ); expect(otoolResult.exitCode, 0); - if (targetIOSSdk == IOSSdk.iPhoneOS || - target == Architecture.x64) { - // The x64 simulator behaves as device, presumably because the - // devices are never x64. - expect(otoolResult.stdout, contains('LC_VERSION_MIN_IPHONEOS')); - expect(otoolResult.stdout, isNot(contains('LC_BUILD_VERSION'))); + // As of native_assets_cli 0.10.0, the min target OS version is + // always being passed in. + expect(otoolResult.stdout, + isNot(contains('LC_VERSION_MIN_IPHONEOS'))); + expect(otoolResult.stdout, contains('LC_BUILD_VERSION')); + final platform = otoolResult.stdout + .split('\n') + .firstWhere((e) => e.contains('platform')); + if (targetIOSSdk == IOSSdk.iPhoneOS) { + const platformIosDevice = 2; + expect(platform, contains(platformIosDevice.toString())); } else { - expect(otoolResult.stdout, - isNot(contains('LC_VERSION_MIN_IPHONEOS'))); - expect(otoolResult.stdout, contains('LC_BUILD_VERSION')); - final platform = otoolResult.stdout - .split('\n') - .firstWhere((e) => e.contains('platform')); const platformIosSimulator = 7; expect(platform, contains(platformIosSimulator.toString())); } @@ -183,9 +188,6 @@ void main() { } } - const flutteriOSHighestBestEffort = 16; - const flutteriOSHighestSupported = 17; - for (final iosVersion in [ flutteriOSHighestBestEffort, flutteriOSHighestSupported @@ -244,8 +246,10 @@ Future buildLib( linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic : LinkModePreference.static, - targetIOSSdk: IOSSdk.iPhoneOS, - targetIOSVersion: targetIOSVersion, + iOSConfig: IOSConfig( + targetSdk: IOSSdk.iPhoneOS, + targetVersion: targetIOSVersion, + ), cCompilerConfig: cCompiler, ); buildConfigBuilder.setupBuildRunConfig( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart index 9df36f3ad..09c781cee 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_cross_macos_host_test.dart @@ -74,6 +74,7 @@ void main() { ? LinkModePreference.dynamic : LinkModePreference.static, cCompilerConfig: cCompiler, + macOSConfig: MacOSConfig(targetVersion: defaultMacOSVersion), ); buildConfigBuilder.setupBuildRunConfig( outputDirectory: tempUri, @@ -174,7 +175,7 @@ Future buildLib( linkModePreference: linkMode == DynamicLoadingBundled() ? LinkModePreference.dynamic : LinkModePreference.static, - targetMacOSVersion: targetMacOSVersion, + macOSConfig: MacOSConfig(targetVersion: targetMacOSVersion), cCompilerConfig: cCompiler, ); buildConfigBuilder.setupBuildRunConfig( diff --git a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart index 3873a5b85..2d826a2d3 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/cbuilder_test.dart @@ -23,6 +23,10 @@ void main() { expect(Language.cpp.toString(), 'c++'); }); + final targetOS = OS.current; + final macOSConfig = targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null; for (final pic in [null, true, false]) { final picTag = switch (pic) { null => 'auto_pic', true => 'pic', false => 'no_pic' }; @@ -54,7 +58,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -136,7 +141,8 @@ void main() { dryRun: dryRun, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: dryRun ? null : cCompiler, @@ -237,7 +243,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -304,7 +311,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -349,6 +357,7 @@ void main() { final logMessages = []; final logger = createCapturingLogger(logMessages); + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -360,7 +369,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -417,6 +427,7 @@ void main() { final logMessages = []; final logger = createCapturingLogger(logMessages); + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -428,7 +439,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -490,6 +502,7 @@ void main() { final logMessages = []; final logger = createCapturingLogger(logMessages); + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -501,7 +514,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -574,6 +588,7 @@ void main() { final logMessages = []; final logger = createCapturingLogger(logMessages); + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -585,7 +600,8 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: macOSConfig, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, @@ -675,6 +691,7 @@ Future testDefines({ } const name = 'defines'; + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -686,7 +703,10 @@ Future testDefines({ dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: Architecture.current, // Ignored by executables. linkModePreference: LinkModePreference.dynamic, diff --git a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart index 8578f2893..ad4512357 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/compiler_resolver_test.dart @@ -41,6 +41,7 @@ void main() { ...await msvc.vcvars64.defaultResolver!.resolve(logger: logger) ].firstOrNull?.uri; + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -52,7 +53,10 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: CCompilerConfig( diff --git a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart index e251080a2..7a78e01eb 100644 --- a/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart +++ b/pkgs/native_toolchain_c/test/cbuilder/objective_c_test.dart @@ -35,6 +35,7 @@ void main() { final logMessages = []; final logger = createCapturingLogger(logMessages); + final targetOS = OS.current; final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], @@ -46,7 +47,10 @@ void main() { dryRun: false, ) ..setupCodeConfig( - targetOS: OS.current, + targetOS: targetOS, + macOSConfig: targetOS == OS.macOS + ? MacOSConfig(targetVersion: defaultMacOSVersion) + : null, targetArchitecture: Architecture.current, linkModePreference: LinkModePreference.dynamic, cCompilerConfig: cCompiler, diff --git a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart index 2dbc32946..4c76bfef5 100644 --- a/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart +++ b/pkgs/native_toolchain_c/test/clinker/build_testfiles.dart @@ -25,6 +25,7 @@ Future buildTestArchive( final logMessages = []; final logger = createCapturingLogger(logMessages); + assert(os == OS.linux); // Setup code config for other OSes. final buildConfigBuilder = BuildConfigBuilder() ..setupHookConfig( buildAssetTypes: [CodeAsset.type], diff --git a/pkgs/native_toolchain_c/test/helpers.dart b/pkgs/native_toolchain_c/test/helpers.dart index b2c647259..5a04e4923 100644 --- a/pkgs/native_toolchain_c/test/helpers.dart +++ b/pkgs/native_toolchain_c/test/helpers.dart @@ -302,3 +302,5 @@ Future expectPageSize( expect(vma, greaterThanOrEqualTo(pageSize)); } } + +int defaultMacOSVersion = 13;