Jni.accessors.Jni.env methods into leaf functions to speed up their execution.kotlin_gradle_plugin.JObject.castTo where the type checking could fail in debug mode.package:dart_flutter_team_lints.jvm.DetachNativeThread is called when the thread detaches as recommended here.JValueChar.fromString constructor.minSdk to 21.operator [] of JArray<jchar> to int instead of String. Similarly, change the argument type of operator []= to accept int.getRange method to JArray of primitive types that returns a TypedData list depending on the kind of the array.JArray's setRange and operator []=.Breaking Change (#981):
JObject.reference now returns a JReference instead of Pointer<Void>.
.fromRef constructors are now called .fromReference and they take a JReference instead of Pointer<Void>.
JObject reflective field retrieving and method calling methods are removed. Use JClass API instead.
The following Jni.accessors methods have been removed:
getClassOfgetMethodIDOfgetStaticMethodIDOfgetFieldIDOfgetStaticFieldIDOfnewObjectWithArgscallMethodWithArgscallStaticMethodWithArgsInstead use the JClass API.
Jni.findJClass is replaced with JClass.forName(String name)
JClass has been refactored. Instead of directly calling methods, getting and setting fields, use JClass.instanceMethodId, JClass.staticMethodId, JClass.constructorId, JClass.instanceFieldId, and JClass.staticFieldId to first get access to the member.
Renamed JObject.getClass() to JObject.jClass.
Removed Jni.deleteAllRefs.
Breaking Change (#548): Converted various Exceptions into Errors:
UseAfterReleaseException -> UseAfterReleaseErrorDoubleReleaseException -> DoubleReleaseErrorSpawnException -> JniError (It's now a sealed class)JNullException -> JNullErrorInvalidCallTypeException -> InvalidCallTypeErrorHelperNotFoundException -> HelperNotFoundErrorJvmExistsException -> JniVmExistsErrorNoJvmInstanceException -> NoJvmInstanceErrorBreaking Change: Removed InvalidJStringException.
Breaking Change: JType is now sealed.
Breaking Change: Primitive types and their type classes are now final.
Breaking Change: JArray.filled now uses the generated type class of the fill object and not its Java runtime type.
JObjects now check the types using instanceof in debug mode when using castTo.
Breaking Change: Jni.initDLApi() is removed.
Added the ability to share JObjects across isolates.
// This now works. final foo = 'foo'.toJString(); Isolate.run(() { // `foo` is usable from another isolate. print(foo); });
get(Static)MethodID and get(Static)FieldID could access null and throw.package:dart_flutter_team_lints.JBuffer and JByteBuffer classes as default classes for java.nio.Buffer and java.nio.ByteBuffer respectively.final.addAll, removeAll and retainAll in JSet would run their respective operation twice.JList.insertAll would not throw the potentially thrown Java exception.delete* to release*.PortProxy and related methods used for interface implementation.java.lang.Character.jint, jshort, ...java.util.Set, java.util.Map, java.util.List and the numeric types like java.lang.Integer, java.lang.Boolean, ... are now included in package:jni.superCount and superType getters used for type inference.PortContinuation used for suspend fun in Kotlin.dartjni now depends on dart_api_dl.h..clang-format to pub.JniX turned into JX for a more terse code.