[jnigen] Rename `delete` to `release` (https://github.com/dart-lang/jnigen/issues/379)
diff --git a/pkgs/jni/CHANGELOG.md b/pkgs/jni/CHANGELOG.md index 35a09db..1c83295 100644 --- a/pkgs/jni/CHANGELOG.md +++ b/pkgs/jni/CHANGELOG.md
@@ -1,4 +1,5 @@ -## 0.6.0-wip-2 +## 0.6.0 +* **Breaking Change** ([#131](https://github.com/dart-lang/jnigen/issues/131)): Renamed `delete*` to `release*`. * Added `PortProxy` and related methods used for interface implementation. * Added the missing binding for `java.lang.Character`.
diff --git a/pkgs/jni/README.md b/pkgs/jni/README.md index 5195ace..37f5b36 100644 --- a/pkgs/jni/README.md +++ b/pkgs/jni/README.md
@@ -4,13 +4,11 @@ This library contains: -* functions to access the JNIEnv and JavaVM variables from JNI, and wrapper functions to those provided by JNI. JNIEnv is exposed via `GlobalJniEnv` type which provides a thin abstraction over JNIEnv, so that it can be used from multiple threads. - +* Functions to access the JNIEnv and JavaVM variables from JNI, and wrapper functions to those provided by JNI. JNIEnv is exposed via `GlobalJniEnv` type which provides a thin abstraction over JNIEnv, so that it can be used from multiple threads. * Functions to spawn a JVM on desktop platforms (`Jni.spawn`). - * Some Android-specific helpers (get application context and current activity references). - * `JObject` class, which provides base class for classes generated by jnigen. +* Commonly used Java classes like `JList`, `JMap`, `JInteger`, ... Apart from being the base library for code generated by `jnigen` this can also be used for one-off uses of the JNI and debugging. __To generate type-safe bindings from Java libraries, use `jnigen`.__
diff --git a/pkgs/jni/example/lib/main.dart b/pkgs/jni/example/lib/main.dart index b2ca2b7..4c73693 100644 --- a/pkgs/jni/example/lib/main.dart +++ b/pkgs/jni/example/lib/main.dart
@@ -44,7 +44,7 @@ double randomDouble() { final math = Jni.findJClass("java/lang/Math"); final random = math.callStaticMethodByName<double>("random", "()D", []); - math.delete(); + math.release(); return random; } @@ -57,7 +57,7 @@ String backAndForth() { final jstring = '🪓'.toJString(); - final dartString = jstring.toDartString(deleteOriginal: true); + final dartString = jstring.toDartString(releaseOriginal: true); return dartString; }
diff --git a/pkgs/jni/example/pubspec.lock b/pkgs/jni/example/pubspec.lock index eb16370..f70135e 100644 --- a/pkgs/jni/example/pubspec.lock +++ b/pkgs/jni/example/pubspec.lock
@@ -200,7 +200,7 @@ path: ".." relative: true source: path - version: "0.6.0-wip.2" + version: "0.6.0" js: dependency: transitive description:
diff --git a/pkgs/jni/lib/src/jarray.dart b/pkgs/jni/lib/src/jarray.dart index b07cee0..1b97039 100644 --- a/pkgs/jni/lib/src/jarray.dart +++ b/pkgs/jni/lib/src/jarray.dart
@@ -78,7 +78,7 @@ type, Jni.accessors.newObjectArray(length, clazz.reference, nullptr).object, ); - clazz.delete(); + clazz.release(); return array; } return JArray.fromRef( @@ -102,7 +102,7 @@ .newObjectArray(length, clazz.reference, fill.reference) .object, ); - clazz.delete(); + clazz.release(); return array; }
diff --git a/pkgs/jni/lib/src/jexceptions.dart b/pkgs/jni/lib/src/jexceptions.dart index 64b95fc..5a0d59e 100644 --- a/pkgs/jni/lib/src/jexceptions.dart +++ b/pkgs/jni/lib/src/jexceptions.dart
@@ -8,13 +8,13 @@ abstract class JException implements Exception {} -class UseAfterFreeException implements JException { +class UseAfterReleaseException implements JException { final Pointer<Void> ptr; - UseAfterFreeException(this.ptr); + UseAfterReleaseException(this.ptr); @override String toString() { - return 'Use after free on $ptr.'; + return 'Use after release on $ptr.'; } } @@ -34,13 +34,13 @@ '0x${reference.address.toRadixString(16)}.'; } -class DoubleFreeException implements JException { +class DoubleReleaseException implements JException { final Pointer<Void> ptr; - DoubleFreeException(this.ptr); + DoubleReleaseException(this.ptr); @override String toString() { - return 'Double free on $ptr.'; + return 'Double release on $ptr.'; } }
diff --git a/pkgs/jni/lib/src/jni.dart b/pkgs/jni/lib/src/jni.dart index d5495bc..1e25151 100644 --- a/pkgs/jni/lib/src/jni.dart +++ b/pkgs/jni/lib/src/jni.dart
@@ -11,7 +11,6 @@ import 'jexceptions.dart'; import 'jobject.dart'; -import 'jreference.dart'; import 'third_party/generated_bindings.dart'; import 'jvalues.dart'; import 'accessors.dart'; @@ -230,7 +229,7 @@ final cls = findJClass(qualifiedName); final ctor = cls.getCtorID(ctorSignature); final obj = cls.newInstance(ctor, args); - cls.delete(); + cls.release(); return obj; } @@ -252,7 +251,7 @@ [int? callType]) { final cls = findJClass(className); final result = cls.getStaticFieldByName<T>(fieldName, signature, callType); - cls.delete(); + cls.release(); return result; } @@ -267,16 +266,9 @@ final cls = findJClass(className); final result = cls.callStaticMethodByName<T>(methodName, signature, args, callType); - cls.delete(); + cls.release(); return result; } - - /// Delete all references in [objects]. - static void deleteAll(List<JReference> objects) { - for (var object in objects) { - object.delete(); - } - } } typedef _SetJniGettersNativeType = Void Function(Pointer<Void>, Pointer<Void>); @@ -340,9 +332,9 @@ extension AdditionalEnvMethods on GlobalJniEnv { /// Convenience method for converting a [JStringPtr] /// to dart string. - /// if [deleteOriginal] is specified, jstring passed will be deleted using + /// if [releaseOriginal] is specified, jstring passed will be deleted using /// DeleteGlobalRef. - String toDartString(JStringPtr jstringPtr, {bool deleteOriginal = false}) { + String toDartString(JStringPtr jstringPtr, {bool releaseOriginal = false}) { if (jstringPtr == nullptr) { throw const JNullException(); } @@ -352,7 +344,7 @@ } final result = chars.cast<Utf16>().toDartString(); ReleaseStringChars(jstringPtr, chars); - if (deleteOriginal) { + if (releaseOriginal) { DeleteGlobalRef(jstringPtr); } return result;
diff --git a/pkgs/jni/lib/src/jobject.dart b/pkgs/jni/lib/src/jobject.dart index c0b077b..6a2cad2 100644 --- a/pkgs/jni/lib/src/jobject.dart +++ b/pkgs/jni/lib/src/jobject.dart
@@ -124,7 +124,7 @@ callType, JniCallType.objectType, {JniCallType.objectType}); final ref = function(finalCallType).object; final ctor = T == String - ? (ref) => Jni.env.toDartString(ref, deleteOriginal: true) + ? (ref) => Jni.env.toDartString(ref, releaseOriginal: true) : (T == JObject ? JObject.fromRef : JString.fromRef); result = ctor(ref) as T; break; @@ -177,12 +177,12 @@ return _jClass ??= getClass(); } - /// Deletes the JNI reference and marks this object as deleted. Any further - /// uses will throw [UseAfterFreeException]. + /// Deletes the JNI reference and marks this object as released. Any further + /// uses will throw [UseAfterReleaseException]. @override - void delete() { - _jClass?.delete(); - super.delete(); + void release() { + _jClass?.release(); + super.release(); } /// Returns [JClass] corresponding to concrete class of this object. @@ -304,12 +304,17 @@ return callStaticMethod<T>(id, args, callType); } - /// Casts this object to another type. - T castTo<T extends JObject>(JObjType<T> type, {bool deleteOriginal = false}) { - if (deleteOriginal) { - _jClass?.delete(); + /// Casts this object to another [type]. + /// + /// If [releaseOriginal] is `true`, the casted object will be released. + T castTo<T extends JObject>( + JObjType<T> type, { + bool releaseOriginal = false, + }) { + if (releaseOriginal) { + _jClass?.release(); final ret = type.fromRef(reference); - setAsDeleted(); + setAsReleased(); return ret; } final newRef = Jni.env.NewGlobalRef(reference); @@ -341,7 +346,7 @@ String toString() { return JString.fromRef(Jni.accessors.callMethodWithArgs( reference, _toStringId, JniCallType.objectType, []).object) - .toDartString(deleteOriginal: true); + .toDartString(releaseOriginal: true); } }
diff --git a/pkgs/jni/lib/src/jreference.dart b/pkgs/jni/lib/src/jreference.dart index 973b3f3..68c0ada 100644 --- a/pkgs/jni/lib/src/jreference.dart +++ b/pkgs/jni/lib/src/jreference.dart
@@ -11,11 +11,11 @@ import 'jni.dart'; extension ProtectedJReference on JReference { - void setAsDeleted() { - if (_deleted) { - throw DoubleFreeException(_reference); + void setAsReleased() { + if (_released) { + throw DoubleReleaseException(_reference); } - _deleted = true; + _released = true; JReference._finalizer.detach(this); } @@ -29,13 +29,14 @@ /// /// Detaches the finalizer so the underlying pointer will not be deleted. JObjectPtr toPointer() { - setAsDeleted(); + setAsReleased(); return _reference; } } -/// A class which holds one or more JNI references, and has a `delete` operation -/// which disposes the reference(s). +/// A managed JNI global reference. +/// +/// Uses a [NativeFinalizer] to delete the JNI global reference when finalized. abstract class JReference implements Finalizable { static final _finalizer = NativeFinalizer(Jni.env.ptr.ref.DeleteGlobalRef.cast()); @@ -44,37 +45,37 @@ _finalizer.attach(this, _reference, detach: this); } - bool _deleted = false; + bool _released = false; /// Check whether the underlying JNI reference is `null`. bool get isNull => reference == nullptr; - /// Returns whether this object is deleted. - bool get isDeleted => _deleted; + /// Returns `true` if the underlying JNI reference is deleted. + bool get isReleased => _released; /// Deletes the underlying JNI reference. /// - /// Further uses will throw [UseAfterFreeException]. - void delete() { - setAsDeleted(); + /// Further uses will throw [UseAfterReleaseException]. + void release() { + setAsReleased(); Jni.env.DeleteGlobalRef(_reference); } /// The underlying JNI global object reference. /// - /// Throws [UseAfterFreeException] if the object is previously deleted. + /// Throws [UseAfterReleaseException] if the object is previously released. /// - /// Be careful when storing this reference in a variable, since the underlying - /// object might get deleted. + /// Be careful when storing this in a variable since it might have gotten + /// released upon use. JObjectPtr get reference { - if (_deleted) throw UseAfterFreeException(_reference); + if (_released) throw UseAfterReleaseException(_reference); return _reference; } final JObjectPtr _reference; - /// Registers this object to be deleted at the end of [arena]'s lifetime. - void deletedIn(Arena arena) => arena.onReleaseAll(delete); + /// Registers this object to be released at the end of [arena]'s lifetime. + void releasedBy(Arena arena) => arena.onReleaseAll(release); } extension JReferenceUseExtension<T extends JReference> on T { @@ -83,10 +84,10 @@ R use<R>(R Function(T) callback) { try { final result = callback(this); - delete(); + release(); return result; } catch (e) { - delete(); + release(); rethrow; } }
diff --git a/pkgs/jni/lib/src/lang/jboolean.dart b/pkgs/jni/lib/src/lang/jboolean.dart index 04f4e7c..3dd22b1 100644 --- a/pkgs/jni/lib/src/lang/jboolean.dart +++ b/pkgs/jni/lib/src/lang/jboolean.dart
@@ -56,12 +56,12 @@ static final _booleanValueId = Jni.accessors.getMethodIDOf(_class.reference, r"booleanValue", r"()Z"); - bool booleanValue({bool deleteOriginal = false}) { + bool booleanValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _booleanValueId, JniCallType.booleanType, []).boolean; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; }
diff --git a/pkgs/jni/lib/src/lang/jcharacter.dart b/pkgs/jni/lib/src/lang/jcharacter.dart index 0678706..c43d2e0 100644 --- a/pkgs/jni/lib/src/lang/jcharacter.dart +++ b/pkgs/jni/lib/src/lang/jcharacter.dart
@@ -54,12 +54,12 @@ static final _charValueId = Jni.accessors.getMethodIDOf(_class.reference, r"charValue", r"()C"); - int charValue({bool deleteOriginal = false}) { + int charValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _charValueId, JniCallType.charType, []).char; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; }
diff --git a/pkgs/jni/lib/src/lang/jnumber.dart b/pkgs/jni/lib/src/lang/jnumber.dart index a468147..43e1085 100644 --- a/pkgs/jni/lib/src/lang/jnumber.dart +++ b/pkgs/jni/lib/src/lang/jnumber.dart
@@ -64,12 +64,12 @@ static final _intValueId = Jni.accessors.getMethodIDOf(_class.reference, r"intValue", r"()I"); - int intValue({bool deleteOriginal = false}) { + int intValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _intValueId, JniCallType.intType, []).integer; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; } @@ -77,12 +77,12 @@ static final _longValueId = Jni.accessors.getMethodIDOf(_class.reference, r"longValue", r"()J"); - int longValue({bool deleteOriginal = false}) { + int longValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _longValueId, JniCallType.longType, []).long; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; } @@ -90,12 +90,12 @@ static final _floatValueId = Jni.accessors.getMethodIDOf(_class.reference, r"floatValue", r"()F"); - double floatValue({bool deleteOriginal = false}) { + double floatValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _floatValueId, JniCallType.floatType, []).float; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; } @@ -103,12 +103,12 @@ static final _doubleValueId = Jni.accessors.getMethodIDOf(_class.reference, r"doubleValue", r"()D"); - double doubleValue({bool deleteOriginal = false}) { + double doubleValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _doubleValueId, JniCallType.doubleType, []).doubleFloat; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; } @@ -116,12 +116,12 @@ static final _byteValueId = Jni.accessors.getMethodIDOf(_class.reference, r"byteValue", r"()B"); - int byteValue({bool deleteOriginal = false}) { + int byteValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _byteValueId, JniCallType.byteType, []).byte; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; } @@ -129,12 +129,12 @@ static final _shortValueId = Jni.accessors.getMethodIDOf(_class.reference, r"shortValue", r"()S"); - int shortValue({bool deleteOriginal = false}) { + int shortValue({bool releaseOriginal = false}) { ensureNotNull(); final ret = Jni.accessors.callMethodWithArgs( reference, _shortValueId, JniCallType.shortType, []).short; - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return ret; }
diff --git a/pkgs/jni/lib/src/lang/jstring.dart b/pkgs/jni/lib/src/lang/jstring.dart index f1df76c..43bda60 100644 --- a/pkgs/jni/lib/src/lang/jstring.dart +++ b/pkgs/jni/lib/src/lang/jstring.dart
@@ -55,16 +55,16 @@ /// Returns the contents as a Dart String. /// - /// If [deleteOriginal] is true, the underlying reference is deleted - /// after conversion and this object will be marked as deleted. - String toDartString({bool deleteOriginal = false}) { + /// If [releaseOriginal] is true, the underlying reference is deleted + /// after conversion and this object will be marked as released. + String toDartString({bool releaseOriginal = false}) { ensureNotNull(); final length = Jni.env.GetStringLength(reference); final chars = Jni.env.GetStringChars(reference, nullptr); final result = chars.cast<Utf16>().toDartString(length: length); Jni.env.ReleaseStringChars(reference, chars); - if (deleteOriginal) { - delete(); + if (releaseOriginal) { + release(); } return result; }
diff --git a/pkgs/jni/lib/src/util/jlist.dart b/pkgs/jni/lib/src/util/jlist.dart index 8087af9..19cb1ed 100644 --- a/pkgs/jni/lib/src/util/jlist.dart +++ b/pkgs/jni/lib/src/util/jlist.dart
@@ -235,7 +235,7 @@ JniCallType.intType, [element.reference], ).integer; - range.delete(); + range.release(); return res; } @@ -260,7 +260,7 @@ void removeRange(int start, int end) { final range = getRange(start, end); range.clear(); - range.delete(); + range.release(); } @override
diff --git a/pkgs/jni/pubspec.yaml b/pkgs/jni/pubspec.yaml index 2808b3c..c269520 100644 --- a/pkgs/jni/pubspec.yaml +++ b/pkgs/jni/pubspec.yaml
@@ -3,10 +3,17 @@ # BSD-style license that can be found in the LICENSE file. name: jni -description: Library to access JNI from Dart and Flutter. -version: 0.6.0-wip.2 +description: A library to access JNI from Dart and Flutter that acts as a support library for package:jnigen. +version: 0.6.0 repository: https://github.com/dart-lang/jnigen/tree/main/jni +topics: + - interop + - ffi + - java + - kotlin + - jni + environment: sdk: '>=3.1.0-262.3.beta <4.0.0' flutter: '>=2.11.0'
diff --git a/pkgs/jni/test/boxed_test.dart b/pkgs/jni/test/boxed_test.dart index 88d8686..261b1ac 100644 --- a/pkgs/jni/test/boxed_test.dart +++ b/pkgs/jni/test/boxed_test.dart
@@ -22,44 +22,44 @@ testRunner('JByte', () { const val = 1 << 5; using((arena) { - expect(JByte(val).byteValue(deleteOriginal: true), val); - expect((-val).toJByte().byteValue(deleteOriginal: true), -val); + expect(JByte(val).byteValue(releaseOriginal: true), val); + expect((-val).toJByte().byteValue(releaseOriginal: true), -val); }); }); testRunner('JCharacter', () { const val = 1 << 5; using((arena) { - expect(JCharacter(val).charValue(deleteOriginal: true), val); - expect(JCharacter(0).charValue(deleteOriginal: true), 0); + expect(JCharacter(val).charValue(releaseOriginal: true), val); + expect(JCharacter(0).charValue(releaseOriginal: true), 0); }); }); testRunner('JShort', () { const val = 1 << 10; using((arena) { - expect(JShort(val).shortValue(deleteOriginal: true), val); - expect((-val).toJShort().shortValue(deleteOriginal: true), -val); + expect(JShort(val).shortValue(releaseOriginal: true), val); + expect((-val).toJShort().shortValue(releaseOriginal: true), -val); }); }); testRunner('JInteger', () { const val = 1 << 20; using((arena) { - expect(JInteger(val).intValue(deleteOriginal: true), val); - expect((-val).toJInteger().intValue(deleteOriginal: true), -val); + expect(JInteger(val).intValue(releaseOriginal: true), val); + expect((-val).toJInteger().intValue(releaseOriginal: true), -val); }); }); testRunner('JLong', () { const val = 1 << 40; using((arena) { - expect(JLong(val).longValue(deleteOriginal: true), val); - expect((-val).toJLong().longValue(deleteOriginal: true), -val); + expect(JLong(val).longValue(releaseOriginal: true), val); + expect((-val).toJLong().longValue(releaseOriginal: true), -val); }); }); testRunner('JFloat', () { const val = 3.14; const eps = 1e-6; using((arena) { - expect(JFloat(val).floatValue(deleteOriginal: true), closeTo(val, eps)); - expect((-val).toJFloat().floatValue(deleteOriginal: true), + expect(JFloat(val).floatValue(releaseOriginal: true), closeTo(val, eps)); + expect((-val).toJFloat().floatValue(releaseOriginal: true), closeTo(-val, eps)); }); }); @@ -67,77 +67,78 @@ const val = 3.14; const eps = 1e-9; using((arena) { - expect(JDouble(val).doubleValue(deleteOriginal: true), closeTo(val, eps)); - expect((-val).toJDouble().doubleValue(deleteOriginal: true), + expect( + JDouble(val).doubleValue(releaseOriginal: true), closeTo(val, eps)); + expect((-val).toJDouble().doubleValue(releaseOriginal: true), closeTo(-val, eps)); }); }); testRunner('JBoolean', () { using((arena) { - expect(JBoolean(false).booleanValue(deleteOriginal: true), false); - expect(JBoolean(true).booleanValue(deleteOriginal: true), true); + expect(JBoolean(false).booleanValue(releaseOriginal: true), false); + expect(JBoolean(true).booleanValue(releaseOriginal: true), true); }); }); testRunner('JByte.\$type hashCode and ==', () { using((arena) { - final a = JByte(1)..deletedIn(arena); - final b = JByte(2)..deletedIn(arena); + final a = JByte(1)..releasedBy(arena); + final b = JByte(2)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JCharacter.\$type hashCode and ==', () { using((arena) { - final a = JCharacter(1)..deletedIn(arena); - final b = JCharacter(2)..deletedIn(arena); + final a = JCharacter(1)..releasedBy(arena); + final b = JCharacter(2)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JShort.\$type hashCode and ==', () { using((arena) { - final a = JShort(1)..deletedIn(arena); - final b = JShort(2)..deletedIn(arena); + final a = JShort(1)..releasedBy(arena); + final b = JShort(2)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JInteger.\$type hashCode and ==', () { using((arena) { - final a = JInteger(1)..deletedIn(arena); - final b = JInteger(2)..deletedIn(arena); + final a = JInteger(1)..releasedBy(arena); + final b = JInteger(2)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JLong.\$type hashCode and ==', () { using((arena) { - final a = JLong(1)..deletedIn(arena); - final b = JLong(2)..deletedIn(arena); + final a = JLong(1)..releasedBy(arena); + final b = JLong(2)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JFloat.\$type hashCode and ==', () { using((arena) { - final a = JFloat(1.0)..deletedIn(arena); - final b = JFloat(2.0)..deletedIn(arena); + final a = JFloat(1.0)..releasedBy(arena); + final b = JFloat(2.0)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JDouble.\$type hashCode and ==', () { using((arena) { - final a = JDouble(1.0)..deletedIn(arena); - final b = JDouble(2.0)..deletedIn(arena); + final a = JDouble(1.0)..releasedBy(arena); + final b = JDouble(2.0)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); }); }); testRunner('JBoolean.\$type hashCode and ==', () { using((arena) { - final a = JBoolean(true)..deletedIn(arena); - final b = JBoolean(false)..deletedIn(arena); + final a = JBoolean(true)..releasedBy(arena); + final b = JBoolean(false)..releasedBy(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); });
diff --git a/pkgs/jni/test/exception_test.dart b/pkgs/jni/test/exception_test.dart index d9af254..d3c806d 100644 --- a/pkgs/jni/test/exception_test.dart +++ b/pkgs/jni/test/exception_test.dart
@@ -37,15 +37,15 @@ void run({required TestRunnerCallback testRunner}) { testRunner("double free throws exception", () { final r = Jni.newInstance("java/util/Random", "()V", []); - r.delete(); - expect(r.delete, throwsA(isA<DoubleFreeException>())); + r.release(); + expect(r.release, throwsA(isA<DoubleReleaseException>())); }); testRunner("Use after free throws exception", () { final r = Jni.newInstance("java/util/Random", "()V", []); - r.delete(); + r.release(); expect(() => r.callMethodByName<int>("nextInt", "(I)I", [JValueInt(256)]), - throwsA(isA<UseAfterFreeException>())); + throwsA(isA<UseAfterReleaseException>())); }); testRunner("void fieldType throws exception", () {
diff --git a/pkgs/jni/test/jarray_test.dart b/pkgs/jni/test/jarray_test.dart index 18550e5..3cc7c98 100644 --- a/pkgs/jni/test/jarray_test.dart +++ b/pkgs/jni/test/jarray_test.dart
@@ -21,7 +21,7 @@ void run({required TestRunnerCallback testRunner}) { testRunner("Java boolean array", () { using((arena) { - final array = JArray(jboolean.type, 3)..deletedIn(arena); + final array = JArray(jboolean.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = true; array[1] = false; @@ -46,7 +46,7 @@ }); testRunner("Java char array", () { using((arena) { - final array = JArray(jchar.type, 3)..deletedIn(arena); + final array = JArray(jchar.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 'Ø'; array[1] = '2'; @@ -71,7 +71,7 @@ }); testRunner("Java byte array", () { using((arena) { - final array = JArray(jbyte.type, 3)..deletedIn(arena); + final array = JArray(jbyte.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -96,7 +96,7 @@ }); testRunner("Java short array", () { using((arena) { - final array = JArray(jshort.type, 3)..deletedIn(arena); + final array = JArray(jshort.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -121,7 +121,7 @@ }); testRunner("Java int array", () { using((arena) { - final array = JArray(jint.type, 3)..deletedIn(arena); + final array = JArray(jint.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -146,7 +146,7 @@ }); testRunner("Java long array", () { using((arena) { - final array = JArray(jlong.type, 3)..deletedIn(arena); + final array = JArray(jlong.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 1; array[1] = 2; @@ -172,7 +172,7 @@ const epsilon = 1e-6; testRunner("Java float array", () { using((arena) { - final array = JArray(jfloat.type, 3)..deletedIn(arena); + final array = JArray(jfloat.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 0.5; array[1] = 2; @@ -197,7 +197,7 @@ }); testRunner("Java double array", () { using((arena) { - final array = JArray(jdouble.type, 3)..deletedIn(arena); + final array = JArray(jdouble.type, 3)..releasedBy(arena); expect(array.length, 3); array[0] = 0.5; array[1] = 2; @@ -222,42 +222,42 @@ }); testRunner("Java string array", () { using((arena) { - final array = JArray(JString.type, 3)..deletedIn(arena); + final array = JArray(JString.type, 3)..releasedBy(arena); expect(array.length, 3); - array[0] = "ØØ³".toJString()..deletedIn(arena); - array[1] = "\$".toJString()..deletedIn(arena); - array[2] = "33".toJString()..deletedIn(arena); - expect(array[0].toDartString(deleteOriginal: true), "ØØ³"); - expect(array[1].toDartString(deleteOriginal: true), "\$"); - expect(array[2].toDartString(deleteOriginal: true), "33"); + array[0] = "ØØ³".toJString()..releasedBy(arena); + array[1] = "\$".toJString()..releasedBy(arena); + array[2] = "33".toJString()..releasedBy(arena); + expect(array[0].toDartString(releaseOriginal: true), "ØØ³"); + expect(array[1].toDartString(releaseOriginal: true), "\$"); + expect(array[2].toDartString(releaseOriginal: true), "33"); array.setRange( 0, 3, [ - "44".toJString()..deletedIn(arena), - "55".toJString()..deletedIn(arena), - "66".toJString()..deletedIn(arena), - "77".toJString()..deletedIn(arena), + "44".toJString()..releasedBy(arena), + "55".toJString()..releasedBy(arena), + "66".toJString()..releasedBy(arena), + "77".toJString()..releasedBy(arena), ], 1, ); - expect(array[0].toDartString(deleteOriginal: true), "55"); - expect(array[1].toDartString(deleteOriginal: true), "66"); - expect(array[2].toDartString(deleteOriginal: true), "77"); + expect(array[0].toDartString(releaseOriginal: true), "55"); + expect(array[1].toDartString(releaseOriginal: true), "66"); + expect(array[2].toDartString(releaseOriginal: true), "77"); expect(() { final _ = array[-1]; }, throwsRangeError); expect(() { - array[-1] = "44".toJString()..deletedIn(arena); + array[-1] = "44".toJString()..releasedBy(arena); }, throwsRangeError); expect(() { - array[3] = "44".toJString()..deletedIn(arena); + array[3] = "44".toJString()..releasedBy(arena); }, throwsRangeError); }); }); testRunner("Java object array", () { using((arena) { - final array = JArray(JObject.type, 3)..deletedIn(arena); + final array = JArray(JObject.type, 3)..releasedBy(arena); expect(array.length, 3); expect(array[0].reference, nullptr); expect(array[1].reference, nullptr); @@ -266,11 +266,11 @@ }); testRunner("Java 2d array", () { using((arena) { - final array = JArray(jint.type, 3)..deletedIn(arena); + final array = JArray(jint.type, 3)..releasedBy(arena); array[0] = 1; array[1] = 2; array[2] = 3; - final twoDimArray = JArray(JArray.type(jint.type), 3)..deletedIn(arena); + final twoDimArray = JArray(JArray.type(jint.type), 3)..releasedBy(arena); expect(twoDimArray.length, 3); twoDimArray[0] = array; twoDimArray[1] = array; @@ -286,86 +286,86 @@ }); testRunner("JArray.filled", () { using((arena) { - final string = "abc".toJString()..deletedIn(arena); - final array = JArray.filled(3, string)..deletedIn(arena); + final string = "abc".toJString()..releasedBy(arena); + final array = JArray.filled(3, string)..releasedBy(arena); expect( () { final _ = JArray.filled(3, JString.fromRef(nullptr)) - ..deletedIn(arena); + ..releasedBy(arena); }, throwsA(isA<AssertionError>()), ); expect(array.length, 3); - expect(array[0].toDartString(deleteOriginal: true), "abc"); - expect(array[1].toDartString(deleteOriginal: true), "abc"); - expect(array[2].toDartString(deleteOriginal: true), "abc"); + expect(array[0].toDartString(releaseOriginal: true), "abc"); + expect(array[1].toDartString(releaseOriginal: true), "abc"); + expect(array[2].toDartString(releaseOriginal: true), "abc"); }); }); testRunner('JArray of JByte', () { using((arena) { - final arr = JArray(JByte.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JByte.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JShort', () { using((arena) { - final arr = JArray(JShort.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JShort.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JInteger', () { using((arena) { - final arr = JArray(JInteger.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JInteger.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JLong', () { using((arena) { - final arr = JArray(JLong.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JLong.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JFloat', () { using((arena) { - final arr = JArray(JFloat.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JFloat.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JDouble', () { using((arena) { - final arr = JArray(JDouble.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JDouble.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JBoolean', () { using((arena) { - final arr = JArray(JBoolean.type, 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JBoolean.type, 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JSet', () { using((arena) { - final arr = JArray(JSet.type(JString.type), 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JSet.type(JString.type), 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JList', () { using((arena) { - final arr = JArray(JList.type(JString.type), 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JList.type(JString.type), 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JMap', () { using((arena) { final arr = JArray(JMap.type(JString.type, JString.type), 1) - ..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + ..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); testRunner('JArray of JIterator', () { using((arena) { - final arr = JArray(JIterator.type(JString.type), 1)..deletedIn(arena); - expect((arr[0]..deletedIn(arena)).isNull, true); + final arr = JArray(JIterator.type(JString.type), 1)..releasedBy(arena); + expect((arr[0]..releasedBy(arena)).isNull, true); }); }); }
diff --git a/pkgs/jni/test/jlist_test.dart b/pkgs/jni/test/jlist_test.dart index c483d53..b410525 100644 --- a/pkgs/jni/test/jlist_test.dart +++ b/pkgs/jni/test/jlist_test.dart
@@ -21,11 +21,11 @@ void run({required TestRunnerCallback testRunner}) { JList<JString> testDataList(Arena arena) { return [ - "1".toJString()..deletedIn(arena), - "2".toJString()..deletedIn(arena), - "3".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena), + "2".toJString()..releasedBy(arena), + "3".toJString()..releasedBy(arena), ].toJList(JString.type) - ..deletedIn(arena); + ..releasedBy(arena); } testRunner('length get', () { @@ -47,25 +47,25 @@ testRunner('[]', () { using((arena) { final list = testDataList(arena); - expect(list[0].toDartString(deleteOriginal: true), "1"); - expect(list[1].toDartString(deleteOriginal: true), "2"); - expect(list[2].toDartString(deleteOriginal: true), "3"); + expect(list[0].toDartString(releaseOriginal: true), "1"); + expect(list[1].toDartString(releaseOriginal: true), "2"); + expect(list[2].toDartString(releaseOriginal: true), "3"); }); }); testRunner('[]=', () { using((arena) { final list = testDataList(arena); - expect(list[0].toDartString(deleteOriginal: true), "1"); - list[0] = "2".toJString()..deletedIn(arena); - expect(list[0].toDartString(deleteOriginal: true), "2"); + expect(list[0].toDartString(releaseOriginal: true), "1"); + list[0] = "2".toJString()..releasedBy(arena); + expect(list[0].toDartString(releaseOriginal: true), "2"); }); }); testRunner('add', () { using((arena) { final list = testDataList(arena); - list.add("4".toJString()..deletedIn(arena)); + list.add("4".toJString()..releasedBy(arena)); expect(list.length, 4); - expect(list[3].toDartString(deleteOriginal: true), "4"); + expect(list[3].toDartString(releaseOriginal: true), "4"); }); }); testRunner('addAll', () { @@ -74,7 +74,7 @@ final toAppend = testDataList(arena); list.addAll(toAppend); expect(list.length, 6); - list.addAll(["4".toJString()..deletedIn(arena)]); + list.addAll(["4".toJString()..releasedBy(arena)]); expect(list.length, 7); }); }); @@ -93,17 +93,17 @@ final list = testDataList(arena); // ignore: iterable_contains_unrelated_type expect(list.contains("1"), false); - expect(list.contains("1".toJString()..deletedIn(arena)), true); - expect(list.contains("4".toJString()..deletedIn(arena)), false); + expect(list.contains("1".toJString()..releasedBy(arena)), true); + expect(list.contains("4".toJString()..releasedBy(arena)), false); }); }); testRunner('getRange', () { using((arena) { final list = testDataList(arena); // ignore: iterable_contains_unrelated_type - final range = list.getRange(1, 2)..deletedIn(arena); + final range = list.getRange(1, 2)..releasedBy(arena); expect(range.length, 1); - expect(range.first.toDartString(deleteOriginal: true), "2"); + expect(range.first.toDartString(releaseOriginal: true), "2"); }); }); testRunner('indexOf', () { @@ -119,9 +119,9 @@ testRunner('insert', () { using((arena) { final list = testDataList(arena); - list.insert(1, "0".toJString()..deletedIn(arena)); + list.insert(1, "0".toJString()..releasedBy(arena)); expect(list.length, 4); - expect(list[1].toDartString(deleteOriginal: true), "0"); + expect(list[1].toDartString(releaseOriginal: true), "0"); }); }); testRunner('insertAll', () { @@ -129,11 +129,11 @@ final list = testDataList(arena); final toInsert = testDataList(arena); list.insertAll(1, toInsert); - expect(list[1].toDartString(deleteOriginal: true), "1"); + expect(list[1].toDartString(releaseOriginal: true), "1"); expect(list.length, 6); - list.insertAll(1, ["4".toJString()..deletedIn(arena)]); + list.insertAll(1, ["4".toJString()..releasedBy(arena)]); expect(list.length, 7); - expect(list[1].toDartString(deleteOriginal: true), "4"); + expect(list[1].toDartString(releaseOriginal: true), "4"); }); }); testRunner('iterator', () { @@ -141,20 +141,20 @@ final list = testDataList(arena); final it = list.iterator; expect(it.moveNext(), true); - expect(it.current.toDartString(deleteOriginal: true), "1"); + expect(it.current.toDartString(releaseOriginal: true), "1"); expect(it.moveNext(), true); - expect(it.current.toDartString(deleteOriginal: true), "2"); + expect(it.current.toDartString(releaseOriginal: true), "2"); expect(it.moveNext(), true); - expect(it.current.toDartString(deleteOriginal: true), "3"); + expect(it.current.toDartString(releaseOriginal: true), "3"); expect(it.moveNext(), false); }); }); testRunner('remove', () { using((arena) { final list = testDataList(arena); - expect(list.remove("3".toJString()..deletedIn(arena)), true); + expect(list.remove("3".toJString()..releasedBy(arena)), true); expect(list.length, 2); - expect(list.remove("4".toJString()..deletedIn(arena)), false); + expect(list.remove("4".toJString()..releasedBy(arena)), false); // ignore: list_remove_unrelated_type expect(list.remove(1), false); }); @@ -162,15 +162,15 @@ testRunner('removeAt', () { using((arena) { final list = testDataList(arena); - expect(list.removeAt(0).toDartString(deleteOriginal: true), "1"); - expect(list.removeAt(1).toDartString(deleteOriginal: true), "3"); + expect(list.removeAt(0).toDartString(releaseOriginal: true), "1"); + expect(list.removeAt(1).toDartString(releaseOriginal: true), "3"); }); }); testRunner('removeRange', () { using((arena) { final list = testDataList(arena); list.removeRange(0, 2); - expect(list.single.toDartString(deleteOriginal: true), "3"); + expect(list.single.toDartString(releaseOriginal: true), "3"); }); }); testRunner('==, hashCode', () { @@ -179,7 +179,7 @@ final b = testDataList(arena); expect(a.hashCode, b.hashCode); expect(a, b); - b.add("4".toJString()..deletedIn(arena)); + b.add("4".toJString()..releasedBy(arena)); expect(a.hashCode, isNot(b.hashCode)); expect(a, isNot(b)); }); @@ -187,7 +187,7 @@ testRunner('toSet', () { using((arena) { final list = testDataList(arena); - final set = list.toSet()..deletedIn(arena); + final set = list.toSet()..releasedBy(arena); expect(set.length, 3); }); }); @@ -197,7 +197,7 @@ final b = testDataList(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); - final c = JList.array(JObject.type)..deletedIn(arena); + final c = JList.array(JObject.type)..releasedBy(arena); expect(a.$type, isNot(c.$type)); expect(a.$type.hashCode, isNot(c.$type.hashCode)); }); @@ -208,7 +208,7 @@ final b = testDataList(arena); expect(a.iterator.$type, b.iterator.$type); expect(a.iterator.$type.hashCode, b.iterator.$type.hashCode); - final c = JList.array(JObject.type)..deletedIn(arena); + final c = JList.array(JObject.type)..releasedBy(arena); expect(a.iterator.$type, isNot(c.iterator.$type)); expect(a.iterator.$type.hashCode, isNot(c.iterator.$type.hashCode)); });
diff --git a/pkgs/jni/test/jmap_test.dart b/pkgs/jni/test/jmap_test.dart index 23edb22..4ece751 100644 --- a/pkgs/jni/test/jmap_test.dart +++ b/pkgs/jni/test/jmap_test.dart
@@ -20,11 +20,12 @@ void run({required TestRunnerCallback testRunner}) { JMap<JString, JString> testDataMap(Arena arena) { return { - "1".toJString()..deletedIn(arena): "One".toJString()..deletedIn(arena), - "2".toJString()..deletedIn(arena): "Two".toJString()..deletedIn(arena), - "3".toJString()..deletedIn(arena): "Three".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena): "One".toJString()..releasedBy(arena), + "2".toJString()..releasedBy(arena): "Two".toJString()..releasedBy(arena), + "3".toJString()..releasedBy(arena): "Three".toJString() + ..releasedBy(arena), }.toJMap(JString.type, JString.type) - ..deletedIn(arena); + ..releasedBy(arena); } testRunner('length', () { @@ -39,12 +40,12 @@ // ignore: collection_methods_unrelated_type expect(map[1], null); expect( - map["1".toJString()..deletedIn(arena)] - ?.toDartString(deleteOriginal: true), + map["1".toJString()..releasedBy(arena)] + ?.toDartString(releaseOriginal: true), "One", ); expect( - map["4".toJString()..deletedIn(arena)], + map["4".toJString()..releasedBy(arena)], null, ); }); @@ -52,19 +53,19 @@ testRunner('[]=', () { using((arena) { final map = testDataMap(arena); - map["0".toJString()..deletedIn(arena)] = "Zero".toJString() - ..deletedIn(arena); + map["0".toJString()..releasedBy(arena)] = "Zero".toJString() + ..releasedBy(arena); expect( - map["0".toJString()..deletedIn(arena)] - ?.toDartString(deleteOriginal: true), + map["0".toJString()..releasedBy(arena)] + ?.toDartString(releaseOriginal: true), "Zero", ); expect(map.length, 4); - map["1".toJString()..deletedIn(arena)] = "one!".toJString() - ..deletedIn(arena); + map["1".toJString()..releasedBy(arena)] = "one!".toJString() + ..releasedBy(arena); expect( - map["1".toJString()..deletedIn(arena)] - ?.toDartString(deleteOriginal: true), + map["1".toJString()..releasedBy(arena)] + ?.toDartString(releaseOriginal: true), "one!", ); expect(map.length, 4); @@ -74,23 +75,26 @@ using((arena) { final map = testDataMap(arena); final toAdd = { - "0".toJString()..deletedIn(arena): "Zero".toJString()..deletedIn(arena), - "1".toJString()..deletedIn(arena): "one!".toJString()..deletedIn(arena), + "0".toJString()..releasedBy(arena): "Zero".toJString() + ..releasedBy(arena), + "1".toJString()..releasedBy(arena): "one!".toJString() + ..releasedBy(arena), }.toJMap(JString.type, JString.type); map.addAll(toAdd); expect(map.length, 4); expect( - map["0".toJString()..deletedIn(arena)] - ?.toDartString(deleteOriginal: true), + map["0".toJString()..releasedBy(arena)] + ?.toDartString(releaseOriginal: true), "Zero", ); expect( - map["1".toJString()..deletedIn(arena)] - ?.toDartString(deleteOriginal: true), + map["1".toJString()..releasedBy(arena)] + ?.toDartString(releaseOriginal: true), "one!", ); map.addAll({ - "4".toJString()..deletedIn(arena): "Four".toJString()..deletedIn(arena) + "4".toJString()..releasedBy(arena): "Four".toJString() + ..releasedBy(arena) }); expect(map.length, 5); }); @@ -110,8 +114,8 @@ final map = testDataMap(arena); // ignore: iterable_contains_unrelated_type expect(map.containsKey(1), false); - expect(map.containsKey("1".toJString()..deletedIn(arena)), true); - expect(map.containsKey("4".toJString()..deletedIn(arena)), false); + expect(map.containsKey("1".toJString()..releasedBy(arena)), true); + expect(map.containsKey("4".toJString()..releasedBy(arena)), false); }); }); testRunner('containsValue', () { @@ -119,8 +123,8 @@ final map = testDataMap(arena); // ignore: iterable_contains_unrelated_type expect(map.containsValue(1), false); - expect(map.containsValue("One".toJString()..deletedIn(arena)), true); - expect(map.containsValue("Four".toJString()..deletedIn(arena)), false); + expect(map.containsValue("One".toJString()..releasedBy(arena)), true); + expect(map.containsValue("Four".toJString()..releasedBy(arena)), false); }); }); testRunner('keys', () { @@ -129,7 +133,7 @@ final keys = map.keys; expect( keys - .map((element) => element.toDartString(deleteOriginal: true)) + .map((element) => element.toDartString(releaseOriginal: true)) .toSet(), {"1", "2", "3"}, ); @@ -140,12 +144,12 @@ final map = testDataMap(arena); // ignore: collection_methods_unrelated_type expect(map.remove(1), null); - expect(map.remove("4".toJString()..deletedIn(arena)), null); + expect(map.remove("4".toJString()..releasedBy(arena)), null); expect(map.length, 3); expect( map - .remove("3".toJString()..deletedIn(arena)) - ?.toDartString(deleteOriginal: true), + .remove("3".toJString()..releasedBy(arena)) + ?.toDartString(releaseOriginal: true), "Three", ); expect(map.length, 2); @@ -158,7 +162,7 @@ expect(a.$type, b.$type); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); - final c = JMap.hash(JObject.type, JObject.type)..deletedIn(arena); + final c = JMap.hash(JObject.type, JObject.type)..releasedBy(arena); expect(a.$type, isNot(c.$type)); expect(a.$type.hashCode, isNot(c.$type.hashCode)); });
diff --git a/pkgs/jni/test/jobject_test.dart b/pkgs/jni/test/jobject_test.dart index 8478d5a..883913c 100644 --- a/pkgs/jni/test/jobject_test.dart +++ b/pkgs/jni/test/jobject_test.dart
@@ -48,11 +48,11 @@ final intValue = long.callMethodByName<int>("intValue", "()I", []); expect(intValue, equals(176)); - // delete any JObject and JClass instances using .delete() after use. - // Deletion is not strictly required since JNI objects / classes have - // a NativeFinalizer. But deleting them after use is a good practice. - long.delete(); - longClass.delete(); + // Release any JObject and JClass instances using `.release()` after use. + // This is not strictly required since JNI objects / classes have + // a [NativeFinalizer]. But deleting them after use is a good practice. + long.release(); + longClass.release(); }); testRunner("call a static method using JClass APIs", () { @@ -60,16 +60,16 @@ final result = integerClass.callStaticMethodByName<JString>( "toHexString", "(I)Ljava/lang/String;", [JValueInt(31)]); - // if the object is supposed to be a Java string - // you can call toDartString on it. + // If the object is supposed to be a Java string you can call + // [toDartString] on it. final resultString = result.toDartString(); - // Dart string is a copy, original object can be deleted. - result.delete(); + // Dart string is a copy, original object can be released. + result.release(); expect(resultString, equals("1f")); - // Also don't forget to delete the class - integerClass.delete(); + // Also don't forget to release the class. + integerClass.release(); }); testRunner("Call method with null argument, expect exception", () { @@ -78,7 +78,7 @@ () => integerClass.callStaticMethodByName<int>( "parseInt", "(Ljava/lang/String;)I", [nullptr]), throwsException); - integerClass.delete(); + integerClass.release(); }); // Skip this test on Android integration test because it fails there, possibly @@ -89,8 +89,8 @@ }); } - /// callMethodByName will be expensive if making same call many times - /// Use getMethodID to get a method ID and use it in subsequent calls + // [callMethodByName] will be expensive if making same call many times. + // Use [getMethodID] to get a method ID and use it in subsequent calls. testRunner("Example for using getMethodID", () { final longClass = Jni.findJClass("java/lang/Long"); final bitCountMethod = longClass.getStaticMethodID("bitCount", "(J)I"); @@ -99,7 +99,7 @@ // It finds the class, gets constructor ID and constructs an instance. final random = Jni.newInstance("java/util/Random", "()V", []); - // You don't need a JClass reference to get instance method IDs + // You don't need a [JClass] reference to get instance method IDs. final nextIntMethod = random.getMethodID("nextInt", "(I)I"); for (int i = 0; i < 100; i++) { @@ -112,7 +112,8 @@ } expect(jbc, equals(bits)); } - Jni.deleteAll([random, longClass]); + random.release(); + longClass.release(); }); // One-off invocation of static method in single call. @@ -135,19 +136,19 @@ expect(maxLong, equals(32767)); }); - // Use callStringMethod if all you care about is a string result + // Use [callStringMethod] if all you care about is a string result testRunner("callStaticStringMethod", () { final longClass = Jni.findJClass("java/lang/Long"); const n = 1223334444; final strFromJava = longClass.callStaticMethodByName<String>( "toOctalString", "(J)Ljava/lang/String;", [n]); expect(strFromJava, equals(n.toRadixString(8))); - longClass.delete(); + longClass.release(); }); - // In JObject, JClass, and retrieve_/invoke_ methods + // In [JObject], [JClass], and retrieve_/invoke_ methods // you can also pass Dart strings, apart from range of types - // allowed by Jni.jvalues + // allowed by [Jni.jvalues]. // They will be converted automatically. testRunner( "Passing strings in arguments", @@ -158,7 +159,7 @@ // (\n because test runner prints first char at end of the line) //out.callMethodByName<Null>( // "println", "(Ljava/lang/Object;)V", ["\nWorks (Apparently)"]); - out.delete(); + out.release(); }, ); @@ -181,14 +182,14 @@ testRunner('Using arena', () { final objects = <JObject>[]; using((arena) { - final r = Jni.findJClass('java/util/Random')..deletedIn(arena); + final r = Jni.findJClass('java/util/Random')..releasedBy(arena); final ctor = r.getCtorID("()V"); for (int i = 0; i < 10; i++) { - objects.add(r.newInstance(ctor, [])..deletedIn(arena)); + objects.add(r.newInstance(ctor, [])..releasedBy(arena)); } }); for (var object in objects) { - expect(object.isDeleted, isTrue); + expect(object.isReleased, isTrue); } }); @@ -202,14 +203,14 @@ testRunner("casting", () { using((arena) { - final str = "hello".toJString()..deletedIn(arena); - final obj = str.castTo(JObject.type)..deletedIn(arena); + final str = "hello".toJString()..releasedBy(arena); + final obj = str.castTo(JObject.type)..releasedBy(arena); final backToStr = obj.castTo(JString.type); expect(backToStr.toDartString(), str.toDartString()); - final _ = backToStr.castTo(JObject.type, deleteOriginal: true) - ..deletedIn(arena); - expect(backToStr.toDartString, throwsA(isA<UseAfterFreeException>())); - expect(backToStr.delete, throwsA(isA<DoubleFreeException>())); + final _ = backToStr.castTo(JObject.type, releaseOriginal: true) + ..releasedBy(arena); + expect(backToStr.toDartString, throwsA(isA<UseAfterReleaseException>())); + expect(backToStr.release, throwsA(isA<DoubleReleaseException>())); }); }); @@ -258,5 +259,5 @@ // Expect throws an [OutsideTestException] // but you can uncomment below print and see it works // print("\n$r"); - random.delete(); + random.release(); }
diff --git a/pkgs/jni/test/jset_test.dart b/pkgs/jni/test/jset_test.dart index 92aaa0c..2d93e63 100644 --- a/pkgs/jni/test/jset_test.dart +++ b/pkgs/jni/test/jset_test.dart
@@ -21,11 +21,11 @@ void run({required TestRunnerCallback testRunner}) { JSet<JString> testDataSet(Arena arena) { return { - "1".toJString()..deletedIn(arena), - "2".toJString()..deletedIn(arena), - "3".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena), + "2".toJString()..releasedBy(arena), + "3".toJString()..releasedBy(arena), }.toJSet(JString.type) - ..deletedIn(arena); + ..releasedBy(arena); } testRunner('length', () { @@ -37,9 +37,9 @@ testRunner('add', () { using((arena) { final set = testDataSet(arena); - set.add("1".toJString()..deletedIn(arena)); + set.add("1".toJString()..releasedBy(arena)); expect(set.length, 3); - set.add("4".toJString()..deletedIn(arena)); + set.add("4".toJString()..releasedBy(arena)); expect(set.length, 4); }); }); @@ -47,12 +47,12 @@ using((arena) { final set = testDataSet(arena); final toAdd = testDataSet(arena); - toAdd.add("4".toJString()..deletedIn(arena)); + toAdd.add("4".toJString()..releasedBy(arena)); set.addAll(toAdd); expect(set.length, 4); set.addAll([ - "1".toJString()..deletedIn(arena), - "5".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena), + "5".toJString()..releasedBy(arena), ]); expect(set.length, 5); }); @@ -70,8 +70,8 @@ final set = testDataSet(arena); // ignore: iterable_contains_unrelated_type expect(set.contains(1), false); - expect(set.contains("1".toJString()..deletedIn(arena)), true); - expect(set.contains("4".toJString()..deletedIn(arena)), false); + expect(set.contains("1".toJString()..releasedBy(arena)), true); + expect(set.contains("4".toJString()..releasedBy(arena)), false); }); }); testRunner('containsAll', () { @@ -80,15 +80,15 @@ expect(set.containsAll(set), true); expect( set.containsAll([ - "1".toJString()..deletedIn(arena), - "2".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena), + "2".toJString()..releasedBy(arena), ]), true, ); final testSet = testDataSet(arena); - testSet.add("4".toJString()..deletedIn(arena)); + testSet.add("4".toJString()..releasedBy(arena)); expect(set.containsAll(testSet), false); - expect(set.containsAll(["4".toJString()..deletedIn(arena)]), false); + expect(set.containsAll(["4".toJString()..releasedBy(arena)]), false); }); }); testRunner('iterator', () { @@ -98,11 +98,11 @@ // There are no order guarantees in a hashset. final dartSet = <String>{}; expect(it.moveNext(), true); - dartSet.add(it.current.toDartString(deleteOriginal: true)); + dartSet.add(it.current.toDartString(releaseOriginal: true)); expect(it.moveNext(), true); - dartSet.add(it.current.toDartString(deleteOriginal: true)); + dartSet.add(it.current.toDartString(releaseOriginal: true)); expect(it.moveNext(), true); - dartSet.add(it.current.toDartString(deleteOriginal: true)); + dartSet.add(it.current.toDartString(releaseOriginal: true)); expect(it.moveNext(), false); // So we just check if the elements have appeared in some order. expect(dartSet, {"1", "2", "3"}); @@ -113,28 +113,28 @@ final set = testDataSet(arena); // ignore: collection_methods_unrelated_type expect(set.remove(1), false); - expect(set.remove("4".toJString()..deletedIn(arena)), false); + expect(set.remove("4".toJString()..releasedBy(arena)), false); expect(set.length, 3); - expect(set.remove("3".toJString()..deletedIn(arena)), true); + expect(set.remove("3".toJString()..releasedBy(arena)), true); expect(set.length, 2); }); }); testRunner('removeAll', () { using((arena) { final set = testDataSet(arena); - final toRemoveExclusive = {"4".toJString()..deletedIn(arena)} + final toRemoveExclusive = {"4".toJString()..releasedBy(arena)} .toJSet(JString.type) - ..deletedIn(arena); + ..releasedBy(arena); set.removeAll(toRemoveExclusive); expect(set.length, 3); final toRemoveInclusive = { - "1".toJString()..deletedIn(arena), - "4".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena), + "4".toJString()..releasedBy(arena), }.toJSet(JString.type) - ..deletedIn(arena); + ..releasedBy(arena); set.removeAll(toRemoveInclusive); expect(set.length, 2); - set.removeAll(["2".toJString()..deletedIn(arena)]); + set.removeAll(["2".toJString()..releasedBy(arena)]); expect(set.length, 1); }); }); @@ -142,15 +142,15 @@ using((arena) { final set = testDataSet(arena); final toRetain = { - "1".toJString()..deletedIn(arena), - "3".toJString()..deletedIn(arena), - "4".toJString()..deletedIn(arena), + "1".toJString()..releasedBy(arena), + "3".toJString()..releasedBy(arena), + "4".toJString()..releasedBy(arena), }; set.retainAll(set); expect(set.length, 3); set.retainAll(toRetain); expect(set.length, 2); - final toRetainJSet = toRetain.toJSet(JString.type)..deletedIn(arena); + final toRetainJSet = toRetain.toJSet(JString.type)..releasedBy(arena); set.retainAll(toRetainJSet); expect(set.length, 2); }); @@ -161,7 +161,7 @@ final b = testDataSet(arena); expect(a.hashCode, b.hashCode); expect(a, b); - b.add("4".toJString()..deletedIn(arena)); + b.add("4".toJString()..releasedBy(arena)); expect(a.hashCode, isNot(b.hashCode)); expect(a, isNot(b)); }); @@ -172,19 +172,19 @@ // ignore: iterable_contains_unrelated_type expect(set.lookup(1), null); expect( - set.lookup("1".toJString())?.toDartString(deleteOriginal: true), + set.lookup("1".toJString())?.toDartString(releaseOriginal: true), "1", ); - expect(set.lookup("4".toJString()..deletedIn(arena)), null); + expect(set.lookup("4".toJString()..releasedBy(arena)), null); }); }); testRunner('toSet', () { using((arena) { // Test if the set gets copied. final set = testDataSet(arena); - final setCopy = set.toSet()..deletedIn(arena); + final setCopy = set.toSet()..releasedBy(arena); expect(set, setCopy); - set.add("4".toJString()..deletedIn(arena)); + set.add("4".toJString()..releasedBy(arena)); expect(set, isNot(setCopy)); }); }); @@ -194,7 +194,7 @@ final b = testDataSet(arena); expect(a.$type, b.$type); expect(a.$type.hashCode, b.$type.hashCode); - final c = JSet.hash(JObject.type)..deletedIn(arena); + final c = JSet.hash(JObject.type)..releasedBy(arena); expect(a.$type, isNot(c.$type)); expect(a.$type.hashCode, isNot(c.$type.hashCode)); });
diff --git a/pkgs/jni/test/jstring_test.dart b/pkgs/jni/test/jstring_test.dart index 210c91d..c1a968c 100644 --- a/pkgs/jni/test/jstring_test.dart +++ b/pkgs/jni/test/jstring_test.dart
@@ -20,7 +20,7 @@ void testStringBackAndForth(String str) { final jstring = str.toJString(); - final dartString = jstring.toDartString(deleteOriginal: true); + final dartString = jstring.toDartString(releaseOriginal: true); expect(dartString, str); }
diff --git a/pkgs/jni/test/load_test.dart b/pkgs/jni/test/load_test.dart index 162b3e9..d74a5fc 100644 --- a/pkgs/jni/test/load_test.dart +++ b/pkgs/jni/test/load_test.dart
@@ -64,14 +64,14 @@ list.add(newRandom()); } for (final jobject in list) { - jobject.delete(); + jobject.release(); } }); - testRunner('Create and delete 256K references in a loop using arena', () { + testRunner('Create and release 256K references in a loop using arena', () { for (int i = 0; i < k256; i++) { using((arena) { - final random = newRandom()..deletedIn(arena); + final random = newRandom()..releasedBy(arena); // The actual expect here does not matter. I am just being paranoid // against assigning to `_` because compiler may optimize it. (It has // side effect of calling FFI but still.) @@ -80,19 +80,20 @@ } }); - testRunner('Create & delete 256K references in a loop (explicit delete)', () { + testRunner('Create and release 256K references in a loop (explicit release)', + () { for (int i = 0; i < k256; i++) { final random = newRandom(); expect(random.reference, isNot(nullptr)); - random.delete(); + random.release(); } }); - testRunner('Create and delete 64K references, in batches of 256', () { + testRunner('Create and release 64K references, in batches of 256', () { for (int i = 0; i < 64 * 4; i++) { using((arena) { for (int i = 0; i < 256; i++) { - final r = newRandom()..deletedIn(arena); + final r = newRandom()..releasedBy(arena); expect(r.reference, isNot(nullptr)); } });
diff --git a/pkgs/jnigen/CHANGELOG.md b/pkgs/jnigen/CHANGELOG.md index 357435d..5354fc2 100644 --- a/pkgs/jnigen/CHANGELOG.md +++ b/pkgs/jnigen/CHANGELOG.md
@@ -1,20 +1,15 @@ -## 0.6.0-wip.3 +## 0.6.0 +* **Breaking Change** ([#131](https://github.com/dart-lang/jnigen/issues/131)): Renamed `delete*` to `release*`. * **Breaking Change** ([#354](https://github.com/dart-lang/jnigen/issues/354)): Renamed constructors from `ctor1`, `ctor2`, ... to `new1`, `new2`, ... - -## 0.6.0-wip.2 +* **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**: Removed `suspend_fun_to_async` flag from the config. It's now happening by default since we read the Kotlin's metadata and reliably identify the `suspend fun`s. * 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. * Fixed a bug where the backends would produce different descriptors for the same method. * Added `enable_experiment` option to config. * 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. * Save all `jnigen` logs to a file in `.dart_tool/jnigen/logs/`. This is useful for debugging. -## 0.6.0-wip.0 -* **Breaking Change** Removed `suspend_fun_to_async` flag from the config. It's now happening by default since we read the Kotlin's metadata and reliably identify the `suspend fun`s. - ## 0.5.0 * **Breaking Change** ([#72](https://github.com/dart-lang/jnigen/issues/72)): Removed support for `importMap` in favor of the newly added interop mechanism with importing yaml files. * **Breaking Change** ([#72](https://github.com/dart-lang/jnigen/issues/72)): `java.util.Set`, `java.util.Map`, `java.util.List`, `java.util.Iterator` and the boxed types like `java.lang.Integer`, `java.lang.Double`, ... will be generated as their corresponding classes in `package:jni`.
diff --git a/pkgs/jnigen/README.md b/pkgs/jnigen/README.md index d524e0e..c5850b5 100644 --- a/pkgs/jnigen/README.md +++ b/pkgs/jnigen/README.md
@@ -191,10 +191,10 @@ #### How are classes mapped into bindings? Each Java class generates a subclass of `JObject` class, which wraps a `jobject` reference in JNI. Nested classes use `_` as separator, `Example.NestedClass` will be mapped to `Example_NestedClass`. -#### Does `JObject` hold a local or global reference? Does it need to be manually deleted? +#### Does `JObject` hold a local or global reference? Does it need to be manually released? Each Java object returned into Dart creates a JNI global reference. Reference deletion is taken care of by `NativeFinalizer` and that's usually sufficient. -It's a good practice to keep the interface between languages sparse. However, if there's a need to create several references (Eg: in a loop), you can use FFI Arena mechanism (`using` function) and `deletedIn` method, or manually delete the object using `delete` method. +It's a good practice to keep the interface between languages sparse. However, if there's a need to create several references (Eg: in a loop), you can use FFI Arena mechanism (`using` function) and `releasedBy` method, or manually release the object using `release` method. #### Should I use `jnigen` over Method channels? This is currently an experimental package. Many features are missing, and it's rough around the edges. You're welcome to try it and give feedback.
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 024059d..620adec 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
@@ -329,7 +329,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Initialize the singleton instance with the default system-provided configuration. /// @@ -361,7 +361,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public androidx.emoji2.text.EmojiCompat init(android.content.Context context, androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigFactory defaultFactory) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// @hide static EmojiCompat init1( @@ -379,7 +379,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public androidx.emoji2.text.EmojiCompat init(androidx.emoji2.text.EmojiCompat.Config config) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Initialize the singleton instance with a configuration. When used on devices running API 18 /// or below, the singleton instance is immediately moved into \#LOAD_STATE_SUCCEEDED @@ -420,7 +420,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat.Config config) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Used by the tests to reset EmojiCompat with a new configuration. Every time it is called a /// new instance is created with the new configuration. @@ -438,7 +438,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public androidx.emoji2.text.EmojiCompat reset(androidx.emoji2.text.EmojiCompat emojiCompat) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Used by the tests to reset EmojiCompat with a new singleton instance. ///@hide @@ -469,7 +469,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public androidx.emoji2.text.EmojiCompat get() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Return singleton EmojiCompat instance. Should be called after /// \#init(EmojiCompat.Config) is called to initialize the singleton instance. @@ -805,7 +805,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. When /// used on devices running API 18 or below, returns the given {@code charSequence} without @@ -832,7 +832,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int, int)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence, int start, int end) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. /// @@ -879,7 +879,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int, int, int)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence, int start, int end, int maxEmojiCount) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. /// @@ -932,7 +932,7 @@ int, int, int, int)>(); /// from: public java.lang.CharSequence process(java.lang.CharSequence charSequence, int start, int end, int maxEmojiCount, int replaceStrategy) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Checks a given CharSequence for emojis, and adds EmojiSpans if any emojis are found. /// @@ -983,7 +983,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getAssetSignature() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns signature for the currently loaded emoji assets. The signature is a SHA that is /// constructed using emoji assets. Can be used to detect if currently loaded asset is different @@ -1072,7 +1072,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected void <init>(androidx.emoji2.text.EmojiCompat.MetadataRepoLoader metadataLoader) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Default constructor. ///@param metadataLoader MetadataRepoLoader instance, cannot be {@code null} @@ -1092,7 +1092,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config registerInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Registers an initialization callback. ///@param initCallback the initialization callback to register, cannot be {@code null} @@ -1114,7 +1114,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config unregisterInitCallback(androidx.emoji2.text.EmojiCompat.InitCallback initCallback) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Unregisters a callback that was added before. ///@param initCallback the initialization callback to be removed, cannot be {@code null} @@ -1133,7 +1133,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setReplaceAll(boolean replaceAll) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Determines whether EmojiCompat should replace all the emojis it finds with the /// EmojiSpans. By default EmojiCompat tries its best to understand if the system already @@ -1154,7 +1154,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Determines whether EmojiCompat should use the emoji presentation style for emojis /// that have text style as default. By default, the text style would be used, unless these @@ -1186,7 +1186,7 @@ ffi.Pointer<ffi.Void>, int, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setUseEmojiAsDefaultStyle(boolean useEmojiAsDefaultStyle, java.util.List<java.lang.Integer> emojiAsDefaultStyleExceptions) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// @see \#setUseEmojiAsDefaultStyle(boolean) ///@param emojiAsDefaultStyleExceptions Contains the exception emojis which will be still @@ -1218,7 +1218,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorEnabled(boolean emojiSpanIndicatorEnabled) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Determines whether a background will be drawn for the emojis that are found and /// replaced by EmojiCompat. Should be used only for debugging purposes. The indicator color @@ -1241,7 +1241,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setEmojiSpanIndicatorColor(int color) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Sets the color used as emoji span indicator. The default value is /// Color\#GREEN Color.GREEN. @@ -1260,7 +1260,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setMetadataLoadStrategy(int strategy) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Determines the strategy to start loading the metadata. By default EmojiCompat /// will start loading the metadata during EmojiCompat\#init(Config). When set to @@ -1310,7 +1310,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setSpanFactory(androidx.emoji2.text.EmojiCompat.SpanFactory factory) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Set the span factory used to actually draw emoji replacements. ///@param factory custum span factory that can draw the emoji replacements @@ -1332,7 +1332,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config setGlyphChecker(androidx.emoji2.text.EmojiCompat.GlyphChecker glyphChecker) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// The interface that is used by EmojiCompat in order to check if a given emoji can be /// rendered by the system. @@ -1351,7 +1351,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected final androidx.emoji2.text.EmojiCompat.MetadataRepoLoader getMetadataRepoLoader() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the MetadataRepoLoader. EmojiCompat_MetadataRepoLoader getMetadataRepoLoader() { @@ -1405,7 +1405,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_MetadataRepoLoaderCallback() { return EmojiCompat_MetadataRepoLoaderCallback.fromRef(_new0().object); } @@ -1658,7 +1658,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_InitCallback() { return EmojiCompat_InitCallback.fromRef(_new0().object); } @@ -1741,7 +1741,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory EmojiCompat_DefaultSpanFactory() { return EmojiCompat_DefaultSpanFactory.fromRef(_new0().object); } @@ -1756,7 +1756,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer rasterizer) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns a TypefaceEmojiSpan. ///@param rasterizer TypefaceEmojiRasterizer instance, which can draw the emoji onto a @@ -1826,7 +1826,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public abstract androidx.emoji2.text.EmojiSpan createSpan(androidx.emoji2.text.TypefaceEmojiRasterizer rasterizer) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Create EmojiSpan instance. ///@param rasterizer TypefaceEmojiRasterizer instance, which can draw the emoji onto a @@ -1920,7 +1920,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public androidx.emoji2.text.FontRequestEmojiCompatConfig create(android.content.Context context) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Get the default emoji compat config for this device. /// @@ -1988,7 +1988,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API28 .fromRef(_new0().object); @@ -2004,7 +2004,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String providerPackage) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.JObject> getSigningSignatures1( jni.JObject packageManager, jni.JString providerPackage, @@ -2075,7 +2075,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper_API19 .fromRef(_new0().object); @@ -2094,7 +2094,7 @@ ffi.Pointer<ffi.Void>, int)>(); /// from: public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int flags) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JList<jni.JObject> queryIntentContentProviders( jni.JObject packageManager, jni.JObject intent, @@ -2116,7 +2116,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getProviderInfo( jni.JObject resolveInfo, ) { @@ -2184,7 +2184,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper() { return DefaultEmojiCompatConfig_DefaultEmojiCompatConfigHelper.fromRef( _new0().object); @@ -2200,7 +2200,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public android.content.pm.Signature[] getSigningSignatures(android.content.pm.PackageManager packageManager, java.lang.String providerPackage) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Get the signing signatures for a package in package manager. jni.JArray<jni.JObject> getSigningSignatures( @@ -2226,7 +2226,7 @@ ffi.Pointer<ffi.Void>, int)>(); /// from: public java.util.List<android.content.pm.ResolveInfo> queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int flags) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Get the content provider by intent. jni.JList<jni.JObject> queryIntentContentProviders( @@ -2250,7 +2250,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public android.content.pm.ProviderInfo getProviderInfo(android.content.pm.ResolveInfo resolveInfo) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Get a ProviderInfo, if present, from a ResolveInfo ///@param resolveInfo the subject @@ -2320,7 +2320,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(androidx.emoji2.text.DefaultEmojiCompatConfig.DefaultEmojiCompatConfigHelper helper) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// @hide factory DefaultEmojiCompatConfig_DefaultEmojiCompatConfigFactory( @@ -2340,7 +2340,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public androidx.emoji2.text.EmojiCompat.Config create(android.content.Context context) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// @see DefaultEmojiCompatConfig\#create ///@hide @@ -2405,7 +2405,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString getName() { return const jni.JStringType().fromRef(_getName(reference).object); } @@ -2417,7 +2417,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getFingerprint() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString getFingerprint() { return const jni.JStringType().fromRef(_getFingerprint(reference).object); } @@ -2502,7 +2502,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String BASE_OS - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get BASE_OS => const jni.JStringType().fromRef(_get_BASE_OS().object); @@ -2512,7 +2512,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String CODENAME - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get CODENAME => const jni.JStringType().fromRef(_get_CODENAME().object); @@ -2522,7 +2522,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String INCREMENTAL - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get INCREMENTAL => const jni.JStringType().fromRef(_get_INCREMENTAL().object); @@ -2549,7 +2549,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String RELEASE - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get RELEASE => const jni.JStringType().fromRef(_get_RELEASE().object); @@ -2559,7 +2559,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String RELEASE_OR_CODENAME - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get RELEASE_OR_CODENAME => const jni.JStringType().fromRef(_get_RELEASE_OR_CODENAME().object); @@ -2569,7 +2569,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String RELEASE_OR_PREVIEW_DISPLAY - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get RELEASE_OR_PREVIEW_DISPLAY => const jni.JStringType().fromRef(_get_RELEASE_OR_PREVIEW_DISPLAY().object); @@ -2579,7 +2579,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String SDK - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get SDK => const jni.JStringType().fromRef(_get_SDK().object); @@ -2597,7 +2597,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String SECURITY_PATCH - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get SECURITY_PATCH => const jni.JStringType().fromRef(_get_SECURITY_PATCH().object); @@ -2606,7 +2606,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION() { return Build_VERSION.fromRef(_new0().object); } @@ -2756,7 +2756,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Build_VERSION_CODES() { return Build_VERSION_CODES.fromRef(_new0().object); } @@ -2805,7 +2805,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String BOARD - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get BOARD => const jni.JStringType().fromRef(_get_BOARD().object); @@ -2815,7 +2815,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String BOOTLOADER - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get BOOTLOADER => const jni.JStringType().fromRef(_get_BOOTLOADER().object); @@ -2825,7 +2825,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String BRAND - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get BRAND => const jni.JStringType().fromRef(_get_BRAND().object); @@ -2835,7 +2835,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String CPU_ABI - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get CPU_ABI => const jni.JStringType().fromRef(_get_CPU_ABI().object); @@ -2845,7 +2845,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String CPU_ABI2 - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get CPU_ABI2 => const jni.JStringType().fromRef(_get_CPU_ABI2().object); @@ -2855,7 +2855,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String DEVICE - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get DEVICE => const jni.JStringType().fromRef(_get_DEVICE().object); @@ -2865,7 +2865,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String DISPLAY - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get DISPLAY => const jni.JStringType().fromRef(_get_DISPLAY().object); @@ -2875,7 +2875,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String FINGERPRINT - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get FINGERPRINT => const jni.JStringType().fromRef(_get_FINGERPRINT().object); @@ -2885,7 +2885,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String HARDWARE - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get HARDWARE => const jni.JStringType().fromRef(_get_HARDWARE().object); @@ -2894,7 +2894,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String HOST - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get HOST => const jni.JStringType().fromRef(_get_HOST().object); @@ -2903,7 +2903,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String ID - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get ID => const jni.JStringType().fromRef(_get_ID().object); @@ -2913,7 +2913,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String MANUFACTURER - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get MANUFACTURER => const jni.JStringType().fromRef(_get_MANUFACTURER().object); @@ -2923,7 +2923,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String MODEL - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get MODEL => const jni.JStringType().fromRef(_get_MODEL().object); @@ -2933,7 +2933,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String ODM_SKU - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get ODM_SKU => const jni.JStringType().fromRef(_get_ODM_SKU().object); @@ -2943,7 +2943,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String PRODUCT - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get PRODUCT => const jni.JStringType().fromRef(_get_PRODUCT().object); @@ -2953,7 +2953,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String RADIO - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get RADIO => const jni.JStringType().fromRef(_get_RADIO().object); @@ -2963,7 +2963,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String SERIAL - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get SERIAL => const jni.JStringType().fromRef(_get_SERIAL().object); @@ -2972,7 +2972,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String SKU - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get SKU => const jni.JStringType().fromRef(_get_SKU().object); @@ -2982,7 +2982,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String SOC_MANUFACTURER - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get SOC_MANUFACTURER => const jni.JStringType().fromRef(_get_SOC_MANUFACTURER().object); @@ -2992,7 +2992,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String SOC_MODEL - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get SOC_MODEL => const jni.JStringType().fromRef(_get_SOC_MODEL().object); @@ -3002,7 +3002,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String[] SUPPORTED_32_BIT_ABIS - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.JString> get SUPPORTED_32_BIT_ABIS => const jni.JArrayType(jni.JStringType()) .fromRef(_get_SUPPORTED_32_BIT_ABIS().object); @@ -3013,7 +3013,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String[] SUPPORTED_64_BIT_ABIS - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.JString> get SUPPORTED_64_BIT_ABIS => const jni.JArrayType(jni.JStringType()) .fromRef(_get_SUPPORTED_64_BIT_ABIS().object); @@ -3024,7 +3024,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String[] SUPPORTED_ABIS - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.JString> get SUPPORTED_ABIS => const jni.JArrayType(jni.JStringType()) .fromRef(_get_SUPPORTED_ABIS().object); @@ -3034,7 +3034,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String TAGS - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get TAGS => const jni.JStringType().fromRef(_get_TAGS().object); @@ -3050,7 +3050,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String TYPE - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get TYPE => const jni.JStringType().fromRef(_get_TYPE().object); @@ -3062,7 +3062,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.lang.String USER - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get USER => const jni.JStringType().fromRef(_get_USER().object); @@ -3071,7 +3071,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Build() { return Build.fromRef(_new0().object); } @@ -3082,7 +3082,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public java.lang.String getSerial() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString getSerial() { return const jni.JStringType().fromRef(_getSerial().object); } @@ -3093,7 +3093,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public java.util.List getFingerprintedPartitions() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JList<Build_Partition> getFingerprintedPartitions() { return const jni.JListType($Build_PartitionType()) .fromRef(_getFingerprintedPartitions().object); @@ -3105,7 +3105,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public java.lang.String getRadioVersion() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString getRadioVersion() { return const jni.JStringType().fromRef(_getRadioVersion().object); } @@ -3168,7 +3168,7 @@ .asFunction<jni.JniResult Function(int, double)>(); /// from: public void <init>(int i, float f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory HashMap( int i, double f, { @@ -3184,7 +3184,7 @@ .asFunction<jni.JniResult Function(int)>(); /// from: public void <init>(int i) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory HashMap.new1( int i, { required jni.JObjType<$K> K, @@ -3198,7 +3198,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory HashMap.new2({ required jni.JObjType<$K> K, required jni.JObjType<$V> V, @@ -3213,7 +3213,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory HashMap.new3( jni.JMap<$K, $V> map, { jni.JObjType<$K>? K, @@ -3259,7 +3259,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public V get(java.lang.Object object) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V get0( jni.JObject object, ) { @@ -3292,7 +3292,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V put(K object, V object1) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V put( $K object, $V object1, @@ -3325,7 +3325,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public V remove(java.lang.Object object) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V remove( jni.JObject object, ) { @@ -3365,7 +3365,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Set keySet() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JSet<$K> keySet() { return jni.JSetType(K).fromRef(_keySet(reference).object); } @@ -3377,7 +3377,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Collection values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject values() { return const jni.JObjectType().fromRef(_values(reference).object); } @@ -3389,7 +3389,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Set entrySet() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JSet<jni.JObject> entrySet() { return const jni.JSetType(jni.JObjectType()) .fromRef(_entrySet(reference).object); @@ -3406,7 +3406,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V getOrDefault(java.lang.Object object, V object1) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V getOrDefault( jni.JObject object, $V object1, @@ -3426,7 +3426,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V putIfAbsent(K object, V object1) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V putIfAbsent( $K object, $V object1, @@ -3486,7 +3486,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V replace(K object, V object1) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V replace1( $K object, $V object1, @@ -3506,7 +3506,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V computeIfAbsent(K object, java.util.function.Function function) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V computeIfAbsent( $K object, jni.JObject function, @@ -3527,7 +3527,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V computeIfPresent(K object, java.util.function.BiFunction biFunction) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V computeIfPresent( $K object, jni.JObject biFunction, @@ -3548,7 +3548,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V compute(K object, java.util.function.BiFunction biFunction) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V compute( $K object, jni.JObject biFunction, @@ -3569,7 +3569,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public V merge(K object, V object1, java.util.function.BiFunction biFunction) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V merge( $K object, $V object1, @@ -3617,7 +3617,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object clone() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject clone() { return const jni.JObjectType().fromRef(_clone(reference).object); }
diff --git a/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart b/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart index df87f6e..50d1434 100644 --- a/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/kotlin_plugin/example/lib/main.dart
@@ -44,7 +44,7 @@ @override void dispose() { - example.delete(); + example.release(); super.dispose(); } @@ -65,7 +65,7 @@ onPressed: () { setState(() { answer = example.thinkBeforeAnswering().then( - (value) => value.toDartString(deleteOriginal: true)); + (value) => value.toDartString(releaseOriginal: true)); }); }, child: const Text('Think...'),
diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index 75da7fe..b7120d2 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart
@@ -41,7 +41,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromRef(_new0().object); } @@ -55,7 +55,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Future<jni.JString> thinkBeforeAnswering() async { final $p = ReceivePort(); final $c =
diff --git a/pkgs/jnigen/example/notification_plugin/example/lib/main.dart b/pkgs/jnigen/example/notification_plugin/example/lib/main.dart index 04fb2dc..c834bcb 100644 --- a/pkgs/jnigen/example/notification_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/notification_plugin/example/lib/main.dart
@@ -19,8 +19,8 @@ var jTitle = JString.fromString(title); var jText = JString.fromString(text); Notifications.showNotification(activity, i, jTitle, jText); - jTitle.delete(); - jText.delete(); + jTitle.release(); + jText.release(); } void main() {
diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index 267d2d3..30664d5 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart
@@ -45,7 +45,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Notifications() { return Notifications.fromRef(_new0().object); }
diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart index 0e74306..ccc6563 100644 --- a/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart +++ b/pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart
@@ -161,7 +161,7 @@ if (jstr.reference == nullptr) { return '(null)'; } - return jstr.toDartString(deleteOriginal: true); + return jstr.toDartString(releaseOriginal: true); } PDFFileInfo.usingPDFBox(this.filename) {
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 6c103dc..5943808 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
@@ -61,7 +61,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Creates an empty PDF document. /// You need to add at least one page for the document to be valid. @@ -76,7 +76,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Creates an empty PDF document. /// You need to add at least one page for the document to be valid. @@ -94,7 +94,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.cos.COSDocument doc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. @@ -113,7 +113,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. @@ -136,7 +136,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.cos.COSDocument doc, org.apache.pdfbox.io.RandomAccessRead source, org.apache.pdfbox.pdmodel.encryption.AccessPermission permission) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor that uses an existing document. The COSDocument that is passed in must be valid. ///@param doc The COSDocument that this document wraps. @@ -368,7 +368,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.PDPage importPage(org.apache.pdfbox.pdmodel.PDPage page) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will import and copy the contents from another location. Currently the content stream is /// stored in a scratch file. The scratch file is associated with the document. If you are adding @@ -405,7 +405,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.cos.COSDocument getDocument() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the low level document. ///@return The document that this layer sits on top of. @@ -420,7 +420,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.PDDocumentInformation getDocumentInformation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the document info dictionary. If it doesn't exist, an empty document info /// dictionary is created in the document trailer. @@ -463,7 +463,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.PDDocumentCatalog getDocumentCatalog() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the document CATALOG. This is guaranteed to not return null. ///@return The documents /Root dictionary @@ -493,7 +493,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.encryption.PDEncryption getEncryption() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the encryption dictionary for this document. This will still return the parameters if the document /// was decrypted. As the encryption architecture in PDF documents is pluggable this returns an abstract class, @@ -531,7 +531,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature getLastSignatureDictionary() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will return the last signature from the field tree. Note that this may not be the /// last in time when empty signature fields are created first but signed after other fields. @@ -549,7 +549,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.List<org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField> getSignatureFields() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Retrieve all signature fields from the document. ///@return a <code>List</code> of <code>PDSignatureField</code>s @@ -566,7 +566,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.List<org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature> getSignatureDictionaries() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Retrieve all signature dictionaries from the document. ///@return a <code>List</code> of <code>PDSignatureField</code>s @@ -604,7 +604,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Unrestricted main memory will be used for buffering PDF streams. ///@param file file to be loaded @@ -626,7 +626,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. ///@param file file to be loaded @@ -651,7 +651,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Unrestricted main memory will be used for buffering PDF streams. ///@param file file to be loaded @@ -678,7 +678,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. ///@param file file to be loaded @@ -709,7 +709,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Unrestricted main memory will be used for buffering PDF streams. ///@param file file to be loaded @@ -746,7 +746,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.File file, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. ///@param file file to be loaded @@ -779,7 +779,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. The given input stream is copied to the memory to enable random access to the /// pdf. Unrestricted main memory will be used for buffering PDF streams. @@ -802,7 +802,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Depending on the memory settings parameter the given input stream is either /// copied to main memory or to a temporary file to enable random access to the pdf. @@ -828,7 +828,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. The given input stream is copied to the memory to enable random access to the /// pdf. Unrestricted main memory will be used for buffering PDF streams. @@ -857,7 +857,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. The given input stream is copied to the memory to enable random access to the /// pdf. Unrestricted main memory will be used for buffering PDF streams. @@ -889,7 +889,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Depending on the memory settings parameter the given input stream is either /// copied to main memory or to a temporary file to enable random access to the pdf. @@ -926,7 +926,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(java.io.InputStream input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Depending on the memory settings parameter the given input stream is either /// copied to memory or to a temporary file to enable random access to the pdf. @@ -961,7 +961,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Unrestricted main memory will be used for buffering PDF streams. ///@param input byte array that contains the document. @@ -983,7 +983,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Unrestricted main memory will be used for buffering PDF streams. ///@param input byte array that contains the document. @@ -1011,7 +1011,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. Unrestricted main memory will be used for buffering PDF streams. ///@param input byte array that contains the document. @@ -1049,7 +1049,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: static public org.apache.pdfbox.pdmodel.PDDocument load(byte[] input, java.lang.String password, java.io.InputStream keyStore, java.lang.String alias, org.apache.pdfbox.io.MemoryUsageSetting memUsageSetting) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Parses a PDF. ///@param input byte array that contains the document. @@ -1224,7 +1224,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.interactive.digitalsignature.ExternalSigningSupport saveIncrementalForExternalSigning(java.io.OutputStream output) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// /// __(This is a new feature for 2.0.3. The API for external signing might change based on feedback after release!)__ @@ -1277,7 +1277,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public org.apache.pdfbox.pdmodel.PDPage getPage(int pageIndex) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the page at the given 0-based index. /// @@ -1300,7 +1300,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.PDPageTree getPages() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the page tree. ///@return the page tree @@ -1369,7 +1369,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.encryption.AccessPermission getCurrentAccessPermission() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the access permissions granted when the document was decrypted. If the document was not decrypted this /// method returns the access permission for a document owner (ie can do everything). The returned object is in read @@ -1419,7 +1419,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Long getDocumentId() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Provides the document ID. ///@return the document ID @@ -1482,7 +1482,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.ResourceCache getResourceCache() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the resource cache associated with this document, or null if there is none. ///@return the resource cache or null.
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 a12b62a..2685572 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
@@ -62,7 +62,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Default Constructor. factory PDDocumentInformation() { @@ -76,7 +76,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(org.apache.pdfbox.cos.COSDictionary dic) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor that is used for a preexisting dictionary. ///@param dic The underlying dictionary. @@ -93,7 +93,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.cos.COSDictionary getCOSObject() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the underlying dictionary that this object wraps. ///@return The underlying info dictionary. @@ -111,7 +111,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object getPropertyStringValue(java.lang.String propertyKey) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Return the properties String value. /// @@ -135,7 +135,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getTitle() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the title of the document. This will return null if no title exists. ///@return The title of the document. @@ -168,7 +168,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getAuthor() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the author of the document. This will return null if no author exists. ///@return The author of the document. @@ -201,7 +201,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getSubject() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the subject of the document. This will return null if no subject exists. ///@return The subject of the document. @@ -234,7 +234,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getKeywords() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the keywords of the document. This will return null if no keywords exists. ///@return The keywords of the document. @@ -267,7 +267,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getCreator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the creator of the document. This will return null if no creator exists. ///@return The creator of the document. @@ -300,7 +300,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getProducer() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the producer of the document. This will return null if no producer exists. ///@return The producer of the document. @@ -333,7 +333,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Calendar getCreationDate() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the creation date of the document. This will return null if no creation date exists. ///@return The creation date of the document. @@ -367,7 +367,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Calendar getModificationDate() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the modification date of the document. This will return null if no modification date exists. ///@return The modification date of the document. @@ -402,7 +402,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getTrapped() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the trapped value for the document. /// This will return null if one is not found. @@ -418,7 +418,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Set<java.lang.String> getMetadataKeys() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the keys of all metadata information fields for the document. ///@return all metadata key strings. @@ -438,7 +438,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getCustomMetadataValue(java.lang.String fieldName) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the value of a custom metadata information field for the document. /// This will return null if one is not found.
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 7f565b0..556d83a 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
@@ -71,7 +71,7 @@ )>(); /// from: protected final java.lang.String LINE_SEPARATOR - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// The platform's line separator. jni.JString get LINE_SEPARATOR => @@ -96,7 +96,7 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: protected java.util.ArrayList<java.util.List<org.apache.pdfbox.text.TextPosition>> charactersByArticle - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// The charactersByArticle is used to extract text by article divisions. For example a PDF that has two columns like /// a newspaper, we want to extract the first column and then the second column. In this example the PDF would have 2 @@ -114,7 +114,7 @@ .fromRef(_get_charactersByArticle(reference).object); /// from: protected java.util.ArrayList<java.util.List<org.apache.pdfbox.text.TextPosition>> charactersByArticle - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// The charactersByArticle is used to extract text by article divisions. For example a PDF that has two columns like /// a newspaper, we want to extract the first column and then the second column. In this example the PDF would have 2 @@ -149,12 +149,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: protected org.apache.pdfbox.pdmodel.PDDocument document - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. pddocument_.PDDocument get document => const pddocument_.$PDDocumentType() .fromRef(_get_document(reference).object); /// from: protected org.apache.pdfbox.pdmodel.PDDocument document - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set document(pddocument_.PDDocument value) => _set_document(reference, value.reference).check(); @@ -176,12 +176,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: protected java.io.Writer output - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get output => const jni.JObjectType().fromRef(_get_output(reference).object); /// from: protected java.io.Writer output - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set output(jni.JObject value) => _set_output(reference, value.reference).check(); @@ -190,7 +190,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Instantiate a new PDFTextStripper object. ///@throws IOException If there is an error loading the properties. @@ -207,7 +207,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getText(org.apache.pdfbox.pdmodel.PDDocument doc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will return the text of a document. See writeText. <br> /// NOTE: The document must not be encrypted when coming into this method. @@ -629,7 +629,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getLineSeparator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the line separator. ///@return The desired line separator string. @@ -644,7 +644,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getWordSeparator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// This will get the word separator. ///@return The desired word separator string. @@ -707,7 +707,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected java.io.Writer getOutput() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// The output stream that is being written to. ///@return The stream that output is being written to. @@ -722,7 +722,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected java.util.List<java.util.List<org.apache.pdfbox.text.TextPosition>> getCharactersByArticle() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Character strings are grouped by articles. It is quite common that there will only be a single article. This /// returns a List that contains List objects, the inner lists will contain TextPosition objects. @@ -790,7 +790,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getEndBookmark() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Get the bookmark where text extraction should end, inclusive. Default is null. ///@return The ending bookmark. @@ -823,7 +823,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDOutlineItem getStartBookmark() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Get the bookmark where text extraction should start, inclusive. Default is null. ///@return The starting bookmark. @@ -1056,7 +1056,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getParagraphStart() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the string which will be used at the beginning of a paragraph. ///@return the paragraph start string @@ -1090,7 +1090,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getParagraphEnd() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the string which will be used at the end of a paragraph. ///@return the paragraph end string @@ -1123,7 +1123,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getPageStart() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the string which will be used at the beginning of a page. ///@return the page start string @@ -1156,7 +1156,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getPageEnd() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the string which will be used at the end of a page. ///@return the page end string @@ -1189,7 +1189,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getArticleStart() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the string which will be used at the beginning of an article. ///@return the article start string @@ -1222,7 +1222,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getArticleEnd() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Returns the string which will be used at the end of an article. ///@return the article end string @@ -1344,7 +1344,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected java.util.List<java.util.regex.Pattern> getListItemPatterns() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// returns a list of regular expression Patterns representing different common list item formats. For example /// numbered items of form: @@ -1376,7 +1376,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static protected java.util.regex.Pattern matchPattern(java.lang.String string, java.util.List<java.util.regex.Pattern> patterns) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// iterates over the specified list of Patterns until it finds one that matches the specified string. Then returns /// the Pattern.
diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index d21665c..689678c 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart
@@ -42,9 +42,9 @@ const _selfPointer = 'reference'; // Docs. -const _deleteInstruction = - ' /// The returned object must be deleted after use, ' - 'by calling the `delete` method.'; +const _releaseInstruction = + ' /// The returned object must be released after use, ' + 'by calling the [release] method.'; extension on Iterable<String> { /// Similar to [join] but adds the [separator] to the end as well. @@ -440,7 +440,7 @@ $MethodInvocation $i, ) { try { - final $d = $i.methodDescriptor.toDartString(deleteOriginal: true); + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; '''); final proxyMethodIf = _InterfaceMethodIf(resolver, s); @@ -1050,11 +1050,11 @@ return '$_env.Set$ifStatic${fieldType}Field($self, _id_$name, value$toNativeSuffix)'; } - void writeDocs(Field node, {required bool writeDeleteInstructions}) { + void writeDocs(Field node, {required bool writeReleaseInstructions}) { final originalDecl = '${node.type.shorthand} ${node.name}'; s.writeln(' /// from: ${node.modifiers.join(' ')} $originalDecl'); - if (node.type.kind != Kind.primitive && writeDeleteInstructions) { - s.writeln(_deleteInstruction); + if (node.type.kind != Kind.primitive && writeReleaseInstructions) { + s.writeln(_releaseInstruction); } node.javadoc?.accept(_DocGenerator(s, depth: 1)); } @@ -1069,7 +1069,7 @@ final value = node.defaultValue!; // TODO(#31): Should we leave String as a normal getter instead? if (value is String || value is num || value is bool) { - writeDocs(node, writeDeleteInstructions: false); + writeDocs(node, writeReleaseInstructions: false); s.write(' static const $name = '); if (value is String) { s.write('r"""$value"""'); @@ -1085,7 +1085,7 @@ (isCBased ? writeCAccessor : writeDartOnlyAccessor)(node); // Getter docs. - writeDocs(node, writeDeleteInstructions: true); + writeDocs(node, writeReleaseInstructions: true); final name = node.finalName; final ifStatic = node.isStatic ? 'static ' : ''; @@ -1097,7 +1097,7 @@ s.writeln(';\n'); if (!node.isFinal) { // Setter docs. - writeDocs(node, writeDeleteInstructions: true); + writeDocs(node, writeReleaseInstructions: true); s.write('${ifStatic}set $name($type value) => '); s.write((isCBased ? cSetter : dartOnlySetter)(node)); @@ -1209,7 +1209,7 @@ s.writeAll(node.params.map((p) => '${p.type.shorthand} ${p.name}'), ', '); s.writeln(')'); if (node.returnType.kind != Kind.primitive || node.isCtor) { - s.writeln(_deleteInstruction); + s.writeln(_releaseInstruction); } node.javadoc?.accept(_DocGenerator(s, depth: 1)); @@ -1684,11 +1684,11 @@ typeVarFromMap: true, )) .name; - s.write('\$a[$paramIndex].castTo($typeClass, deleteOriginal: true)'); + s.write('\$a[$paramIndex].castTo($typeClass, releaseOriginal: true)'); if (node.type.kind == Kind.primitive) { // Convert to Dart type. final name = (node.type.type as PrimitiveType).name; - s.write('.${name}Value(deleteOriginal: true)'); + s.write('.${name}Value(releaseOriginal: true)'); } s.writeln(','); } @@ -1700,7 +1700,7 @@ /// /// Since Dart doesn't know that this global reference is still used, it might /// garbage collect it via [NativeFinalizer] thus making it invalid. -/// This passes the ownership to Java using [setAsDeleted]. +/// This passes the ownership to Java using [setAsReleased]. /// /// `toPointer` detaches the object from the [NativeFinalizer] and Java /// will clean up the global reference afterwards. @@ -1714,7 +1714,7 @@ String visitNonPrimitiveType(ReferredType node) { // Casting is done to create a new global reference. The user might // use the original reference elsewhere and so the original object - // should not be [setAsDeleted]. + // should not be [setAsReleased]. return '(\$r as $_jObject).castTo(const ${_jObject}Type()).toPointer()'; }
diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index 74898fb..56fea0a 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart
@@ -82,10 +82,11 @@ 'runtimeType': 1, 'noSuchMethod': 1, 'reference': 1, - 'isDeleted': 1, + 'isReleased': 1, 'isNull': 1, 'use': 1, - 'delete': 1, + 'release': 1, + 'releasedBy': 1, 'getFieldID': 1, 'getStaticFieldID': 1, 'getMethodID': 1,
diff --git a/pkgs/jnigen/pubspec.yaml b/pkgs/jnigen/pubspec.yaml index c0b3dbf..b68d371 100644 --- a/pkgs/jnigen/pubspec.yaml +++ b/pkgs/jnigen/pubspec.yaml
@@ -3,12 +3,20 @@ # BSD-style license that can be found in the LICENSE file. name: jnigen -version: 0.6.0-wip.3 -description: Experimental generator for FFI+JNI bindings. +description: A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine. +version: 0.6.0 repository: https://github.com/dart-lang/jnigen/tree/main/jnigen environment: - sdk: '>=3.1.0-262.3.beta <4.0.0' + sdk: ">=3.1.0-262.3.beta <4.0.0" + +topics: + - interop + - ffi + - codegen + - java + - kotlin + - jni dependencies: json_annotation: ^4.8.0
diff --git a/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart b/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart index 32687fb..28e6c2b 100644 --- a/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/jackson_core_test/runtime_test_registrant.dart
@@ -24,17 +24,19 @@ final next = parser.nextToken(); if (next.isNull) continue; values.add(next.isNumeric()); - next.delete(); + next.release(); } expect(values, equals([false, true, false, false, true, true, false])); - Jni.deleteAll([factory, parser, json]); + for (final obj in [factory, parser, json]) { + obj.release(); + } }); test("parsing invalid JSON throws JniException", () { using((arena) { - final factory = JsonFactory()..deletedIn(arena); + final factory = JsonFactory()..releasedBy(arena); final erroneous = factory - .createParser6("<html>".toJString()..deletedIn(arena)) - ..deletedIn(arena); + .createParser6("<html>".toJString()..releasedBy(arena)) + ..releasedBy(arena); expect(() => erroneous.nextToken(), throwsA(isA<JniException>())); }); });
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 7112fc3..4ebdfd9 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
@@ -117,7 +117,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => const jni.JObjectType() .fromRef(_get_DEFAULT_ROOT_VALUE_SEPARATOR().object); @@ -126,7 +126,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Default constructor used to create factory instances. /// Creation of a factory instance is a light-weight operation, @@ -147,7 +147,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory JsonFactory.new1( jni.JObject oc, ) { @@ -163,7 +163,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: protected void <init>(com.fasterxml.jackson.core.JsonFactory src, com.fasterxml.jackson.core.ObjectCodec codec) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor used when copy()ing a factory instance. ///@param src Original factory to copy settings from @@ -183,7 +183,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.fasterxml.jackson.core.JsonFactoryBuilder b) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor used by JsonFactoryBuilder for instantiation. ///@param b Builder that contains settings to use @@ -201,7 +201,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: protected void <init>(com.fasterxml.jackson.core.TSFBuilder<?,?> b, boolean bogus) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor for subtypes; needed to work around the fact that before 3.0, /// this factory has cumbersome dual role as generic type as well as actual @@ -222,7 +222,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.TSFBuilder<?,?> rebuild() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that allows construction of differently configured factory, starting /// with settings of this factory. @@ -238,7 +238,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.fasterxml.jackson.core.TSFBuilder<?,?> builder() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Main factory method to use for constructing JsonFactory instances with /// different configuration: creates and returns a builder for collecting configuration @@ -259,7 +259,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory copy() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing a new JsonFactory that has /// the same settings as this instance, but is otherwise @@ -284,7 +284,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: protected java.lang.Object readResolve() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that we need to override to actually make restoration go /// through constructors etc: needed to allow JDK serializability of @@ -394,7 +394,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Class<? extends com.fasterxml.jackson.core.FormatFeature> getFormatReadFeatureType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getFormatReadFeatureType() { return const jni.JObjectType() .fromRef(_getFormatReadFeatureType(reference).object); @@ -407,7 +407,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Class<? extends com.fasterxml.jackson.core.FormatFeature> getFormatWriteFeatureType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getFormatWriteFeatureType() { return const jni.JObjectType() .fromRef(_getFormatWriteFeatureType(reference).object); @@ -445,7 +445,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getFormatName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that returns short textual id identifying format /// this factory supports. @@ -466,7 +466,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject hasFormat( jni.JObject acc, ) { @@ -504,7 +504,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: protected com.fasterxml.jackson.core.format.MatchStrength hasJSONFormat(com.fasterxml.jackson.core.format.InputAccessor acc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject hasJSONFormat( jni.JObject acc, ) { @@ -519,7 +519,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.Version version() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject version() { return const jni.JObjectType().fromRef(_version(reference).object); } @@ -533,7 +533,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int)>(); /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified parser feature /// (check JsonParser.Feature for list of features) @@ -558,7 +558,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature /// (check JsonFactory.Feature for list of features) @@ -581,7 +581,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified parser features /// (check JsonFactory.Feature for list of features) @@ -667,7 +667,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int)>(); /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified parser feature /// (check JsonParser.Feature for list of features) @@ -691,7 +691,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature /// (check JsonParser.Feature for list of features) @@ -713,7 +713,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified parser features /// (check JsonParser.Feature for list of features) @@ -772,7 +772,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.io.InputDecorator getInputDecorator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for getting currently configured input decorator (if any; /// there is no default decorator). @@ -791,7 +791,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory setInputDecorator(com.fasterxml.jackson.core.io.InputDecorator d) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for overriding currently configured input decorator ///@param d Decorator to configure for this factory, if any ({@code null} if none) @@ -813,7 +813,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int)>(); /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified generator feature /// (check JsonGenerator.Feature for list of features) @@ -837,7 +837,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified generator features /// (check JsonGenerator.Feature for list of features) @@ -859,7 +859,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified generator feature /// (check JsonGenerator.Feature for list of features) @@ -918,7 +918,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.io.CharacterEscapes getCharacterEscapes() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for accessing custom escapes factory uses for JsonGenerators /// it creates. @@ -937,7 +937,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory setCharacterEscapes(com.fasterxml.jackson.core.io.CharacterEscapes esc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for defining custom escapes factory uses for JsonGenerators /// it creates. @@ -957,7 +957,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.io.OutputDecorator getOutputDecorator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for getting currently configured output decorator (if any; /// there is no default decorator). @@ -977,7 +977,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory setOutputDecorator(com.fasterxml.jackson.core.io.OutputDecorator d) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for overriding currently configured output decorator ///@return This factory instance (to allow call chaining) @@ -999,7 +999,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory setRootValueSeparator(java.lang.String sep) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that allows overriding String used for separating root-level /// JSON values (default is single space character) @@ -1020,7 +1020,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getRootValueSeparator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// @return Root value separator configured, if any jni.JString getRootValueSeparator() { @@ -1037,7 +1037,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonFactory setCodec(com.fasterxml.jackson.core.ObjectCodec oc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for associating a ObjectCodec (typically /// a <code>com.fasterxml.jackson.databind.ObjectMapper</code>) @@ -1060,7 +1060,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.ObjectCodec getCodec() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getCodec() { return const jni.JObjectType().fromRef(_getCodec(reference).object); } @@ -1074,7 +1074,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.File f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of specified file. @@ -1108,7 +1108,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.net.URL url) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of resource reference by given URL. @@ -1140,7 +1140,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.InputStream in) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// the contents accessed via specified input stream. @@ -1175,7 +1175,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.Reader r) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents accessed via specified Reader. @@ -1203,7 +1203,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(byte[] data) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents of given byte array. @@ -1227,7 +1227,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(byte[] data, int offset, int len) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents of given byte array. @@ -1253,7 +1253,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.lang.String content) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// contents of given String. @@ -1274,7 +1274,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(char[] content) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// contents of given char array. @@ -1298,7 +1298,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(char[] content, int offset, int len) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing contents of given char array. ///@since 2.4 @@ -1320,7 +1320,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.DataInput in) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Optional method for constructing parser for reading contents from specified DataInput /// instance. @@ -1342,7 +1342,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createNonBlockingByteArrayParser() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Optional method for constructing parser for non-blocking parsing /// via com.fasterxml.jackson.core.async.ByteArrayFeeder @@ -1373,7 +1373,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified output stream. @@ -1410,7 +1410,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience method for constructing generator that uses default /// encoding of the format (UTF-8 for JSON and most other data formats). @@ -1433,7 +1433,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.Writer w) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified Writer. @@ -1464,7 +1464,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.File f, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// to specified file, overwriting contents it might have (or creating @@ -1497,7 +1497,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing generator for writing content using specified /// DataOutput instance. @@ -1519,7 +1519,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience method for constructing generator that uses default /// encoding of the format (UTF-8 for JSON and most other data formats). @@ -1542,7 +1542,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.File f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of specified file. @@ -1578,7 +1578,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.net.URL url) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of resource reference by given URL. @@ -1613,7 +1613,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.InputStream in) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// the contents accessed via specified input stream. @@ -1651,7 +1651,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.Reader r) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents accessed via specified Reader. @@ -1682,7 +1682,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing the contents of given byte array. ///@param data Input content to parse @@ -1709,7 +1709,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data, int offset, int len) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents of given byte array. @@ -1738,7 +1738,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.lang.String content) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// contents of given String. @@ -1765,7 +1765,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified output stream. @@ -1804,7 +1804,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.Writer out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified Writer. @@ -1835,7 +1835,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience method for constructing generator that uses default /// encoding of the format (UTF-8 for JSON and most other data formats). @@ -1897,7 +1897,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.fasterxml.jackson.core.JsonFactory.Feature[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonFactory_Feature> values() { return const jni.JArrayType($JsonFactory_FeatureType()) .fromRef(_values().object); @@ -1910,7 +1910,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonFactory_Feature valueOf( jni.JString name, ) {
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 7828fd8..3ea73b1 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
@@ -62,7 +62,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static protected final com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> DEFAULT_READ_CAPABILITIES - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Default set of StreamReadCapabilityies that may be used as /// basis for format-specific readers (or as bogus instance if non-null @@ -76,7 +76,7 @@ .asFunction<jni.JniResult Function()>(); /// from: protected void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory JsonParser() { return JsonParser.fromRef(_new0().object); } @@ -87,7 +87,7 @@ .asFunction<jni.JniResult Function(int)>(); /// from: protected void <init>(int features) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory JsonParser.new1( int features, ) { @@ -101,7 +101,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.ObjectCodec getCodec() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor for ObjectCodec associated with this /// parser, if any. Codec is used by \#readValueAs(Class) @@ -138,7 +138,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object getInputSource() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be used to get access to object that is used /// to access input being parsed; this is usually either @@ -255,7 +255,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.FormatSchema getSchema() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for accessing Schema that this parser uses, if any. /// Default implementation returns null. @@ -335,7 +335,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.async.NonBlockingInputFeeder getNonBlockingInputFeeder() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will either return a feeder instance (if parser uses /// non-blocking, aka asynchronous access); or <code>null</code> for @@ -354,7 +354,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> getReadCapabilities() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor for getting metadata on capabilities of this parser, based on /// underlying data format being read (directly or indirectly). @@ -372,7 +372,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.Version version() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor for getting version of the core package, given a parser instance. /// Left for sub-classes to implement. @@ -434,7 +434,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonStreamContext getParsingContext() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be used to access current parsing context reader /// is in. There are 3 different types: root, array and object contexts, @@ -457,7 +457,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonLocation currentLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that returns location of the last processed input unit (character /// or byte) from the input; @@ -482,7 +482,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that return the __starting__ location of the current /// (most recently returned) @@ -508,7 +508,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonLocation getCurrentLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). @@ -525,7 +525,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonLocation getTokenLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentTokenLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). @@ -541,7 +541,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object currentValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Helper method, usually equivalent to: ///<code> @@ -587,7 +587,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object getCurrentValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentValue(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). @@ -679,7 +679,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature /// (check Feature for list of features) @@ -701,7 +701,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified feature /// (check Feature for list of features) @@ -723,7 +723,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified feature /// (check Feature for list of features) @@ -799,7 +799,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser setFeatureMask(int mask) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Bulk set method for (re)setting states of all standard Features ///@param mask Bit mask that defines set of features to enable @@ -820,7 +820,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser overrideStdFeatures(int values, int mask) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Bulk set method for (re)setting states of features specified by <code>mask</code>. /// Functionally equivalent to @@ -865,7 +865,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>, int, int)>(); /// from: public com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values, int mask) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Bulk set method for (re)setting states of FormatFeatures, /// by specifying values (set / clear) along with a mask, to determine @@ -892,7 +892,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonToken nextToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Main iteration method, which will advance stream enough /// to determine type of the next token, if any. If none @@ -914,7 +914,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonToken nextValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Iteration method that will advance stream enough /// to determine type of the next token that is a value type @@ -975,7 +975,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String nextFieldName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that fetches next token (as if calling \#nextToken) and /// verifies whether it is JsonToken\#FIELD_NAME; if it is, @@ -996,7 +996,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String nextTextValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that fetches next token (as if calling \#nextToken) and /// if it is JsonToken\#VALUE_STRING returns contained String value; @@ -1084,7 +1084,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Boolean nextBooleanValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that fetches next token (as if calling \#nextToken) and /// if it is JsonToken\#VALUE_TRUE or JsonToken\#VALUE_FALSE @@ -1114,7 +1114,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonParser skipChildren() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will skip all child tokens of an array or /// object token that the parser currently points to, @@ -1167,7 +1167,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.fasterxml.jackson.core.JsonToken currentToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor to find which token parser currently points to, if any; /// null will be returned if none. @@ -1211,7 +1211,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonToken getCurrentToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentToken(), may be deprecated sometime after /// Jackson 2.13 (will be removed from 3.0). @@ -1431,7 +1431,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonToken getLastClearedToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to get the last token that was /// cleared using \#clearCurrentToken. This is not necessarily @@ -1475,7 +1475,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.lang.String getCurrentName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias of \#currentName(). ///@return Name of the current field in the parsing context @@ -1492,7 +1492,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String currentName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to get the name associated with /// the current token: for JsonToken\#FIELD_NAMEs it will @@ -1514,7 +1514,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.lang.String getText() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for accessing textual representation of the current token; /// if no current token (before first call to \#nextToken, or @@ -1566,7 +1566,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract char[] getTextCharacters() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method similar to \#getText, but that will return /// underlying (unmodifiable) character array that contains @@ -1671,7 +1671,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.lang.Number getNumberValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Generic number value accessor method that will work for /// all kinds of numeric values. It will return the optimal @@ -1694,7 +1694,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Number getNumberValueExact() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method similar to \#getNumberValue with the difference that /// for floating-point numbers value returned may be BigDecimal @@ -1722,7 +1722,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract com.fasterxml.jackson.core.JsonParser.NumberType getNumberType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// If current token is of type /// JsonToken\#VALUE_NUMBER_INT or @@ -1857,7 +1857,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.math.BigInteger getBigIntegerValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Numeric accessor that can be called when the current /// token is of type JsonToken\#VALUE_NUMBER_INT and @@ -1936,7 +1936,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.math.BigDecimal getDecimalValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Numeric accessor that can be called when the current /// token is of type JsonToken\#VALUE_NUMBER_FLOAT or @@ -1980,7 +1980,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object getEmbeddedObject() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor that can be called if (and only if) the current token /// is JsonToken\#VALUE_EMBEDDED_OBJECT. For other token types, @@ -2010,7 +2010,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public abstract byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant bv) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be used to read (and consume -- results /// may not be accessible using other methods after the call) @@ -2046,7 +2046,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public byte[] getBinaryValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience alternative to \#getBinaryValue(Base64Variant) /// that defaults to using @@ -2328,7 +2328,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getValueAsString() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will try to convert value of current token to a /// java.lang.String. @@ -2354,7 +2354,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.lang.String getValueAsString(java.lang.String def) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will try to convert value of current token to a /// java.lang.String. @@ -2428,7 +2428,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object getObjectId() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to check whether current token /// (one that was just read) has an associated Object id, and if @@ -2454,7 +2454,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object getTypeId() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to check whether current token /// (one that was just read) has an associated type id, and if @@ -2482,7 +2482,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public T readValueAs(java.lang.Class<T> valueType) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method to deserialize JSON content into a non-container /// type (it can be an array type, however): typically a bean, array @@ -2525,7 +2525,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public T readValueAs(com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method to deserialize JSON content into a Java type, reference /// to which is passed as argument. Type is passed using so-called @@ -2565,7 +2565,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Iterator<T> readValuesAs(java.lang.Class<T> valueType) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for reading sequence of Objects from parser stream, /// all with same specified value type. @@ -2592,7 +2592,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Iterator<T> readValuesAs(com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for reading sequence of Objects from parser stream, /// all with same specified value type. @@ -2617,7 +2617,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public T readValueAsTree() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method to deserialize JSON content into equivalent "tree model", /// represented by root TreeNode of resulting model. @@ -2678,7 +2678,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.fasterxml.jackson.core.JsonParser.Feature[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonParser_Feature> values() { return const jni.JArrayType($JsonParser_FeatureType()) .fromRef(_values().object); @@ -2691,7 +2691,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonParser_Feature valueOf( jni.JString name, ) { @@ -2795,7 +2795,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.fasterxml.jackson.core.JsonParser.NumberType[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonParser_NumberType> values() { return const jni.JArrayType($JsonParser_NumberTypeType()) .fromRef(_values().object); @@ -2808,7 +2808,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonParser_NumberType valueOf( jni.JString name, ) {
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart index d5c82a5..da95cb6 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/c_based/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart
@@ -59,7 +59,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.fasterxml.jackson.core.JsonToken[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonToken> values() { return const jni.JArrayType($JsonTokenType()).fromRef(_values().object); } @@ -71,7 +71,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonToken valueOf( jni.JString name, ) { @@ -96,7 +96,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public final java.lang.String asString() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString asString() { return const jni.JStringType().fromRef(_asString(reference).object); } @@ -108,7 +108,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public final char[] asCharArray() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.jchar> asCharArray() { return const jni.JArrayType(jni.jcharType()) .fromRef(_asCharArray(reference).object); @@ -121,7 +121,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public final byte[] asByteArray() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.jbyte> asByteArray() { return const jni.JArrayType(jni.jbyteType()) .fromRef(_asByteArray(reference).object);
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 e5045b9..3677ba1 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
@@ -133,7 +133,7 @@ ); /// from: static public final com.fasterxml.jackson.core.SerializableString DEFAULT_ROOT_VALUE_SEPARATOR - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JObject get DEFAULT_ROOT_VALUE_SEPARATOR => const jni.JObjectType().fromRef(jni.Jni.accessors .getStaticField(_class.reference, _id_DEFAULT_ROOT_VALUE_SEPARATOR, @@ -144,7 +144,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. /// /// Default constructor used to create factory instances. /// Creation of a factory instance is a light-weight operation, @@ -163,7 +163,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory JsonFactory.new1( jni.JObject oc, ) { @@ -177,7 +177,7 @@ r"(Lcom/fasterxml/jackson/core/JsonFactory;Lcom/fasterxml/jackson/core/ObjectCodec;)V"); /// from: protected void <init>(com.fasterxml.jackson.core.JsonFactory src, com.fasterxml.jackson.core.ObjectCodec codec) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor used when copy()ing a factory instance. ///@param src Original factory to copy settings from @@ -195,7 +195,7 @@ r"<init>", r"(Lcom/fasterxml/jackson/core/JsonFactoryBuilder;)V"); /// from: public void <init>(com.fasterxml.jackson.core.JsonFactoryBuilder b) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor used by JsonFactoryBuilder for instantiation. ///@param b Builder that contains settings to use @@ -211,7 +211,7 @@ r"<init>", r"(Lcom/fasterxml/jackson/core/TSFBuilder;Z)V"); /// from: protected void <init>(com.fasterxml.jackson.core.TSFBuilder<?,?> b, boolean bogus) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Constructor for subtypes; needed to work around the fact that before 3.0, /// this factory has cumbersome dual role as generic type as well as actual @@ -230,7 +230,7 @@ r"rebuild", r"()Lcom/fasterxml/jackson/core/TSFBuilder;"); /// from: public com.fasterxml.jackson.core.TSFBuilder<?,?> rebuild() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that allows construction of differently configured factory, starting /// with settings of this factory. @@ -247,7 +247,7 @@ r"()Lcom/fasterxml/jackson/core/TSFBuilder;"); /// from: static public com.fasterxml.jackson.core.TSFBuilder<?,?> builder() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Main factory method to use for constructing JsonFactory instances with /// different configuration: creates and returns a builder for collecting configuration @@ -267,7 +267,7 @@ _class.reference, r"copy", r"()Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory copy() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing a new JsonFactory that has /// the same settings as this instance, but is otherwise @@ -291,7 +291,7 @@ .getMethodIDOf(_class.reference, r"readResolve", r"()Ljava/lang/Object;"); /// from: protected java.lang.Object readResolve() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that we need to override to actually make restoration go /// through constructors etc: needed to allow JDK serializability of @@ -391,7 +391,7 @@ _class.reference, r"getFormatReadFeatureType", r"()Ljava/lang/Class;"); /// from: public java.lang.Class<? extends com.fasterxml.jackson.core.FormatFeature> getFormatReadFeatureType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getFormatReadFeatureType() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, @@ -403,7 +403,7 @@ _class.reference, r"getFormatWriteFeatureType", r"()Ljava/lang/Class;"); /// from: public java.lang.Class<? extends com.fasterxml.jackson.core.FormatFeature> getFormatWriteFeatureType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getFormatWriteFeatureType() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, @@ -438,7 +438,7 @@ _class.reference, r"getFormatName", r"()Ljava/lang/String;"); /// from: public java.lang.String getFormatName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that returns short textual id identifying format /// this factory supports. @@ -457,7 +457,7 @@ r"(Lcom/fasterxml/jackson/core/format/InputAccessor;)Lcom/fasterxml/jackson/core/format/MatchStrength;"); /// from: public com.fasterxml.jackson.core.format.MatchStrength hasFormat(com.fasterxml.jackson.core.format.InputAccessor acc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject hasFormat( jni.JObject acc, ) { @@ -493,7 +493,7 @@ r"(Lcom/fasterxml/jackson/core/format/InputAccessor;)Lcom/fasterxml/jackson/core/format/MatchStrength;"); /// from: protected com.fasterxml.jackson.core.format.MatchStrength hasJSONFormat(com.fasterxml.jackson.core.format.InputAccessor acc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject hasJSONFormat( jni.JObject acc, ) { @@ -508,7 +508,7 @@ _class.reference, r"version", r"()Lcom/fasterxml/jackson/core/Version;"); /// from: public com.fasterxml.jackson.core.Version version() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject version() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_version, jni.JniCallType.objectType, []).object); @@ -520,7 +520,7 @@ r"(Lcom/fasterxml/jackson/core/JsonFactory$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified parser feature /// (check JsonParser.Feature for list of features) @@ -543,7 +543,7 @@ r"(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature /// (check JsonFactory.Feature for list of features) @@ -564,7 +564,7 @@ r"(Lcom/fasterxml/jackson/core/JsonFactory$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified parser features /// (check JsonFactory.Feature for list of features) @@ -636,7 +636,7 @@ r"(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified parser feature /// (check JsonParser.Feature for list of features) @@ -658,7 +658,7 @@ r"(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature /// (check JsonParser.Feature for list of features) @@ -678,7 +678,7 @@ r"(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified parser features /// (check JsonParser.Feature for list of features) @@ -733,7 +733,7 @@ r"()Lcom/fasterxml/jackson/core/io/InputDecorator;"); /// from: public com.fasterxml.jackson.core.io.InputDecorator getInputDecorator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for getting currently configured input decorator (if any; /// there is no default decorator). @@ -751,7 +751,7 @@ r"(Lcom/fasterxml/jackson/core/io/InputDecorator;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory setInputDecorator(com.fasterxml.jackson.core.io.InputDecorator d) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for overriding currently configured input decorator ///@param d Decorator to configure for this factory, if any ({@code null} if none) @@ -771,7 +771,7 @@ r"(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;Z)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified generator feature /// (check JsonGenerator.Feature for list of features) @@ -793,7 +793,7 @@ r"(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified generator features /// (check JsonGenerator.Feature for list of features) @@ -813,7 +813,7 @@ r"(Lcom/fasterxml/jackson/core/JsonGenerator$Feature;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified generator feature /// (check JsonGenerator.Feature for list of features) @@ -868,7 +868,7 @@ r"()Lcom/fasterxml/jackson/core/io/CharacterEscapes;"); /// from: public com.fasterxml.jackson.core.io.CharacterEscapes getCharacterEscapes() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for accessing custom escapes factory uses for JsonGenerators /// it creates. @@ -886,7 +886,7 @@ r"(Lcom/fasterxml/jackson/core/io/CharacterEscapes;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory setCharacterEscapes(com.fasterxml.jackson.core.io.CharacterEscapes esc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for defining custom escapes factory uses for JsonGenerators /// it creates. @@ -906,7 +906,7 @@ r"()Lcom/fasterxml/jackson/core/io/OutputDecorator;"); /// from: public com.fasterxml.jackson.core.io.OutputDecorator getOutputDecorator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for getting currently configured output decorator (if any; /// there is no default decorator). @@ -925,7 +925,7 @@ r"(Lcom/fasterxml/jackson/core/io/OutputDecorator;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory setOutputDecorator(com.fasterxml.jackson.core.io.OutputDecorator d) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for overriding currently configured output decorator ///@return This factory instance (to allow call chaining) @@ -945,7 +945,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory setRootValueSeparator(java.lang.String sep) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that allows overriding String used for separating root-level /// JSON values (default is single space character) @@ -964,7 +964,7 @@ _class.reference, r"getRootValueSeparator", r"()Ljava/lang/String;"); /// from: public java.lang.String getRootValueSeparator() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// @return Root value separator configured, if any jni.JString getRootValueSeparator() { @@ -980,7 +980,7 @@ r"(Lcom/fasterxml/jackson/core/ObjectCodec;)Lcom/fasterxml/jackson/core/JsonFactory;"); /// from: public com.fasterxml.jackson.core.JsonFactory setCodec(com.fasterxml.jackson.core.ObjectCodec oc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for associating a ObjectCodec (typically /// a <code>com.fasterxml.jackson.databind.ObjectMapper</code>) @@ -1001,7 +1001,7 @@ r"getCodec", r"()Lcom/fasterxml/jackson/core/ObjectCodec;"); /// from: public com.fasterxml.jackson.core.ObjectCodec getCodec() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getCodec() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_getCodec, jni.JniCallType.objectType, []).object); @@ -1013,7 +1013,7 @@ r"(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.File f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of specified file. @@ -1045,7 +1045,7 @@ r"(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.net.URL url) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of resource reference by given URL. @@ -1075,7 +1075,7 @@ r"(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.InputStream in) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// the contents accessed via specified input stream. @@ -1108,7 +1108,7 @@ r"(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.Reader r) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents accessed via specified Reader. @@ -1134,7 +1134,7 @@ r"([B)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(byte[] data) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents of given byte array. @@ -1153,7 +1153,7 @@ r"([BII)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(byte[] data, int offset, int len) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents of given byte array. @@ -1181,7 +1181,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.lang.String content) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// contents of given String. @@ -1200,7 +1200,7 @@ r"([C)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(char[] content) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// contents of given char array. @@ -1219,7 +1219,7 @@ r"([CII)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(char[] content, int offset, int len) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing contents of given char array. ///@since 2.4 @@ -1243,7 +1243,7 @@ r"(Ljava/io/DataInput;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createParser(java.io.DataInput in) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Optional method for constructing parser for reading contents from specified DataInput /// instance. @@ -1264,7 +1264,7 @@ r"()Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createNonBlockingByteArrayParser() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Optional method for constructing parser for non-blocking parsing /// via com.fasterxml.jackson.core.async.ByteArrayFeeder @@ -1291,7 +1291,7 @@ r"(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified output stream. @@ -1328,7 +1328,7 @@ r"(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.OutputStream out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience method for constructing generator that uses default /// encoding of the format (UTF-8 for JSON and most other data formats). @@ -1351,7 +1351,7 @@ r"(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.Writer w) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified Writer. @@ -1380,7 +1380,7 @@ r"(Ljava/io/File;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.File f, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// to specified file, overwriting contents it might have (or creating @@ -1411,7 +1411,7 @@ r"(Ljava/io/DataOutput;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing generator for writing content using specified /// DataOutput instance. @@ -1433,7 +1433,7 @@ r"(Ljava/io/DataOutput;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createGenerator(java.io.DataOutput out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience method for constructing generator that uses default /// encoding of the format (UTF-8 for JSON and most other data formats). @@ -1456,7 +1456,7 @@ r"(Ljava/io/File;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.File f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of specified file. @@ -1490,7 +1490,7 @@ r"(Ljava/net/URL;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.net.URL url) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// contents of resource reference by given URL. @@ -1523,7 +1523,7 @@ r"(Ljava/io/InputStream;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.InputStream in) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON parser instance to parse /// the contents accessed via specified input stream. @@ -1559,7 +1559,7 @@ r"(Ljava/io/Reader;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.io.Reader r) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents accessed via specified Reader. @@ -1588,7 +1588,7 @@ r"([B)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing the contents of given byte array. ///@param data Input content to parse @@ -1610,7 +1610,7 @@ r"([BII)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(byte[] data, int offset, int len) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// the contents of given byte array. @@ -1641,7 +1641,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser createJsonParser(java.lang.String content) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing parser for parsing /// contents of given String. @@ -1664,7 +1664,7 @@ r"(Ljava/io/OutputStream;Lcom/fasterxml/jackson/core/JsonEncoding;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out, com.fasterxml.jackson.core.JsonEncoding enc) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified output stream. @@ -1703,7 +1703,7 @@ r"(Ljava/io/Writer;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.Writer out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for constructing JSON generator for writing JSON content /// using specified Writer. @@ -1734,7 +1734,7 @@ r"(Ljava/io/OutputStream;)Lcom/fasterxml/jackson/core/JsonGenerator;"); /// from: public com.fasterxml.jackson.core.JsonGenerator createJsonGenerator(java.io.OutputStream out) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience method for constructing generator that uses default /// encoding of the format (UTF-8 for JSON and most other data formats). @@ -1802,7 +1802,7 @@ r"()[Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); /// from: static public com.fasterxml.jackson.core.JsonFactory.Feature[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonFactory_Feature> values() { return const jni.JArrayType($JsonFactory_FeatureType()).fromRef( jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, @@ -1815,7 +1815,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonFactory$Feature;"); /// from: static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonFactory_Feature valueOf( jni.JString name, ) {
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 115c360..7d0dceb 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
@@ -66,7 +66,7 @@ ); /// from: static protected final com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> DEFAULT_READ_CAPABILITIES - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Default set of StreamReadCapabilityies that may be used as /// basis for format-specific readers (or as bogus instance if non-null @@ -82,7 +82,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory JsonParser() { return JsonParser.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -92,7 +92,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory JsonParser.new1( int features, ) { @@ -104,7 +104,7 @@ r"getCodec", r"()Lcom/fasterxml/jackson/core/ObjectCodec;"); /// from: public abstract com.fasterxml.jackson.core.ObjectCodec getCodec() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor for ObjectCodec associated with this /// parser, if any. Codec is used by \#readValueAs(Class) @@ -135,7 +135,7 @@ _class.reference, r"getInputSource", r"()Ljava/lang/Object;"); /// from: public java.lang.Object getInputSource() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be used to get access to object that is used /// to access input being parsed; this is usually either @@ -242,7 +242,7 @@ r"getSchema", r"()Lcom/fasterxml/jackson/core/FormatSchema;"); /// from: public com.fasterxml.jackson.core.FormatSchema getSchema() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for accessing Schema that this parser uses, if any. /// Default implementation returns null. @@ -316,7 +316,7 @@ r"()Lcom/fasterxml/jackson/core/async/NonBlockingInputFeeder;"); /// from: public com.fasterxml.jackson.core.async.NonBlockingInputFeeder getNonBlockingInputFeeder() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will either return a feeder instance (if parser uses /// non-blocking, aka asynchronous access); or <code>null</code> for @@ -336,7 +336,7 @@ r"()Lcom/fasterxml/jackson/core/util/JacksonFeatureSet;"); /// from: public com.fasterxml.jackson.core.util.JacksonFeatureSet<com.fasterxml.jackson.core.StreamReadCapability> getReadCapabilities() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor for getting metadata on capabilities of this parser, based on /// underlying data format being read (directly or indirectly). @@ -353,7 +353,7 @@ _class.reference, r"version", r"()Lcom/fasterxml/jackson/core/Version;"); /// from: public abstract com.fasterxml.jackson.core.Version version() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor for getting version of the core package, given a parser instance. /// Left for sub-classes to implement. @@ -411,7 +411,7 @@ r"()Lcom/fasterxml/jackson/core/JsonStreamContext;"); /// from: public abstract com.fasterxml.jackson.core.JsonStreamContext getParsingContext() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be used to access current parsing context reader /// is in. There are 3 different types: root, array and object contexts, @@ -435,7 +435,7 @@ r"()Lcom/fasterxml/jackson/core/JsonLocation;"); /// from: public com.fasterxml.jackson.core.JsonLocation currentLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that returns location of the last processed input unit (character /// or byte) from the input; @@ -460,7 +460,7 @@ r"()Lcom/fasterxml/jackson/core/JsonLocation;"); /// from: public com.fasterxml.jackson.core.JsonLocation currentTokenLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that return the __starting__ location of the current /// (most recently returned) @@ -487,7 +487,7 @@ r"()Lcom/fasterxml/jackson/core/JsonLocation;"); /// from: public abstract com.fasterxml.jackson.core.JsonLocation getCurrentLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). @@ -505,7 +505,7 @@ r"()Lcom/fasterxml/jackson/core/JsonLocation;"); /// from: public abstract com.fasterxml.jackson.core.JsonLocation getTokenLocation() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentTokenLocation(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). @@ -521,7 +521,7 @@ _class.reference, r"currentValue", r"()Ljava/lang/Object;"); /// from: public java.lang.Object currentValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Helper method, usually equivalent to: ///<code> @@ -564,7 +564,7 @@ _class.reference, r"getCurrentValue", r"()Ljava/lang/Object;"); /// from: public java.lang.Object getCurrentValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentValue(), to be deprecated in later /// Jackson 2.x versions (and removed from Jackson 3.0). @@ -642,7 +642,7 @@ r"(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature /// (check Feature for list of features) @@ -664,7 +664,7 @@ r"(Lcom/fasterxml/jackson/core/JsonParser$Feature;)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser.Feature f) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified feature /// (check Feature for list of features) @@ -686,7 +686,7 @@ r"(Lcom/fasterxml/jackson/core/JsonParser$Feature;Z)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified feature /// (check Feature for list of features) @@ -756,7 +756,7 @@ r"(I)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser setFeatureMask(int mask) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Bulk set method for (re)setting states of all standard Features ///@param mask Bit mask that defines set of features to enable @@ -779,7 +779,7 @@ r"(II)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser overrideStdFeatures(int values, int mask) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Bulk set method for (re)setting states of features specified by <code>mask</code>. /// Functionally equivalent to @@ -824,7 +824,7 @@ r"(II)Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public com.fasterxml.jackson.core.JsonParser overrideFormatFeatures(int values, int mask) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Bulk set method for (re)setting states of FormatFeatures, /// by specifying values (set / clear) along with a mask, to determine @@ -851,7 +851,7 @@ r"nextToken", r"()Lcom/fasterxml/jackson/core/JsonToken;"); /// from: public abstract com.fasterxml.jackson.core.JsonToken nextToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Main iteration method, which will advance stream enough /// to determine type of the next token, if any. If none @@ -871,7 +871,7 @@ r"nextValue", r"()Lcom/fasterxml/jackson/core/JsonToken;"); /// from: public abstract com.fasterxml.jackson.core.JsonToken nextValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Iteration method that will advance stream enough /// to determine type of the next token that is a value type @@ -928,7 +928,7 @@ _class.reference, r"nextFieldName", r"()Ljava/lang/String;"); /// from: public java.lang.String nextFieldName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that fetches next token (as if calling \#nextToken) and /// verifies whether it is JsonToken\#FIELD_NAME; if it is, @@ -947,7 +947,7 @@ _class.reference, r"nextTextValue", r"()Ljava/lang/String;"); /// from: public java.lang.String nextTextValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that fetches next token (as if calling \#nextToken) and /// if it is JsonToken\#VALUE_STRING returns contained String value; @@ -1029,7 +1029,7 @@ _class.reference, r"nextBooleanValue", r"()Ljava/lang/Boolean;"); /// from: public java.lang.Boolean nextBooleanValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that fetches next token (as if calling \#nextToken) and /// if it is JsonToken\#VALUE_TRUE or JsonToken\#VALUE_FALSE @@ -1059,7 +1059,7 @@ r"()Lcom/fasterxml/jackson/core/JsonParser;"); /// from: public abstract com.fasterxml.jackson.core.JsonParser skipChildren() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will skip all child tokens of an array or /// object token that the parser currently points to, @@ -1110,7 +1110,7 @@ r"()Lcom/fasterxml/jackson/core/JsonToken;"); /// from: public com.fasterxml.jackson.core.JsonToken currentToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor to find which token parser currently points to, if any; /// null will be returned if none. @@ -1152,7 +1152,7 @@ r"()Lcom/fasterxml/jackson/core/JsonToken;"); /// from: public abstract com.fasterxml.jackson.core.JsonToken getCurrentToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias for \#currentToken(), may be deprecated sometime after /// Jackson 2.13 (will be removed from 3.0). @@ -1354,7 +1354,7 @@ r"()Lcom/fasterxml/jackson/core/JsonToken;"); /// from: public abstract com.fasterxml.jackson.core.JsonToken getLastClearedToken() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to get the last token that was /// cleared using \#clearCurrentToken. This is not necessarily @@ -1395,7 +1395,7 @@ _class.reference, r"getCurrentName", r"()Ljava/lang/String;"); /// from: public abstract java.lang.String getCurrentName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Alias of \#currentName(). ///@return Name of the current field in the parsing context @@ -1410,7 +1410,7 @@ .getMethodIDOf(_class.reference, r"currentName", r"()Ljava/lang/String;"); /// from: public java.lang.String currentName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to get the name associated with /// the current token: for JsonToken\#FIELD_NAMEs it will @@ -1430,7 +1430,7 @@ .getMethodIDOf(_class.reference, r"getText", r"()Ljava/lang/String;"); /// from: public abstract java.lang.String getText() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for accessing textual representation of the current token; /// if no current token (before first call to \#nextToken, or @@ -1476,7 +1476,7 @@ .getMethodIDOf(_class.reference, r"getTextCharacters", r"()[C"); /// from: public abstract char[] getTextCharacters() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method similar to \#getText, but that will return /// underlying (unmodifiable) character array that contains @@ -1573,7 +1573,7 @@ _class.reference, r"getNumberValue", r"()Ljava/lang/Number;"); /// from: public abstract java.lang.Number getNumberValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Generic number value accessor method that will work for /// all kinds of numeric values. It will return the optimal @@ -1594,7 +1594,7 @@ _class.reference, r"getNumberValueExact", r"()Ljava/lang/Number;"); /// from: public java.lang.Number getNumberValueExact() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method similar to \#getNumberValue with the difference that /// for floating-point numbers value returned may be BigDecimal @@ -1623,7 +1623,7 @@ r"()Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); /// from: public abstract com.fasterxml.jackson.core.JsonParser.NumberType getNumberType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// If current token is of type /// JsonToken\#VALUE_NUMBER_INT or @@ -1748,7 +1748,7 @@ _class.reference, r"getBigIntegerValue", r"()Ljava/math/BigInteger;"); /// from: public abstract java.math.BigInteger getBigIntegerValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Numeric accessor that can be called when the current /// token is of type JsonToken\#VALUE_NUMBER_INT and @@ -1822,7 +1822,7 @@ _class.reference, r"getDecimalValue", r"()Ljava/math/BigDecimal;"); /// from: public abstract java.math.BigDecimal getDecimalValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Numeric accessor that can be called when the current /// token is of type JsonToken\#VALUE_NUMBER_FLOAT or @@ -1862,7 +1862,7 @@ _class.reference, r"getEmbeddedObject", r"()Ljava/lang/Object;"); /// from: public java.lang.Object getEmbeddedObject() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Accessor that can be called if (and only if) the current token /// is JsonToken\#VALUE_EMBEDDED_OBJECT. For other token types, @@ -1891,7 +1891,7 @@ r"(Lcom/fasterxml/jackson/core/Base64Variant;)[B"); /// from: public abstract byte[] getBinaryValue(com.fasterxml.jackson.core.Base64Variant bv) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be used to read (and consume -- results /// may not be accessible using other methods after the call) @@ -1925,7 +1925,7 @@ .getMethodIDOf(_class.reference, r"getBinaryValue", r"()[B"); /// from: public byte[] getBinaryValue() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Convenience alternative to \#getBinaryValue(Base64Variant) /// that defaults to using @@ -2184,7 +2184,7 @@ _class.reference, r"getValueAsString", r"()Ljava/lang/String;"); /// from: public java.lang.String getValueAsString() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will try to convert value of current token to a /// java.lang.String. @@ -2210,7 +2210,7 @@ r"(Ljava/lang/String;)Ljava/lang/String;"); /// from: public abstract java.lang.String getValueAsString(java.lang.String def) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that will try to convert value of current token to a /// java.lang.String. @@ -2280,7 +2280,7 @@ .getMethodIDOf(_class.reference, r"getObjectId", r"()Ljava/lang/Object;"); /// from: public java.lang.Object getObjectId() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to check whether current token /// (one that was just read) has an associated Object id, and if @@ -2304,7 +2304,7 @@ .getMethodIDOf(_class.reference, r"getTypeId", r"()Ljava/lang/Object;"); /// from: public java.lang.Object getTypeId() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method that can be called to check whether current token /// (one that was just read) has an associated type id, and if @@ -2330,7 +2330,7 @@ r"(Ljava/lang/Class;)Ljava/lang/Object;"); /// from: public T readValueAs(java.lang.Class<T> valueType) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method to deserialize JSON content into a non-container /// type (it can be an array type, however): typically a bean, array @@ -2374,7 +2374,7 @@ r"(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/lang/Object;"); /// from: public T readValueAs(com.fasterxml.jackson.core.type.TypeReference<?> valueTypeRef) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method to deserialize JSON content into a Java type, reference /// to which is passed as argument. Type is passed using so-called @@ -2415,7 +2415,7 @@ r"(Ljava/lang/Class;)Ljava/util/Iterator;"); /// from: public java.util.Iterator<T> readValuesAs(java.lang.Class<T> valueType) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for reading sequence of Objects from parser stream, /// all with same specified value type. @@ -2442,7 +2442,7 @@ r"(Lcom/fasterxml/jackson/core/type/TypeReference;)Ljava/util/Iterator;"); /// from: public java.util.Iterator<T> readValuesAs(com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method for reading sequence of Objects from parser stream, /// all with same specified value type. @@ -2469,7 +2469,7 @@ r"()Lcom/fasterxml/jackson/core/TreeNode;"); /// from: public T readValueAsTree() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Method to deserialize JSON content into equivalent "tree model", /// represented by root TreeNode of resulting model. @@ -2534,7 +2534,7 @@ r"()[Lcom/fasterxml/jackson/core/JsonParser$Feature;"); /// from: static public com.fasterxml.jackson.core.JsonParser.Feature[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonParser_Feature> values() { return const jni.JArrayType($JsonParser_FeatureType()).fromRef( jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, @@ -2547,7 +2547,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$Feature;"); /// from: static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonParser_Feature valueOf( jni.JString name, ) { @@ -2648,7 +2648,7 @@ r"()[Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); /// from: static public com.fasterxml.jackson.core.JsonParser.NumberType[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonParser_NumberType> values() { return const jni.JArrayType($JsonParser_NumberTypeType()).fromRef( jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, @@ -2661,7 +2661,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonParser$NumberType;"); /// from: static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonParser_NumberType valueOf( jni.JString name, ) {
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart index aac454b..6b60adb 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/dart_only/dart_bindings/com/fasterxml/jackson/core/JsonToken.dart
@@ -60,7 +60,7 @@ r"()[Lcom/fasterxml/jackson/core/JsonToken;"); /// from: static public com.fasterxml.jackson.core.JsonToken[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonToken> values() { return const jni.JArrayType($JsonTokenType()).fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_values, @@ -73,7 +73,7 @@ r"(Ljava/lang/String;)Lcom/fasterxml/jackson/core/JsonToken;"); /// from: static public com.fasterxml.jackson.core.JsonToken valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonToken valueOf( jni.JString name, ) { @@ -95,7 +95,7 @@ .getMethodIDOf(_class.reference, r"asString", r"()Ljava/lang/String;"); /// from: public final java.lang.String asString() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString asString() { return const jni.JStringType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_asString, jni.JniCallType.objectType, []).object); @@ -105,7 +105,7 @@ .getMethodIDOf(_class.reference, r"asCharArray", r"()[C"); /// from: public final char[] asCharArray() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.jchar> asCharArray() { return const jni.JArrayType(jni.jcharType()).fromRef(jni.Jni.accessors .callMethodWithArgs( @@ -116,7 +116,7 @@ .getMethodIDOf(_class.reference, r"asByteArray", r"()[B"); /// from: public final byte[] asByteArray() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.jbyte> asByteArray() { return const jni.JArrayType(jni.jbyteType()).fromRef(jni.Jni.accessors .callMethodWithArgs(
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 67c1e4d..1792649 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
@@ -45,7 +45,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory SuspendFun() { return SuspendFun.fromRef(_new0().object); } @@ -59,7 +59,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Future<jni.JString> sayHello() async { final $p = ReceivePort(); final $c = @@ -84,7 +84,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Future<jni.JString> sayHello1( jni.JString string, ) async {
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 9b9ce95..357e6e5 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
@@ -42,7 +42,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory SuspendFun() { return SuspendFun.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -52,7 +52,7 @@ r"sayHello", r"(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"); /// from: public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Future<jni.JString> sayHello() async { final $p = ReceivePort(); final $c = @@ -73,7 +73,7 @@ r"(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;"); /// from: public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Future<jni.JString> sayHello1( jni.JString string, ) async {
diff --git a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart index 642622b..6a9696b 100644 --- a/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/kotlin_test/runtime_test_registrant.dart
@@ -13,13 +13,13 @@ group(groupName, () { test('Suspend functions', () async { await using((arena) async { - final suspendFun = SuspendFun()..deletedIn(arena); + final suspendFun = SuspendFun()..releasedBy(arena); final hello = await suspendFun.sayHello(); - expect(hello.toDartString(deleteOriginal: true), "Hello!"); + expect(hello.toDartString(releaseOriginal: true), "Hello!"); const name = "Bob"; final helloBob = - await suspendFun.sayHello1(name.toJString()..deletedIn(arena)); - expect(helloBob.toDartString(deleteOriginal: true), "Hello $name!"); + await suspendFun.sayHello1(name.toJString()..releasedBy(arena)); + expect(helloBob.toDartString(releaseOriginal: true), "Hello $name!"); }); }); });
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 5154b75..a91eba6 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
@@ -45,7 +45,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.github.dart_lang.jnigen.simple_package.Color[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<Color> values() { return const jni.JArrayType($ColorType()).fromRef(_values().object); } @@ -57,7 +57,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static Color valueOf( jni.JString name, ) { @@ -122,7 +122,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public final java.util.Random unusedRandom - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JObject get unusedRandom => const jni.JObjectType().fromRef(_get_unusedRandom().object); @@ -144,12 +144,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: protected java.util.Random protectedField - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get protectedField => const jni.JObjectType().fromRef(_get_protectedField(reference).object); /// from: protected java.util.Random protectedField - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set protectedField(jni.JObject value) => _set_protectedField(reference, value.reference).check(); @@ -188,7 +188,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public java.lang.String getName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString getName() { return const jni.JStringType().fromRef(_getName().object); } @@ -199,7 +199,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.github.dart_lang.jnigen.simple_package.Example.Nested getNestedInstance() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static Example_Nested getNestedInstance() { return const $Example_NestedType().fromRef(_getNestedInstance().object); } @@ -334,7 +334,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getCodename() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString getCodename() { return const jni.JStringType().fromRef(_getCodename(reference).object); } @@ -361,7 +361,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Random getRandom() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getRandom() { return const jni.JObjectType().fromRef(_getRandom(reference).object); } @@ -448,7 +448,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String getRandomNumericString(java.util.Random random) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString getRandomNumericString( jni.JObject random, ) { @@ -492,7 +492,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.util.List<java.lang.String> getList() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JList<jni.JString> getList() { return const jni.JListType(jni.JStringType()) .fromRef(_getList(reference).object); @@ -509,7 +509,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String joinStrings(java.util.List<java.lang.String> values, java.lang.String delim) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Joins the strings in the list using the given delimiter. jni.JString joinStrings( @@ -564,7 +564,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromRef(_new0().object); } @@ -575,7 +575,7 @@ .asFunction<jni.JniResult Function(int)>(); /// from: public void <init>(int number) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example.new1( int number, ) { @@ -588,7 +588,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new2( int number, bool isUp, @@ -603,7 +603,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new3( int number, bool isUp, @@ -621,7 +621,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new4( int a, int b, @@ -664,7 +664,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public int[] getArr() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.jint> getArr() { return const jni.JArrayType(jni.jintType()).fromRef(_getArr().object); } @@ -689,7 +689,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.github.dart_lang.jnigen.simple_package.Example getSelf() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Example getSelf() { return const $ExampleType().fromRef(_getSelf(reference).object); } @@ -820,7 +820,7 @@ .asFunction<jni.JniResult Function(int)>(); /// from: public void <init>(boolean value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example_Nested( bool value, ) { @@ -921,7 +921,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example_Nested_NestedTwice() { return Example_Nested_NestedTwice.fromRef(_new0().object); } @@ -995,7 +995,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.github.dart_lang.jnigen.simple_package.Example $parent) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example_NonStaticNested( Example $parent, ) { @@ -1047,7 +1047,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Exceptions() { return Exceptions.fromRef(_new0().object); } @@ -1058,7 +1058,7 @@ .asFunction<jni.JniResult Function(double)>(); /// from: public void <init>(float x) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Exceptions.new1( double x, ) { @@ -1072,7 +1072,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory Exceptions.new2( int a, int b, @@ -1090,7 +1090,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public java.lang.Object staticObjectMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JObject staticObjectMethod() { return const jni.JObjectType().fromRef(_staticObjectMethod().object); } @@ -1111,7 +1111,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public java.lang.Object[] staticObjectArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.JObject> staticObjectArrayMethod() { return const jni.JArrayType(jni.JObjectType()) .fromRef(_staticObjectArrayMethod().object); @@ -1123,7 +1123,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public int[] staticIntArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.jint> staticIntArrayMethod() { return const jni.JArrayType(jni.jintType()) .fromRef(_staticIntArrayMethod().object); @@ -1136,7 +1136,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object objectMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject objectMethod() { return const jni.JObjectType().fromRef(_objectMethod(reference).object); } @@ -1159,7 +1159,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Object[] objectArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.JObject> objectArrayMethod() { return const jni.JArrayType(jni.JObjectType()) .fromRef(_objectArrayMethod(reference).object); @@ -1172,7 +1172,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public int[] intArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.jint> intArrayMethod() { return const jni.JArrayType(jni.jintType()) .fromRef(_intArrayMethod(reference).object); @@ -1196,7 +1196,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.io.InputStream throwFileNotFoundException() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject throwFileNotFoundException() { return const jni.JObjectType() .fromRef(_throwFileNotFoundException(reference).object); @@ -1209,7 +1209,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public java.io.FileInputStream throwClassCastException() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject throwClassCastException() { return const jni.JObjectType() .fromRef(_throwClassCastException(reference).object); @@ -1343,12 +1343,12 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public java.lang.String name - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get name => const jni.JStringType().fromRef(_get_name().object); /// from: static public java.lang.String name - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static set name(jni.JString value) => _set_name(value.reference).check(); static final _get_i = jniLookup< @@ -1369,12 +1369,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Integer i - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JInteger get i => const jni.JIntegerType().fromRef(_get_i(reference).object); /// from: public java.lang.Integer i - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set i(jni.JInteger value) => _set_i(reference, value.reference).check(); static final _get_trillion = jniLookup< @@ -1440,12 +1440,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.String bestFighterInGreece - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString get bestFighterInGreece => const jni.JStringType() .fromRef(_get_bestFighterInGreece(reference).object); /// from: public java.lang.String bestFighterInGreece - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set bestFighterInGreece(jni.JString value) => _set_bestFighterInGreece(reference, value.reference).check(); @@ -1467,12 +1467,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public java.util.Random random - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get random => const jni.JObjectType().fromRef(_get_random(reference).object); /// from: public java.util.Random random - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set random(jni.JObject value) => _set_random(reference, value.reference).check(); @@ -1497,7 +1497,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Fields() { return Fields.fromRef(_new0().object); } @@ -1573,12 +1573,12 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public java.lang.String BEST_GOD - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get BEST_GOD => const jni.JStringType().fromRef(_get_BEST_GOD().object); /// from: static public java.lang.String BEST_GOD - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static set BEST_GOD(jni.JString value) => _set_BEST_GOD(value.reference).check(); @@ -1587,7 +1587,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Fields_Nested() { return Fields_Nested.fromRef(_new0().object); } @@ -1651,7 +1651,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory C2() { return C2.fromRef(_new0().object); } @@ -1697,7 +1697,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example1() { return Example1.fromRef(_new0().object); } @@ -1770,7 +1770,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GenericTypeParams({ required jni.JObjType<$S> S, required jni.JObjType<$K> K, @@ -1854,11 +1854,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public T value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T get value => T.fromRef(_get_value(reference).object); /// from: public T value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($T value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< @@ -1868,7 +1868,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(T value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent( $T value, { jni.JObjType<$T>? T, @@ -1886,7 +1886,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.github.dart_lang.jnigen.generics.GrandParent<T>.Parent<java.lang.String> stringParent() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. GrandParent_Parent<jni.JObject, jni.JString> stringParent() { return const $GrandParent_ParentType(jni.JObjectType(), jni.JStringType()) .fromRef(_stringParent(reference).object); @@ -1901,7 +1901,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public com.github.dart_lang.jnigen.generics.GrandParent<T>.Parent<S> varParent(S nestedValue) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. GrandParent_Parent<jni.JObject, $S> varParent<$S extends jni.JObject>( $S nestedValue, { jni.JObjType<$S>? S, @@ -1919,7 +1919,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent<java.lang.String> stringStaticParent() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static GrandParent_StaticParent<jni.JString> stringStaticParent() { return const $GrandParent_StaticParentType(jni.JStringType()) .fromRef(_stringStaticParent().object); @@ -1932,7 +1932,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent<S> varStaticParent(S value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static GrandParent_StaticParent<$S> varStaticParent<$S extends jni.JObject>( $S value, { jni.JObjType<$S>? S, @@ -1951,7 +1951,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent<T> staticParentWithSameType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. GrandParent_StaticParent<$T> staticParentWithSameType() { return $GrandParent_StaticParentType(T) .fromRef(_staticParentWithSameType(reference).object); @@ -2035,11 +2035,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public T parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T get parentValue => T.fromRef(_get_parentValue(reference).object); /// from: public T parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set parentValue($T value) => _set_parentValue(reference, value.reference).check(); @@ -2061,11 +2061,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get value => S.fromRef(_get_value(reference).object); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($S value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< @@ -2077,7 +2077,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent( GrandParent<$T> $parent, $S newValue, { @@ -2182,11 +2182,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public T grandParentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T get grandParentValue => T.fromRef(_get_grandParentValue(reference).object); /// from: public T grandParentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set grandParentValue($T value) => _set_grandParentValue(reference, value.reference).check(); @@ -2209,11 +2209,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get parentValue => S.fromRef(_get_parentValue(reference).object); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set parentValue($S value) => _set_parentValue(reference, value.reference).check(); @@ -2236,11 +2236,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $U get value => U.fromRef(_get_value(reference).object); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($U value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< @@ -2252,7 +2252,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.github.dart_lang.jnigen.generics.GrandParent$Parent $parent, U newValue) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent_Child( GrandParent_Parent<$T, $S> $parent, $U newValue, { @@ -2354,11 +2354,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get value => S.fromRef(_get_value(reference).object); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($S value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< @@ -2368,7 +2368,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(S value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent( $S value, { jni.JObjType<$S>? S, @@ -2460,11 +2460,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get parentValue => S.fromRef(_get_parentValue(reference).object); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set parentValue($S value) => _set_parentValue(reference, value.reference).check(); @@ -2487,11 +2487,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $U get value => U.fromRef(_get_value(reference).object); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($U value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< @@ -2504,7 +2504,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $parent, S parentValue, U value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent_Child( GrandParent_StaticParent<$S> $parent, $S parentValue, @@ -2596,7 +2596,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyMap({ required jni.JObjType<$K> K, required jni.JObjType<$V> V, @@ -2613,7 +2613,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public V get(K key) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V get0( $K key, ) { @@ -2629,7 +2629,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public V put(K key, V value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V put( $K key, $V value, @@ -2644,7 +2644,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public com.github.dart_lang.jnigen.generics.MyStack<com.github.dart_lang.jnigen.generics.MyMap<K,V>.MyEntry> entryStack() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. MyStack<MyMap_MyEntry<jni.JObject, jni.JObject>> entryStack() { return const $MyStackType( $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType())) @@ -2731,11 +2731,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public K key - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $K get key => K.fromRef(_get_key(reference).object); /// from: public K key - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set key($K value) => _set_key(reference, value.reference).check(); static final _get_value = jniLookup< @@ -2756,11 +2756,11 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public V value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V get value => V.fromRef(_get_value(reference).object); /// from: public V value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($V value) => _set_value(reference, value.reference).check(); static final _new0 = jniLookup< @@ -2774,7 +2774,7 @@ ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.github.dart_lang.jnigen.generics.MyMap $parent, K key, V value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyMap_MyEntry( MyMap<$K, $V> $parent, $K key, @@ -2857,7 +2857,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyStack({ required jni.JObjType<$T> T, }) { @@ -2871,7 +2871,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> fromArray(T[] arr) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> fromArray<$T extends jni.JObject>( jni.JArray<$T> arr, { jni.JObjType<$T>? T, @@ -2889,7 +2889,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<S> fromArrayOfArrayOfGrandParents(com.github.dart_lang.jnigen.generics.GrandParent<S>[][] arr) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$S> fromArrayOfArrayOfGrandParents<$S extends jni.JObject>( jni.JArray<jni.JArray<GrandParent<$S>>> arr, { jni.JObjType<$S>? S, @@ -2909,7 +2909,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> of() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> of<$T extends jni.JObject>({ required jni.JObjType<$T> T, }) { @@ -2923,7 +2923,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> of(T obj) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> of1<$T extends jni.JObject>( $T obj, { jni.JObjType<$T>? T, @@ -2943,7 +2943,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> of(T obj, T obj2) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> of2<$T extends jni.JObject>( $T obj, $T obj2, { @@ -2978,7 +2978,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public T pop() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T pop() { return T.fromRef(_pop(reference).object); } @@ -3051,7 +3051,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory StringKeyedMap({ required jni.JObjType<$V> V, }) { @@ -3108,7 +3108,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory StringMap() { return StringMap.fromRef(_new0().object); } @@ -3154,7 +3154,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory StringStack() { return StringStack.fromRef(_new0().object); } @@ -3210,7 +3210,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory StringValuedMap({ required jni.JObjType<$K> K, }) { @@ -3296,7 +3296,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public abstract java.lang.String stringCallback(java.lang.String s) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString stringCallback( jni.JString s, ) { @@ -3313,7 +3313,7 @@ ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.Void>)>(); /// from: public abstract T varCallback(T t) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T varCallback( $T t, ) { @@ -3372,40 +3372,40 @@ $MethodInvocation $i, ) { try { - final $d = $i.methodDescriptor.toDartString(deleteOriginal: true); + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r"voidCallback(Ljava/lang/String;)V") { _$impls[$p]!.voidCallback( - $a[0].castTo(const jni.JStringType(), deleteOriginal: true), + $a[0].castTo(const jni.JStringType(), releaseOriginal: true), ); return jni.nullptr; } if ($d == r"stringCallback(Ljava/lang/String;)Ljava/lang/String;") { final $r = _$impls[$p]!.stringCallback( - $a[0].castTo(const jni.JStringType(), deleteOriginal: true), + $a[0].castTo(const jni.JStringType(), releaseOriginal: true), ); return ($r as jni.JObject).castTo(const jni.JObjectType()).toPointer(); } if ($d == r"varCallback(Ljava/lang/Object;)Ljava/lang/Object;") { final $r = _$impls[$p]!.varCallback( - $a[0].castTo(_$impls[$p]!.T, deleteOriginal: true), + $a[0].castTo(_$impls[$p]!.T, releaseOriginal: true), ); return ($r as jni.JObject).castTo(const jni.JObjectType()).toPointer(); } if ($d == r"manyPrimitives(IZCD)J") { final $r = _$impls[$p]!.manyPrimitives( $a[0] - .castTo(const jni.JIntegerType(), deleteOriginal: true) - .intValue(deleteOriginal: true), + .castTo(const jni.JIntegerType(), releaseOriginal: true) + .intValue(releaseOriginal: true), $a[1] - .castTo(const jni.JBooleanType(), deleteOriginal: true) - .booleanValue(deleteOriginal: true), + .castTo(const jni.JBooleanType(), releaseOriginal: true) + .booleanValue(releaseOriginal: true), $a[2] - .castTo(const jni.JCharacterType(), deleteOriginal: true) - .charValue(deleteOriginal: true), + .castTo(const jni.JCharacterType(), releaseOriginal: true) + .charValue(releaseOriginal: true), $a[3] - .castTo(const jni.JDoubleType(), deleteOriginal: true) - .doubleValue(deleteOriginal: true), + .castTo(const jni.JDoubleType(), releaseOriginal: true) + .doubleValue(releaseOriginal: true), ); return jni.JLong($r).toPointer(); } @@ -3547,7 +3547,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyInterfaceConsumer() { return MyInterfaceConsumer.fromRef(_new0().object); } @@ -3702,7 +3702,7 @@ $MethodInvocation $i, ) { try { - final $d = $i.methodDescriptor.toDartString(deleteOriginal: true); + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r"run()V") { _$impls[$p]!.run(); @@ -3815,12 +3815,12 @@ jni.JniResult Function(jni.JObjectPtr, ffi.Pointer<ffi.Void>)>(); /// from: public java.lang.Throwable error - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get error => const jni.JObjectType().fromRef(_get_error(reference).object); /// from: public java.lang.Throwable error - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set error(jni.JObject value) => _set_error(reference, value.reference).check(); @@ -3831,7 +3831,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: public void <init>(com.github.dart_lang.jnigen.interfaces.MyRunnable runnable) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyRunnableRunner( MyRunnable runnable, ) { @@ -3904,7 +3904,7 @@ .asFunction<jni.JniResult Function()>(); /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonSerializable_Case> values() { return const jni.JArrayType($JsonSerializable_CaseType()) .fromRef(_values().object); @@ -3917,7 +3917,7 @@ .asFunction<jni.JniResult Function(ffi.Pointer<ffi.Void>)>(); /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonSerializable_Case valueOf( jni.JString name, ) { @@ -3969,7 +3969,7 @@ .asFunction<jni.JniResult Function()>(); /// from: public void <init>() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyDataClass() { 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 7b36cdd..3c6d41b 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
@@ -44,7 +44,7 @@ r"()[Lcom/github/dart_lang/jnigen/simple_package/Color;"); /// from: static public com.github.dart_lang.jnigen.simple_package.Color[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<Color> values() { return const jni.JArrayType($ColorType()).fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_values, @@ -57,7 +57,7 @@ r"(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/simple_package/Color;"); /// from: static public com.github.dart_lang.jnigen.simple_package.Color valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static Color valueOf( jni.JString name, ) { @@ -128,7 +128,7 @@ ); /// from: static public final java.util.Random unusedRandom - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JObject get unusedRandom => const jni.JObjectType().fromRef(jni.Jni.accessors .getStaticField( @@ -142,14 +142,14 @@ ); /// from: protected java.util.Random protectedField - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get protectedField => const jni.JObjectType().fromRef(jni.Jni.accessors .getField(reference, _id_protectedField, jni.JniCallType.objectType) .object); /// from: protected java.util.Random protectedField - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set protectedField(jni.JObject value) => jni.Jni.env .SetObjectField(reference, _id_protectedField, value.reference); @@ -184,7 +184,7 @@ _class.reference, r"getName", r"()Ljava/lang/String;"); /// from: static public java.lang.String getName() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString getName() { return const jni.JStringType().fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_getName, @@ -197,7 +197,7 @@ r"()Lcom/github/dart_lang/jnigen/simple_package/Example$Nested;"); /// from: static public com.github.dart_lang.jnigen.simple_package.Example.Nested getNestedInstance() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static Example_Nested getNestedInstance() { return const $Example_NestedType().fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_getNestedInstance, @@ -335,7 +335,7 @@ .getMethodIDOf(_class.reference, r"getCodename", r"()Ljava/lang/String;"); /// from: public java.lang.String getCodename() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString getCodename() { return const jni.JStringType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_getCodename, jni.JniCallType.objectType, []).object); @@ -356,7 +356,7 @@ .getMethodIDOf(_class.reference, r"getRandom", r"()Ljava/util/Random;"); /// from: public java.util.Random getRandom() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject getRandom() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_getRandom, jni.JniCallType.objectType, []).object); @@ -420,7 +420,7 @@ r"(Ljava/util/Random;)Ljava/lang/String;"); /// from: public java.lang.String getRandomNumericString(java.util.Random random) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString getRandomNumericString( jni.JObject random, ) { @@ -458,7 +458,7 @@ .getMethodIDOf(_class.reference, r"getList", r"()Ljava/util/List;"); /// from: public java.util.List<java.lang.String> getList() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JList<jni.JString> getList() { return const jni.JListType(jni.JStringType()).fromRef(jni.Jni.accessors .callMethodWithArgs( @@ -471,7 +471,7 @@ r"(Ljava/util/List;Ljava/lang/String;)Ljava/lang/String;"); /// from: public java.lang.String joinStrings(java.util.List<java.lang.String> values, java.lang.String delim) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. /// /// Joins the strings in the list using the given delimiter. jni.JString joinStrings( @@ -519,7 +519,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Example() { return Example.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -529,7 +529,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new1( int number, ) { @@ -541,7 +541,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new2( int number, bool isUp, @@ -554,7 +554,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new3( int number, bool isUp, @@ -570,7 +570,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory Example.new4( int a, int b, @@ -622,7 +622,7 @@ .getStaticMethodIDOf(_class.reference, r"getArr", r"()[I"); /// from: static public int[] getArr() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.jint> getArr() { return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_getArr, @@ -644,7 +644,7 @@ r"getSelf", r"()Lcom/github/dart_lang/jnigen/simple_package/Example;"); /// from: public com.github.dart_lang.jnigen.simple_package.Example getSelf() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. Example getSelf() { return const $ExampleType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_getSelf, jni.JniCallType.objectType, []).object); @@ -760,7 +760,7 @@ jni.Jni.accessors.getMethodIDOf(_class.reference, r"<init>", r"(Z)V"); /// from: public void <init>(boolean value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example_Nested( bool value, ) { @@ -857,7 +857,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Example_Nested_NestedTwice() { return Example_Nested_NestedTwice.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -925,7 +925,7 @@ r"<init>", r"(Lcom/github/dart_lang/jnigen/simple_package/Example;)V"); /// from: public void <init>(com.github.dart_lang.jnigen.simple_package.Example $parent) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory Example_NonStaticNested( Example $parent, ) { @@ -980,7 +980,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Exceptions() { return Exceptions.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -990,7 +990,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Exceptions.new1( double x, ) { @@ -1002,7 +1002,7 @@ .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. + /// The returned object must be released after use, by calling the [release] method. factory Exceptions.new2( int a, int b, @@ -1026,7 +1026,7 @@ _class.reference, r"staticObjectMethod", r"()Ljava/lang/Object;"); /// from: static public java.lang.Object staticObjectMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JObject staticObjectMethod() { return const jni.JObjectType().fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_staticObjectMethod, @@ -1047,7 +1047,7 @@ r"()[Ljava/lang/Object;"); /// from: static public java.lang.Object[] staticObjectArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.JObject> staticObjectArrayMethod() { return const jni.JArrayType(jni.JObjectType()).fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_staticObjectArrayMethod, @@ -1058,7 +1058,7 @@ .getStaticMethodIDOf(_class.reference, r"staticIntArrayMethod", r"()[I"); /// from: static public int[] staticIntArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<jni.jint> staticIntArrayMethod() { return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors .callStaticMethodWithArgs(_class.reference, _id_staticIntArrayMethod, @@ -1069,7 +1069,7 @@ _class.reference, r"objectMethod", r"()Ljava/lang/Object;"); /// from: public java.lang.Object objectMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject objectMethod() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_objectMethod, jni.JniCallType.objectType, []).object); @@ -1088,7 +1088,7 @@ _class.reference, r"objectArrayMethod", r"()[Ljava/lang/Object;"); /// from: public java.lang.Object[] objectArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.JObject> objectArrayMethod() { return const jni.JArrayType(jni.JObjectType()).fromRef(jni.Jni.accessors .callMethodWithArgs(reference, _id_objectArrayMethod, @@ -1099,7 +1099,7 @@ .getMethodIDOf(_class.reference, r"intArrayMethod", r"()[I"); /// from: public int[] intArrayMethod() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JArray<jni.jint> intArrayMethod() { return const jni.JArrayType(jni.jintType()).fromRef(jni.Jni.accessors .callMethodWithArgs(reference, _id_intArrayMethod, @@ -1121,7 +1121,7 @@ r"()Ljava/io/InputStream;"); /// from: public java.io.InputStream throwFileNotFoundException() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject throwFileNotFoundException() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, @@ -1135,7 +1135,7 @@ r"()Ljava/io/FileInputStream;"); /// from: public java.io.FileInputStream throwClassCastException() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject throwClassCastException() { return const jni.JObjectType().fromRef(jni.Jni.accessors.callMethodWithArgs( reference, @@ -1262,14 +1262,14 @@ ); /// from: static public java.lang.String name - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get name => const jni.JStringType().fromRef(jni .Jni.accessors .getStaticField(_class.reference, _id_name, jni.JniCallType.objectType) .object); /// from: static public java.lang.String name - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static set name(jni.JString value) => jni.Jni.env .SetStaticObjectField(_class.reference, _id_name, value.reference); @@ -1280,13 +1280,13 @@ ); /// from: public java.lang.Integer i - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JInteger get i => const jni.JIntegerType().fromRef(jni.Jni.accessors .getField(reference, _id_i, jni.JniCallType.objectType) .object); /// from: public java.lang.Integer i - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set i(jni.JInteger value) => jni.Jni.env.SetObjectField(reference, _id_i, value.reference); @@ -1327,14 +1327,14 @@ ); /// from: public java.lang.String bestFighterInGreece - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString get bestFighterInGreece => const jni.JStringType().fromRef(jni .Jni.accessors .getField(reference, _id_bestFighterInGreece, jni.JniCallType.objectType) .object); /// from: public java.lang.String bestFighterInGreece - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set bestFighterInGreece(jni.JString value) => jni.Jni.env .SetObjectField(reference, _id_bestFighterInGreece, value.reference); @@ -1345,13 +1345,13 @@ ); /// from: public java.util.Random random - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get random => const jni.JObjectType().fromRef(jni.Jni.accessors .getField(reference, _id_random, jni.JniCallType.objectType) .object); /// from: public java.util.Random random - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set random(jni.JObject value) => jni.Jni.env.SetObjectField(reference, _id_random, value.reference); @@ -1375,7 +1375,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Fields() { return Fields.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -1443,7 +1443,7 @@ ); /// from: static public java.lang.String BEST_GOD - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JString get BEST_GOD => const jni.JStringType().fromRef(jni.Jni.accessors .getStaticField( @@ -1451,7 +1451,7 @@ .object); /// from: static public java.lang.String BEST_GOD - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static set BEST_GOD(jni.JString value) => jni.Jni.env .SetStaticObjectField(_class.reference, _id_BEST_GOD, value.reference); @@ -1459,7 +1459,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Fields_Nested() { return Fields_Nested.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -1525,7 +1525,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory C2() { return C2.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -1574,7 +1574,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory Example1() { return Example1.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -1648,7 +1648,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory GenericTypeParams({ required jni.JObjType<$S> S, required jni.JObjType<$K> K, @@ -1728,13 +1728,13 @@ ); /// from: public T value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T get value => T.fromRef(jni.Jni.accessors .getField(reference, _id_value, jni.JniCallType.objectType) .object); /// from: public T value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($T value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); @@ -1742,7 +1742,7 @@ .getMethodIDOf(_class.reference, r"<init>", r"(Ljava/lang/Object;)V"); /// from: public void <init>(T value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent( $T value, { jni.JObjType<$T>? T, @@ -1762,7 +1762,7 @@ r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); /// from: public com.github.dart_lang.jnigen.generics.GrandParent<T>.Parent<java.lang.String> stringParent() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. GrandParent_Parent<jni.JObject, jni.JString> stringParent() { return const $GrandParent_ParentType(jni.JObjectType(), jni.JStringType()) .fromRef(jni.Jni.accessors.callMethodWithArgs(reference, @@ -1775,7 +1775,7 @@ r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;"); /// from: public com.github.dart_lang.jnigen.generics.GrandParent<T>.Parent<S> varParent(S nestedValue) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. GrandParent_Parent<jni.JObject, $S> varParent<$S extends jni.JObject>( $S nestedValue, { jni.JObjType<$S>? S, @@ -1794,7 +1794,7 @@ r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent<java.lang.String> stringStaticParent() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static GrandParent_StaticParent<jni.JString> stringStaticParent() { return const $GrandParent_StaticParentType(jni.JStringType()).fromRef( jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, @@ -1807,7 +1807,7 @@ r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); /// from: static public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent<S> varStaticParent(S value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static GrandParent_StaticParent<$S> varStaticParent<$S extends jni.JObject>( $S value, { jni.JObjType<$S>? S, @@ -1826,7 +1826,7 @@ r"()Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;"); /// from: public com.github.dart_lang.jnigen.generics.GrandParent.StaticParent<T> staticParentWithSameType() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. GrandParent_StaticParent<$T> staticParentWithSameType() { return $GrandParent_StaticParentType(T).fromRef(jni.Jni.accessors .callMethodWithArgs(reference, _id_staticParentWithSameType, @@ -1902,13 +1902,13 @@ ); /// from: public T parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T get parentValue => T.fromRef(jni.Jni.accessors .getField(reference, _id_parentValue, jni.JniCallType.objectType) .object); /// from: public T parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set parentValue($T value) => jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); @@ -1919,13 +1919,13 @@ ); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get value => S.fromRef(jni.Jni.accessors .getField(reference, _id_value, jni.JniCallType.objectType) .object); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($S value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); @@ -1935,7 +1935,7 @@ r"(Lcom/github/dart_lang/jnigen/generics/GrandParent;Ljava/lang/Object;)V"); /// from: public void <init>(com.github.dart_lang.jnigen.generics.GrandParent $parent, S newValue) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent( GrandParent<$T> $parent, $S newValue, { @@ -2034,13 +2034,13 @@ ); /// from: public T grandParentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T get grandParentValue => T.fromRef(jni.Jni.accessors .getField(reference, _id_grandParentValue, jni.JniCallType.objectType) .object); /// from: public T grandParentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set grandParentValue($T value) => jni.Jni.env .SetObjectField(reference, _id_grandParentValue, value.reference); @@ -2051,13 +2051,13 @@ ); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get parentValue => S.fromRef(jni.Jni.accessors .getField(reference, _id_parentValue, jni.JniCallType.objectType) .object); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set parentValue($S value) => jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); @@ -2068,13 +2068,13 @@ ); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $U get value => U.fromRef(jni.Jni.accessors .getField(reference, _id_value, jni.JniCallType.objectType) .object); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($U value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); @@ -2084,7 +2084,7 @@ r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$Parent;Ljava/lang/Object;)V"); /// from: public void <init>(com.github.dart_lang.jnigen.generics.GrandParent$Parent $parent, U newValue) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_Parent_Child( GrandParent_Parent<$T, $S> $parent, $U newValue, { @@ -2181,13 +2181,13 @@ ); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get value => S.fromRef(jni.Jni.accessors .getField(reference, _id_value, jni.JniCallType.objectType) .object); /// from: public S value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($S value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); @@ -2195,7 +2195,7 @@ .getMethodIDOf(_class.reference, r"<init>", r"(Ljava/lang/Object;)V"); /// from: public void <init>(S value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent( $S value, { jni.JObjType<$S>? S, @@ -2281,13 +2281,13 @@ ); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $S get parentValue => S.fromRef(jni.Jni.accessors .getField(reference, _id_parentValue, jni.JniCallType.objectType) .object); /// from: public S parentValue - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set parentValue($S value) => jni.Jni.env.SetObjectField(reference, _id_parentValue, value.reference); @@ -2298,13 +2298,13 @@ ); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $U get value => U.fromRef(jni.Jni.accessors .getField(reference, _id_value, jni.JniCallType.objectType) .object); /// from: public U value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($U value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); @@ -2314,7 +2314,7 @@ r"(Lcom/github/dart_lang/jnigen/generics/GrandParent$StaticParent;Ljava/lang/Object;Ljava/lang/Object;)V"); /// from: public void <init>(com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $parent, S parentValue, U value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory GrandParent_StaticParent_Child( GrandParent_StaticParent<$S> $parent, $S parentValue, @@ -2411,7 +2411,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory MyMap({ required jni.JObjType<$K> K, required jni.JObjType<$V> V, @@ -2427,7 +2427,7 @@ _class.reference, r"get", r"(Ljava/lang/Object;)Ljava/lang/Object;"); /// from: public V get(K key) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V get0( $K key, ) { @@ -2439,7 +2439,7 @@ r"put", r"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); /// from: public V put(K key, V value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V put( $K key, $V value, @@ -2454,7 +2454,7 @@ r"()Lcom/github/dart_lang/jnigen/generics/MyStack;"); /// from: public com.github.dart_lang.jnigen.generics.MyStack<com.github.dart_lang.jnigen.generics.MyMap<K,V>.MyEntry> entryStack() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. MyStack<MyMap_MyEntry<jni.JObject, jni.JObject>> entryStack() { return const $MyStackType( $MyMap_MyEntryType(jni.JObjectType(), jni.JObjectType())) @@ -2534,13 +2534,13 @@ ); /// from: public K key - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $K get key => K.fromRef(jni.Jni.accessors .getField(reference, _id_key, jni.JniCallType.objectType) .object); /// from: public K key - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set key($K value) => jni.Jni.env.SetObjectField(reference, _id_key, value.reference); @@ -2551,13 +2551,13 @@ ); /// from: public V value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $V get value => V.fromRef(jni.Jni.accessors .getField(reference, _id_value, jni.JniCallType.objectType) .object); /// from: public V value - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set value($V value) => jni.Jni.env.SetObjectField(reference, _id_value, value.reference); @@ -2567,7 +2567,7 @@ r"(Lcom/github/dart_lang/jnigen/generics/MyMap;Ljava/lang/Object;Ljava/lang/Object;)V"); /// from: public void <init>(com.github.dart_lang.jnigen.generics.MyMap $parent, K key, V value) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyMap_MyEntry( MyMap<$K, $V> $parent, $K key, @@ -2655,7 +2655,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory MyStack({ required jni.JObjType<$T> T, }) { @@ -2671,7 +2671,7 @@ r"([Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> fromArray(T[] arr) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> fromArray<$T extends jni.JObject>( jni.JArray<$T> arr, { jni.JObjType<$T>? T, @@ -2691,7 +2691,7 @@ r"([[Lcom/github/dart_lang/jnigen/generics/GrandParent;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<S> fromArrayOfArrayOfGrandParents(com.github.dart_lang.jnigen.generics.GrandParent<S>[][] arr) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$S> fromArrayOfArrayOfGrandParents<$S extends jni.JObject>( jni.JArray<jni.JArray<GrandParent<$S>>> arr, { jni.JObjType<$S>? S, @@ -2713,7 +2713,7 @@ r"of", r"()Lcom/github/dart_lang/jnigen/generics/MyStack;"); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> of() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> of<$T extends jni.JObject>({ required jni.JObjType<$T> T, }) { @@ -2727,7 +2727,7 @@ r"(Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> of(T obj) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> of1<$T extends jni.JObject>( $T obj, { jni.JObjType<$T>? T, @@ -2748,7 +2748,7 @@ r"(Ljava/lang/Object;Ljava/lang/Object;)Lcom/github/dart_lang/jnigen/generics/MyStack;"); /// from: static public com.github.dart_lang.jnigen.generics.MyStack<T> of(T obj, T obj2) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static MyStack<$T> of2<$T extends jni.JObject>( $T obj, $T obj2, { @@ -2780,7 +2780,7 @@ .getMethodIDOf(_class.reference, r"pop", r"()Ljava/lang/Object;"); /// from: public T pop() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T pop() { return T.fromRef(jni.Jni.accessors.callMethodWithArgs( reference, _id_pop, jni.JniCallType.objectType, []).object); @@ -2854,7 +2854,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory StringKeyedMap({ required jni.JObjType<$V> V, }) { @@ -2916,7 +2916,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory StringMap() { return StringMap.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -2965,7 +2965,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory StringStack() { return StringStack.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -3024,7 +3024,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory StringValuedMap({ required jni.JObjType<$K> K, }) { @@ -3109,7 +3109,7 @@ r"(Ljava/lang/String;)Ljava/lang/String;"); /// from: public abstract java.lang.String stringCallback(java.lang.String s) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JString stringCallback( jni.JString s, ) { @@ -3126,7 +3126,7 @@ r"(Ljava/lang/Object;)Ljava/lang/Object;"); /// from: public abstract T varCallback(T t) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. $T varCallback( $T t, ) { @@ -3181,40 +3181,40 @@ $MethodInvocation $i, ) { try { - final $d = $i.methodDescriptor.toDartString(deleteOriginal: true); + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r"voidCallback(Ljava/lang/String;)V") { _$impls[$p]!.voidCallback( - $a[0].castTo(const jni.JStringType(), deleteOriginal: true), + $a[0].castTo(const jni.JStringType(), releaseOriginal: true), ); return jni.nullptr; } if ($d == r"stringCallback(Ljava/lang/String;)Ljava/lang/String;") { final $r = _$impls[$p]!.stringCallback( - $a[0].castTo(const jni.JStringType(), deleteOriginal: true), + $a[0].castTo(const jni.JStringType(), releaseOriginal: true), ); return ($r as jni.JObject).castTo(const jni.JObjectType()).toPointer(); } if ($d == r"varCallback(Ljava/lang/Object;)Ljava/lang/Object;") { final $r = _$impls[$p]!.varCallback( - $a[0].castTo(_$impls[$p]!.T, deleteOriginal: true), + $a[0].castTo(_$impls[$p]!.T, releaseOriginal: true), ); return ($r as jni.JObject).castTo(const jni.JObjectType()).toPointer(); } if ($d == r"manyPrimitives(IZCD)J") { final $r = _$impls[$p]!.manyPrimitives( $a[0] - .castTo(const jni.JIntegerType(), deleteOriginal: true) - .intValue(deleteOriginal: true), + .castTo(const jni.JIntegerType(), releaseOriginal: true) + .intValue(releaseOriginal: true), $a[1] - .castTo(const jni.JBooleanType(), deleteOriginal: true) - .booleanValue(deleteOriginal: true), + .castTo(const jni.JBooleanType(), releaseOriginal: true) + .booleanValue(releaseOriginal: true), $a[2] - .castTo(const jni.JCharacterType(), deleteOriginal: true) - .charValue(deleteOriginal: true), + .castTo(const jni.JCharacterType(), releaseOriginal: true) + .charValue(releaseOriginal: true), $a[3] - .castTo(const jni.JDoubleType(), deleteOriginal: true) - .doubleValue(deleteOriginal: true), + .castTo(const jni.JDoubleType(), releaseOriginal: true) + .doubleValue(releaseOriginal: true), ); return jni.JLong($r).toPointer(); } @@ -3358,7 +3358,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory MyInterfaceConsumer() { return MyInterfaceConsumer.fromRef(jni.Jni.accessors .newObjectWithArgs(_class.reference, _id_new0, []).object); @@ -3509,7 +3509,7 @@ $MethodInvocation $i, ) { try { - final $d = $i.methodDescriptor.toDartString(deleteOriginal: true); + final $d = $i.methodDescriptor.toDartString(releaseOriginal: true); final $a = $i.args; if ($d == r"run()V") { _$impls[$p]!.run(); @@ -3614,13 +3614,13 @@ ); /// from: public java.lang.Throwable error - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. jni.JObject get error => const jni.JObjectType().fromRef(jni.Jni.accessors .getField(reference, _id_error, jni.JniCallType.objectType) .object); /// from: public java.lang.Throwable error - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. set error(jni.JObject value) => jni.Jni.env.SetObjectField(reference, _id_error, value.reference); @@ -3628,7 +3628,7 @@ r"<init>", r"(Lcom/github/dart_lang/jnigen/interfaces/MyRunnable;)V"); /// from: public void <init>(com.github.dart_lang.jnigen.interfaces.MyRunnable runnable) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. factory MyRunnableRunner( MyRunnable runnable, ) { @@ -3701,7 +3701,7 @@ r"()[Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case[] values() - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static jni.JArray<JsonSerializable_Case> values() { return const jni.JArrayType($JsonSerializable_CaseType()).fromRef( jni.Jni.accessors.callStaticMethodWithArgs(_class.reference, _id_values, @@ -3714,7 +3714,7 @@ r"(Ljava/lang/String;)Lcom/github/dart_lang/jnigen/annotations/JsonSerializable$Case;"); /// from: static public com.github.dart_lang.jnigen.annotations.JsonSerializable.Case valueOf(java.lang.String name) - /// The returned object must be deleted after use, by calling the `delete` method. + /// The returned object must be released after use, by calling the [release] method. static JsonSerializable_Case valueOf( jni.JString name, ) { @@ -3769,7 +3769,7 @@ 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. + /// The returned object must be released after use, by calling the [release] method. factory MyDataClass() { return MyDataClass.fromRef(jni.Jni.accessors .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 07ed1d3..3791f9e 100644 --- a/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart +++ b/pkgs/jnigen/test/simple_package_test/runtime_test_registrant.dart
@@ -51,12 +51,12 @@ test('Static fields & methods - string', () { expect( - Example.getName().toDartString(deleteOriginal: true), + Example.getName().toDartString(releaseOriginal: true), isIn(["Ragnar Lothbrok", "Theseus"]), ); Example.setName("Theseus".toJString()); expect( - Example.getName().toDartString(deleteOriginal: true), + Example.getName().toDartString(releaseOriginal: true), equals("Theseus"), ); }); @@ -85,7 +85,7 @@ expect(e.getIsUp(), false); expect(e.getNumber(), 1); expect(e.getCodename().toDartString(), equals("spartan")); - e.delete(); + e.release(); }); test('Instance methods with several arguments', () { @@ -101,7 +101,7 @@ -trillion, -trillion, -trillion), equals(2 * -trillion), ); - e.delete(); + e.release(); }); test('Misc. instance methods', () { @@ -110,14 +110,14 @@ expect(rand.isNull, isFalse); final _ = e.getRandomLong(); final id = - e.getRandomNumericString(rand).toDartString(deleteOriginal: true); + e.getRandomNumericString(rand).toDartString(releaseOriginal: true); expect(int.parse(id), lessThan(10000)); e.setNumber(145); expect( e.getSelf().getSelf().getSelf().getSelf().getNumber(), equals(145), ); - e.delete(); + e.release(); }); test('Constructors', () { @@ -200,9 +200,9 @@ array[1] = ex2; expect(array[0].getNumber(), 1); expect(array[1].getNumber(), 2); - array.delete(); - ex1.delete(); - ex2.delete(); + array.release(); + ex1.release(); + ex2.release(); }); test("Check bindings for same-named classes", () { @@ -262,28 +262,31 @@ group('generics', () { test('GrandParent constructor', () { using((arena) { - final grandParent = GrandParent('Hello'.toJString()..deletedIn(arena)) - ..deletedIn(arena); + final grandParent = + GrandParent('Hello'.toJString()..releasedBy(arena)) + ..releasedBy(arena); expect(grandParent, isA<GrandParent<JString>>()); expect(grandParent.$type, isA<$GrandParentType<JString>>()); - expect(grandParent.value.toDartString(deleteOriginal: true), 'Hello'); + expect( + grandParent.value.toDartString(releaseOriginal: true), 'Hello'); }); }); test('MyStack<T>', () { using((arena) { - final stack = MyStack(T: JString.type)..deletedIn(arena); - stack.push('Hello'.toJString()..deletedIn(arena)); - stack.push('World'.toJString()..deletedIn(arena)); - expect(stack.pop().toDartString(deleteOriginal: true), 'World'); - expect(stack.pop().toDartString(deleteOriginal: true), 'Hello'); + final stack = MyStack(T: JString.type)..releasedBy(arena); + stack.push('Hello'.toJString()..releasedBy(arena)); + stack.push('World'.toJString()..releasedBy(arena)); + expect(stack.pop().toDartString(releaseOriginal: true), 'World'); + expect(stack.pop().toDartString(releaseOriginal: true), 'Hello'); }); }); test('Different stacks have different types, same stacks have same types', () { using((arena) { - final aStringStack = MyStack(T: JString.type)..deletedIn(arena); - final anotherStringStack = MyStack(T: JString.type)..deletedIn(arena); - final anObjectStack = MyStack(T: JObject.type)..deletedIn(arena); + final aStringStack = MyStack(T: JString.type)..releasedBy(arena); + final anotherStringStack = MyStack(T: JString.type) + ..releasedBy(arena); + final anObjectStack = MyStack(T: JObject.type)..releasedBy(arena); expect(aStringStack.$type, anotherStringStack.$type); expect( aStringStack.$type.hashCode, @@ -298,26 +301,29 @@ }); test('MyMap<K, V>', () { using((arena) { - final map = MyMap(K: JString.type, V: Example.type)..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); + final map = MyMap(K: JString.type, V: Example.type) + ..releasedBy(arena); + final helloExample = Example.new1(1)..releasedBy(arena); + final worldExample = Example.new1(2)..releasedBy(arena); + map.put('Hello'.toJString()..releasedBy(arena), helloExample); + map.put('World'.toJString()..releasedBy(arena), worldExample); expect( - (map.get0('Hello'.toJString()..deletedIn(arena))..deletedIn(arena)) + (map.get0('Hello'.toJString()..releasedBy(arena)) + ..releasedBy(arena)) .getNumber(), 1, ); expect( - (map.get0('World'.toJString()..deletedIn(arena))..deletedIn(arena)) + (map.get0('World'.toJString()..releasedBy(arena)) + ..releasedBy(arena)) .getNumber(), 2, ); expect( - ((map.entryStack()..deletedIn(arena)).pop()..deletedIn(arena)) + ((map.entryStack()..releasedBy(arena)).pop()..releasedBy(arena)) .key - .castTo(JString.type, deleteOriginal: true) - .toDartString(deleteOriginal: true), + .castTo(JString.type, releaseOriginal: true) + .toDartString(releaseOriginal: true), anyOf('Hello', 'World'), ); }); @@ -325,20 +331,20 @@ group('classes extending generics', () { test('StringStack', () { using((arena) { - final stringStack = StringStack()..deletedIn(arena); - stringStack.push('Hello'.toJString()..deletedIn(arena)); + final stringStack = StringStack()..releasedBy(arena); + stringStack.push('Hello'.toJString()..releasedBy(arena)); expect( - stringStack.pop().toDartString(deleteOriginal: true), 'Hello'); + stringStack.pop().toDartString(releaseOriginal: true), 'Hello'); }); }); test('StringKeyedMap', () { using((arena) { - final map = StringKeyedMap(V: Example.type)..deletedIn(arena); - final example = Example()..deletedIn(arena); - map.put('Hello'.toJString()..deletedIn(arena), example); + final map = StringKeyedMap(V: Example.type)..releasedBy(arena); + final example = Example()..releasedBy(arena); + map.put('Hello'.toJString()..releasedBy(arena), example); expect( - (map.get0('Hello'.toJString()..deletedIn(arena)) - ..deletedIn(arena)) + (map.get0('Hello'.toJString()..releasedBy(arena)) + ..releasedBy(arena)) .getNumber(), 0, ); @@ -346,24 +352,24 @@ }); test('StringValuedMap', () { using((arena) { - final map = StringValuedMap(K: Example.type)..deletedIn(arena); - final example = Example()..deletedIn(arena); - map.put(example, 'Hello'.toJString()..deletedIn(arena)); + final map = StringValuedMap(K: Example.type)..releasedBy(arena); + final example = Example()..releasedBy(arena); + map.put(example, 'Hello'.toJString()..releasedBy(arena)); expect( - map.get0(example).toDartString(deleteOriginal: true), + map.get0(example).toDartString(releaseOriginal: true), 'Hello', ); }); }); test('StringMap', () { using((arena) { - final map = StringMap()..deletedIn(arena); - map.put('hello'.toJString()..deletedIn(arena), - 'world'.toJString()..deletedIn(arena)); + final map = StringMap()..releasedBy(arena); + map.put('hello'.toJString()..releasedBy(arena), + 'world'.toJString()..releasedBy(arena)); expect( map - .get0('hello'.toJString()..deletedIn(arena)) - .toDartString(deleteOriginal: true), + .get0('hello'.toJString()..releasedBy(arena)) + .toDartString(releaseOriginal: true), 'world', ); }); @@ -379,51 +385,51 @@ test('nested generics', () { using((arena) { final grandParent = - GrandParent(T: JString.type, "!".toJString()..deletedIn(arena)) - ..deletedIn(arena); + GrandParent(T: JString.type, "!".toJString()..releasedBy(arena)) + ..releasedBy(arena); expect( - grandParent.value.toDartString(deleteOriginal: true), + grandParent.value.toDartString(releaseOriginal: true), "!", ); final strStaticParent = GrandParent.stringStaticParent() - ..deletedIn(arena); + ..releasedBy(arena); expect( - strStaticParent.value.toDartString(deleteOriginal: true), + strStaticParent.value.toDartString(releaseOriginal: true), "Hello", ); final exampleStaticParent = GrandParent.varStaticParent( - S: Example.type, Example()..deletedIn(arena)) - ..deletedIn(arena); + S: Example.type, Example()..releasedBy(arena)) + ..releasedBy(arena); expect( - (exampleStaticParent.value..deletedIn(arena)).getNumber(), + (exampleStaticParent.value..releasedBy(arena)).getNumber(), 0, ); - final strParent = grandParent.stringParent()..deletedIn(arena); + final strParent = grandParent.stringParent()..releasedBy(arena); expect( strParent.parentValue - .castTo(JString.type, deleteOriginal: true) - .toDartString(deleteOriginal: true), + .castTo(JString.type, releaseOriginal: true) + .toDartString(releaseOriginal: true), "!", ); expect( - strParent.value.toDartString(deleteOriginal: true), + strParent.value.toDartString(releaseOriginal: true), "Hello", ); final exampleParent = grandParent.varParent( - S: Example.type, Example()..deletedIn(arena)) - ..deletedIn(arena); + S: Example.type, Example()..releasedBy(arena)) + ..releasedBy(arena); expect( exampleParent.parentValue - .castTo(JString.type, deleteOriginal: true) - .toDartString(deleteOriginal: true), + .castTo(JString.type, releaseOriginal: true) + .toDartString(releaseOriginal: true), "!", ); expect( - (exampleParent.value..deletedIn(arena)).getNumber(), + (exampleParent.value..releasedBy(arena)).getNumber(), 0, ); // TODO(#139): test constructing Child, currently does not work due @@ -433,32 +439,32 @@ }); test('Constructing non-static nested classes', () { using((arena) { - final grandParent = GrandParent(1.toJInteger())..deletedIn(arena); + final grandParent = GrandParent(1.toJInteger())..releasedBy(arena); final parent = GrandParent_Parent(grandParent, 2.toJInteger()) - ..deletedIn(arena); + ..releasedBy(arena); final child = GrandParent_Parent_Child(parent, 3.toJInteger()) - ..deletedIn(arena); - expect(grandParent.value.intValue(deleteOriginal: true), 1); - expect(parent.parentValue.intValue(deleteOriginal: true), 1); - expect(parent.value.intValue(deleteOriginal: true), 2); - expect(child.grandParentValue.intValue(deleteOriginal: true), 1); - expect(child.parentValue.intValue(deleteOriginal: true), 2); - expect(child.value.intValue(deleteOriginal: true), 3); + ..releasedBy(arena); + expect(grandParent.value.intValue(releaseOriginal: true), 1); + expect(parent.parentValue.intValue(releaseOriginal: true), 1); + expect(parent.value.intValue(releaseOriginal: true), 2); + expect(child.grandParentValue.intValue(releaseOriginal: true), 1); + expect(child.parentValue.intValue(releaseOriginal: true), 2); + expect(child.value.intValue(releaseOriginal: true), 3); }); }); group('Generic type inference', () { test('MyStack.of1', () { using((arena) { - final emptyStack = MyStack(T: JString.type)..deletedIn(arena); + final emptyStack = MyStack(T: JString.type)..releasedBy(arena); expect(emptyStack.size(), 0); final stack = MyStack.of1( - "Hello".toJString()..deletedIn(arena), - )..deletedIn(arena); + "Hello".toJString()..releasedBy(arena), + )..releasedBy(arena); expect(stack, isA<MyStack<JString>>()); expect(stack.$type, isA<$MyStackType<JString>>()); expect( - stack.pop().toDartString(deleteOriginal: true), + stack.pop().toDartString(releaseOriginal: true), "Hello", ); }); @@ -466,56 +472,56 @@ test('MyStack.of 2 strings', () { using((arena) { final stack = MyStack.of2( - "Hello".toJString()..deletedIn(arena), - "World".toJString()..deletedIn(arena), - )..deletedIn(arena); + "Hello".toJString()..releasedBy(arena), + "World".toJString()..releasedBy(arena), + )..releasedBy(arena); expect(stack, isA<MyStack<JString>>()); expect(stack.$type, isA<$MyStackType<JString>>()); expect( - stack.pop().toDartString(deleteOriginal: true), + stack.pop().toDartString(releaseOriginal: true), "World", ); expect( - stack.pop().toDartString(deleteOriginal: true), + stack.pop().toDartString(releaseOriginal: true), "Hello", ); }); }); test('MyStack.of a string and an array', () { using((arena) { - final array = JArray.filled(1, "World".toJString()..deletedIn(arena)) - ..deletedIn(arena); + final array = JArray.filled(1, "World".toJString()..releasedBy(arena)) + ..releasedBy(arena); final stack = MyStack.of2( - "Hello".toJString()..deletedIn(arena), + "Hello".toJString()..releasedBy(arena), array, - )..deletedIn(arena); + )..releasedBy(arena); expect(stack, isA<MyStack<JObject>>()); expect(stack.$type, isA<$MyStackType<JObject>>()); expect( stack .pop() - .castTo(JArray.type(JString.type), deleteOriginal: true)[0] - .toDartString(deleteOriginal: true), + .castTo(JArray.type(JString.type), releaseOriginal: true)[0] + .toDartString(releaseOriginal: true), "World", ); expect( stack .pop() - .castTo(JString.type, deleteOriginal: true) - .toDartString(deleteOriginal: true), + .castTo(JString.type, releaseOriginal: true) + .toDartString(releaseOriginal: true), "Hello", ); }); }); test('MyStack.from array of string', () { using((arena) { - final array = JArray.filled(1, "Hello".toJString()..deletedIn(arena)) - ..deletedIn(arena); - final stack = MyStack.fromArray(array)..deletedIn(arena); + final array = JArray.filled(1, "Hello".toJString()..releasedBy(arena)) + ..releasedBy(arena); + final stack = MyStack.fromArray(array)..releasedBy(arena); expect(stack, isA<MyStack<JString>>()); expect(stack.$type, isA<$MyStackType<JString>>()); expect( - stack.pop().toDartString(deleteOriginal: true), + stack.pop().toDartString(releaseOriginal: true), "Hello", ); }); @@ -524,18 +530,18 @@ using((arena) { final firstDimention = JArray.filled( 1, - GrandParent("Hello".toJString()..deletedIn(arena)) - ..deletedIn(arena), - )..deletedIn(arena); + GrandParent("Hello".toJString()..releasedBy(arena)) + ..releasedBy(arena), + )..releasedBy(arena); final twoDimentionalArray = JArray.filled(1, firstDimention) - ..deletedIn(arena); + ..releasedBy(arena); final stack = MyStack.fromArrayOfArrayOfGrandParents(twoDimentionalArray) - ..deletedIn(arena); + ..releasedBy(arena); expect(stack, isA<MyStack<JString>>()); expect(stack.$type, isA<$MyStackType<JString>>()); expect( - stack.pop().toDartString(deleteOriginal: true), + stack.pop().toDartString(releaseOriginal: true), "Hello", ); }); @@ -561,11 +567,11 @@ voidCallbackResult.complete(s); }, stringCallback: (s) { - return (s.toDartString(deleteOriginal: true) * 2).toJString(); + return (s.toDartString(releaseOriginal: true) * 2).toJString(); }, varCallback: (JInteger t) { final result = - (t.intValue(deleteOriginal: true) * 2).toJInteger(); + (t.intValue(releaseOriginal: true) * 2).toJInteger(); varCallbackResult.complete(result); return result; }, @@ -600,7 +606,7 @@ 7.toJInteger(), ); final voidCallback = await voidCallbackResult.future; - expect(voidCallback.toDartString(deleteOriginal: true), 'hellohello'); + expect(voidCallback.toDartString(releaseOriginal: true), 'hellohello'); final varCallback = await varCallbackResult.future; expect(varCallback.intValue(), 14); @@ -610,7 +616,7 @@ // Currently we have one implementation of the interface. expect(MyInterface.$impls, hasLength(1)); - myInterface.delete(); + myInterface.release(); // Running System.gc() and waiting. _runJavaGC(); for (var i = 0; i < 8; ++i) { @@ -682,7 +688,7 @@ test('Create many JNI refs with scoped deletion', () { for (int i = 0; i < k256; i++) { using((arena) { - final e = Example.new1(i)..deletedIn(arena); + final e = Example.new1(i)..releasedBy(arena); expect(e.getNumber(), equals(i)); }); } @@ -691,7 +697,7 @@ for (int i = 0; i < 256; i++) { using((arena) { for (int i = 0; i < 1024; i++) { - final e = Example.new1(i)..deletedIn(arena); + final e = Example.new1(i)..releasedBy(arena); expect(e.getNumber(), equals(i)); } }); @@ -701,12 +707,12 @@ for (int i = 0; i < k256; i++) { final e = Example.new1(i); expect(e.getNumber(), equals(i)); - e.delete(); + e.release(); } }); test('Method returning primitive type does not create references', () { using((arena) { - final e = Example.new1(64)..deletedIn(arena); + final e = Example.new1(64)..releasedBy(arena); for (int i = 0; i < k256; i++) { expect(e.getNumber(), equals(64)); }