[jnigen] Remove array extensions from the generated code (https://github.com/dart-lang/jnigen/issues/217)
diff --git a/pkgs/jni/lib/src/jarray.dart b/pkgs/jni/lib/src/jarray.dart index d1e8ac4..92f05b4 100644 --- a/pkgs/jni/lib/src/jarray.dart +++ b/pkgs/jni/lib/src/jarray.dart
@@ -312,17 +312,17 @@ } extension ObjectArray<T extends JObject> on JArray<T> { - JObject operator [](int index) { - return JObject.fromRef(elementAt(index, JniCallType.objectType).object); + T operator [](int index) { + return (elementType as JObjType<T>) + .fromRef(elementAt(index, JniCallType.objectType).object); } - void operator []=(int index, JObject value) { + void operator []=(int index, T value) { RangeError.checkValidIndex(index, this); _env.SetObjectArrayElement(reference, index, value.reference); } - void setRange(int start, int end, Iterable<JObject> iterable, - [int skipCount = 0]) { + void setRange(int start, int end, Iterable<T> iterable, [int skipCount = 0]) { RangeError.checkValidRange(start, end, length); final size = end - start; final it = iterable.skip(skipCount).take(size); @@ -344,13 +344,3 @@ (this as JArray<JObject>)[index] = value; } } - -extension StringArray on JArray<JString> { - JString operator [](int index) { - return JString.fromRef(elementAt(index, JniCallType.objectType).object); - } - - void operator []=(int index, JString value) { - (this as JArray<JObject>)[index] = value; - } -}
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 75abb32..4030ba7 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart
@@ -60,17 +60,6 @@ AndroidUtils fromRef(jni.JObjectPtr ref) => AndroidUtils.fromRef(ref); } -extension $AndroidUtilsArray on jni.JArray<AndroidUtils> { - AndroidUtils operator [](int index) { - return (elementType as $AndroidUtilsType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, AndroidUtils value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: android.os.Build class Build extends jni.JObject { late final jni.JObjType? _$type; @@ -399,17 +388,6 @@ Build fromRef(jni.JObjectPtr ref) => Build.fromRef(ref); } -extension $BuildArray on jni.JArray<Build> { - Build operator [](int index) { - return (elementType as $BuildType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, Build value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: java.util.HashMap class HashMap<K extends jni.JObject, V extends jni.JObject> extends jni.JObject { @@ -795,15 +773,3 @@ @override HashMap<K, V> fromRef(jni.JObjectPtr ref) => HashMap.fromRef($K, $V, ref); } - -extension $HashMapArray<K extends jni.JObject, V extends jni.JObject> - on jni.JArray<HashMap<K, V>> { - HashMap<K, V> operator [](int index) { - return (elementType as $HashMapType<K, V>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, HashMap<K, V> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index f508dac..b6a9bca 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart
@@ -76,14 +76,3 @@ @override Example fromRef(jni.JObjectPtr ref) => Example.fromRef(ref); } - -extension $ExampleArray on jni.JArray<Example> { - Example operator [](int index) { - return (elementType as $ExampleType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, Example value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index 028904a..7d93c7c 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart
@@ -76,14 +76,3 @@ @override Notifications fromRef(jni.JObjectPtr ref) => Notifications.fromRef(ref); } - -extension $NotificationsArray on jni.JArray<Notifications> { - Notifications operator [](int index) { - return (elementType as $NotificationsType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, Notifications value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
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 15e060e..ebafa96 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
@@ -1332,14 +1332,3 @@ @override PDDocument fromRef(jni.JObjectPtr ref) => PDDocument.fromRef(ref); } - -extension $PDDocumentArray on jni.JArray<PDDocument> { - PDDocument operator [](int index) { - return (elementType as $PDDocumentType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, PDDocument value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
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 30e4076..bcb2655 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
@@ -450,14 +450,3 @@ PDDocumentInformation fromRef(jni.JObjectPtr ref) => PDDocumentInformation.fromRef(ref); } - -extension $PDDocumentInformationArray on jni.JArray<PDDocumentInformation> { - PDDocumentInformation operator [](int index) { - return (elementType as $PDDocumentInformationType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, PDDocumentInformation value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
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 aff6055..ccf668b 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
@@ -1234,14 +1234,3 @@ @override PDFTextStripper fromRef(jni.JObjectPtr ref) => PDFTextStripper.fromRef(ref); } - -extension $PDFTextStripperArray on jni.JArray<PDFTextStripper> { - PDFTextStripper operator [](int index) { - return (elementType as $PDFTextStripperType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, PDFTextStripper value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index db53275..56fff02 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart
@@ -256,9 +256,6 @@ static const staticTypeGetter = 'type'; static const instanceTypeGetter = '\$$staticTypeGetter'; - static const arrayExtensionPrefix = '\$'; - static const arrayExtensionSuffix = 'Array'; - @override void visit(ClassDecl node) { final isDartOnly = @@ -389,20 +386,6 @@ } '''); - - // Array extension - s.write(''' -extension $arrayExtensionPrefix$name$arrayExtensionSuffix$typeParamsDef on $_jArray<$name$typeParamsCall> { - $name$typeParamsCall operator [](int index) { - return (elementType as $typeClassName$typeParamsCall) - .fromRef(elementAt(index, $_jni.JniCallType.objectType).object); - } - - void operator []=(int index, $name$typeParamsCall value) { - (this as $_jArray<$_jObject>)[index] = value; - } -} -'''); log.finest('Generated bindings for class ${node.binaryName}'); } }
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart index 899ab00..7ce9e77 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonFactory.dart
@@ -1539,17 +1539,6 @@ JsonFactory fromRef(jni.JObjectPtr ref) => JsonFactory.fromRef(ref); } -extension $JsonFactoryArray on jni.JArray<JsonFactory> { - JsonFactory operator [](int index) { - return (elementType as $JsonFactoryType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonFactory value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.fasterxml.jackson.core.JsonFactory$Feature /// /// Enumeration that defines all on/off features that can only be @@ -1636,14 +1625,3 @@ JsonFactory_Feature fromRef(jni.JObjectPtr ref) => JsonFactory_Feature.fromRef(ref); } - -extension $JsonFactory_FeatureArray on jni.JArray<JsonFactory_Feature> { - JsonFactory_Feature operator [](int index) { - return (elementType as $JsonFactory_FeatureType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonFactory_Feature value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart index ee9ceff..1f71c76 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonParser.dart
@@ -2215,17 +2215,6 @@ JsonParser fromRef(jni.JObjectPtr ref) => JsonParser.fromRef(ref); } -extension $JsonParserArray on jni.JArray<JsonParser> { - JsonParser operator [](int index) { - return (elementType as $JsonParserType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonParser value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.fasterxml.jackson.core.JsonParser$Feature /// /// Enumeration that defines all on/off features for parsers. @@ -2312,17 +2301,6 @@ JsonParser_Feature.fromRef(ref); } -extension $JsonParser_FeatureArray on jni.JArray<JsonParser_Feature> { - JsonParser_Feature operator [](int index) { - return (elementType as $JsonParser_FeatureType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonParser_Feature value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.fasterxml.jackson.core.JsonParser$NumberType /// /// Enumeration of possible "native" (optimal) types that can be @@ -2374,14 +2352,3 @@ JsonParser_NumberType fromRef(jni.JObjectPtr ref) => JsonParser_NumberType.fromRef(ref); } - -extension $JsonParser_NumberTypeArray on jni.JArray<JsonParser_NumberType> { - JsonParser_NumberType operator [](int index) { - return (elementType as $JsonParser_NumberTypeType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonParser_NumberType value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart index 84d23d7..6f3e8b4 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/lib/com/fasterxml/jackson/core/JsonToken.dart
@@ -187,14 +187,3 @@ @override JsonToken fromRef(jni.JObjectPtr ref) => JsonToken.fromRef(ref); } - -extension $JsonTokenArray on jni.JArray<JsonToken> { - JsonToken operator [](int index) { - return (elementType as $JsonTokenType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonToken value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/test/kotlin_test/lib/kotlin.dart b/pkgs/jnigen/test/kotlin_test/lib/kotlin.dart index 7546ded..5d11a17 100644 --- a/pkgs/jnigen/test/kotlin_test/lib/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/lib/kotlin.dart
@@ -104,14 +104,3 @@ @override SuspendFun fromRef(jni.JObjectPtr ref) => SuspendFun.fromRef(ref); } - -extension $SuspendFunArray on jni.JArray<SuspendFun> { - SuspendFun operator [](int index) { - return (elementType as $SuspendFunType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, SuspendFun value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}
diff --git a/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart b/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart index c38553f..aca99d9 100644 --- a/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/lib/simple_package.dart
@@ -208,17 +208,6 @@ Example fromRef(jni.JObjectPtr ref) => Example.fromRef(ref); } -extension $ExampleArray on jni.JArray<Example> { - Example operator [](int index) { - return (elementType as $ExampleType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, Example value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.simple_package.Example$Aux class Example_Aux extends jni.JObject { late final jni.JObjType? _$type; @@ -292,17 +281,6 @@ Example_Aux fromRef(jni.JObjectPtr ref) => Example_Aux.fromRef(ref); } -extension $Example_AuxArray on jni.JArray<Example_Aux> { - Example_Aux operator [](int index) { - return (elementType as $Example_AuxType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, Example_Aux value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.pkg2.C2 class C2 extends jni.JObject { late final jni.JObjType? _$type; @@ -350,17 +328,6 @@ C2 fromRef(jni.JObjectPtr ref) => C2.fromRef(ref); } -extension $C2Array on jni.JArray<C2> { - C2 operator [](int index) { - return (elementType as $C2Type) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, C2 value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.pkg2.Example class Example1 extends jni.JObject { late final jni.JObjType? _$type; @@ -401,17 +368,6 @@ Example1 fromRef(jni.JObjectPtr ref) => Example1.fromRef(ref); } -extension $Example1Array on jni.JArray<Example1> { - Example1 operator [](int index) { - return (elementType as $Example1Type) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, Example1 value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.GrandParent class GrandParent<T extends jni.JObject> extends jni.JObject { late final jni.JObjType? _$type; @@ -548,18 +504,6 @@ GrandParent<T> fromRef(jni.JObjectPtr ref) => GrandParent.fromRef($T, ref); } -extension $GrandParentArray<T extends jni.JObject> - on jni.JArray<GrandParent<T>> { - GrandParent<T> operator [](int index) { - return (elementType as $GrandParentType<T>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, GrandParent<T> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.GrandParent$Parent class GrandParent_Parent<T extends jni.JObject, S extends jni.JObject> extends jni.JObject { @@ -672,18 +616,6 @@ GrandParent_Parent.fromRef($T, $S, ref); } -extension $GrandParent_ParentArray<T extends jni.JObject, S extends jni.JObject> - on jni.JArray<GrandParent_Parent<T, S>> { - GrandParent_Parent<T, S> operator [](int index) { - return (elementType as $GrandParent_ParentType<T, S>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, GrandParent_Parent<T, S> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.GrandParent$Parent$Child class GrandParent_Parent_Child<T extends jni.JObject, S extends jni.JObject, U extends jni.JObject> extends jni.JObject { @@ -836,20 +768,6 @@ GrandParent_Parent_Child.fromRef($T, $S, $U, ref); } -extension $GrandParent_Parent_ChildArray< - T extends jni.JObject, - S extends jni.JObject, - U extends jni.JObject> on jni.JArray<GrandParent_Parent_Child<T, S, U>> { - GrandParent_Parent_Child<T, S, U> operator [](int index) { - return (elementType as $GrandParent_Parent_ChildType<T, S, U>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, GrandParent_Parent_Child<T, S, U> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.GrandParent$StaticParent class GrandParent_StaticParent<S extends jni.JObject> extends jni.JObject { late final jni.JObjType? _$type; @@ -927,18 +845,6 @@ GrandParent_StaticParent.fromRef($S, ref); } -extension $GrandParent_StaticParentArray<S extends jni.JObject> - on jni.JArray<GrandParent_StaticParent<S>> { - GrandParent_StaticParent<S> operator [](int index) { - return (elementType as $GrandParent_StaticParentType<S>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, GrandParent_StaticParent<S> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.GrandParent$StaticParent$Child class GrandParent_StaticParent_Child<S extends jni.JObject, U extends jni.JObject> extends jni.JObject { @@ -1054,18 +960,6 @@ GrandParent_StaticParent_Child.fromRef($S, $U, ref); } -extension $GrandParent_StaticParent_ChildArray<S extends jni.JObject, - U extends jni.JObject> on jni.JArray<GrandParent_StaticParent_Child<S, U>> { - GrandParent_StaticParent_Child<S, U> operator [](int index) { - return (elementType as $GrandParent_StaticParent_ChildType<S, U>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, GrandParent_StaticParent_Child<S, U> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.MyMap class MyMap<K extends jni.JObject, V extends jni.JObject> extends jni.JObject { late final jni.JObjType? _$type; @@ -1156,18 +1050,6 @@ MyMap<K, V> fromRef(jni.JObjectPtr ref) => MyMap.fromRef($K, $V, ref); } -extension $MyMapArray<K extends jni.JObject, V extends jni.JObject> - on jni.JArray<MyMap<K, V>> { - MyMap<K, V> operator [](int index) { - return (elementType as $MyMapType<K, V>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, MyMap<K, V> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.MyMap$MyEntry class MyMap_MyEntry<K extends jni.JObject, V extends jni.JObject> extends jni.JObject { @@ -1279,18 +1161,6 @@ MyMap_MyEntry.fromRef($K, $V, ref); } -extension $MyMap_MyEntryArray<K extends jni.JObject, V extends jni.JObject> - on jni.JArray<MyMap_MyEntry<K, V>> { - MyMap_MyEntry<K, V> operator [](int index) { - return (elementType as $MyMap_MyEntryType<K, V>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, MyMap_MyEntry<K, V> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.MyStack class MyStack<T extends jni.JObject> extends jni.JObject { late final jni.JObjType? _$type; @@ -1356,17 +1226,6 @@ MyStack<T> fromRef(jni.JObjectPtr ref) => MyStack.fromRef($T, ref); } -extension $MyStackArray<T extends jni.JObject> on jni.JArray<MyStack<T>> { - MyStack<T> operator [](int index) { - return (elementType as $MyStackType<T>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, MyStack<T> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.StringKeyedMap class StringKeyedMap<V extends jni.JObject> extends MyMap<jni.JString, V> { late final jni.JObjType? _$type; @@ -1416,18 +1275,6 @@ StringKeyedMap.fromRef($V, ref); } -extension $StringKeyedMapArray<V extends jni.JObject> - on jni.JArray<StringKeyedMap<V>> { - StringKeyedMap<V> operator [](int index) { - return (elementType as $StringKeyedMapType<V>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, StringKeyedMap<V> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.StringStack class StringStack extends MyStack<jni.JString> { late final jni.JObjType? _$type; @@ -1459,17 +1306,6 @@ StringStack fromRef(jni.JObjectPtr ref) => StringStack.fromRef(ref); } -extension $StringStackArray on jni.JArray<StringStack> { - StringStack operator [](int index) { - return (elementType as $StringStackType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, StringStack value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.generics.StringValuedMap class StringValuedMap<K extends jni.JObject> extends MyMap<K, jni.JString> { late final jni.JObjType? _$type; @@ -1519,18 +1355,6 @@ StringValuedMap.fromRef($K, ref); } -extension $StringValuedMapArray<K extends jni.JObject> - on jni.JArray<StringValuedMap<K>> { - StringValuedMap<K> operator [](int index) { - return (elementType as $StringValuedMapType<K>) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, StringValuedMap<K> value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.annotations.JsonSerializable$Case class JsonSerializable_Case extends jni.JObject { late final jni.JObjType? _$type; @@ -1579,17 +1403,6 @@ JsonSerializable_Case.fromRef(ref); } -extension $JsonSerializable_CaseArray on jni.JArray<JsonSerializable_Case> { - JsonSerializable_Case operator [](int index) { - return (elementType as $JsonSerializable_CaseType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, JsonSerializable_Case value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -} - /// from: com.github.dart_lang.jnigen.annotations.MyDataClass class MyDataClass extends jni.JObject { late final jni.JObjType? _$type; @@ -1621,14 +1434,3 @@ @override MyDataClass fromRef(jni.JObjectPtr ref) => MyDataClass.fromRef(ref); } - -extension $MyDataClassArray on jni.JArray<MyDataClass> { - MyDataClass operator [](int index) { - return (elementType as $MyDataClassType) - .fromRef(elementAt(index, jni.JniCallType.objectType).object); - } - - void operator []=(int index, MyDataClass value) { - (this as jni.JArray<jni.JObject>)[index] = value; - } -}