[jnigen] Rename ctor to new (https://github.com/dart-lang/jnigen/issues/362)
diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 8d2086e..357435d 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md
@@ -1,3 +1,6 @@ +## 0.6.0-wip.3 +* **Breaking Change** ([#354](https://github.com/dart-lang/jnigen/issues/354)): Renamed constructors from `ctor1`, `ctor2`, ... to `new1`, `new2`, ... + ## 0.6.0-wip.2 * Fixed a bug where the nested classes would be generated incorrectly depending on the backend used for generation. * Fixed a bug where ASM backend would produce the incorrect parent for multi-level nested classes. @@ -6,7 +9,7 @@ * Created an experiment called `interface_implementation` which creates a `.implement` method for interfaces, so you can implement them using Dart. ## 0.6.0-wip.1 -* **Breaking Change** Specifying a class always pulls in nested classes by default. If a nested class is specified in config, it will be an error. +* **Breaking Change**: Specifying a class always pulls in nested classes by default. If a nested class is specified in config, it will be an error. * Save all `jnigen` logs to a file in `.dart_tool/jnigen/logs/`. This is useful for debugging. ## 0.6.0-wip.0
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 c4a8f04..024059d 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
@@ -1065,10 +1065,10 @@ /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_ConfigType(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "EmojiCompat_Config__ctor") + "EmojiCompat_Config__new0") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected void <init>(androidx.emoji2.text.EmojiCompat.MetadataRepoLoader metadataLoader) @@ -1079,7 +1079,7 @@ factory EmojiCompat_Config( EmojiCompat_MetadataRepoLoader metadataLoader, ) { - return EmojiCompat_Config.fromRef(_ctor(metadataLoader.reference).object); + return EmojiCompat_Config.fromRef(_new0(metadataLoader.reference).object); } static final _registerInitCallback = jniLookup< @@ -1400,14 +1400,14 @@ /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_MetadataRepoLoaderCallbackType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "EmojiCompat_MetadataRepoLoaderCallback__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "EmojiCompat_MetadataRepoLoaderCallback__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory EmojiCompat_MetadataRepoLoaderCallback() { - return EmojiCompat_MetadataRepoLoaderCallback.fromRef(_ctor().object); + return EmojiCompat_MetadataRepoLoaderCallback.fromRef(_new0().object); } static final _onLoaded = jniLookup< @@ -1653,14 +1653,14 @@ /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_InitCallbackType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "EmojiCompat_InitCallback__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "EmojiCompat_InitCallback__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory EmojiCompat_InitCallback() { - return EmojiCompat_InitCallback.fromRef(_ctor().object); + return EmojiCompat_InitCallback.fromRef(_new0().object); } static final _onInitialized = jniLookup< @@ -1736,14 +1736,14 @@ /// The type which includes information such as the signature of this class. static const type = $EmojiCompat_DefaultSpanFactoryType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "EmojiCompat_DefaultSpanFactory__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "EmojiCompat_DefaultSpanFactory__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory EmojiCompat_DefaultSpanFactory() { - return EmojiCompat_DefaultSpanFactory.fromRef(_ctor().object); + return EmojiCompat_DefaultSpanFactory.fromRef(_new0().object); } static final _createSpan = jniLookup< @@ -1983,15 +1983,15 @@ /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28Type(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 - .fromRef(_ctor().object); + .fromRef(_new0().object); } static final _getSigningSignatures1 = jniLookup< @@ -2070,15 +2070,15 @@ /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19Type(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 - .fromRef(_ctor().object); + .fromRef(_new0().object); } static final _queryIntentContentProviders = jniLookup< @@ -2179,15 +2179,15 @@ /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelperType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef( - _ctor().object); + _new0().object); } static final _getSigningSignatures = jniLookup< @@ -2313,10 +2313,10 @@ /// The type which includes information such as the signature of this class. static const type = $DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactoryType(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__ctor") + "DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigHelper helper) @@ -2327,7 +2327,7 @@ DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper helper, ) { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory.fromRef( - _ctor(helper.reference).object); + _new0(helper.reference).object); } static final _create = jniLookup< @@ -2601,14 +2601,14 @@ static jni.JString get SECURITY_PATCH => const jni.JStringType().fromRef(_get_SECURITY_PATCH().object); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "Build_VERSION__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "Build_VERSION__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Build_VERSION() { - return Build_VERSION.fromRef(_ctor().object); + return Build_VERSION.fromRef(_new0().object); } } @@ -2751,14 +2751,14 @@ /// from: static public final int TIRAMISU static const TIRAMISU = 33; - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "Build_VERSION_CODES__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "Build_VERSION_CODES__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Build_VERSION_CODES() { - return Build_VERSION_CODES.fromRef(_ctor().object); + return Build_VERSION_CODES.fromRef(_new0().object); } } @@ -3066,14 +3066,14 @@ static jni.JString get USER => const jni.JStringType().fromRef(_get_USER().object); - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Build__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Build__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Build() { - return Build.fromRef(_ctor().object); + return Build.fromRef(_new0().object); } static final _getSerial = @@ -3162,9 +3162,9 @@ ); } - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi.NativeFunction<jni.JniResult Function(ffi.Int32, ffi.Float)>>( - "HashMap__ctor") + "HashMap__new0") .asFunction<jni.JniResult Function(int, double)>(); /// from: public void <init>(int i, float f) @@ -3175,46 +3175,46 @@ required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return HashMap.fromRef(K, V, _ctor(i, f).object); + return HashMap.fromRef(K, V, _new0(i, f).object); } - static final _ctor1 = + static final _new1 = jniLookup<ffi.NativeFunction<jni.JniResult Function(ffi.Int32)>>( - "HashMap__ctor1") + "HashMap__new1") .asFunction<jni.JniResult Function(int)>(); /// from: public void <init>(int i) /// The returned object must be deleted after use, by calling the `delete` method. - factory HashMap.ctor1( + factory HashMap.new1( int i, { required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return HashMap.fromRef(K, V, _ctor1(i).object); + return HashMap.fromRef(K, V, _new1(i).object); } - static final _ctor2 = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("HashMap__ctor2") + static final _new2 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("HashMap__new2") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. - factory HashMap.ctor2({ + factory HashMap.new2({ required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return HashMap.fromRef(K, V, _ctor2().object); + return HashMap.fromRef(K, V, _new2().object); } - static final _ctor3 = jniLookup< + static final _new3 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "HashMap__ctor3") + "HashMap__new3") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(java.util.Map map) /// The returned object must be deleted after use, by calling the `delete` method. - factory HashMap.ctor3( + factory HashMap.new3( jni.JMap<$K, $V> map, { jni.JObjType<$K>? K, jni.JObjType<$V>? V, @@ -3225,7 +3225,7 @@ V ??= jni.lowestCommonSuperType([ (map.$type as jni.JMapType).V, ]) as jni.JObjType<$V>; - return HashMap.fromRef(K, V, _ctor3(map.reference).object); + return HashMap.fromRef(K, V, _new3(map.reference).object); } static final _size = jniLookup<
diff --git a/pkgs/jnigen/example/in_app_java/lib/main.dart b/pkgs/jnigen/example/in_app_java/lib/main.dart index 7765b9c..2257581 100644 --- a/pkgs/jnigen/example/in_app_java/lib/main.dart +++ b/pkgs/jnigen/example/in_app_java/lib/main.dart
@@ -12,7 +12,7 @@ JObject activity = JObject.fromRef(Jni.getCurrentActivity()); JObject context = JObject.fromRef(Jni.getCachedApplicationContext()); -final hashmap = HashMap.ctor2(K: JString.type, V: JString.type); +final hashmap = HashMap.new2(K: JString.type, V: JString.type); final emojiCompat = EmojiCompat.get0();
diff --git a/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c b/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c index a6e491c..983838b 100644 --- a/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c +++ b/pkgs/jnigen/example/in_app_java/src/android_utils/android_utils.c
@@ -520,21 +520,21 @@ // androidx.emoji2.text.EmojiCompat$Config jclass _c_EmojiCompat_Config = NULL; -jmethodID _m_EmojiCompat_Config__ctor = NULL; +jmethodID _m_EmojiCompat_Config__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_Config__ctor(jobject metadataLoader) { +JniResult EmojiCompat_Config__new0(jobject metadataLoader) { load_env(); load_class_global_ref(&_c_EmojiCompat_Config, "androidx/emoji2/text/EmojiCompat$Config"); if (_c_EmojiCompat_Config == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_Config, &_m_EmojiCompat_Config__ctor, "<init>", + load_method(_c_EmojiCompat_Config, &_m_EmojiCompat_Config__new0, "<init>", "(Landroidx/emoji2/text/EmojiCompat$MetadataRepoLoader;)V"); - if (_m_EmojiCompat_Config__ctor == NULL) + if (_m_EmojiCompat_Config__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_Config, - _m_EmojiCompat_Config__ctor, metadataLoader); + _m_EmojiCompat_Config__new0, metadataLoader); return to_global_ref_result(_result); } @@ -766,9 +766,9 @@ // androidx.emoji2.text.EmojiCompat$MetadataRepoLoaderCallback jclass _c_EmojiCompat_MetadataRepoLoaderCallback = NULL; -jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__ctor = NULL; +jmethodID _m_EmojiCompat_MetadataRepoLoaderCallback__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_MetadataRepoLoaderCallback__ctor() { +JniResult EmojiCompat_MetadataRepoLoaderCallback__new0() { load_env(); load_class_global_ref( &_c_EmojiCompat_MetadataRepoLoaderCallback, @@ -776,13 +776,13 @@ if (_c_EmojiCompat_MetadataRepoLoaderCallback == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method(_c_EmojiCompat_MetadataRepoLoaderCallback, - &_m_EmojiCompat_MetadataRepoLoaderCallback__ctor, "<init>", + &_m_EmojiCompat_MetadataRepoLoaderCallback__new0, "<init>", "()V"); - if (_m_EmojiCompat_MetadataRepoLoaderCallback__ctor == NULL) + if (_m_EmojiCompat_MetadataRepoLoaderCallback__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_MetadataRepoLoaderCallback, - _m_EmojiCompat_MetadataRepoLoaderCallback__ctor); + _m_EmojiCompat_MetadataRepoLoaderCallback__new0); return to_global_ref_result(_result); } @@ -881,20 +881,20 @@ // androidx.emoji2.text.EmojiCompat$InitCallback jclass _c_EmojiCompat_InitCallback = NULL; -jmethodID _m_EmojiCompat_InitCallback__ctor = NULL; +jmethodID _m_EmojiCompat_InitCallback__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_InitCallback__ctor() { +JniResult EmojiCompat_InitCallback__new0() { load_env(); load_class_global_ref(&_c_EmojiCompat_InitCallback, "androidx/emoji2/text/EmojiCompat$InitCallback"); if (_c_EmojiCompat_InitCallback == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_EmojiCompat_InitCallback, &_m_EmojiCompat_InitCallback__ctor, + load_method(_c_EmojiCompat_InitCallback, &_m_EmojiCompat_InitCallback__new0, "<init>", "()V"); - if (_m_EmojiCompat_InitCallback__ctor == NULL) + if (_m_EmojiCompat_InitCallback__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_InitCallback, - _m_EmojiCompat_InitCallback__ctor); + _m_EmojiCompat_InitCallback__new0); return to_global_ref_result(_result); } @@ -937,21 +937,21 @@ // androidx.emoji2.text.EmojiCompat$DefaultSpanFactory jclass _c_EmojiCompat_DefaultSpanFactory = NULL; -jmethodID _m_EmojiCompat_DefaultSpanFactory__ctor = NULL; +jmethodID _m_EmojiCompat_DefaultSpanFactory__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult EmojiCompat_DefaultSpanFactory__ctor() { +JniResult EmojiCompat_DefaultSpanFactory__new0() { load_env(); load_class_global_ref(&_c_EmojiCompat_DefaultSpanFactory, "androidx/emoji2/text/EmojiCompat$DefaultSpanFactory"); if (_c_EmojiCompat_DefaultSpanFactory == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method(_c_EmojiCompat_DefaultSpanFactory, - &_m_EmojiCompat_DefaultSpanFactory__ctor, "<init>", "()V"); - if (_m_EmojiCompat_DefaultSpanFactory__ctor == NULL) + &_m_EmojiCompat_DefaultSpanFactory__new0, "<init>", "()V"); + if (_m_EmojiCompat_DefaultSpanFactory__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_EmojiCompat_DefaultSpanFactory, - _m_EmojiCompat_DefaultSpanFactory__ctor); + _m_EmojiCompat_DefaultSpanFactory__new0); return to_global_ref_result(_result); } @@ -1025,11 +1025,11 @@ jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 = NULL; jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__ctor = + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0 = NULL; FFI_PLUGIN_EXPORT JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__ctor() { +DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0() { load_env(); load_class_global_ref( &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, @@ -1039,14 +1039,14 @@ return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method( _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__ctor, + &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0, "<init>", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__ctor == + if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__ctor); + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28__new0); return to_global_ref_result(_result); } @@ -1086,11 +1086,11 @@ jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 = NULL; jmethodID - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__ctor = + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0 = NULL; FFI_PLUGIN_EXPORT JniResult -DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__ctor() { +DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0() { load_env(); load_class_global_ref( &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, @@ -1100,14 +1100,14 @@ return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method( _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__ctor, + &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0, "<init>", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__ctor == + if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__ctor); + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19__new0); return to_global_ref_result(_result); } @@ -1177,10 +1177,10 @@ // androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper = NULL; -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__ctor = +jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__ctor() { +JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0() { load_env(); load_class_global_ref( &_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, @@ -1189,13 +1189,13 @@ if (_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method(_c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__ctor, + &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0, "<init>", "()V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__ctor == NULL) + if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__ctor); + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper__new0); return to_global_ref_result(_result); } @@ -1297,10 +1297,10 @@ // androidx.emoji2.text.DefaultEmojiCompatConfig$DefaultEmojiCompatConfigFactory jclass _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory = NULL; -jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__ctor = +jmethodID _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__ctor( +JniResult DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0( jobject helper) { load_env(); load_class_global_ref( @@ -1311,15 +1311,15 @@ return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method( _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__ctor, + &_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0, "<init>", "(Landroidx/emoji2/text/" "DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper;)V"); - if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__ctor == NULL) + if (_m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( jniEnv, _c_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory, - _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__ctor, + _m_DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory__new0, helper); return to_global_ref_result(_result); } @@ -1438,18 +1438,18 @@ // android.os.Build$VERSION jclass _c_Build_VERSION = NULL; -jmethodID _m_Build_VERSION__ctor = NULL; +jmethodID _m_Build_VERSION__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Build_VERSION__ctor() { +JniResult Build_VERSION__new0() { load_env(); load_class_global_ref(&_c_Build_VERSION, "android/os/Build$VERSION"); if (_c_Build_VERSION == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_VERSION, &_m_Build_VERSION__ctor, "<init>", "()V"); - if (_m_Build_VERSION__ctor == NULL) + load_method(_c_Build_VERSION, &_m_Build_VERSION__new0, "<init>", "()V"); + if (_m_Build_VERSION__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Build_VERSION, _m_Build_VERSION__ctor); + (*jniEnv)->NewObject(jniEnv, _c_Build_VERSION, _m_Build_VERSION__new0); return to_global_ref_result(_result); } @@ -1612,37 +1612,37 @@ // android.os.Build$VERSION_CODES jclass _c_Build_VERSION_CODES = NULL; -jmethodID _m_Build_VERSION_CODES__ctor = NULL; +jmethodID _m_Build_VERSION_CODES__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Build_VERSION_CODES__ctor() { +JniResult Build_VERSION_CODES__new0() { load_env(); load_class_global_ref(&_c_Build_VERSION_CODES, "android/os/Build$VERSION_CODES"); if (_c_Build_VERSION_CODES == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build_VERSION_CODES, &_m_Build_VERSION_CODES__ctor, "<init>", + load_method(_c_Build_VERSION_CODES, &_m_Build_VERSION_CODES__new0, "<init>", "()V"); - if (_m_Build_VERSION_CODES__ctor == NULL) + if (_m_Build_VERSION_CODES__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Build_VERSION_CODES, - _m_Build_VERSION_CODES__ctor); + _m_Build_VERSION_CODES__new0); return to_global_ref_result(_result); } // android.os.Build jclass _c_Build = NULL; -jmethodID _m_Build__ctor = NULL; +jmethodID _m_Build__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Build__ctor() { +JniResult Build__new0() { load_env(); load_class_global_ref(&_c_Build, "android/os/Build"); if (_c_Build == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Build, &_m_Build__ctor, "<init>", "()V"); - if (_m_Build__ctor == NULL) + load_method(_c_Build, &_m_Build__new0, "<init>", "()V"); + if (_m_Build__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Build, _m_Build__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Build, _m_Build__new0); return to_global_ref_result(_result); } @@ -2064,62 +2064,62 @@ // java.util.HashMap jclass _c_HashMap = NULL; -jmethodID _m_HashMap__ctor = NULL; +jmethodID _m_HashMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult HashMap__ctor(int32_t i, float f) { +JniResult HashMap__new0(int32_t i, float f) { load_env(); load_class_global_ref(&_c_HashMap, "java/util/HashMap"); if (_c_HashMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__ctor, "<init>", "(IF)V"); - if (_m_HashMap__ctor == NULL) + load_method(_c_HashMap, &_m_HashMap__new0, "<init>", "(IF)V"); + if (_m_HashMap__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__ctor, i, f); + (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new0, i, f); return to_global_ref_result(_result); } -jmethodID _m_HashMap__ctor1 = NULL; +jmethodID _m_HashMap__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult HashMap__ctor1(int32_t i) { +JniResult HashMap__new1(int32_t i) { load_env(); load_class_global_ref(&_c_HashMap, "java/util/HashMap"); if (_c_HashMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__ctor1, "<init>", "(I)V"); - if (_m_HashMap__ctor1 == NULL) + load_method(_c_HashMap, &_m_HashMap__new1, "<init>", "(I)V"); + if (_m_HashMap__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__ctor1, i); + (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new1, i); return to_global_ref_result(_result); } -jmethodID _m_HashMap__ctor2 = NULL; +jmethodID _m_HashMap__new2 = NULL; FFI_PLUGIN_EXPORT -JniResult HashMap__ctor2() { +JniResult HashMap__new2() { load_env(); load_class_global_ref(&_c_HashMap, "java/util/HashMap"); if (_c_HashMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__ctor2, "<init>", "()V"); - if (_m_HashMap__ctor2 == NULL) + load_method(_c_HashMap, &_m_HashMap__new2, "<init>", "()V"); + if (_m_HashMap__new2 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__ctor2); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new2); return to_global_ref_result(_result); } -jmethodID _m_HashMap__ctor3 = NULL; +jmethodID _m_HashMap__new3 = NULL; FFI_PLUGIN_EXPORT -JniResult HashMap__ctor3(jobject map) { +JniResult HashMap__new3(jobject map) { load_env(); load_class_global_ref(&_c_HashMap, "java/util/HashMap"); if (_c_HashMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_HashMap, &_m_HashMap__ctor3, "<init>", "(Ljava/util/Map;)V"); - if (_m_HashMap__ctor3 == NULL) + load_method(_c_HashMap, &_m_HashMap__new3, "<init>", "(Ljava/util/Map;)V"); + if (_m_HashMap__new3 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__ctor3, map); + (*jniEnv)->NewObject(jniEnv, _c_HashMap, _m_HashMap__new3, map); return to_global_ref_result(_result); }
diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index e1002dd..75da7fe 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart
@@ -36,14 +36,14 @@ /// The type which includes information such as the signature of this class. static const type = $ExampleType(); - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example() { - return Example.fromRef(_ctor().object); + return Example.fromRef(_new0().object); } static final _thinkBeforeAnswering = jniLookup<
diff --git a/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c b/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c index fd8b22b..28a2af6 100644 --- a/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c +++ b/pkgs/jnigen/example/kotlin_plugin/src/kotlin_plugin_bindings.c
@@ -18,17 +18,17 @@ // Example jclass _c_Example = NULL; -jmethodID _m_Example__ctor = NULL; +jmethodID _m_Example__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example__ctor() { +JniResult Example__new0() { load_env(); load_class_global_ref(&_c_Example, "Example"); if (_c_Example == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__ctor, "<init>", "()V"); - if (_m_Example__ctor == NULL) + load_method(_c_Example, &_m_Example__new0, "<init>", "()V"); + if (_m_Example__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new0); return to_global_ref_result(_result); }
diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index 170c720..267d2d3 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart
@@ -40,14 +40,14 @@ /// The type which includes information such as the signature of this class. static const type = $NotificationsType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "Notifications__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "Notifications__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Notifications() { - return Notifications.fromRef(_ctor().object); + return Notifications.fromRef(_new0().object); } static final _showNotification = jniLookup<
diff --git a/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c b/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c index 387fe0c..9f1e577 100644 --- a/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c +++ b/pkgs/jnigen/example/notification_plugin/src/notification_plugin.c
@@ -22,19 +22,19 @@ // com.example.notification_plugin.Notifications jclass _c_Notifications = NULL; -jmethodID _m_Notifications__ctor = NULL; +jmethodID _m_Notifications__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Notifications__ctor() { +JniResult Notifications__new0() { load_env(); load_class_global_ref(&_c_Notifications, "com/example/notification_plugin/Notifications"); if (_c_Notifications == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Notifications, &_m_Notifications__ctor, "<init>", "()V"); - if (_m_Notifications__ctor == NULL) + load_method(_c_Notifications, &_m_Notifications__new0, "<init>", "()V"); + if (_m_Notifications__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Notifications, _m_Notifications__ctor); + (*jniEnv)->NewObject(jniEnv, _c_Notifications, _m_Notifications__new0); return to_global_ref_result(_result); }
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 ed3c555..6c103dc 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
@@ -56,8 +56,8 @@ /// The type which includes information such as the signature of this class. static const type = $PDDocumentType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "PDDocument__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "PDDocument__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -66,13 +66,13 @@ /// Creates an empty PDF document. /// You need to add at least one page for the document to be valid. factory PDDocument() { - return PDDocument.fromRef(_ctor().object); + return PDDocument.fromRef(_new0().object); } - static final _ctor1 = jniLookup< + static final _new1 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "PDDocument__ctor1") + "PDDocument__new1") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) @@ -81,16 +81,16 @@ /// Creates an empty PDF document. /// 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.ctor1( + factory PDDocument.new1( jni.JObject memUsageSetting, ) { - return PDDocument.fromRef(_ctor1(memUsageSetting.reference).object); + return PDDocument.fromRef(_new1(memUsageSetting.reference).object); } - static final _ctor2 = jniLookup< + static final _new2 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "PDDocument__ctor2") + "PDDocument__new2") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.cos.COSDocument doc) @@ -98,16 +98,16 @@ /// /// 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.ctor2( + factory PDDocument.new2( jni.JObject doc, ) { - return PDDocument.fromRef(_ctor2(doc.reference).object); + return PDDocument.fromRef(_new2(doc.reference).object); } - static final _ctor3 = jniLookup< + static final _new3 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, - ffi.Pointer<ffi.Void>)>>("PDDocument__ctor3") + ffi.Pointer<ffi.Void>)>>("PDDocument__new3") .asFunction< jni.JniResult Function( ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -118,19 +118,19 @@ /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. ///@param source the parser which is used to read the pdf - factory PDDocument.ctor3( + factory PDDocument.new3( jni.JObject doc, jni.JObject source, ) { - return PDDocument.fromRef(_ctor3(doc.reference, source.reference).object); + return PDDocument.fromRef(_new3(doc.reference, source.reference).object); } - static final _ctor4 = jniLookup< + static final _new4 = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, - ffi.Pointer<ffi.Void>)>>("PDDocument__ctor4") + ffi.Pointer<ffi.Void>)>>("PDDocument__new4") .asFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -142,13 +142,13 @@ ///@param doc The COSDocument that this document wraps. ///@param source the parser which is used to read the pdf ///@param permission he access permissions of the pdf - factory PDDocument.ctor4( + factory PDDocument.new4( jni.JObject doc, jni.JObject source, jni.JObject permission, ) { return PDDocument.fromRef( - _ctor4(doc.reference, source.reference, permission.reference).object); + _new4(doc.reference, source.reference, permission.reference).object); } static final _addPage = jniLookup<
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 5d9a8ff..a12b62a 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
@@ -57,8 +57,8 @@ /// The type which includes information such as the signature of this class. static const type = $PDDocumentInformationType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "PDDocumentInformation__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "PDDocumentInformation__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -66,13 +66,13 @@ /// /// Default Constructor. factory PDDocumentInformation() { - return PDDocumentInformation.fromRef(_ctor().object); + return PDDocumentInformation.fromRef(_new0().object); } - static final _ctor1 = jniLookup< + static final _new1 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "PDDocumentInformation__ctor1") + "PDDocumentInformation__new1") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.cos.COSDictionary dic) @@ -80,10 +80,10 @@ /// /// Constructor that is used for a preexisting dictionary. ///@param dic The underlying dictionary. - factory PDDocumentInformation.ctor1( + factory PDDocumentInformation.new1( jni.JObject dic, ) { - return PDDocumentInformation.fromRef(_ctor1(dic.reference).object); + return PDDocumentInformation.fromRef(_new1(dic.reference).object); } static final _getCOSObject = jniLookup<
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 e2bc490..7f565b0 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
@@ -185,8 +185,8 @@ set output(jni.JObject value) => _set_output(reference, value.reference).check(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "PDFTextStripper__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "PDFTextStripper__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -195,7 +195,7 @@ /// Instantiate a new PDFTextStripper object. ///@throws IOException If there is an error loading the properties. factory PDFTextStripper() { - return PDFTextStripper.fromRef(_ctor().object); + return PDFTextStripper.fromRef(_new0().object); } static final _getText = jniLookup<
diff --git a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c b/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c index 86a8161..6b11133 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c +++ b/pkgs/jnigen/example/pdfbox_plugin/src/third_party/pdfbox_plugin.c
@@ -36,85 +36,85 @@ // org.apache.pdfbox.pdmodel.PDDocument jclass _c_PDDocument = NULL; -jmethodID _m_PDDocument__ctor = NULL; +jmethodID _m_PDDocument__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocument__ctor() { +JniResult PDDocument__new0() { load_env(); load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); if (_c_PDDocument == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__ctor, "<init>", "()V"); - if (_m_PDDocument__ctor == NULL) + load_method(_c_PDDocument, &_m_PDDocument__new0, "<init>", "()V"); + if (_m_PDDocument__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_PDDocument, _m_PDDocument__ctor); + (*jniEnv)->NewObject(jniEnv, _c_PDDocument, _m_PDDocument__new0); return to_global_ref_result(_result); } -jmethodID _m_PDDocument__ctor1 = NULL; +jmethodID _m_PDDocument__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocument__ctor1(jobject memUsageSetting) { +JniResult PDDocument__new1(jobject memUsageSetting) { load_env(); load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); if (_c_PDDocument == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__ctor1, "<init>", + load_method(_c_PDDocument, &_m_PDDocument__new1, "<init>", "(Lorg/apache/pdfbox/io/MemoryUsageSetting;)V"); - if (_m_PDDocument__ctor1 == NULL) + if (_m_PDDocument__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocument, - _m_PDDocument__ctor1, memUsageSetting); + _m_PDDocument__new1, memUsageSetting); return to_global_ref_result(_result); } -jmethodID _m_PDDocument__ctor2 = NULL; +jmethodID _m_PDDocument__new2 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocument__ctor2(jobject doc) { +JniResult PDDocument__new2(jobject doc) { load_env(); load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); if (_c_PDDocument == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__ctor2, "<init>", + load_method(_c_PDDocument, &_m_PDDocument__new2, "<init>", "(Lorg/apache/pdfbox/cos/COSDocument;)V"); - if (_m_PDDocument__ctor2 == NULL) + if (_m_PDDocument__new2 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_PDDocument, _m_PDDocument__ctor2, doc); + (*jniEnv)->NewObject(jniEnv, _c_PDDocument, _m_PDDocument__new2, doc); return to_global_ref_result(_result); } -jmethodID _m_PDDocument__ctor3 = NULL; +jmethodID _m_PDDocument__new3 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocument__ctor3(jobject doc, jobject source) { +JniResult PDDocument__new3(jobject doc, jobject source) { load_env(); load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); if (_c_PDDocument == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__ctor3, "<init>", + load_method(_c_PDDocument, &_m_PDDocument__new3, "<init>", "(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/" "RandomAccessRead;)V"); - if (_m_PDDocument__ctor3 == NULL) + if (_m_PDDocument__new3 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocument, - _m_PDDocument__ctor3, doc, source); + _m_PDDocument__new3, doc, source); return to_global_ref_result(_result); } -jmethodID _m_PDDocument__ctor4 = NULL; +jmethodID _m_PDDocument__new4 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocument__ctor4(jobject doc, jobject source, jobject permission) { +JniResult PDDocument__new4(jobject doc, jobject source, jobject permission) { load_env(); load_class_global_ref(&_c_PDDocument, "org/apache/pdfbox/pdmodel/PDDocument"); if (_c_PDDocument == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocument, &_m_PDDocument__ctor4, "<init>", + load_method(_c_PDDocument, &_m_PDDocument__new4, "<init>", "(Lorg/apache/pdfbox/cos/COSDocument;Lorg/apache/pdfbox/io/" "RandomAccessRead;Lorg/apache/pdfbox/pdmodel/encryption/" "AccessPermission;)V"); - if (_m_PDDocument__ctor4 == NULL) + if (_m_PDDocument__new4 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_PDDocument, _m_PDDocument__ctor4, doc, source, permission); + jniEnv, _c_PDDocument, _m_PDDocument__new4, doc, source, permission); return to_global_ref_result(_result); } @@ -1103,37 +1103,37 @@ // org.apache.pdfbox.pdmodel.PDDocumentInformation jclass _c_PDDocumentInformation = NULL; -jmethodID _m_PDDocumentInformation__ctor = NULL; +jmethodID _m_PDDocumentInformation__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__ctor() { +JniResult PDDocumentInformation__new0() { load_env(); load_class_global_ref(&_c_PDDocumentInformation, "org/apache/pdfbox/pdmodel/PDDocumentInformation"); if (_c_PDDocumentInformation == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__ctor, + load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__new0, "<init>", "()V"); - if (_m_PDDocumentInformation__ctor == NULL) + if (_m_PDDocumentInformation__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocumentInformation, - _m_PDDocumentInformation__ctor); + _m_PDDocumentInformation__new0); return to_global_ref_result(_result); } -jmethodID _m_PDDocumentInformation__ctor1 = NULL; +jmethodID _m_PDDocumentInformation__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult PDDocumentInformation__ctor1(jobject dic) { +JniResult PDDocumentInformation__new1(jobject dic) { load_env(); load_class_global_ref(&_c_PDDocumentInformation, "org/apache/pdfbox/pdmodel/PDDocumentInformation"); if (_c_PDDocumentInformation == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__ctor1, + load_method(_c_PDDocumentInformation, &_m_PDDocumentInformation__new1, "<init>", "(Lorg/apache/pdfbox/cos/COSDictionary;)V"); - if (_m_PDDocumentInformation__ctor1 == NULL) + if (_m_PDDocumentInformation__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDDocumentInformation, - _m_PDDocumentInformation__ctor1, dic); + _m_PDDocumentInformation__new1, dic); return to_global_ref_result(_result); } @@ -1550,19 +1550,19 @@ // org.apache.pdfbox.text.PDFTextStripper jclass _c_PDFTextStripper = NULL; -jmethodID _m_PDFTextStripper__ctor = NULL; +jmethodID _m_PDFTextStripper__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult PDFTextStripper__ctor() { +JniResult PDFTextStripper__new0() { load_env(); load_class_global_ref(&_c_PDFTextStripper, "org/apache/pdfbox/text/PDFTextStripper"); if (_c_PDFTextStripper == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_PDFTextStripper, &_m_PDFTextStripper__ctor, "<init>", "()V"); - if (_m_PDFTextStripper__ctor == NULL) + load_method(_c_PDFTextStripper, &_m_PDFTextStripper__new0, "<init>", "()V"); + if (_m_PDFTextStripper__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_PDFTextStripper, - _m_PDFTextStripper__ctor); + _m_PDFTextStripper__new0); return to_global_ref_result(_result); }
diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index 7f734ac..04d095b 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart
@@ -1242,7 +1242,7 @@ if (node.isCtor) { final className = node.classDecl.finalName; final name = node.finalName; - final ctorName = name == 'ctor' ? className : '$className.$name'; + final ctorName = name == 'new0' ? className : '$className.$name'; final paramsDef = node.params.accept(_ParamDef(resolver)).delimited(', '); final typeClassDef = _encloseIfNotEmpty( '{',
diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index 607216e..74898fb 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart
@@ -197,7 +197,7 @@ @override void visit(Method node) { - final name = node.name == '<init>' ? 'ctor' : node.name; + final name = node.name == '<init>' ? 'new' : node.name; final sig = node.javaSig; // If node is in super class, assign its number, overriding it. final superClass =
diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index 31019dd..c0b3dbf 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml
@@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: jnigen -version: 0.6.0-wip.2 +version: 0.6.0-wip.3 description: Experimental generator for FFI+JNI bindings. repository: https://github.com/dart-lang/jnigen/tree/main/jnigen
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c index 0f6b727..3203612 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c +++ b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/c_bindings/jackson_core.c
@@ -35,88 +35,88 @@ // com.fasterxml.jackson.core.JsonFactory jclass _c_JsonFactory = NULL; -jmethodID _m_JsonFactory__ctor = NULL; +jmethodID _m_JsonFactory__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory__ctor() { +JniResult JsonFactory__new0() { load_env(); load_class_global_ref(&_c_JsonFactory, "com/fasterxml/jackson/core/JsonFactory"); if (_c_JsonFactory == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__ctor, "<init>", "()V"); - if (_m_JsonFactory__ctor == NULL) + load_method(_c_JsonFactory, &_m_JsonFactory__new0, "<init>", "()V"); + if (_m_JsonFactory__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__ctor); + (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__new0); return to_global_ref_result(_result); } -jmethodID _m_JsonFactory__ctor1 = NULL; +jmethodID _m_JsonFactory__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory__ctor1(jobject oc) { +JniResult JsonFactory__new1(jobject oc) { load_env(); load_class_global_ref(&_c_JsonFactory, "com/fasterxml/jackson/core/JsonFactory"); if (_c_JsonFactory == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__ctor1, "<init>", + load_method(_c_JsonFactory, &_m_JsonFactory__new1, "<init>", "(Lcom/fasterxml/jackson/core/ObjectCodec;)V"); - if (_m_JsonFactory__ctor1 == NULL) + if (_m_JsonFactory__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__ctor1, oc); + (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__new1, oc); return to_global_ref_result(_result); } -jmethodID _m_JsonFactory__ctor2 = NULL; +jmethodID _m_JsonFactory__new2 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory__ctor2(jobject src, jobject codec) { +JniResult JsonFactory__new2(jobject src, jobject codec) { load_env(); load_class_global_ref(&_c_JsonFactory, "com/fasterxml/jackson/core/JsonFactory"); if (_c_JsonFactory == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__ctor2, "<init>", + load_method(_c_JsonFactory, &_m_JsonFactory__new2, "<init>", "(Lcom/fasterxml/jackson/core/JsonFactory;Lcom/fasterxml/jackson/" "core/ObjectCodec;)V"); - if (_m_JsonFactory__ctor2 == NULL) + if (_m_JsonFactory__new2 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, - _m_JsonFactory__ctor2, src, codec); + _m_JsonFactory__new2, src, codec); return to_global_ref_result(_result); } -jmethodID _m_JsonFactory__ctor3 = NULL; +jmethodID _m_JsonFactory__new3 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory__ctor3(jobject b) { +JniResult JsonFactory__new3(jobject b) { load_env(); load_class_global_ref(&_c_JsonFactory, "com/fasterxml/jackson/core/JsonFactory"); if (_c_JsonFactory == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__ctor3, "<init>", + load_method(_c_JsonFactory, &_m_JsonFactory__new3, "<init>", "(Lcom/fasterxml/jackson/core/JsonFactoryBuilder;)V"); - if (_m_JsonFactory__ctor3 == NULL) + if (_m_JsonFactory__new3 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__ctor3, b); + (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, _m_JsonFactory__new3, b); return to_global_ref_result(_result); } -jmethodID _m_JsonFactory__ctor4 = NULL; +jmethodID _m_JsonFactory__new4 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonFactory__ctor4(jobject b, uint8_t bogus) { +JniResult JsonFactory__new4(jobject b, uint8_t bogus) { load_env(); load_class_global_ref(&_c_JsonFactory, "com/fasterxml/jackson/core/JsonFactory"); if (_c_JsonFactory == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonFactory, &_m_JsonFactory__ctor4, "<init>", + load_method(_c_JsonFactory, &_m_JsonFactory__new4, "<init>", "(Lcom/fasterxml/jackson/core/TSFBuilder;Z)V"); - if (_m_JsonFactory__ctor4 == NULL) + if (_m_JsonFactory__new4 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_JsonFactory, - _m_JsonFactory__ctor4, b, bogus); + _m_JsonFactory__new4, b, bogus); return to_global_ref_result(_result); } @@ -1562,35 +1562,35 @@ // com.fasterxml.jackson.core.JsonParser jclass _c_JsonParser = NULL; -jmethodID _m_JsonParser__ctor = NULL; +jmethodID _m_JsonParser__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonParser__ctor() { +JniResult JsonParser__new0() { load_env(); load_class_global_ref(&_c_JsonParser, "com/fasterxml/jackson/core/JsonParser"); if (_c_JsonParser == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__ctor, "<init>", "()V"); - if (_m_JsonParser__ctor == NULL) + load_method(_c_JsonParser, &_m_JsonParser__new0, "<init>", "()V"); + if (_m_JsonParser__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_JsonParser, _m_JsonParser__ctor); + (*jniEnv)->NewObject(jniEnv, _c_JsonParser, _m_JsonParser__new0); return to_global_ref_result(_result); } -jmethodID _m_JsonParser__ctor1 = NULL; +jmethodID _m_JsonParser__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult JsonParser__ctor1(int32_t features) { +JniResult JsonParser__new1(int32_t features) { load_env(); load_class_global_ref(&_c_JsonParser, "com/fasterxml/jackson/core/JsonParser"); if (_c_JsonParser == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_JsonParser, &_m_JsonParser__ctor1, "<init>", "(I)V"); - if (_m_JsonParser__ctor1 == NULL) + load_method(_c_JsonParser, &_m_JsonParser__new1, "<init>", "(I)V"); + if (_m_JsonParser__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_JsonParser, - _m_JsonParser__ctor1, features); + _m_JsonParser__new1, features); return to_global_ref_result(_result); }
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart index 1e60c8a..7112fc3 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart
@@ -121,8 +121,8 @@ static jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => const jni.JObjectType() .fromRef(_get_DEFAULT_ROOT_VALUE_SEPARATOR().object); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "JsonFactory__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "JsonFactory__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -137,27 +137,27 @@ /// and this reuse only works within context of a single /// factory instance. factory JsonFactory() { - return JsonFactory.fromRef(_ctor().object); + return JsonFactory.fromRef(_new0().object); } - static final _ctor1 = jniLookup< + static final _new1 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "JsonFactory__ctor1") + "JsonFactory__new1") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.fasterxml.jackson.core.ObjectCodec oc) /// The returned object must be deleted after use, by calling the `delete` method. - factory JsonFactory.ctor1( + factory JsonFactory.new1( jni.JObject oc, ) { - return JsonFactory.fromRef(_ctor1(oc.reference).object); + return JsonFactory.fromRef(_new1(oc.reference).object); } - static final _ctor2 = jniLookup< + static final _new2 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, - ffi.Pointer<ffi.Void>)>>("JsonFactory__ctor2") + ffi.Pointer<ffi.Void>)>>("JsonFactory__new2") .asFunction< jni.JniResult Function( ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -169,17 +169,17 @@ ///@param src Original factory to copy settings from ///@param codec Databinding-level codec to use, if any ///@since 2.2.1 - factory JsonFactory.ctor2( + factory JsonFactory.new2( JsonFactory src, jni.JObject codec, ) { - return JsonFactory.fromRef(_ctor2(src.reference, codec.reference).object); + return JsonFactory.fromRef(_new2(src.reference, codec.reference).object); } - static final _ctor3 = jniLookup< + static final _new3 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "JsonFactory__ctor3") + "JsonFactory__new3") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.fasterxml.jackson.core.JsonFactoryBuilder b) @@ -188,16 +188,16 @@ /// Constructor used by JsonFactoryBuilder for instantiation. ///@param b Builder that contains settings to use ///@since 2.10 - factory JsonFactory.ctor3( + factory JsonFactory.new3( jni.JObject b, ) { - return JsonFactory.fromRef(_ctor3(b.reference).object); + return JsonFactory.fromRef(_new3(b.reference).object); } - static final _ctor4 = jniLookup< + static final _new4 = jniLookup< ffi.NativeFunction< jni.JniResult Function( - ffi.Pointer<ffi.Void>, ffi.Uint8)>>("JsonFactory__ctor4") + ffi.Pointer<ffi.Void>, ffi.Uint8)>>("JsonFactory__new4") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: protected void <init>(com.fasterxml.jackson.core.TSFBuilder<?,?> b, boolean bogus) @@ -208,11 +208,11 @@ /// implementation for json. ///@param b Builder that contains settings to use ///@param bogus Argument only needed to separate constructor signature; ignored - factory JsonFactory.ctor4( + factory JsonFactory.new4( jni.JObject b, bool bogus, ) { - return JsonFactory.fromRef(_ctor4(b.reference, bogus ? 1 : 0).object); + return JsonFactory.fromRef(_new4(b.reference, bogus ? 1 : 0).object); } static final _rebuild = jniLookup<
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart index 8790d3c..7828fd8 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
@@ -71,27 +71,27 @@ static jni.JObject get DEFAULT_READ_CAPABILITIES => const jni.JObjectType().fromRef(_get_DEFAULT_READ_CAPABILITIES().object); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "JsonParser__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "JsonParser__new0") .asFunction<jni.JniResult Function()>(); /// from: protected void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory JsonParser() { - return JsonParser.fromRef(_ctor().object); + return JsonParser.fromRef(_new0().object); } - static final _ctor1 = + static final _new1 = jniLookup<ffi.NativeFunction<jni.JniResult Function(ffi.Int32)>>( - "JsonParser__ctor1") + "JsonParser__new1") .asFunction<jni.JniResult Function(int)>(); /// from: protected void <init>(int features) /// The returned object must be deleted after use, by calling the `delete` method. - factory JsonParser.ctor1( + factory JsonParser.new1( int features, ) { - return JsonParser.fromRef(_ctor1(features).object); + return JsonParser.fromRef(_new1(features).object); } static final _getCodec = jniLookup<
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart index 71a79f1..e5045b9 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonFactory.dart
@@ -140,7 +140,7 @@ jni.JniCallType.objectType) .object); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() @@ -156,22 +156,22 @@ /// factory instance. factory JsonFactory() { return JsonFactory.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } - static final _id_ctor1 = jni.Jni.accessors.getMethodIDOf(_class.reference, + static final _id_new1 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(Lcom/fasterxml/jackson/core/ObjectCodec;)V"); /// from: public void <init>(com.fasterxml.jackson.core.ObjectCodec oc) /// The returned object must be deleted after use, by calling the `delete` method. - factory JsonFactory.ctor1( + factory JsonFactory.new1( jni.JObject oc, ) { return JsonFactory.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor1, [oc.reference]).object); + .newObjectWithArgs(_class.reference, _id_new1, [oc.reference]).object); } - static final _id_ctor2 = jni.Jni.accessors.getMethodIDOf( + static final _id_new2 = jni.Jni.accessors.getMethodIDOf( _class.reference, r"<init>", r"(Lcom/fasterxml/jackson/core/JsonFactory;Lcom/fasterxml/jackson/core/ObjectCodec;)V"); @@ -183,15 +183,15 @@ ///@param src Original factory to copy settings from ///@param codec Databinding-level codec to use, if any ///@since 2.2.1 - factory JsonFactory.ctor2( + factory JsonFactory.new2( JsonFactory src, jni.JObject codec, ) { return JsonFactory.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor2, [src.reference, codec.reference]).object); + _class.reference, _id_new2, [src.reference, codec.reference]).object); } - static final _id_ctor3 = jni.Jni.accessors.getMethodIDOf(_class.reference, + static final _id_new3 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(Lcom/fasterxml/jackson/core/JsonFactoryBuilder;)V"); /// from: public void <init>(com.fasterxml.jackson.core.JsonFactoryBuilder b) @@ -200,14 +200,14 @@ /// Constructor used by JsonFactoryBuilder for instantiation. ///@param b Builder that contains settings to use ///@since 2.10 - factory JsonFactory.ctor3( + factory JsonFactory.new3( jni.JObject b, ) { return JsonFactory.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor3, [b.reference]).object); + .newObjectWithArgs(_class.reference, _id_new3, [b.reference]).object); } - static final _id_ctor4 = jni.Jni.accessors.getMethodIDOf(_class.reference, + static final _id_new4 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(Lcom/fasterxml/jackson/core/TSFBuilder;Z)V"); /// from: protected void <init>(com.fasterxml.jackson.core.TSFBuilder<?,?> b, boolean bogus) @@ -218,12 +218,12 @@ /// implementation for json. ///@param b Builder that contains settings to use ///@param bogus Argument only needed to separate constructor signature; ignored - factory JsonFactory.ctor4( + factory JsonFactory.new4( jni.JObject b, bool bogus, ) { return JsonFactory.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor4, [b.reference, bogus ? 1 : 0]).object); + _class.reference, _id_new4, [b.reference, bogus ? 1 : 0]).object); } static final _id_rebuild = jni.Jni.accessors.getMethodIDOf(_class.reference,
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart index f978756..115c360 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonParser.dart
@@ -78,26 +78,26 @@ jni.JniCallType.objectType) .object); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: protected void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory JsonParser() { return JsonParser.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } - static final _id_ctor1 = + static final _id_new1 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(I)V"); /// from: protected void <init>(int features) /// The returned object must be deleted after use, by calling the `delete` method. - factory JsonParser.ctor1( + factory JsonParser.new1( int features, ) { return JsonParser.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor1, [jni.JValueInt(features)]).object); + _class.reference, _id_new1, [jni.JValueInt(features)]).object); } static final _id_getCodec = jni.Jni.accessors.getMethodIDOf(_class.reference,
diff --git a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c b/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c index b131ce9..e3c227e 100644 --- a/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c +++ b/pkgs/jnigen/test/kotlin_test/c_based/c_bindings/kotlin.c
@@ -22,19 +22,19 @@ // com.github.dart_lang.jnigen.SuspendFun jclass _c_SuspendFun = NULL; -jmethodID _m_SuspendFun__ctor = NULL; +jmethodID _m_SuspendFun__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult SuspendFun__ctor() { +JniResult SuspendFun__new0() { load_env(); load_class_global_ref(&_c_SuspendFun, "com/github/dart_lang/jnigen/SuspendFun"); if (_c_SuspendFun == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_SuspendFun, &_m_SuspendFun__ctor, "<init>", "()V"); - if (_m_SuspendFun__ctor == NULL) + load_method(_c_SuspendFun, &_m_SuspendFun__new0, "<init>", "()V"); + if (_m_SuspendFun__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_SuspendFun, _m_SuspendFun__ctor); + (*jniEnv)->NewObject(jniEnv, _c_SuspendFun, _m_SuspendFun__new0); return to_global_ref_result(_result); }
diff --git a/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart index 3e65d3b..67c1e4d 100644 --- a/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/c_based/dart_bindings/kotlin.dart
@@ -40,14 +40,14 @@ /// The type which includes information such as the signature of this class. static const type = $SuspendFunType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "SuspendFun__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "SuspendFun__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory SuspendFun() { - return SuspendFun.fromRef(_ctor().object); + return SuspendFun.fromRef(_new0().object); } static final _sayHello = jniLookup<
diff --git a/pkgs/jnigen/test/kotlin_test/dart_only/dart_bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/dart_only/dart_bindings/kotlin.dart index e4ceec3..9b9ce95 100644 --- a/pkgs/jnigen/test/kotlin_test/dart_only/dart_bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/dart_only/dart_bindings/kotlin.dart
@@ -38,14 +38,14 @@ /// The type which includes information such as the signature of this class. static const type = $SuspendFunType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory SuspendFun() { return SuspendFun.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } static final _id_sayHello = jni.Jni.accessors.getMethodIDOf(_class.reference,
diff --git a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c b/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c index 9b6e5e1..18621f8 100644 --- a/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c +++ b/pkgs/jnigen/test/simple_package_test/c_based/c_bindings/simple_package.c
@@ -402,89 +402,89 @@ return to_global_ref_result(_result); } -jmethodID _m_Example__ctor = NULL; +jmethodID _m_Example__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example__ctor() { +JniResult Example__new0() { load_env(); load_class_global_ref(&_c_Example, "com/github/dart_lang/jnigen/simple_package/Example"); if (_c_Example == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__ctor, "<init>", "()V"); - if (_m_Example__ctor == NULL) + load_method(_c_Example, &_m_Example__new0, "<init>", "()V"); + if (_m_Example__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new0); return to_global_ref_result(_result); } -jmethodID _m_Example__ctor1 = NULL; +jmethodID _m_Example__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult Example__ctor1(int32_t number) { +JniResult Example__new1(int32_t number) { load_env(); load_class_global_ref(&_c_Example, "com/github/dart_lang/jnigen/simple_package/Example"); if (_c_Example == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__ctor1, "<init>", "(I)V"); - if (_m_Example__ctor1 == NULL) + load_method(_c_Example, &_m_Example__new1, "<init>", "(I)V"); + if (_m_Example__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__ctor1, number); + (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new1, number); return to_global_ref_result(_result); } -jmethodID _m_Example__ctor2 = NULL; +jmethodID _m_Example__new2 = NULL; FFI_PLUGIN_EXPORT -JniResult Example__ctor2(int32_t number, uint8_t isUp) { +JniResult Example__new2(int32_t number, uint8_t isUp) { load_env(); load_class_global_ref(&_c_Example, "com/github/dart_lang/jnigen/simple_package/Example"); if (_c_Example == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__ctor2, "<init>", "(IZ)V"); - if (_m_Example__ctor2 == NULL) + load_method(_c_Example, &_m_Example__new2, "<init>", "(IZ)V"); + if (_m_Example__new2 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__ctor2, number, isUp); + (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new2, number, isUp); return to_global_ref_result(_result); } -jmethodID _m_Example__ctor3 = NULL; +jmethodID _m_Example__new3 = NULL; FFI_PLUGIN_EXPORT -JniResult Example__ctor3(int32_t number, uint8_t isUp, jobject codename) { +JniResult Example__new3(int32_t number, uint8_t isUp, jobject codename) { load_env(); load_class_global_ref(&_c_Example, "com/github/dart_lang/jnigen/simple_package/Example"); if (_c_Example == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__ctor3, "<init>", + load_method(_c_Example, &_m_Example__new3, "<init>", "(IZLjava/lang/String;)V"); - if (_m_Example__ctor3 == NULL) + if (_m_Example__new3 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__ctor3, + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new3, number, isUp, codename); return to_global_ref_result(_result); } -jmethodID _m_Example__ctor4 = NULL; +jmethodID _m_Example__new4 = NULL; FFI_PLUGIN_EXPORT -JniResult Example__ctor4(int32_t a, - int32_t b, - int32_t c, - int32_t d, - int32_t e, - int32_t f, - int32_t g, - int32_t h) { +JniResult Example__new4(int32_t a, + int32_t b, + int32_t c, + int32_t d, + int32_t e, + int32_t f, + int32_t g, + int32_t h) { load_env(); load_class_global_ref(&_c_Example, "com/github/dart_lang/jnigen/simple_package/Example"); if (_c_Example == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example, &_m_Example__ctor4, "<init>", "(IIIIIIII)V"); - if (_m_Example__ctor4 == NULL) + load_method(_c_Example, &_m_Example__new4, "<init>", "(IIIIIIII)V"); + if (_m_Example__new4 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__ctor4, + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example, _m_Example__new4, a, b, c, d, e, f, g, h); return to_global_ref_result(_result); } @@ -590,20 +590,20 @@ // com.github.dart_lang.jnigen.simple_package.Example$Nested jclass _c_Example_Nested = NULL; -jmethodID _m_Example_Nested__ctor = NULL; +jmethodID _m_Example_Nested__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example_Nested__ctor(uint8_t value) { +JniResult Example_Nested__new0(uint8_t value) { load_env(); load_class_global_ref( &_c_Example_Nested, "com/github/dart_lang/jnigen/simple_package/Example$Nested"); if (_c_Example_Nested == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example_Nested, &_m_Example_Nested__ctor, "<init>", "(Z)V"); - if (_m_Example_Nested__ctor == NULL) + load_method(_c_Example_Nested, &_m_Example_Nested__new0, "<init>", "(Z)V"); + if (_m_Example_Nested__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example_Nested, - _m_Example_Nested__ctor, value); + _m_Example_Nested__new0, value); return to_global_ref_result(_result); } @@ -663,9 +663,9 @@ // com.github.dart_lang.jnigen.simple_package.Example$Nested$NestedTwice jclass _c_Example_Nested_NestedTwice = NULL; -jmethodID _m_Example_Nested_NestedTwice__ctor = NULL; +jmethodID _m_Example_Nested_NestedTwice__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example_Nested_NestedTwice__ctor() { +JniResult Example_Nested_NestedTwice__new0() { load_env(); load_class_global_ref( &_c_Example_Nested_NestedTwice, @@ -673,11 +673,11 @@ if (_c_Example_Nested_NestedTwice == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method(_c_Example_Nested_NestedTwice, - &_m_Example_Nested_NestedTwice__ctor, "<init>", "()V"); - if (_m_Example_Nested_NestedTwice__ctor == NULL) + &_m_Example_Nested_NestedTwice__new0, "<init>", "()V"); + if (_m_Example_Nested_NestedTwice__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Example_Nested_NestedTwice, - _m_Example_Nested_NestedTwice__ctor); + _m_Example_Nested_NestedTwice__new0); return to_global_ref_result(_result); } @@ -716,56 +716,56 @@ // com.github.dart_lang.jnigen.simple_package.Exceptions jclass _c_Exceptions = NULL; -jmethodID _m_Exceptions__ctor = NULL; +jmethodID _m_Exceptions__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__ctor() { +JniResult Exceptions__new0() { load_env(); load_class_global_ref( &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); if (_c_Exceptions == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__ctor, "<init>", "()V"); - if (_m_Exceptions__ctor == NULL) + load_method(_c_Exceptions, &_m_Exceptions__new0, "<init>", "()V"); + if (_m_Exceptions__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__ctor); + (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__new0); return to_global_ref_result(_result); } -jmethodID _m_Exceptions__ctor1 = NULL; +jmethodID _m_Exceptions__new1 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__ctor1(float x) { +JniResult Exceptions__new1(float x) { load_env(); load_class_global_ref( &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); if (_c_Exceptions == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__ctor1, "<init>", "(F)V"); - if (_m_Exceptions__ctor1 == NULL) + load_method(_c_Exceptions, &_m_Exceptions__new1, "<init>", "(F)V"); + if (_m_Exceptions__new1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__ctor1, x); + (*jniEnv)->NewObject(jniEnv, _c_Exceptions, _m_Exceptions__new1, x); return to_global_ref_result(_result); } -jmethodID _m_Exceptions__ctor2 = NULL; +jmethodID _m_Exceptions__new2 = NULL; FFI_PLUGIN_EXPORT -JniResult Exceptions__ctor2(int32_t a, - int32_t b, - int32_t c, - int32_t d, - int32_t e, - int32_t f) { +JniResult Exceptions__new2(int32_t a, + int32_t b, + int32_t c, + int32_t d, + int32_t e, + int32_t f) { load_env(); load_class_global_ref( &_c_Exceptions, "com/github/dart_lang/jnigen/simple_package/Exceptions"); if (_c_Exceptions == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Exceptions, &_m_Exceptions__ctor2, "<init>", "(IIIIII)V"); - if (_m_Exceptions__ctor2 == NULL) + load_method(_c_Exceptions, &_m_Exceptions__new2, "<init>", "(IIIIII)V"); + if (_m_Exceptions__new2 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_Exceptions, _m_Exceptions__ctor2, a, b, c, d, e, f); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Exceptions, + _m_Exceptions__new2, a, b, c, d, e, f); return to_global_ref_result(_result); } @@ -1009,18 +1009,18 @@ // com.github.dart_lang.jnigen.simple_package.Fields jclass _c_Fields = NULL; -jmethodID _m_Fields__ctor = NULL; +jmethodID _m_Fields__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Fields__ctor() { +JniResult Fields__new0() { load_env(); load_class_global_ref(&_c_Fields, "com/github/dart_lang/jnigen/simple_package/Fields"); if (_c_Fields == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Fields, &_m_Fields__ctor, "<init>", "()V"); - if (_m_Fields__ctor == NULL) + load_method(_c_Fields, &_m_Fields__new0, "<init>", "()V"); + if (_m_Fields__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Fields, _m_Fields__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_Fields, _m_Fields__new0); return to_global_ref_result(_result); } @@ -1288,20 +1288,20 @@ // com.github.dart_lang.jnigen.simple_package.Fields$Nested jclass _c_Fields_Nested = NULL; -jmethodID _m_Fields_Nested__ctor = NULL; +jmethodID _m_Fields_Nested__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Fields_Nested__ctor() { +JniResult Fields_Nested__new0() { load_env(); load_class_global_ref( &_c_Fields_Nested, "com/github/dart_lang/jnigen/simple_package/Fields$Nested"); if (_c_Fields_Nested == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Fields_Nested, &_m_Fields_Nested__ctor, "<init>", "()V"); - if (_m_Fields_Nested__ctor == NULL) + load_method(_c_Fields_Nested, &_m_Fields_Nested__new0, "<init>", "()V"); + if (_m_Fields_Nested__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Fields_Nested, _m_Fields_Nested__ctor); + (*jniEnv)->NewObject(jniEnv, _c_Fields_Nested, _m_Fields_Nested__new0); return to_global_ref_result(_result); } @@ -1367,17 +1367,17 @@ // com.github.dart_lang.jnigen.pkg2.C2 jclass _c_C2 = NULL; -jmethodID _m_C2__ctor = NULL; +jmethodID _m_C2__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult C2__ctor() { +JniResult C2__new0() { load_env(); load_class_global_ref(&_c_C2, "com/github/dart_lang/jnigen/pkg2/C2"); if (_c_C2 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_C2, &_m_C2__ctor, "<init>", "()V"); - if (_m_C2__ctor == NULL) + load_method(_c_C2, &_m_C2__new0, "<init>", "()V"); + if (_m_C2__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_C2, _m_C2__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_C2, _m_C2__new0); return to_global_ref_result(_result); } @@ -1408,19 +1408,19 @@ // com.github.dart_lang.jnigen.pkg2.Example jclass _c_Example1 = NULL; -jmethodID _m_Example1__ctor = NULL; +jmethodID _m_Example1__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult Example1__ctor() { +JniResult Example1__new0() { load_env(); load_class_global_ref(&_c_Example1, "com/github/dart_lang/jnigen/pkg2/Example"); if (_c_Example1 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_Example1, &_m_Example1__ctor, "<init>", "()V"); - if (_m_Example1__ctor == NULL) + load_method(_c_Example1, &_m_Example1__new0, "<init>", "()V"); + if (_m_Example1__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_Example1, _m_Example1__ctor); + (*jniEnv)->NewObject(jniEnv, _c_Example1, _m_Example1__new0); return to_global_ref_result(_result); } @@ -1443,20 +1443,20 @@ // com.github.dart_lang.jnigen.generics.GrandParent jclass _c_GrandParent = NULL; -jmethodID _m_GrandParent__ctor = NULL; +jmethodID _m_GrandParent__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent__ctor(jobject value) { +JniResult GrandParent__new0(jobject value) { load_env(); load_class_global_ref(&_c_GrandParent, "com/github/dart_lang/jnigen/generics/GrandParent"); if (_c_GrandParent == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent, &_m_GrandParent__ctor, "<init>", + load_method(_c_GrandParent, &_m_GrandParent__new0, "<init>", "(Ljava/lang/Object;)V"); - if (_m_GrandParent__ctor == NULL) + if (_m_GrandParent__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_GrandParent, _m_GrandParent__ctor, value); + (*jniEnv)->NewObject(jniEnv, _c_GrandParent, _m_GrandParent__new0, value); return to_global_ref_result(_result); } @@ -1582,23 +1582,23 @@ // com.github.dart_lang.jnigen.generics.GrandParent$Parent jclass _c_GrandParent_Parent = NULL; -jmethodID _m_GrandParent_Parent__ctor = NULL; +jmethodID _m_GrandParent_Parent__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_Parent__ctor(jobject _parent, jobject newValue) { +JniResult GrandParent_Parent__new0(jobject _parent, jobject newValue) { load_env(); load_class_global_ref( &_c_GrandParent_Parent, "com/github/dart_lang/jnigen/generics/GrandParent$Parent"); if (_c_GrandParent_Parent == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent_Parent, &_m_GrandParent_Parent__ctor, "<init>", + load_method(_c_GrandParent_Parent, &_m_GrandParent_Parent__new0, "<init>", "(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/" "Object;)V"); - if (_m_GrandParent_Parent__ctor == NULL) + if (_m_GrandParent_Parent__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GrandParent_Parent, - _m_GrandParent_Parent__ctor, _parent, newValue); + _m_GrandParent_Parent__new0, _parent, newValue); return to_global_ref_result(_result); } @@ -1666,23 +1666,23 @@ // com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child jclass _c_GrandParent_Parent_Child = NULL; -jmethodID _m_GrandParent_Parent_Child__ctor = NULL; +jmethodID _m_GrandParent_Parent_Child__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_Parent_Child__ctor(jobject _parent, jobject newValue) { +JniResult GrandParent_Parent_Child__new0(jobject _parent, jobject newValue) { load_env(); load_class_global_ref( &_c_GrandParent_Parent_Child, "com/github/dart_lang/jnigen/generics/GrandParent$Parent$Child"); if (_c_GrandParent_Parent_Child == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent_Parent_Child, &_m_GrandParent_Parent_Child__ctor, + load_method(_c_GrandParent_Parent_Child, &_m_GrandParent_Parent_Child__new0, "<init>", "(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/" "lang/Object;)V"); - if (_m_GrandParent_Parent_Child__ctor == NULL) + if (_m_GrandParent_Parent_Child__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GrandParent_Parent_Child, - _m_GrandParent_Parent_Child__ctor, + _m_GrandParent_Parent_Child__new0, _parent, newValue); return to_global_ref_result(_result); } @@ -1789,22 +1789,22 @@ // com.github.dart_lang.jnigen.generics.GrandParent$StaticParent jclass _c_GrandParent_StaticParent = NULL; -jmethodID _m_GrandParent_StaticParent__ctor = NULL; +jmethodID _m_GrandParent_StaticParent__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_StaticParent__ctor(jobject value) { +JniResult GrandParent_StaticParent__new0(jobject value) { load_env(); load_class_global_ref( &_c_GrandParent_StaticParent, "com/github/dart_lang/jnigen/generics/GrandParent$StaticParent"); if (_c_GrandParent_StaticParent == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_GrandParent_StaticParent, &_m_GrandParent_StaticParent__ctor, + load_method(_c_GrandParent_StaticParent, &_m_GrandParent_StaticParent__new0, "<init>", "(Ljava/lang/Object;)V"); - if (_m_GrandParent_StaticParent__ctor == NULL) + if (_m_GrandParent_StaticParent__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_GrandParent_StaticParent, - _m_GrandParent_StaticParent__ctor, value); + _m_GrandParent_StaticParent__new0, value); return to_global_ref_result(_result); } @@ -1842,9 +1842,9 @@ // com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child jclass _c_GrandParent_StaticParent_Child = NULL; -jmethodID _m_GrandParent_StaticParent_Child__ctor = NULL; +jmethodID _m_GrandParent_StaticParent_Child__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult GrandParent_StaticParent_Child__ctor(jobject _parent, +JniResult GrandParent_StaticParent_Child__new0(jobject _parent, jobject parentValue, jobject value) { load_env(); @@ -1855,14 +1855,14 @@ return (JniResult){.value = {.j = 0}, .exception = check_exception()}; load_method( _c_GrandParent_StaticParent_Child, - &_m_GrandParent_StaticParent_Child__ctor, "<init>", + &_m_GrandParent_StaticParent_Child__new0, "<init>", "(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/" "lang/Object;Ljava/lang/Object;)V"); - if (_m_GrandParent_StaticParent_Child__ctor == NULL) + if (_m_GrandParent_StaticParent_Child__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( jniEnv, _c_GrandParent_StaticParent_Child, - _m_GrandParent_StaticParent_Child__ctor, _parent, parentValue, value); + _m_GrandParent_StaticParent_Child__new0, _parent, parentValue, value); return to_global_ref_result(_result); } @@ -1937,18 +1937,18 @@ // com.github.dart_lang.jnigen.generics.MyMap jclass _c_MyMap = NULL; -jmethodID _m_MyMap__ctor = NULL; +jmethodID _m_MyMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyMap__ctor() { +JniResult MyMap__new0() { load_env(); load_class_global_ref(&_c_MyMap, "com/github/dart_lang/jnigen/generics/MyMap"); if (_c_MyMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap, &_m_MyMap__ctor, "<init>", "()V"); - if (_m_MyMap__ctor == NULL) + load_method(_c_MyMap, &_m_MyMap__new0, "<init>", "()V"); + if (_m_MyMap__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyMap, _m_MyMap__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyMap, _m_MyMap__new0); return to_global_ref_result(_result); } @@ -2006,21 +2006,21 @@ // com.github.dart_lang.jnigen.generics.MyMap$MyEntry jclass _c_MyMap_MyEntry = NULL; -jmethodID _m_MyMap_MyEntry__ctor = NULL; +jmethodID _m_MyMap_MyEntry__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyMap_MyEntry__ctor(jobject _parent, jobject key, jobject value) { +JniResult MyMap_MyEntry__new0(jobject _parent, jobject key, jobject value) { load_env(); load_class_global_ref(&_c_MyMap_MyEntry, "com/github/dart_lang/jnigen/generics/MyMap$MyEntry"); if (_c_MyMap_MyEntry == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyMap_MyEntry, &_m_MyMap_MyEntry__ctor, "<init>", + load_method(_c_MyMap_MyEntry, &_m_MyMap_MyEntry__new0, "<init>", "(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/" "Object;Ljava/lang/Object;)V"); - if (_m_MyMap_MyEntry__ctor == NULL) + if (_m_MyMap_MyEntry__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject( - jniEnv, _c_MyMap_MyEntry, _m_MyMap_MyEntry__ctor, _parent, key, value); + jniEnv, _c_MyMap_MyEntry, _m_MyMap_MyEntry__new0, _parent, key, value); return to_global_ref_result(_result); } @@ -2083,18 +2083,18 @@ // com.github.dart_lang.jnigen.generics.MyStack jclass _c_MyStack = NULL; -jmethodID _m_MyStack__ctor = NULL; +jmethodID _m_MyStack__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyStack__ctor() { +JniResult MyStack__new0() { load_env(); load_class_global_ref(&_c_MyStack, "com/github/dart_lang/jnigen/generics/MyStack"); if (_c_MyStack == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyStack, &_m_MyStack__ctor, "<init>", "()V"); - if (_m_MyStack__ctor == NULL) + load_method(_c_MyStack, &_m_MyStack__new0, "<init>", "()V"); + if (_m_MyStack__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyStack, _m_MyStack__ctor); + jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyStack, _m_MyStack__new0); return to_global_ref_result(_result); } @@ -2237,76 +2237,76 @@ // com.github.dart_lang.jnigen.generics.StringKeyedMap jclass _c_StringKeyedMap = NULL; -jmethodID _m_StringKeyedMap__ctor = NULL; +jmethodID _m_StringKeyedMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult StringKeyedMap__ctor() { +JniResult StringKeyedMap__new0() { load_env(); load_class_global_ref(&_c_StringKeyedMap, "com/github/dart_lang/jnigen/generics/StringKeyedMap"); if (_c_StringKeyedMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringKeyedMap, &_m_StringKeyedMap__ctor, "<init>", "()V"); - if (_m_StringKeyedMap__ctor == NULL) + load_method(_c_StringKeyedMap, &_m_StringKeyedMap__new0, "<init>", "()V"); + if (_m_StringKeyedMap__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringKeyedMap, _m_StringKeyedMap__ctor); + (*jniEnv)->NewObject(jniEnv, _c_StringKeyedMap, _m_StringKeyedMap__new0); return to_global_ref_result(_result); } // com.github.dart_lang.jnigen.generics.StringMap jclass _c_StringMap = NULL; -jmethodID _m_StringMap__ctor = NULL; +jmethodID _m_StringMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult StringMap__ctor() { +JniResult StringMap__new0() { load_env(); load_class_global_ref(&_c_StringMap, "com/github/dart_lang/jnigen/generics/StringMap"); if (_c_StringMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringMap, &_m_StringMap__ctor, "<init>", "()V"); - if (_m_StringMap__ctor == NULL) + load_method(_c_StringMap, &_m_StringMap__new0, "<init>", "()V"); + if (_m_StringMap__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringMap, _m_StringMap__ctor); + (*jniEnv)->NewObject(jniEnv, _c_StringMap, _m_StringMap__new0); return to_global_ref_result(_result); } // com.github.dart_lang.jnigen.generics.StringStack jclass _c_StringStack = NULL; -jmethodID _m_StringStack__ctor = NULL; +jmethodID _m_StringStack__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult StringStack__ctor() { +JniResult StringStack__new0() { load_env(); load_class_global_ref(&_c_StringStack, "com/github/dart_lang/jnigen/generics/StringStack"); if (_c_StringStack == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringStack, &_m_StringStack__ctor, "<init>", "()V"); - if (_m_StringStack__ctor == NULL) + load_method(_c_StringStack, &_m_StringStack__new0, "<init>", "()V"); + if (_m_StringStack__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_StringStack, _m_StringStack__ctor); + (*jniEnv)->NewObject(jniEnv, _c_StringStack, _m_StringStack__new0); return to_global_ref_result(_result); } // com.github.dart_lang.jnigen.generics.StringValuedMap jclass _c_StringValuedMap = NULL; -jmethodID _m_StringValuedMap__ctor = NULL; +jmethodID _m_StringValuedMap__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult StringValuedMap__ctor() { +JniResult StringValuedMap__new0() { load_env(); load_class_global_ref(&_c_StringValuedMap, "com/github/dart_lang/jnigen/generics/StringValuedMap"); if (_c_StringValuedMap == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_StringValuedMap, &_m_StringValuedMap__ctor, "<init>", "()V"); - if (_m_StringValuedMap__ctor == NULL) + load_method(_c_StringValuedMap, &_m_StringValuedMap__new0, "<init>", "()V"); + if (_m_StringValuedMap__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_StringValuedMap, - _m_StringValuedMap__ctor); + _m_StringValuedMap__new0); return to_global_ref_result(_result); } @@ -2387,21 +2387,21 @@ // com.github.dart_lang.jnigen.interfaces.MyInterfaceConsumer jclass _c_MyInterfaceConsumer = NULL; -jmethodID _m_MyInterfaceConsumer__ctor = NULL; +jmethodID _m_MyInterfaceConsumer__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyInterfaceConsumer__ctor() { +JniResult MyInterfaceConsumer__new0() { load_env(); load_class_global_ref( &_c_MyInterfaceConsumer, "com/github/dart_lang/jnigen/interfaces/MyInterfaceConsumer"); if (_c_MyInterfaceConsumer == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyInterfaceConsumer, &_m_MyInterfaceConsumer__ctor, "<init>", + load_method(_c_MyInterfaceConsumer, &_m_MyInterfaceConsumer__new0, "<init>", "()V"); - if (_m_MyInterfaceConsumer__ctor == NULL) + if (_m_MyInterfaceConsumer__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = (*jniEnv)->NewObject(jniEnv, _c_MyInterfaceConsumer, - _m_MyInterfaceConsumer__ctor); + _m_MyInterfaceConsumer__new0); return to_global_ref_result(_result); } @@ -2508,18 +2508,18 @@ // com.github.dart_lang.jnigen.annotations.MyDataClass jclass _c_MyDataClass = NULL; -jmethodID _m_MyDataClass__ctor = NULL; +jmethodID _m_MyDataClass__new0 = NULL; FFI_PLUGIN_EXPORT -JniResult MyDataClass__ctor() { +JniResult MyDataClass__new0() { load_env(); load_class_global_ref(&_c_MyDataClass, "com/github/dart_lang/jnigen/annotations/MyDataClass"); if (_c_MyDataClass == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; - load_method(_c_MyDataClass, &_m_MyDataClass__ctor, "<init>", "()V"); - if (_m_MyDataClass__ctor == NULL) + load_method(_c_MyDataClass, &_m_MyDataClass__new0, "<init>", "()V"); + if (_m_MyDataClass__new0 == NULL) return (JniResult){.value = {.j = 0}, .exception = check_exception()}; jobject _result = - (*jniEnv)->NewObject(jniEnv, _c_MyDataClass, _m_MyDataClass__ctor); + (*jniEnv)->NewObject(jniEnv, _c_MyDataClass, _m_MyDataClass__new0); return to_global_ref_result(_result); }
diff --git a/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart index cbc1b21..10e3990 100644 --- a/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/c_based/dart_bindings/simple_package.dart
@@ -359,77 +359,70 @@ .fromRef(_getRandomNumericString(reference, random.reference).object); } - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example() { - return Example.fromRef(_ctor().object); + return Example.fromRef(_new0().object); } - static final _ctor1 = + static final _new1 = jniLookup<ffi.NativeFunction<jni.JniResult Function(ffi.Int32)>>( - "Example__ctor1") + "Example__new1") .asFunction<jni.JniResult Function(int)>(); /// from: public void <init>(int number) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor1( + factory Example.new1( int number, ) { - return Example.fromRef(_ctor1(number).object); + return Example.fromRef(_new1(number).object); } - static final _ctor2 = jniLookup< + static final _new2 = jniLookup< ffi.NativeFunction<jni.JniResult Function(ffi.Int32, ffi.Uint8)>>( - "Example__ctor2") + "Example__new2") .asFunction<jni.JniResult Function(int, int)>(); /// from: public void <init>(int number, boolean isUp) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor2( + factory Example.new2( int number, bool isUp, ) { - return Example.fromRef(_ctor2(number, isUp ? 1 : 0).object); + return Example.fromRef(_new2(number, isUp ? 1 : 0).object); } - static final _ctor3 = jniLookup< + static final _new3 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Int32, ffi.Uint8, - ffi.Pointer<ffi.Void>)>>("Example__ctor3") + ffi.Pointer<ffi.Void>)>>("Example__new3") .asFunction<jni.JniResult Function(int, int, ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(int number, boolean isUp, java.lang.String codename) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor3( + factory Example.new3( int number, bool isUp, jni.JString codename, ) { return Example.fromRef( - _ctor3(number, isUp ? 1 : 0, codename.reference).object); + _new3(number, isUp ? 1 : 0, codename.reference).object); } - static final _ctor4 = jniLookup< + static final _new4 = jniLookup< ffi.NativeFunction< - jni.JniResult Function( - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32, - ffi.Int32)>>("Example__ctor4") + jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, + ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32)>>("Example__new4") .asFunction< jni.JniResult Function(int, int, int, int, int, int, int, int)>(); /// from: public void <init>(int a, int b, int c, int d, int e, int f, int g, int h) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor4( + factory Example.new4( int a, int b, int c, @@ -439,7 +432,7 @@ int g, int h, ) { - return Example.fromRef(_ctor4(a, b, c, d, e, f, g, h).object); + return Example.fromRef(_new4(a, b, c, d, e, f, g, h).object); } static final _whichExample = jniLookup< @@ -548,9 +541,9 @@ /// The type which includes information such as the signature of this class. static const type = $Example_NestedType(); - static final _ctor = + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function(ffi.Uint8)>>( - "Example_Nested__ctor") + "Example_Nested__new0") .asFunction<jni.JniResult Function(int)>(); /// from: public void <init>(boolean value) @@ -558,7 +551,7 @@ factory Example_Nested( bool value, ) { - return Example_Nested.fromRef(_ctor(value ? 1 : 0).object); + return Example_Nested.fromRef(_new0(value ? 1 : 0).object); } static final _usesAnonymousInnerClass = jniLookup< @@ -650,14 +643,14 @@ /// from: static public int ZERO static set ZERO(int value) => _set_ZERO(value).check(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "Example_Nested_NestedTwice__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "Example_Nested_NestedTwice__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example_Nested_NestedTwice() { - return Example_Nested_NestedTwice.fromRef(_ctor().object); + return Example_Nested_NestedTwice.fromRef(_new0().object); } } @@ -700,38 +693,38 @@ /// The type which includes information such as the signature of this class. static const type = $ExceptionsType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "Exceptions__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "Exceptions__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Exceptions() { - return Exceptions.fromRef(_ctor().object); + return Exceptions.fromRef(_new0().object); } - static final _ctor1 = + static final _new1 = jniLookup<ffi.NativeFunction<jni.JniResult Function(ffi.Float)>>( - "Exceptions__ctor1") + "Exceptions__new1") .asFunction<jni.JniResult Function(double)>(); /// from: public void <init>(float x) /// The returned object must be deleted after use, by calling the `delete` method. - factory Exceptions.ctor1( + factory Exceptions.new1( double x, ) { - return Exceptions.fromRef(_ctor1(x).object); + return Exceptions.fromRef(_new1(x).object); } - static final _ctor2 = jniLookup< + static final _new2 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Int32, ffi.Int32, ffi.Int32, ffi.Int32, - ffi.Int32, ffi.Int32)>>("Exceptions__ctor2") + ffi.Int32, ffi.Int32)>>("Exceptions__new2") .asFunction<jni.JniResult Function(int, int, int, int, int, int)>(); /// from: public void <init>(int a, int b, int c, int d, int e, int f) /// The returned object must be deleted after use, by calling the `delete` method. - factory Exceptions.ctor2( + factory Exceptions.new2( int a, int b, int c, @@ -739,7 +732,7 @@ int e, int f, ) { - return Exceptions.fromRef(_ctor2(a, b, c, d, e, f).object); + return Exceptions.fromRef(_new2(a, b, c, d, e, f).object); } static final _staticObjectMethod = @@ -1150,14 +1143,14 @@ /// from: static public char euroSymbol static set euroSymbol(int value) => _set_euroSymbol(value).check(); - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Fields__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Fields__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Fields() { - return Fields.fromRef(_ctor().object); + return Fields.fromRef(_new0().object); } } @@ -1240,14 +1233,14 @@ static set BEST_GOD(jni.JString value) => _set_BEST_GOD(value.reference).check(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "Fields_Nested__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "Fields_Nested__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Fields_Nested() { - return Fields_Nested.fromRef(_ctor().object); + return Fields_Nested.fromRef(_new0().object); } } @@ -1304,14 +1297,14 @@ /// from: static public int CONSTANT static set CONSTANT(int value) => _set_CONSTANT(value).check(); - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("C2__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("C2__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory C2() { - return C2.fromRef(_ctor().object); + return C2.fromRef(_new0().object); } } @@ -1350,14 +1343,14 @@ /// The type which includes information such as the signature of this class. static const type = $Example1Type(); - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example1__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("Example1__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example1() { - return Example1.fromRef(_ctor().object); + return Example1.fromRef(_new0().object); } static final _whichExample = jniLookup< @@ -1442,10 +1435,10 @@ /// The returned object must be deleted after use, by calling the `delete` method. set value($T value) => _set_value(reference, value.reference).check(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "GrandParent__ctor") + "GrandParent__new0") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(T value) @@ -1457,7 +1450,7 @@ T ??= jni.lowestCommonSuperType([ value.$type, ]) as jni.JObjType<$T>; - return GrandParent.fromRef(T, _ctor(value.reference).object); + return GrandParent.fromRef(T, _new0(value.reference).object); } static final _stringParent = jniLookup< @@ -1649,10 +1642,10 @@ /// The returned object must be deleted after use, by calling the `delete` method. set value($S value) => _set_value(reference, value.reference).check(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, - ffi.Pointer<ffi.Void>)>>("GrandParent_Parent__ctor") + ffi.Pointer<ffi.Void>)>>("GrandParent_Parent__new0") .asFunction< jni.JniResult Function( ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -1672,7 +1665,7 @@ newValue.$type, ]) as jni.JObjType<$S>; return GrandParent_Parent.fromRef( - T, S, _ctor($parent.reference, newValue.reference).object); + T, S, _new0($parent.reference, newValue.reference).object); } } @@ -1824,10 +1817,10 @@ /// The returned object must be deleted after use, by calling the `delete` method. set value($U value) => _set_value(reference, value.reference).check(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, - ffi.Pointer<ffi.Void>)>>("GrandParent_Parent_Child__ctor") + ffi.Pointer<ffi.Void>)>>("GrandParent_Parent_Child__new0") .asFunction< jni.JniResult Function( ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -1851,7 +1844,7 @@ newValue.$type, ]) as jni.JObjType<$U>; return GrandParent_Parent_Child.fromRef( - T, S, U, _ctor($parent.reference, newValue.reference).object); + T, S, U, _new0($parent.reference, newValue.reference).object); } } @@ -1942,10 +1935,10 @@ /// The returned object must be deleted after use, by calling the `delete` method. set value($S value) => _set_value(reference, value.reference).check(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi .NativeFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>>( - "GrandParent_StaticParent__ctor") + "GrandParent_StaticParent__new0") .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(S value) @@ -1957,7 +1950,7 @@ S ??= jni.lowestCommonSuperType([ value.$type, ]) as jni.JObjType<$S>; - return GrandParent_StaticParent.fromRef(S, _ctor(value.reference).object); + return GrandParent_StaticParent.fromRef(S, _new0(value.reference).object); } } @@ -2075,11 +2068,11 @@ /// The returned object must be deleted after use, by calling the `delete` method. set value($U value) => _set_value(reference, value.reference).check(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi.NativeFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>>( - "GrandParent_StaticParent_Child__ctor") + "GrandParent_StaticParent_Child__new0") .asFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -2103,7 +2096,7 @@ return GrandParent_StaticParent_Child.fromRef( S, U, - _ctor($parent.reference, parentValue.reference, value.reference) + _new0($parent.reference, parentValue.reference, value.reference) .object); } } @@ -2172,8 +2165,8 @@ ); } - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("MyMap__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("MyMap__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -2182,7 +2175,7 @@ required jni.JObjType<$K> K, required jni.JObjType<$V> V, }) { - return MyMap.fromRef(K, V, _ctor().object); + return MyMap.fromRef(K, V, _new0().object); } static final _get0 = jniLookup< @@ -2344,12 +2337,12 @@ /// The returned object must be deleted after use, by calling the `delete` method. set value($V value) => _set_value(reference, value.reference).check(); - static final _ctor = jniLookup< + static final _new0 = jniLookup< ffi.NativeFunction< jni.JniResult Function( ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, - ffi.Pointer<ffi.Void>)>>("MyMap_MyEntry__ctor") + ffi.Pointer<ffi.Void>)>>("MyMap_MyEntry__new0") .asFunction< jni.JniResult Function(ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); @@ -2372,7 +2365,7 @@ ($parent.$type as $MyMapType).V, ]) as jni.JObjType<$V>; return MyMap_MyEntry.fromRef( - K, V, _ctor($parent.reference, key.reference, value.reference).object); + K, V, _new0($parent.reference, key.reference, value.reference).object); } } @@ -2433,8 +2426,8 @@ ); } - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("MyStack__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("MyStack__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -2442,7 +2435,7 @@ factory MyStack({ required jni.JObjType<$T> T, }) { - return MyStack.fromRef(T, _ctor().object); + return MyStack.fromRef(T, _new0().object); } static final _fromArray = jniLookup< @@ -2627,8 +2620,8 @@ ); } - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "StringKeyedMap__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "StringKeyedMap__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -2636,7 +2629,7 @@ factory StringKeyedMap({ required jni.JObjType<$V> V, }) { - return StringKeyedMap.fromRef(V, _ctor().object); + return StringKeyedMap.fromRef(V, _new0().object); } } @@ -2684,14 +2677,14 @@ /// The type which includes information such as the signature of this class. static const type = $StringMapType(); - static final _ctor = - jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("StringMap__ctor") + static final _new0 = + jniLookup<ffi.NativeFunction<jni.JniResult Function()>>("StringMap__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory StringMap() { - return StringMap.fromRef(_ctor().object); + return StringMap.fromRef(_new0().object); } } @@ -2730,14 +2723,14 @@ /// The type which includes information such as the signature of this class. static const type = $StringStackType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "StringStack__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "StringStack__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory StringStack() { - return StringStack.fromRef(_ctor().object); + return StringStack.fromRef(_new0().object); } } @@ -2786,8 +2779,8 @@ ); } - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "StringValuedMap__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "StringValuedMap__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() @@ -2795,7 +2788,7 @@ factory StringValuedMap({ required jni.JObjType<$K> K, }) { - return StringValuedMap.fromRef(K, _ctor().object); + return StringValuedMap.fromRef(K, _new0().object); } } @@ -3128,14 +3121,14 @@ /// The type which includes information such as the signature of this class. static const type = $MyInterfaceConsumerType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "MyInterfaceConsumer__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "MyInterfaceConsumer__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory MyInterfaceConsumer() { - return MyInterfaceConsumer.fromRef(_ctor().object); + return MyInterfaceConsumer.fromRef(_new0().object); } static final _consumeOnAnotherThread = jniLookup< @@ -3313,14 +3306,14 @@ /// The type which includes information such as the signature of this class. static const type = $MyDataClassType(); - static final _ctor = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( - "MyDataClass__ctor") + static final _new0 = jniLookup<ffi.NativeFunction<jni.JniResult Function()>>( + "MyDataClass__new0") .asFunction<jni.JniResult Function()>(); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory MyDataClass() { - return MyDataClass.fromRef(_ctor().object); + return MyDataClass.fromRef(_new0().object); } }
diff --git a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart index bfe2a16..e3667c1 100644 --- a/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/dart_only/dart_bindings/simple_package.dart
@@ -332,63 +332,63 @@ [random.reference]).object); } - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example() { return Example.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } - static final _id_ctor1 = + static final _id_new1 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(I)V"); /// from: public void <init>(int number) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor1( + factory Example.new1( int number, ) { return Example.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor1, [jni.JValueInt(number)]).object); + _class.reference, _id_new1, [jni.JValueInt(number)]).object); } - static final _id_ctor2 = + static final _id_new2 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(IZ)V"); /// from: public void <init>(int number, boolean isUp) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor2( + factory Example.new2( int number, bool isUp, ) { return Example.fromRef(jni.Jni.accessors.newObjectWithArgs(_class.reference, - _id_ctor2, [jni.JValueInt(number), isUp ? 1 : 0]).object); + _id_new2, [jni.JValueInt(number), isUp ? 1 : 0]).object); } - static final _id_ctor3 = jni.Jni.accessors + static final _id_new3 = jni.Jni.accessors .getMethodIDOf(_class.reference, r"<init>", r"(IZLjava/lang/String;)V"); /// from: public void <init>(int number, boolean isUp, java.lang.String codename) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor3( + factory Example.new3( int number, bool isUp, jni.JString codename, ) { return Example.fromRef(jni.Jni.accessors.newObjectWithArgs( _class.reference, - _id_ctor3, + _id_new3, [jni.JValueInt(number), isUp ? 1 : 0, codename.reference]).object); } - static final _id_ctor4 = jni.Jni.accessors + static final _id_new4 = jni.Jni.accessors .getMethodIDOf(_class.reference, r"<init>", r"(IIIIIIII)V"); /// from: public void <init>(int a, int b, int c, int d, int e, int f, int g, int h) /// The returned object must be deleted after use, by calling the `delete` method. - factory Example.ctor4( + factory Example.new4( int a, int b, int c, @@ -399,7 +399,7 @@ int h, ) { return Example.fromRef( - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_ctor4, [ + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new4, [ jni.JValueInt(a), jni.JValueInt(b), jni.JValueInt(c), @@ -516,7 +516,7 @@ /// The type which includes information such as the signature of this class. static const type = $Example_NestedType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(Z)V"); /// from: public void <init>(boolean value) @@ -525,7 +525,7 @@ bool value, ) { return Example_Nested.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, [value ? 1 : 0]).object); + .newObjectWithArgs(_class.reference, _id_new0, [value ? 1 : 0]).object); } static final _id_usesAnonymousInnerClass = jni.Jni.accessors @@ -613,14 +613,14 @@ static set ZERO(int value) => jni.Jni.env.SetStaticIntField(_class.reference, _id_ZERO, value); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example_Nested_NestedTwice() { return Example_Nested_NestedTwice.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -666,34 +666,34 @@ /// The type which includes information such as the signature of this class. static const type = $ExceptionsType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Exceptions() { return Exceptions.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } - static final _id_ctor1 = + static final _id_new1 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(F)V"); /// from: public void <init>(float x) /// The returned object must be deleted after use, by calling the `delete` method. - factory Exceptions.ctor1( + factory Exceptions.new1( double x, ) { return Exceptions.fromRef(jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor1, [jni.JValueFloat(x)]).object); + _class.reference, _id_new1, [jni.JValueFloat(x)]).object); } - static final _id_ctor2 = jni.Jni.accessors + static final _id_new2 = jni.Jni.accessors .getMethodIDOf(_class.reference, r"<init>", r"(IIIIII)V"); /// from: public void <init>(int a, int b, int c, int d, int e, int f) /// The returned object must be deleted after use, by calling the `delete` method. - factory Exceptions.ctor2( + factory Exceptions.new2( int a, int b, int c, @@ -702,7 +702,7 @@ int f, ) { return Exceptions.fromRef( - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_ctor2, [ + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new2, [ jni.JValueInt(a), jni.JValueInt(b), jni.JValueInt(c), @@ -1061,14 +1061,14 @@ static set euroSymbol(int value) => jni.Jni.env.SetStaticCharField(_class.reference, _id_euroSymbol, value); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Fields() { return Fields.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -1145,14 +1145,14 @@ static set BEST_GOD(jni.JString value) => jni.Jni.env .SetStaticObjectField(_class.reference, _id_BEST_GOD, value.reference); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Fields_Nested() { return Fields_Nested.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -1211,14 +1211,14 @@ static set CONSTANT(int value) => jni.Jni.env.SetStaticIntField(_class.reference, _id_CONSTANT, value); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory C2() { return C2.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -1260,14 +1260,14 @@ /// The type which includes information such as the signature of this class. static const type = $Example1Type(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory Example1() { return Example1.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } static final _id_whichExample = jni.Jni.accessors @@ -1345,7 +1345,7 @@ set value($T value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_ctor = jni.Jni.accessors + static final _id_new0 = jni.Jni.accessors .getMethodIDOf(_class.reference, r"<init>", r"(Ljava/lang/Object;)V"); /// from: public void <init>(T value) @@ -1360,7 +1360,7 @@ return GrandParent.fromRef( T, jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor, [value.reference]).object); + _class.reference, _id_new0, [value.reference]).object); } static final _id_stringParent = jni.Jni.accessors.getMethodIDOf( @@ -1536,7 +1536,7 @@ set value($S value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_ctor = jni.Jni.accessors.getMethodIDOf( + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( _class.reference, r"<init>", r"(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V"); @@ -1558,7 +1558,7 @@ return GrandParent_Parent.fromRef( T, S, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_ctor, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, [$parent.reference, newValue.reference]).object); } } @@ -1685,7 +1685,7 @@ set value($U value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_ctor = jni.Jni.accessors.getMethodIDOf( + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( _class.reference, r"<init>", r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V"); @@ -1712,7 +1712,7 @@ T, S, U, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_ctor, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, [$parent.reference, newValue.reference]).object); } } @@ -1798,7 +1798,7 @@ set value($S value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_ctor = jni.Jni.accessors + static final _id_new0 = jni.Jni.accessors .getMethodIDOf(_class.reference, r"<init>", r"(Ljava/lang/Object;)V"); /// from: public void <init>(S value) @@ -1813,7 +1813,7 @@ return GrandParent_StaticParent.fromRef( S, jni.Jni.accessors.newObjectWithArgs( - _class.reference, _id_ctor, [value.reference]).object); + _class.reference, _id_new0, [value.reference]).object); } } @@ -1915,7 +1915,7 @@ set value($U value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_ctor = jni.Jni.accessors.getMethodIDOf( + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( _class.reference, r"<init>", r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V"); @@ -1939,7 +1939,7 @@ return GrandParent_StaticParent_Child.fromRef( S, U, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_ctor, [ + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, [ $parent.reference, parentValue.reference, value.reference @@ -2014,7 +2014,7 @@ ); } - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() @@ -2027,7 +2027,7 @@ K, V, jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } static final _id_get0 = jni.Jni.accessors.getMethodIDOf( @@ -2168,7 +2168,7 @@ set value($V value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); - static final _id_ctor = jni.Jni.accessors.getMethodIDOf( + static final _id_new0 = jni.Jni.accessors.getMethodIDOf( _class.reference, r"<init>", r"(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V"); @@ -2193,7 +2193,7 @@ return MyMap_MyEntry.fromRef( K, V, - jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_ctor, + jni.Jni.accessors.newObjectWithArgs(_class.reference, _id_new0, [$parent.reference, key.reference, value.reference]).object); } } @@ -2258,7 +2258,7 @@ ); } - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() @@ -2269,7 +2269,7 @@ return MyStack.fromRef( T, jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } static final _id_fromArray = jni.Jni.accessors.getStaticMethodIDOf( @@ -2457,7 +2457,7 @@ ); } - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() @@ -2468,7 +2468,7 @@ return StringKeyedMap.fromRef( V, jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -2519,14 +2519,14 @@ /// The type which includes information such as the signature of this class. static const type = $StringMapType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory StringMap() { return StringMap.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -2568,14 +2568,14 @@ /// The type which includes information such as the signature of this class. static const type = $StringStackType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory StringStack() { return StringStack.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -2627,7 +2627,7 @@ ); } - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() @@ -2638,7 +2638,7 @@ return StringValuedMap.fromRef( K, jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } } @@ -2966,14 +2966,14 @@ /// The type which includes information such as the signature of this class. static const type = $MyInterfaceConsumerType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory MyInterfaceConsumer() { return MyInterfaceConsumer.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } static final _id_consumeOnAnotherThread = jni.Jni.accessors.getStaticMethodIDOf( @@ -3152,14 +3152,14 @@ /// The type which includes information such as the signature of this class. static const type = $MyDataClassType(); - static final _id_ctor = + static final _id_new0 = jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"()V"); /// from: public void <init>() /// The returned object must be deleted after use, by calling the `delete` method. factory MyDataClass() { return MyDataClass.fromRef(jni.Jni.accessors - .newObjectWithArgs(_class.reference, _id_ctor, []).object); + .newObjectWithArgs(_class.reference, _id_new0, []).object); } }
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 1c40768..e14dbfb 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart
@@ -112,15 +112,15 @@ expect(e0.getNumber(), 0); expect(e0.getIsUp(), true); expect(e0.getCodename().toDartString(), equals('achilles')); - final e1 = Example.ctor1(111); + final e1 = Example.new1(111); expect(e1.getNumber(), equals(111)); expect(e1.getIsUp(), true); expect(e1.getCodename().toDartString(), "achilles"); - final e2 = Example.ctor2(122, false); + final e2 = Example.new2(122, false); expect(e2.getNumber(), equals(122)); expect(e2.getIsUp(), false); expect(e2.getCodename().toDartString(), "achilles"); - final e3 = Example.ctor3(133, false, "spartan".toJString()); + final e3 = Example.new3(133, false, "spartan".toJString()); expect(e3.getNumber(), equals(133)); expect(e3.getIsUp(), false); expect(e3.getCodename().toDartString(), "spartan"); @@ -227,8 +227,8 @@ }); test('Exception from constructor', () { - throwsException(() => Exceptions.ctor1(6.8)); - throwsException(() => Exceptions.ctor2(1, 2, 3, 4, 5, 6)); + throwsException(() => Exceptions.new1(6.8)); + throwsException(() => Exceptions.new2(1, 2, 3, 4, 5, 6)); }); test('Exception contains error message & stack trace', () { @@ -286,8 +286,8 @@ test('MyMap<K, V>', () { using((arena) { final map = MyMap(K: JString.type, V: Example.type)..deletedIn(arena); - final helloExample = Example.ctor1(1)..deletedIn(arena); - final worldExample = Example.ctor1(2)..deletedIn(arena); + final helloExample = Example.new1(1)..deletedIn(arena); + final worldExample = Example.new1(2)..deletedIn(arena); map.put('Hello'.toJString()..deletedIn(arena), helloExample); map.put('World'.toJString()..deletedIn(arena), worldExample); expect( @@ -605,14 +605,14 @@ const k256 = 256 * 1024; test('create large number of JNI references without deleting', () { for (int i = 0; i < k4; i++) { - final e = Example.ctor1(i); + final e = Example.new1(i); expect(e.getNumber(), equals(i)); } }); test('Create many JNI refs with scoped deletion', () { for (int i = 0; i < k256; i++) { using((arena) { - final e = Example.ctor1(i)..deletedIn(arena); + final e = Example.new1(i)..deletedIn(arena); expect(e.getNumber(), equals(i)); }); } @@ -621,7 +621,7 @@ for (int i = 0; i < 256; i++) { using((arena) { for (int i = 0; i < 1024; i++) { - final e = Example.ctor1(i)..deletedIn(arena); + final e = Example.new1(i)..deletedIn(arena); expect(e.getNumber(), equals(i)); } }); @@ -629,14 +629,14 @@ }); test('Create large number of JNI refs with manual delete', () { for (int i = 0; i < k256; i++) { - final e = Example.ctor1(i); + final e = Example.new1(i); expect(e.getNumber(), equals(i)); e.delete(); } }); test('Method returning primitive type does not create references', () { using((arena) { - final e = Example.ctor1(64)..deletedIn(arena); + final e = Example.new1(64)..deletedIn(arena); for (int i = 0; i < k256; i++) { expect(e.getNumber(), equals(64)); }