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 329e5443e5..1854b3c5c0 100644 --- a/pkgs/jnigen/example/in_app_java/lib/android_utils.dart +++ b/pkgs/jnigen/example/in_app_java/lib/android_utils.dart @@ -5,6 +5,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -782,7 +783,7 @@ class EmojiCompat$Config extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, int, jni$_.Pointer)>(); - /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z, java.util.List list)` + /// from: `public androidx.emoji2.text.EmojiCompat$Config setUseEmojiAsDefaultStyle(boolean z, java.util.List list)` /// The returned object must be released after use, by calling the [release] method. EmojiCompat$Config setUseEmojiAsDefaultStyle$1( bool z, @@ -3737,7 +3738,7 @@ class DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper jni$_.Pointer, int)>(); - /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` + /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList queryIntentContentProviders( jni$_.JObject packageManager, @@ -3949,7 +3950,7 @@ class DefaultEmojiCompatConfig$DefaultEmojiCompatConfigHelper_API19 jni$_.Pointer, int)>(); - /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` + /// from: `public java.util.List queryIntentContentProviders(android.content.pm.PackageManager packageManager, android.content.Intent intent, int i)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList queryIntentContentProviders( jni$_.JObject packageManager, @@ -5448,7 +5449,7 @@ class Build extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public java.util.List getFingerprintedPartitions()` + /// from: `static public java.util.List getFingerprintedPartitions()` /// The returned object must be released after use, by calling the [release] method. static jni$_.JList? getFingerprintedPartitions() { return _getFingerprintedPartitions(_class.reference.pointer, @@ -5703,7 +5704,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void (java.util.Map map)` + /// from: `public void (java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. factory HashMap.new$3( jni$_.JMap<$K?, $V?>? map, { @@ -5868,7 +5869,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JThrowablePtr Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void putAll(java.util.Map map)` + /// from: `public void putAll(java.util.Map map)` void putAll( jni$_.JMap<$K?, $V?>? map, ) { @@ -5969,7 +5970,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.Set keySet()` + /// from: `public java.util.Set keySet()` /// The returned object must be released after use, by calling the [release] method. jni$_.JSet<$K?>? keySet() { return _keySet(reference.pointer, _id_keySet as jni$_.JMethodIDPtr) @@ -5993,7 +5994,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.Collection values()` + /// from: `public java.util.Collection values()` /// The returned object must be released after use, by calling the [release] method. jni$_.JObject? values() { return _values(reference.pointer, _id_values as jni$_.JMethodIDPtr) @@ -6017,7 +6018,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.Set entrySet()` + /// from: `public java.util.Set> entrySet()` /// The returned object must be released after use, by calling the [release] method. jni$_.JSet? entrySet() { return _entrySet(reference.pointer, _id_entrySet as jni$_.JMethodIDPtr) @@ -6231,7 +6232,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public V computeIfAbsent(K object, java.util.function.Function function)` + /// from: `public V computeIfAbsent(K object, java.util.function.Function function)` /// The returned object must be released after use, by calling the [release] method. $V? computeIfAbsent( $K? object, @@ -6269,7 +6270,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public V computeIfPresent(K object, java.util.function.BiFunction biFunction)` + /// from: `public V computeIfPresent(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V? computeIfPresent( $K? object, @@ -6307,7 +6308,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public V compute(K object, java.util.function.BiFunction biFunction)` + /// from: `public V compute(K object, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V? compute( $K? object, @@ -6344,7 +6345,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public V merge(K object, V object1, java.util.function.BiFunction biFunction)` + /// from: `public V merge(K object, V object1, java.util.function.BiFunction biFunction)` /// The returned object must be released after use, by calling the [release] method. $V? merge( $K? object, @@ -6375,7 +6376,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JThrowablePtr Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void forEach(java.util.function.BiConsumer biConsumer)` + /// from: `public void forEach(java.util.function.BiConsumer biConsumer)` void forEach( jni$_.JObject? biConsumer, ) { @@ -6401,7 +6402,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JThrowablePtr Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void replaceAll(java.util.function.BiFunction biFunction)` + /// from: `public void replaceAll(java.util.function.BiFunction biFunction)` void replaceAll( jni$_.JObject? biFunction, ) { @@ -6449,7 +6450,7 @@ class HashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `static public java.util.HashMap newHashMap(int i)` + /// from: `static public java.util.HashMap newHashMap(int i)` /// The returned object must be released after use, by calling the [release] method. static HashMap<$K?, $V?>? newHashMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?>( diff --git a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart index 4482cf64c1..aaae1ce6f8 100644 --- a/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart +++ b/pkgs/jnigen/example/kotlin_plugin/lib/kotlin_bindings.dart @@ -5,6 +5,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -92,7 +93,7 @@ class Example extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)` + /// from: `public final java.lang.Object thinkBeforeAnswering(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. core$_.Future thinkBeforeAnswering() async { final $p = jni$_.ReceivePort(); diff --git a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart index ff92d0ae3e..dd5ac4b8fe 100644 --- a/pkgs/jnigen/example/notification_plugin/lib/notifications.dart +++ b/pkgs/jnigen/example/notification_plugin/lib/notifications.dart @@ -9,6 +9,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter 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 2ff9f4e29b..9b0662c333 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 @@ -23,6 +23,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter 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 c15971f0f1..d416020d8c 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 @@ -23,6 +23,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter 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 d1048dbc10..76805d2890 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 @@ -23,6 +23,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter diff --git a/pkgs/jnigen/lib/src/bindings/dart_generator.dart b/pkgs/jnigen/lib/src/bindings/dart_generator.dart index 46715b4a71..4cea21931a 100644 --- a/pkgs/jnigen/lib/src/bindings/dart_generator.dart +++ b/pkgs/jnigen/lib/src/bindings/dart_generator.dart @@ -67,12 +67,12 @@ extension on String { extension on DeclaredType { List mapTypeParameters( - T Function(bool isNullable, TypeUsage definedType) mapper, + T Function(bool isNullable, ReferredType definedType) mapper, ) { final result = []; final offset = classDecl.allTypeParams.length - params.length; for (var i = 0; i < classDecl.allTypeParams.length; ++i) { - final param = i >= offset ? params[i - offset] : TypeUsage.object; + final param = i >= offset ? params[i - offset] : DeclaredType.object; result.add(mapper(classDecl.allTypeParams[i].isNullable, param)); } return result; @@ -157,6 +157,7 @@ import 'package:jni/jni.dart' as $_jni; // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -387,7 +388,7 @@ ${modifier}final $classRef = $_jni.JClass.forName(r'$internalName'); final ctorTypeClassesDef = typeParams .map((typeParam) => 'this.$typeParam,') .join(_newLine(depth: 2)); - final superClass = node.classDecl.superclass!.type as DeclaredType; + final superClass = node.classDecl.superclass! as DeclaredType; final superTypeClassesCall = superClass.classDecl.isObject ? '' : superClass.params @@ -666,16 +667,12 @@ final class _$implClassName$typeParamsDef with $implClassName$typeParamsCall { annotations: [Annotation.nullable], params: node.allTypeParams .map( - (typeParam) => TypeUsage( - shorthand: '', - kind: Kind.typeVariable, - typeJson: {}, - )..type = (TypeVar(name: typeParam.name) + (typeParam) => TypeVar(name: typeParam.name) ..origin = TypeParam( name: typeParam.name, annotations: [Annotation.nonNull], bounds: typeParam.bounds, - )), + ), ) .toList(), )..classDecl = node) @@ -818,7 +815,7 @@ class _TypeGenerator extends TypeVisitor { arrayType: true, isTopTypeNullable: true, ); - if (innerType.kind == Kind.primitive) { + if (innerType is PrimitiveType) { return '$_jni.J${innerType.accept(typeGenerator)}Array$nullable'; } return '$_jArray<${innerType.accept(typeGenerator)}>$nullable'; @@ -973,7 +970,7 @@ class _TypeClassGenerator extends TypeVisitor<_TypeClass> { final type = includeNullability && node.isNullable && isTopTypeNullable ? 'NullableType' : 'Type'; - if (node.elementType.kind == Kind.primitive) { + if (node.elementType is PrimitiveType) { return _TypeClass( '$ifConst$_jni.J${innerType}Array$type()', innerTypeClass.canBeConst, @@ -1222,9 +1219,9 @@ ${modifier}final _id_$name = } void writeDocs(Field node, {required bool writeReleaseInstructions}) { - final originalDecl = '${node.type.shorthand} ${node.name}'; + final originalDecl = '${node.type} ${node.name}'; s.writeln(' /// from: `${node.modifiers.join(' ')} $originalDecl`'); - if (node.type.kind != Kind.primitive && writeReleaseInstructions) { + if (node.type is! PrimitiveType && writeReleaseInstructions) { s.writeln(_releaseInstruction); } node.javadoc?.accept(_DocGenerator(s, depth: 1)); @@ -1369,10 +1366,10 @@ ${modifier}final _$name = $_protectedExtension // Docs s.write(' /// from: `'); s.writeAll(node.modifiers.map((m) => '$m ')); - s.write('${node.returnType.shorthand} ${node.name}('); - s.writeAll(node.params.map((p) => '${p.type.shorthand} ${p.name}'), ', '); + s.write('${node.returnType} ${node.name}('); + s.writeAll(node.params.map((p) => '${p.type} ${p.name}'), ', '); s.writeln(')`'); - if (node.returnType.kind != Kind.primitive || node.isConstructor) { + if (node.returnType is! PrimitiveType || node.isConstructor) { s.writeln(_releaseInstruction); } node.javadoc?.accept(_DocGenerator(s, depth: 1)); @@ -1584,7 +1581,7 @@ class _ParamReference extends Visitor { @override String visit(Param node) { - if (node.type.kind == Kind.primitive) { + if (node.type is PrimitiveType) { return ''; } final nullable = node.isNullable ? '?' : ''; @@ -1606,7 +1603,7 @@ class _ParamCall extends Visitor { @override String visit(Param node) { final nativeSuffix = node.type.accept(const _ToNativeSuffix()); - final nonPrimitive = node.type.kind == Kind.primitive ? '' : r'_$'; + final nonPrimitive = node.type is PrimitiveType ? '' : r'_$'; final paramCall = '$nonPrimitive${node.finalName}$nativeSuffix'; return paramCall; } @@ -1945,12 +1942,11 @@ class _InterfaceParamCast extends Visitor { ), ) .name; - final nullable = - node.isNullable && node.type.kind != Kind.primitive ? '?' : '!'; + final nullable = node.isNullable && node.type is! PrimitiveType ? '?' : '!'; s.write('\$a![$paramIndex]$nullable.as($typeClass, releaseOriginal: true)'); - if (node.type.kind == Kind.primitive) { + if (node.type is PrimitiveType) { // Convert to Dart type. - final name = (node.type.type as PrimitiveType).name; + final name = node.type.name; s.write('.${name}Value(releaseOriginal: true)'); } s.writeln(','); @@ -2000,8 +1996,8 @@ class _CallMethodName extends Visitor { return 'globalEnv_NewObject'; } final String type; - if (node.returnType.kind == Kind.primitive) { - type = (node.returnType.type as PrimitiveType).name.capitalize(); + if (node.returnType is PrimitiveType) { + type = node.returnType.name.capitalize(); } else { type = 'Object'; } diff --git a/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart b/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart index e6e0527b6b..f020f7049d 100644 --- a/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart +++ b/pkgs/jnigen/lib/src/bindings/kotlin_processor.dart @@ -147,23 +147,23 @@ class _KotlinMethodProcessor extends Visitor { if (function.isSuspend) { const kotlinContinutationType = 'kotlin.coroutines.Continuation'; assert(node.params.isNotEmpty && - node.params.last.type.kind == Kind.declared && + node.params.last.type is DeclaredType && node.params.last.type.name == kotlinContinutationType); var continuationType = - (node.params.last.type.type as DeclaredType).params.firstOrNull; + (node.params.last.type as DeclaredType).params.firstOrNull; if (continuationType != null && - continuationType.kind == Kind.wildcard && - (continuationType.type as Wildcard).superBound != null) { - continuationType = (continuationType.type as Wildcard).superBound!; + continuationType is Wildcard && + continuationType.superBound != null) { + continuationType = continuationType.superBound!; } node.asyncReturnType = continuationType == null - ? TypeUsage.object + ? DeclaredType.object : continuationType.clone(); node.asyncReturnType!.accept(_KotlinTypeProcessor(function.returnType)); // The continuation object is always non-null. - node.returnType.type.annotations ??= []; - node.returnType.type.annotations!.add(Annotation.nonNull); + node.returnType.annotations ??= []; + node.returnType.annotations!.add(Annotation.nonNull); } else { node.returnType.accept(_KotlinTypeProcessor(function.returnType)); } diff --git a/pkgs/jnigen/lib/src/bindings/linker.dart b/pkgs/jnigen/lib/src/bindings/linker.dart index 39f85db839..4133c337ff 100644 --- a/pkgs/jnigen/lib/src/bindings/linker.dart +++ b/pkgs/jnigen/lib/src/bindings/linker.dart @@ -66,11 +66,10 @@ class Linker extends Visitor> with TopLevelVisitor { ClassDecl resolve(String? binaryName) { return config.importedClasses[binaryName] ?? node.decls[binaryName] ?? - resolve(TypeUsage.object.name); + resolve(DeclaredType.object.name); } - (TypeUsage.object.type as DeclaredType).classDecl = - resolve(TypeUsage.object.name); + DeclaredType.object.classDecl = resolve(DeclaredType.object.name); final classLinker = _ClassLinker( config, resolve, @@ -117,9 +116,9 @@ class _ClassLinker extends Visitor { } final typeLinker = _TypeLinker(resolve, typeVarOrigin); - node.superclass ??= TypeUsage.object; - node.superclass!.type.accept(typeLinker); - final superclass = (node.superclass!.type as DeclaredType).classDecl; + node.superclass ??= DeclaredType.object; + node.superclass!.accept(typeLinker); + final superclass = (node.superclass! as DeclaredType).classDecl; superclass.accept(this); final methodSignatures = {}; @@ -136,7 +135,7 @@ class _ClassLinker extends Visitor { } for (final interface in node.interfaces) { interface.accept(typeLinker); - if (interface.type case final DeclaredType interfaceType) { + if (interface case final DeclaredType interfaceType) { interfaceType.classDecl.accept(this); for (final interfaceMethod in interfaceType.classDecl.methods) { final clonedMethod = @@ -189,10 +188,8 @@ class _MethodLinker extends Visitor { final outerClassTypeParams = [ for (final typeParam in node.classDecl.allTypeParams.take(outerClassTypeParamCount)) ...[ - TypeUsage( - shorthand: typeParam.name, kind: Kind.typeVariable, typeJson: {}) - ..type = (TypeVar(name: typeParam.name) - ..annotations = [if (typeParam.hasNonNull) Annotation.nonNull]), + TypeVar(name: typeParam.name) + ..annotations = [if (typeParam.hasNonNull) Annotation.nonNull], ] ]; final outerClassType = DeclaredType( @@ -201,12 +198,7 @@ class _MethodLinker extends Visitor { // `$outerClass` parameter must not be null. annotations: [Annotation.nonNull], ); - final outerClassTypeUsage = TypeUsage( - shorthand: outerClassType.binaryName, - kind: Kind.declared, - typeJson: {}, - )..type = outerClassType; - final param = Param(name: '\$outerClass', type: outerClassTypeUsage); + final param = Param(name: '\$outerClass', type: outerClassType); final usedDoclet = node.descriptor == null; // For now the nullity of [node.descriptor] identifies if the doclet // backend was used and the method would potentially need "unnesting". @@ -232,10 +224,10 @@ class _MethodLinker extends Visitor { // If the type itself does not have nullability annotations, use the // parent's nullability annotations. Some annotations such as // `androidx.annotation.NonNull` only get applied to elements but not types. - if (!node.returnType.type.hasNullabilityAnnotations && + if (!node.returnType.hasNullabilityAnnotations && node.hasNullabilityAnnotations) { - node.returnType.type.annotations = [ - ...?node.returnType.type.annotations, + node.returnType.annotations = [ + ...?node.returnType.annotations, ...?node.annotations, ]; } @@ -259,8 +251,8 @@ class _MethodLinker extends Visitor { } // Fill out compareTo method of the class used for comparison operators. if (node.name == 'compareTo' && node.params.length == 1) { - final returnType = node.returnType.type; - final parameterType = node.params.single.type.type; + final returnType = node.returnType; + final parameterType = node.params.single.type; if (parameterType is DeclaredType && parameterType.binaryName == node.classDecl.binaryName && returnType is PrimitiveType && @@ -287,8 +279,8 @@ class _TypeLinker extends TypeVisitor { @override void visitWildcard(Wildcard node) { - node.superBound?.type.accept(this); - node.extendsBound?.type.accept(this); + node.superBound?.accept(this); + node.extendsBound?.accept(this); } @override @@ -322,10 +314,10 @@ class _FieldLinker extends Visitor { // If the type itself does not have nullability annotations, use the // parent's nullability annotations. Some annotations such as // `androidx.annotation.NonNull` only get applied to elements but not types. - if (!node.type.type.hasNullabilityAnnotations && + if (!node.type.hasNullabilityAnnotations && node.hasNullabilityAnnotations) { - node.type.type.annotations = [ - ...?node.type.type.annotations, + node.type.annotations = [ + ...?node.type.annotations, ...?node.annotations, ]; } @@ -358,10 +350,10 @@ class _ParamLinker extends Visitor { // If the type itself does not have nullability annotations, use the // parent's nullability annotations. Some annotations such as // `androidx.annotation.NonNull` only get applied to elements but not types. - if (!node.type.type.hasNullabilityAnnotations && + if (!node.type.hasNullabilityAnnotations && node.hasNullabilityAnnotations) { - node.type.type.annotations = [ - ...?node.type.type.annotations, + node.type.annotations = [ + ...?node.type.annotations, ...?node.annotations, ]; } @@ -387,21 +379,21 @@ class _MethodMover extends Visitor { void visit(Method node) { node.classDecl = toClass; final typeMover = _TypeMover(fromType: fromType); - if (node.returnType.kind == Kind.typeVariable) { - node.returnType = typeMover.replaceTypeVar(node.returnType); + if (node.returnType is TypeVar) { + node.returnType = typeMover.replaceTypeVar(node.returnType as TypeVar); } else { node.returnType.accept(typeMover); } for (final param in node.params) { - if (param.type.kind == Kind.typeVariable) { - param.type = typeMover.replaceTypeVar(param.type); + if (param.type is TypeVar) { + param.type = typeMover.replaceTypeVar(param.type as TypeVar); } else { param.type.accept(typeMover); } } for (final typeParam in node.typeParams) { for (final (i, bound) in typeParam.bounds.indexed) { - if (bound.kind == Kind.typeVariable) { + if (bound is TypeVar) { typeParam.bounds[i] = typeMover.replaceTypeVar(bound); } else { bound.accept(typeMover); @@ -426,8 +418,7 @@ class _TypeMover extends TypeVisitor { // Do nothing. } - TypeUsage replaceTypeVar(TypeUsage typeUsage) { - final typeVar = typeUsage.type as TypeVar; + ReferredType replaceTypeVar(TypeVar typeVar) { if (typeVar.origin.parent == fromType.classDecl) { final index = fromType.classDecl.allTypeParams .indexWhere((typeParam) => typeParam.name == typeVar.name); @@ -435,24 +426,24 @@ class _TypeMover extends TypeVisitor { return fromType.params[index].clone(until: GenerationStage.linker); } } - return typeUsage; + return typeVar; } @override void visitDeclaredType(DeclaredType node) { for (final (i, typeParam) in node.params.indexed) { - if (typeParam.type is TypeVar) { + if (typeParam is TypeVar) { node.params[i] = replaceTypeVar(typeParam); } else { - typeParam.type.accept(this); + typeParam.accept(this); } } } @override void visitArrayType(ArrayType node) { - if (node.elementType.type is TypeVar) { - node.elementType = replaceTypeVar(node.elementType); + if (node.elementType is TypeVar) { + node.elementType = replaceTypeVar(node.elementType as TypeVar); } else { node.elementType.accept(this); } diff --git a/pkgs/jnigen/lib/src/bindings/printer.dart b/pkgs/jnigen/lib/src/bindings/printer.dart index 121d3d0f7d..392ce95744 100644 --- a/pkgs/jnigen/lib/src/bindings/printer.dart +++ b/pkgs/jnigen/lib/src/bindings/printer.dart @@ -64,7 +64,7 @@ class _ParamPrinter extends Visitor { @override void visit(Param node) { print(' <${node.finalName}>'); - node.type.type.accept(_TypePrinter(10)); + node.type.accept(_TypePrinter(10)); print(' '); } } diff --git a/pkgs/jnigen/lib/src/bindings/renamer.dart b/pkgs/jnigen/lib/src/bindings/renamer.dart index d12471ea80..a943ceebb5 100644 --- a/pkgs/jnigen/lib/src/bindings/renamer.dart +++ b/pkgs/jnigen/lib/src/bindings/renamer.dart @@ -180,7 +180,7 @@ class _ClassRenamer implements Visitor { } node.methodNumsAfterRenaming = {}; - final superClass = (node.superclass!.type as DeclaredType).classDecl; + final superClass = (node.superclass! as DeclaredType).classDecl; superClass.accept(this); nameCounts[node]!.addAll(nameCounts[superClass] ?? {}); @@ -244,8 +244,7 @@ class _MethodRenamer implements Visitor { node.userDefinedName ?? (node.isConstructor ? 'new' : node.name)); final sig = node.javaSig; // If node is in super class, assign its number, overriding it. - final superClass = - (node.classDecl.superclass!.type as DeclaredType).classDecl; + final superClass = (node.classDecl.superclass! as DeclaredType).classDecl; final superNum = superClass.methodNumsAfterRenaming[sig]; if (superNum != null) { // Don't rename if superNum == 0 diff --git a/pkgs/jnigen/lib/src/bindings/visitor.dart b/pkgs/jnigen/lib/src/bindings/visitor.dart index f3fcf9a8e0..7e360d4a5a 100644 --- a/pkgs/jnigen/lib/src/bindings/visitor.dart +++ b/pkgs/jnigen/lib/src/bindings/visitor.dart @@ -32,9 +32,9 @@ extension MultiVisitor> on Iterable> { } } -extension MultiTypeUsageVisitor on Iterable { +extension MultiTypeUsageVisitor on Iterable { /// Accepts all lazily. Remember to call `.toList()` or similar methods! Iterable accept(TypeVisitor v) { - return map((e) => e.type.accept(v)); + return map((e) => e.accept(v)); } } diff --git a/pkgs/jnigen/lib/src/config/config_types.dart b/pkgs/jnigen/lib/src/config/config_types.dart index bead7f3713..55f47f8a52 100644 --- a/pkgs/jnigen/lib/src/config/config_types.dart +++ b/pkgs/jnigen/lib/src/config/config_types.dart @@ -433,20 +433,13 @@ class Config { 'of "$binaryName".', ); } - final boundKind = (e.value as String) == 'DECLARED' - ? Kind.declared - : Kind.typeVariable; final ReferredType type; - if (boundKind == Kind.declared) { + if ((e.value as String) == 'DECLARED') { type = DeclaredType(binaryName: boundName); } else { type = TypeVar(name: boundName); } - return TypeUsage( - shorthand: binaryName, - kind: boundKind, - typeJson: {}, - )..type = type; + return type; }).toList(); classDecl.allTypeParams.add( TypeParam(name: typeParamName, bounds: bounds), diff --git a/pkgs/jnigen/lib/src/elements/elements.dart b/pkgs/jnigen/lib/src/elements/elements.dart index 09c11b182b..2958db8380 100644 --- a/pkgs/jnigen/lib/src/elements/elements.dart +++ b/pkgs/jnigen/lib/src/elements/elements.dart @@ -111,10 +111,10 @@ class ClassDecl with ClassMember, Annotated implements Element { List typeParams; List methods; List fields; - final List interfaces; + final List interfaces; /// Will default to java.lang.Object if null by [Linker]. - TypeUsage? superclass; + ReferredType? superclass; final String? outerClassBinaryName; @@ -231,122 +231,39 @@ class ClassDecl with ClassMember, Annotated implements Element { bool get isTopLevel => kotlinPackage != null; } -@JsonEnum() -enum Kind { - @JsonValue('PRIMITIVE') - primitive, - @JsonValue('TYPE_VARIABLE') - typeVariable, - @JsonValue('WILDCARD') - wildcard, - @JsonValue('DECLARED') - declared, - @JsonValue('ARRAY') - array, -} - -@JsonSerializable(createToJson: false) -class TypeUsage { - TypeUsage({ - required this.shorthand, - required this.kind, - required this.typeJson, - }); - - static final object = TypeUsage( - kind: Kind.declared, - shorthand: 'java.lang.Object', - typeJson: {}, - )..type = DeclaredType(binaryName: 'java.lang.Object'); - - final String shorthand; - Kind kind; - - @JsonKey(name: 'type') - final Map typeJson; +sealed class ReferredType with Annotated { + ReferredType(); - /// Populated by [TypeUsage.fromJson]. - @JsonKey(includeFromJson: false) - late ReferredType type; + String get name; /// Populated by [Linker]. @JsonKey(includeFromJson: false) String? descriptor; - String get name => type.name; - // Since json_serializable doesn't directly support union types, // we have to temporarily store `type` in a JSON map, and switch on the // enum value received. - factory TypeUsage.fromJson(Map json) { - final t = _$TypeUsageFromJson(json); - switch (t.kind) { - case Kind.primitive: - t.type = PrimitiveType.fromJson(t.typeJson); - break; - case Kind.typeVariable: - t.type = TypeVar.fromJson(t.typeJson); - break; - case Kind.wildcard: - t.type = Wildcard.fromJson(t.typeJson); - break; - case Kind.declared: - t.type = DeclaredType.fromJson(t.typeJson); - break; - case Kind.array: - t.type = ArrayType.fromJson(t.typeJson); - break; - } - return t; - } - - R accept(TypeVisitor v) { - return type.accept(v); - } - - // TODO(https://github.com/dart-lang/native/issues/2010): Removing [TypeUsage] - // entirely, makes this logic nicer. - TypeUsage clone({GenerationStage until = GenerationStage.userVisitors}) { - final ReferredType clonedType; - final clonedTypeJson = {...typeJson}; + factory ReferredType.fromJson(Map json) { + final kind = json['kind'] as String; + final typeJson = json['type'] as Map; switch (kind) { - case Kind.primitive: - clonedType = PrimitiveType.fromJson(clonedTypeJson); - break; - case Kind.typeVariable: - clonedType = TypeVar.fromJson(clonedTypeJson); - if (GenerationStage.linker <= until) { - (clonedType as TypeVar).origin = (type as TypeVar).origin; - } - break; - case Kind.wildcard: - clonedType = Wildcard.fromJson(clonedTypeJson); - break; - case Kind.declared: - clonedType = DeclaredType.fromJson(clonedTypeJson); - break; - case Kind.array: - clonedType = ArrayType.fromJson(clonedTypeJson); - break; - } - clonedType.annotations = type.annotations; - final cloned = TypeUsage( - shorthand: shorthand, - kind: kind, - typeJson: clonedTypeJson, - )..type = clonedType; - if (GenerationStage.linker <= until) { - cloned.descriptor = descriptor; + case 'PRIMITIVE': + return PrimitiveType.fromJson(typeJson); + case 'TYPE_VARIABLE': + return TypeVar.fromJson(typeJson); + case 'WILDCARD': + return Wildcard.fromJson(typeJson); + case 'DECLARED': + return DeclaredType.fromJson(typeJson); + case 'ARRAY': + return ArrayType.fromJson(typeJson); } - return cloned; + throw UnsupportedError('The referred type of kind $kind is not supported'); } -} - -abstract class ReferredType with Annotated { - ReferredType(); - String get name; R accept(TypeVisitor v); + + ReferredType clone({GenerationStage until = GenerationStage.userVisitors}); } class PrimitiveType extends ReferredType { @@ -436,6 +353,10 @@ class PrimitiveType extends ReferredType { @override final String name; + + @override + String toString() => name; + @override List? annotations; @@ -453,10 +374,28 @@ class PrimitiveType extends ReferredType { R accept(TypeVisitor v) { return v.visitPrimitiveType(this); } + + @override + PrimitiveType clone({GenerationStage until = GenerationStage.userVisitors}) { + final cloned = PrimitiveType._( + boxedName: boxedName, + cType: cType, + dartType: dartType, + ffiVarArgType: ffiVarArgType, + name: name, + signature: signature, + ); + if (GenerationStage.linker <= until) { + cloned.descriptor = descriptor; + } + return cloned; + } } @JsonSerializable(createToJson: false) class DeclaredType extends ReferredType { + static final object = DeclaredType(binaryName: 'java.lang.Object'); + DeclaredType({ required this.binaryName, this.annotations, @@ -464,7 +403,7 @@ class DeclaredType extends ReferredType { }); final String binaryName; - final List params; + final List params; @override List? annotations; @@ -474,6 +413,12 @@ class DeclaredType extends ReferredType { @override String get name => binaryName; + @override + String toString() { + if (params.isEmpty) return binaryName; + return '$binaryName<${params.join(', ')}>'; + } + factory DeclaredType.fromJson(Map json) => _$DeclaredTypeFromJson(json); @@ -485,7 +430,20 @@ class DeclaredType extends ReferredType { @override bool get hasNullabilityAnnotations => super.hasNullabilityAnnotations || - params.any((param) => param.type.hasNullabilityAnnotations); + params.any((param) => param.hasNullabilityAnnotations); + + @override + DeclaredType clone({GenerationStage until = GenerationStage.userVisitors}) { + final cloned = DeclaredType( + binaryName: binaryName, + annotations: [...?annotations], + params: params.map((param) => param.clone(until: until)).toList(), + ); + if (GenerationStage.linker <= until) { + cloned.descriptor = descriptor; + } + return cloned; + } } @JsonSerializable(createToJson: false) @@ -498,6 +456,10 @@ class TypeVar extends ReferredType { @override String name; + + @override + String toString() => name; + @override List? annotations; @@ -539,21 +501,44 @@ class TypeVar extends ReferredType { R accept(TypeVisitor v) { return v.visitTypeVar(this); } + + @override + TypeVar clone({GenerationStage until = GenerationStage.userVisitors}) { + final cloned = TypeVar(name: name, annotations: [...?annotations]); + if (GenerationStage.linker <= until) { + cloned.origin = origin; + cloned.descriptor = descriptor; + } + return cloned; + } } @JsonSerializable(createToJson: false) class Wildcard extends ReferredType { Wildcard({this.extendsBound, this.superBound, this.annotations}); - TypeUsage? extendsBound, superBound; + ReferredType? extendsBound; + ReferredType? superBound; @override bool get isNullable => super.isNullable && // If the extends bound is non-null, this is non-null. - !(extendsBound?.type.hasNonNull ?? false); + !(extendsBound?.hasNonNull ?? false); @override - String get name => '?'; + String get name { + if (extendsBound != null) { + return '? extends ${extendsBound!.name}'; + } + if (superBound != null) { + return '? super ${superBound!.name}'; + } + return '?'; + } + + @override + String toString() => name; + @override List? annotations; @@ -568,17 +553,34 @@ class Wildcard extends ReferredType { @override bool get hasNullabilityAnnotations => super.hasNullabilityAnnotations || - (superBound?.type.hasNullabilityAnnotations ?? false) || - (extendsBound?.type.hasNullabilityAnnotations ?? false); + (superBound?.hasNullabilityAnnotations ?? false) || + (extendsBound?.hasNullabilityAnnotations ?? false); + + @override + Wildcard clone({GenerationStage until = GenerationStage.userVisitors}) { + final cloned = Wildcard( + annotations: [...?annotations], + extendsBound: extendsBound?.clone(until: until), + superBound: superBound?.clone(until: until), + ); + if (GenerationStage.linker <= until) { + cloned.descriptor = descriptor; + } + return cloned; + } } @JsonSerializable(createToJson: false) class ArrayType extends ReferredType { ArrayType({required this.elementType, this.annotations}); - TypeUsage elementType; + ReferredType elementType; @override - String get name => '[${elementType.name}'; + String get name => '${elementType.name}[]'; + + @override + String toString() => name; + @override List? annotations; @@ -592,8 +594,19 @@ class ArrayType extends ReferredType { @override bool get hasNullabilityAnnotations => - super.hasNullabilityAnnotations || - elementType.type.hasNullabilityAnnotations; + super.hasNullabilityAnnotations || elementType.hasNullabilityAnnotations; + + @override + ArrayType clone({GenerationStage until = GenerationStage.userVisitors}) { + final cloned = ArrayType( + elementType: elementType.clone(until: until), + annotations: [...?annotations], + ); + if (GenerationStage.linker <= until) { + cloned.descriptor = descriptor; + } + return cloned; + } } mixin Annotated { @@ -691,7 +704,7 @@ class Method with ClassMember, Annotated implements Element { final JavaDocComment? javadoc; List typeParams; List params; - TypeUsage returnType; + ReferredType returnType; /// Populated by user-defined visitors. @JsonKey(includeFromJson: false) @@ -709,7 +722,7 @@ class Method with ClassMember, Annotated implements Element { /// /// Populated by [KotlinProcessor]. @JsonKey(includeFromJson: false) - TypeUsage? asyncReturnType; + ReferredType? asyncReturnType; /// The [ClassDecl] where this method is defined. /// @@ -806,13 +819,13 @@ class Param with Annotated implements Element { final JavaDocComment? javadoc; @override - bool get isNullable => type.type.isNullable || super.hasNullable; + bool get isNullable => type.isNullable || super.hasNullable; // Synthetic methods might not have parameter names. @JsonKey(defaultValue: 'synthetic') final String name; - TypeUsage type; + ReferredType type; /// Populated by [Linker]. @JsonKey(includeFromJson: false) @@ -872,7 +885,7 @@ class Field with ClassMember, Annotated implements Element { @override List? annotations; final JavaDocComment? javadoc; - final TypeUsage type; + final ReferredType type; final Object? defaultValue; /// The [ClassDecl] where this field is defined. @@ -900,7 +913,7 @@ class TypeParam with Annotated implements Element { TypeParam({required this.name, this.bounds = const [], this.annotations}); final String name; - final List bounds; + final List bounds; @override List? annotations; @@ -908,7 +921,7 @@ class TypeParam with Annotated implements Element { @override bool get hasNonNull => // A type param with any non-null bound is non-null. - super.hasNonNull || bounds.any((bound) => !bound.type.isNullable); + super.hasNonNull || bounds.any((bound) => !bound.isNullable); /// Can either be a [ClassDecl] or a [Method]. /// diff --git a/pkgs/jnigen/lib/src/elements/elements.g.dart b/pkgs/jnigen/lib/src/elements/elements.g.dart index a7b2e0053d..e8481fb915 100644 --- a/pkgs/jnigen/lib/src/elements/elements.g.dart +++ b/pkgs/jnigen/lib/src/elements/elements.g.dart @@ -33,10 +33,10 @@ ClassDecl _$ClassDeclFromJson(Map json) => ClassDecl( const [], superclass: json['superclass'] == null ? null - : TypeUsage.fromJson(json['superclass'] as Map), + : ReferredType.fromJson(json['superclass'] as Map), outerClassBinaryName: json['outerClassBinaryName'] as String?, interfaces: (json['interfaces'] as List?) - ?.map((e) => TypeUsage.fromJson(e as Map)) + ?.map((e) => ReferredType.fromJson(e as Map)) .toList() ?? const [], values: @@ -56,27 +56,13 @@ const _$DeclKindEnumMap = { DeclKind.enumKind: 'ENUM', }; -TypeUsage _$TypeUsageFromJson(Map json) => TypeUsage( - shorthand: json['shorthand'] as String, - kind: $enumDecode(_$KindEnumMap, json['kind']), - typeJson: json['type'] as Map, - ); - -const _$KindEnumMap = { - Kind.primitive: 'PRIMITIVE', - Kind.typeVariable: 'TYPE_VARIABLE', - Kind.wildcard: 'WILDCARD', - Kind.declared: 'DECLARED', - Kind.array: 'ARRAY', -}; - DeclaredType _$DeclaredTypeFromJson(Map json) => DeclaredType( binaryName: json['binaryName'] as String, annotations: (json['annotations'] as List?) ?.map((e) => Annotation.fromJson(e as Map)) .toList(), params: (json['params'] as List?) - ?.map((e) => TypeUsage.fromJson(e as Map)) + ?.map((e) => ReferredType.fromJson(e as Map)) .toList() ?? const [], ); @@ -91,10 +77,10 @@ TypeVar _$TypeVarFromJson(Map json) => TypeVar( Wildcard _$WildcardFromJson(Map json) => Wildcard( extendsBound: json['extendsBound'] == null ? null - : TypeUsage.fromJson(json['extendsBound'] as Map), + : ReferredType.fromJson(json['extendsBound'] as Map), superBound: json['superBound'] == null ? null - : TypeUsage.fromJson(json['superBound'] as Map), + : ReferredType.fromJson(json['superBound'] as Map), annotations: (json['annotations'] as List?) ?.map((e) => Annotation.fromJson(e as Map)) .toList(), @@ -102,7 +88,7 @@ Wildcard _$WildcardFromJson(Map json) => Wildcard( ArrayType _$ArrayTypeFromJson(Map json) => ArrayType( elementType: - TypeUsage.fromJson(json['elementType'] as Map), + ReferredType.fromJson(json['elementType'] as Map), annotations: (json['annotations'] as List?) ?.map((e) => Annotation.fromJson(e as Map)) .toList(), @@ -130,7 +116,7 @@ Method _$MethodFromJson(Map json) => Method( .toList() ?? const [], returnType: - TypeUsage.fromJson(json['returnType'] as Map), + ReferredType.fromJson(json['returnType'] as Map), ); Param _$ParamFromJson(Map json) => Param( @@ -141,7 +127,7 @@ Param _$ParamFromJson(Map json) => Param( ? null : JavaDocComment.fromJson(json['javadoc'] as Map), name: json['name'] as String? ?? 'synthetic', - type: TypeUsage.fromJson(json['type'] as Map), + type: ReferredType.fromJson(json['type'] as Map), ); Field _$FieldFromJson(Map json) => Field( @@ -156,14 +142,14 @@ Field _$FieldFromJson(Map json) => Field( .toSet() ?? const {}, name: json['name'] as String, - type: TypeUsage.fromJson(json['type'] as Map), + type: ReferredType.fromJson(json['type'] as Map), defaultValue: json['defaultValue'], ); TypeParam _$TypeParamFromJson(Map json) => TypeParam( name: json['name'] as String, bounds: (json['bounds'] as List?) - ?.map((e) => TypeUsage.fromJson(e as Map)) + ?.map((e) => ReferredType.fromJson(e as Map)) .toList() ?? const [], annotations: (json['annotations'] as List?) diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart index db9a7c406e..e43017a83a 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonFactory.dart @@ -22,6 +22,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -80,7 +81,7 @@ class JsonFactory$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonFactory.Feature INTERN_FIELD_NAMES` + /// from: `static public final com.fasterxml.jackson.core.JsonFactory$Feature INTERN_FIELD_NAMES` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether JSON object field names are @@ -104,7 +105,7 @@ class JsonFactory$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonFactory.Feature CANONICALIZE_FIELD_NAMES` + /// from: `static public final com.fasterxml.jackson.core.JsonFactory$Feature CANONICALIZE_FIELD_NAMES` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether JSON object field names are @@ -122,7 +123,7 @@ class JsonFactory$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonFactory.Feature FAIL_ON_SYMBOL_HASH_OVERFLOW` + /// from: `static public final com.fasterxml.jackson.core.JsonFactory$Feature FAIL_ON_SYMBOL_HASH_OVERFLOW` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines what happens if we encounter a case in symbol @@ -145,7 +146,7 @@ class JsonFactory$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonFactory$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonFactory.Feature USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING` + /// from: `static public final com.fasterxml.jackson.core.JsonFactory$Feature USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether we will use BufferRecycler with @@ -181,7 +182,7 @@ class JsonFactory$Feature extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature[] values()` + /// from: `static public com.fasterxml.jackson.core.JsonFactory$Feature[] values()` /// The returned object must be released after use, by calling the [release] method. static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) @@ -206,7 +207,7 @@ class JsonFactory$Feature extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.fasterxml.jackson.core.JsonFactory.Feature valueOf(java.lang.String name)` + /// from: `static public com.fasterxml.jackson.core.JsonFactory$Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonFactory$Feature? valueOf( jni$_.JString? name, @@ -566,7 +567,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public com.fasterxml.jackson.core.TSFBuilder rebuild()` + /// from: `public com.fasterxml.jackson.core.TSFBuilder rebuild()` /// The returned object must be released after use, by calling the [release] method. /// /// Method that allows construction of differently configured factory, starting @@ -595,7 +596,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public com.fasterxml.jackson.core.TSFBuilder builder()` + /// from: `static public com.fasterxml.jackson.core.TSFBuilder builder()` /// The returned object must be released after use, by calling the [release] method. /// /// Main factory method to use for constructing JsonFactory instances with @@ -1011,7 +1012,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); - /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory.Feature f, boolean state)` + /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonFactory$Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified parser feature @@ -1046,7 +1047,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonFactory$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature @@ -1079,7 +1080,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonFactory$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified parser features @@ -1112,7 +1113,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonFactory.Feature f)` + /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonFactory$Feature f)` /// /// Checked whether specified parser feature is enabled. ///@param f Feature to check @@ -1240,7 +1241,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); - /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)` + /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonParser$Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified parser feature @@ -1274,7 +1275,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonParser$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature @@ -1306,7 +1307,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonParser$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified parser features @@ -1338,7 +1339,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)` + /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonParser$Feature f)` /// /// Method for checking if the specified parser feature is enabled. ///@param f Feature to check @@ -1461,7 +1462,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); - /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator.Feature f, boolean state)` + /// from: `public final com.fasterxml.jackson.core.JsonFactory configure(com.fasterxml.jackson.core.JsonGenerator$Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified generator feature @@ -1495,7 +1496,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonFactory enable(com.fasterxml.jackson.core.JsonGenerator$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified generator features @@ -1527,7 +1528,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonFactory disable(com.fasterxml.jackson.core.JsonGenerator$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified generator feature @@ -1559,7 +1560,7 @@ class JsonFactory extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator.Feature f)` + /// from: `public final boolean isEnabled(com.fasterxml.jackson.core.JsonGenerator$Feature f)` /// /// Check whether specified generator feature is enabled. ///@param f Feature to check diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart index 0af0b6d188..c90f76f4ac 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonParser.dart @@ -22,6 +22,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -79,7 +80,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature AUTO_CLOSE_SOURCE` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature AUTO_CLOSE_SOURCE` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will automatically @@ -100,7 +101,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_COMMENTS` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_COMMENTS` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will allow use @@ -124,7 +125,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_YAML_COMMENTS` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_YAML_COMMENTS` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will allow use @@ -148,7 +149,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_UNQUOTED_FIELD_NAMES` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_UNQUOTED_FIELD_NAMES` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will allow use @@ -170,7 +171,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_SINGLE_QUOTES` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_SINGLE_QUOTES` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will allow use @@ -193,7 +194,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_UNQUOTED_CONTROL_CHARS` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_UNQUOTED_CONTROL_CHARS` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will allow @@ -216,7 +217,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that can be enabled to accept quoting of all character @@ -236,7 +237,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_NUMERIC_LEADING_ZEROS` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_NUMERIC_LEADING_ZEROS` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether parser will allow @@ -258,7 +259,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS` /// The returned object must be released after use, by calling the [release] method. /// /// @deprecated Use com.fasterxml.jackson.core.json.JsonReadFeature\#ALLOW_LEADING_DECIMAL_POINT_FOR_NUMBERS instead @@ -271,7 +272,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_NON_NUMERIC_NUMBERS` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_NON_NUMERIC_NUMBERS` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that allows parser to recognize set of @@ -300,7 +301,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_MISSING_VALUES` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_MISSING_VALUES` /// The returned object must be released after use, by calling the [release] method. /// /// Feature allows the support for "missing" values in a JSON array: missing @@ -325,7 +326,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature ALLOW_TRAILING_COMMA` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature ALLOW_TRAILING_COMMA` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether JsonParser will allow for a single trailing @@ -355,7 +356,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature STRICT_DUPLICATE_DETECTION` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature STRICT_DUPLICATE_DETECTION` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether JsonParser will explicitly @@ -380,7 +381,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature IGNORE_UNDEFINED` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature IGNORE_UNDEFINED` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines what to do if the underlying data format requires knowledge @@ -410,7 +411,7 @@ class JsonParser$Feature extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$Feature;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.Feature INCLUDE_SOURCE_IN_LOCATION` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$Feature INCLUDE_SOURCE_IN_LOCATION` /// The returned object must be released after use, by calling the [release] method. /// /// Feature that determines whether JsonLocation instances should be constructed @@ -450,7 +451,7 @@ class JsonParser$Feature extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature[] values()` + /// from: `static public com.fasterxml.jackson.core.JsonParser$Feature[] values()` /// The returned object must be released after use, by calling the [release] method. static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) @@ -475,7 +476,7 @@ class JsonParser$Feature extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.fasterxml.jackson.core.JsonParser.Feature valueOf(java.lang.String name)` + /// from: `static public com.fasterxml.jackson.core.JsonParser$Feature valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonParser$Feature? valueOf( jni$_.JString? name, @@ -690,7 +691,7 @@ class JsonParser$NumberType extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.NumberType INT` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$NumberType INT` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType get INT => _id_INT.get(_class, const $JsonParser$NumberType$Type()); @@ -700,7 +701,7 @@ class JsonParser$NumberType extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.NumberType LONG` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$NumberType LONG` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType get LONG => _id_LONG.get(_class, const $JsonParser$NumberType$Type()); @@ -710,7 +711,7 @@ class JsonParser$NumberType extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.NumberType BIG_INTEGER` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$NumberType BIG_INTEGER` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType get BIG_INTEGER => _id_BIG_INTEGER.get(_class, const $JsonParser$NumberType$Type()); @@ -720,7 +721,7 @@ class JsonParser$NumberType extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.NumberType FLOAT` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$NumberType FLOAT` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType get FLOAT => _id_FLOAT.get(_class, const $JsonParser$NumberType$Type()); @@ -730,7 +731,7 @@ class JsonParser$NumberType extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.NumberType DOUBLE` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$NumberType DOUBLE` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType get DOUBLE => _id_DOUBLE.get(_class, const $JsonParser$NumberType$Type()); @@ -740,7 +741,7 @@ class JsonParser$NumberType extends jni$_.JObject { r'Lcom/fasterxml/jackson/core/JsonParser$NumberType;', ); - /// from: `static public final com.fasterxml.jackson.core.JsonParser.NumberType BIG_DECIMAL` + /// from: `static public final com.fasterxml.jackson.core.JsonParser$NumberType BIG_DECIMAL` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType get BIG_DECIMAL => _id_BIG_DECIMAL.get(_class, const $JsonParser$NumberType$Type()); @@ -762,7 +763,7 @@ class JsonParser$NumberType extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType[] values()` + /// from: `static public com.fasterxml.jackson.core.JsonParser$NumberType[] values()` /// The returned object must be released after use, by calling the [release] method. static jni$_.JArray? values() { return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) @@ -787,7 +788,7 @@ class JsonParser$NumberType extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.fasterxml.jackson.core.JsonParser.NumberType valueOf(java.lang.String name)` + /// from: `static public com.fasterxml.jackson.core.JsonParser$NumberType valueOf(java.lang.String name)` /// The returned object must be released after use, by calling the [release] method. static JsonParser$NumberType? valueOf( jni$_.JString? name, @@ -1823,7 +1824,7 @@ class JsonParser extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonParser enable(com.fasterxml.jackson.core.JsonParser$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling specified parser feature @@ -1855,7 +1856,7 @@ class JsonParser extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser.Feature f)` + /// from: `public com.fasterxml.jackson.core.JsonParser disable(com.fasterxml.jackson.core.JsonParser$Feature f)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for disabling specified feature @@ -1888,7 +1889,7 @@ class JsonParser extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); - /// from: `public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser.Feature f, boolean state)` + /// from: `public com.fasterxml.jackson.core.JsonParser configure(com.fasterxml.jackson.core.JsonParser$Feature f, boolean state)` /// The returned object must be released after use, by calling the [release] method. /// /// Method for enabling or disabling specified feature @@ -1922,7 +1923,7 @@ class JsonParser extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public boolean isEnabled(com.fasterxml.jackson.core.JsonParser.Feature f)` + /// from: `public boolean isEnabled(com.fasterxml.jackson.core.JsonParser$Feature f)` /// /// Method for checking whether specified Feature is enabled. ///@param f Feature to check @@ -3401,7 +3402,7 @@ class JsonParser extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public abstract com.fasterxml.jackson.core.JsonParser.NumberType getNumberType()` + /// from: `public abstract com.fasterxml.jackson.core.JsonParser$NumberType getNumberType()` /// The returned object must be released after use, by calling the [release] method. /// /// If current token is of type diff --git a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart index 9dee394950..cdb17bb12e 100644 --- a/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart +++ b/pkgs/jnigen/test/jackson_core_test/third_party/bindings/com/fasterxml/jackson/core/JsonToken.dart @@ -22,6 +22,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter diff --git a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart index 04ad2c2cf1..e7a4b59f45 100644 --- a/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart +++ b/pkgs/jnigen/test/kotlin_test/bindings/kotlin.dart @@ -9,6 +9,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -565,7 +566,7 @@ class Nullability$InnerClass<$T extends jni$_.JObject?, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void (com.github.dart_lang.jnigen.Nullability $outerClass)` + /// from: `public void (com.github.dart_lang.jnigen.Nullability $outerClass)` /// The returned object must be released after use, by calling the [release] method. factory Nullability$InnerClass( Nullability<$T?, $U> $outerClass, { @@ -962,7 +963,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JMethodIDPtr, )>(); - /// from: `public final com.github.dart_lang.jnigen.Nullability self()` + /// from: `public final com.github.dart_lang.jnigen.Nullability self()` /// The returned object must be released after use, by calling the [release] method. Nullability self() { return _self(reference.pointer, _id_self as jni$_.JMethodIDPtr) @@ -1037,7 +1038,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JMethodIDPtr, )>(); - /// from: `public final java.util.List list()` + /// from: `public final java.util.List list()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList list() { return _list(reference.pointer, _id_list as jni$_.JMethodIDPtr) @@ -1178,7 +1179,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.String firstOf(java.util.List list)` + /// from: `public final java.lang.String firstOf(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. jni$_.JString firstOf( jni$_.JList list, @@ -1205,7 +1206,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.String firstOfNullable(java.util.List list)` + /// from: `public final java.lang.String firstOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. jni$_.JString? firstOfNullable( jni$_.JList list, @@ -1232,7 +1233,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final U classGenericFirstOf(java.util.List list)` + /// from: `public final U classGenericFirstOf(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $U classGenericFirstOf( jni$_.JList<$U> list, @@ -1260,7 +1261,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final T classGenericFirstOfNullable(java.util.List list)` + /// from: `public final T classGenericFirstOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T classGenericFirstOfNullable( jni$_.JList<$T> list, @@ -1289,7 +1290,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final V methodGenericFirstOf(java.util.List list)` + /// from: `public final V methodGenericFirstOf(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $V methodGenericFirstOf<$V extends jni$_.JObject>( jni$_.JList<$V> list, { @@ -1321,7 +1322,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final V methodGenericFirstOfNullable(java.util.List list)` + /// from: `public final V methodGenericFirstOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $V methodGenericFirstOfNullable<$V extends jni$_.JObject?>( jni$_.JList<$V> list, { @@ -1354,7 +1355,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.util.List stringListOf(java.lang.String string)` + /// from: `public final java.util.List stringListOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList stringListOf( jni$_.JString string, @@ -1382,7 +1383,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.util.List nullableListOf(java.lang.String string)` + /// from: `public final java.util.List nullableListOf(java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList nullableListOf( jni$_.JString? string, @@ -1410,7 +1411,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.util.List classGenericListOf(U object)` + /// from: `public final java.util.List classGenericListOf(U object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$U> classGenericListOf( $U object, @@ -1438,7 +1439,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.util.List classGenericNullableListOf(T object)` + /// from: `public final java.util.List classGenericNullableListOf(T object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$T> classGenericNullableListOf( $T object, @@ -1467,7 +1468,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.util.List methodGenericListOf(V object)` + /// from: `public final java.util.List methodGenericListOf(V object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$V> methodGenericListOf<$V extends jni$_.JObject>( $V object, { @@ -1499,7 +1500,7 @@ class Nullability<$T extends jni$_.JObject?, $U extends jni$_.JObject> jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.util.List methodGenericNullableListOf(V object)` + /// from: `public final java.util.List methodGenericNullableListOf(V object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$V> methodGenericNullableListOf<$V extends jni$_.JObject?>( $V object, { @@ -2646,7 +2647,7 @@ class SuspendFun extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.Object sayHelloWithoutDelay(kotlin.coroutines.Continuation continuation)` + /// from: `public final java.lang.Object sayHelloWithoutDelay(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. core$_.Future sayHelloWithoutDelay() async { final $p = jni$_.ReceivePort(); @@ -2691,7 +2692,7 @@ class SuspendFun extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.Object failWithoutDelay(kotlin.coroutines.Continuation continuation)` + /// from: `public final java.lang.Object failWithoutDelay(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. core$_.Future failWithoutDelay() async { final $p = jni$_.ReceivePort(); @@ -2734,7 +2735,7 @@ class SuspendFun extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.Object fail(kotlin.coroutines.Continuation continuation)` + /// from: `public final java.lang.Object fail(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. core$_.Future fail() async { final $p = jni$_.ReceivePort(); @@ -2777,7 +2778,7 @@ class SuspendFun extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation)` + /// from: `public final java.lang.Object sayHello(kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. core$_.Future sayHello() async { final $p = jni$_.ReceivePort(); @@ -2826,7 +2827,7 @@ class SuspendFun extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation)` + /// from: `public final java.lang.Object sayHello(java.lang.String string, kotlin.coroutines.Continuation continuation)` /// The returned object must be released after use, by calling the [release] method. core$_.Future sayHello$1( jni$_.JString string, diff --git a/pkgs/jnigen/test/renamer_test.dart b/pkgs/jnigen/test/renamer_test.dart index d2c9bac24c..1da7f185b8 100644 --- a/pkgs/jnigen/test/renamer_test.dart +++ b/pkgs/jnigen/test/renamer_test.dart @@ -31,50 +31,50 @@ void main() { 'Foo': ClassDecl( binaryName: 'Foo', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: 'foo1', returnType: TypeUsage.object), - Method(name: 'foo1', returnType: TypeUsage.object), - Method(name: 'foo1', returnType: TypeUsage.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: 'foo1', returnType: DeclaredType.object), + Method(name: 'foo1', returnType: DeclaredType.object), + Method(name: 'foo1', returnType: DeclaredType.object), ], ), 'x.Foo': ClassDecl( binaryName: 'x.Foo', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: 'foo1', returnType: TypeUsage.object), - Method(name: 'foo1', returnType: TypeUsage.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: 'foo1', returnType: DeclaredType.object), + Method(name: 'foo1', returnType: DeclaredType.object), ], fields: [ - Field(name: 'foo', type: TypeUsage.object), - Field(name: 'foo1', type: TypeUsage.object), + Field(name: 'foo', type: DeclaredType.object), + Field(name: 'foo1', type: DeclaredType.object), ], ), 'y.Foo': ClassDecl( binaryName: 'y.Foo', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, ), 'Foo1': ClassDecl( binaryName: 'Foo1', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, ), 'x.Foo1': ClassDecl( binaryName: 'x.Foo1', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, ), 'y.Foo1': ClassDecl( binaryName: 'y.Foo1', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, ), }); await rename(classes); @@ -120,19 +120,17 @@ void main() { 'Player': ClassDecl( binaryName: 'Player', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'duck', returnType: TypeUsage.object), + Method(name: 'duck', returnType: DeclaredType.object), ], ), 'DuckOwningPlayer': ClassDecl( binaryName: 'DuckOwningPlayer', declKind: DeclKind.classKind, - superclass: - TypeUsage(shorthand: 'Player', kind: Kind.declared, typeJson: {}) - ..type = DeclaredType(binaryName: 'Player'), + superclass: DeclaredType(binaryName: 'Player'), fields: [ - Field(name: 'duck', type: TypeUsage.object), + Field(name: 'duck', type: DeclaredType.object), ], ), }); @@ -149,20 +147,20 @@ void main() { 'Foo': ClassDecl( binaryName: 'Foo', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'yield', returnType: TypeUsage.object), - Method(name: 'const', returnType: TypeUsage.object), - Method(name: 'const', returnType: TypeUsage.object), + Method(name: 'yield', returnType: DeclaredType.object), + Method(name: 'const', returnType: DeclaredType.object), + Method(name: 'const', returnType: DeclaredType.object), ], fields: [ - Field(name: 'const', type: TypeUsage.object), + Field(name: 'const', type: DeclaredType.object), ], ), 'Function': ClassDecl( binaryName: 'Function', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, ), }); await rename(classes); @@ -181,18 +179,19 @@ void main() { 'Foo': ClassDecl( binaryName: 'Foo', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: 'foo', returnType: TypeUsage.object), - Method(name: r'foo$1', returnType: TypeUsage.object), - Method(name: r'$$Many$Dollar$$Signs$', returnType: TypeUsage.object), - Method(name: 'alsoAField', returnType: TypeUsage.object), - Method(name: 'alsoAField', returnType: TypeUsage.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: 'foo', returnType: DeclaredType.object), + Method(name: r'foo$1', returnType: DeclaredType.object), + Method( + name: r'$$Many$Dollar$$Signs$', returnType: DeclaredType.object), + Method(name: 'alsoAField', returnType: DeclaredType.object), + Method(name: 'alsoAField', returnType: DeclaredType.object), ], fields: [ - Field(name: r'alsoAField', type: TypeUsage.object), - Field(name: r'alsoAField$1', type: TypeUsage.object), + Field(name: r'alsoAField', type: DeclaredType.object), + Field(name: r'alsoAField$1', type: DeclaredType.object), ], ), }); @@ -220,12 +219,12 @@ void main() { '_Foo': ClassDecl( binaryName: '_Foo', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: '_foo', returnType: TypeUsage.object), + Method(name: '_foo', returnType: DeclaredType.object), ], fields: [ - Field(name: '_bar', type: TypeUsage.object), + Field(name: '_bar', type: DeclaredType.object), ], ), }); @@ -246,13 +245,13 @@ void main() { r'_Foo$': ClassDecl( binaryName: r'_Foo$', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: r'_foo$', returnType: TypeUsage.object), - Method(name: r'_foo$', returnType: TypeUsage.object), + Method(name: r'_foo$', returnType: DeclaredType.object), + Method(name: r'_foo$', returnType: DeclaredType.object), ], fields: [ - Field(name: r'_foo$', type: TypeUsage.object), + Field(name: r'_foo$', type: DeclaredType.object), ], ), }); @@ -269,19 +268,19 @@ void main() { 'MyInterface': ClassDecl( binaryName: 'MyInterface', declKind: DeclKind.interfaceKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'implement', returnType: TypeUsage.object), - Method(name: 'implementIn', returnType: TypeUsage.object), + Method(name: 'implement', returnType: DeclaredType.object), + Method(name: 'implementIn', returnType: DeclaredType.object), ], ), 'MyClass': ClassDecl( binaryName: 'MyClass', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [ - Method(name: 'implement', returnType: TypeUsage.object), - Method(name: 'implementIn', returnType: TypeUsage.object), + Method(name: 'implement', returnType: DeclaredType.object), + Method(name: 'implementIn', returnType: DeclaredType.object), ], ), }); @@ -299,27 +298,27 @@ void main() { 'Outer': ClassDecl( binaryName: 'Outer', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [], ), r'Outer$Inner': ClassDecl( binaryName: r'Outer$Inner', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [], outerClassBinaryName: 'Outer', ), r'Outer$Inner$Innermost': ClassDecl( binaryName: r'Outer$Inner$Innermost', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [], outerClassBinaryName: r'Outer$Inner', ), r'Outer$With$Many$Dollarsigns': ClassDecl( binaryName: r'Outer$With$Many$Dollarsigns', declKind: DeclKind.classKind, - superclass: TypeUsage.object, + superclass: DeclaredType.object, methods: [], ), }); diff --git a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart index edb3a5e30e..89a41fc91f 100644 --- a/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart +++ b/pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart @@ -9,6 +9,7 @@ // ignore_for_file: camel_case_extensions // ignore_for_file: camel_case_types // ignore_for_file: constant_identifier_names +// ignore_for_file: comment_references // ignore_for_file: doc_directive_unknown // ignore_for_file: file_names // ignore_for_file: inference_failure_on_untyped_parameter @@ -1174,7 +1175,7 @@ class Example extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List getList()` + /// from: `public java.util.List getList()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList? getList() { return _getList(reference.pointer, _id_getList as jni$_.JMethodIDPtr) @@ -1205,7 +1206,7 @@ class Example extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public java.lang.String joinStrings(java.util.List list, java.lang.String string)` + /// from: `public java.lang.String joinStrings(java.util.List list, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. jni$_.JString? joinStrings( jni$_.JList? list, @@ -1251,7 +1252,7 @@ class Example extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void methodWithSeveralParams(char c, java.lang.String string, java.lang.Object[] is, T charSequence, java.util.List list, java.util.Map map)` + /// from: `public void methodWithSeveralParams(char c, java.lang.String string, int[] is, T charSequence, java.util.List list, java.util.Map map)` void methodWithSeveralParams<$T extends jni$_.JObject?>( int c, jni$_.JString? string, @@ -1669,7 +1670,7 @@ class Example extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void overloaded(java.util.List list, java.lang.String string)` + /// from: `public void overloaded(java.util.List list, java.lang.String string)` void overloaded$3( jni$_.JList? list, jni$_.JString? string, @@ -1697,7 +1698,7 @@ class Example extends jni$_.JObject { jni$_.JThrowablePtr Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void overloaded(java.util.List list)` + /// from: `public void overloaded(java.util.List list)` void overloaded$4( jni$_.JList? list, ) { @@ -3677,7 +3678,7 @@ class GrandParent$Parent$Child< jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $outerClass, U object)` + /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$Parent $outerClass, U object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent$Parent$Child( GrandParent$Parent<$T?, $S?> $outerClass, @@ -3927,7 +3928,7 @@ class GrandParent$Parent<$T extends jni$_.JObject?, $S extends jni$_.JObject?> jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $outerClass, S object)` + /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent $outerClass, S object)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent$Parent( GrandParent<$T?> $outerClass, @@ -4153,7 +4154,7 @@ class GrandParent$StaticParent$Child<$S extends jni$_.JObject?, jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $outerClass, S object, U object1)` + /// from: `public void (com.github.dart_lang.jnigen.generics.GrandParent$StaticParent $outerClass, S object, U object1)` /// The returned object must be released after use, by calling the [release] method. factory GrandParent$StaticParent$Child( GrandParent$StaticParent<$S?> $outerClass, @@ -4559,7 +4560,7 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent stringParent()` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$Parent stringParent()` /// The returned object must be released after use, by calling the [release] method. GrandParent$Parent<$T?, jni$_.JString?>? stringParent() { return _stringParent( @@ -4585,7 +4586,7 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent.Parent varParent(S object)` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$Parent varParent(S object)` /// The returned object must be released after use, by calling the [release] method. GrandParent$Parent<$T?, $S?>? varParent<$S extends jni$_.JObject?>( $S? object, { @@ -4616,7 +4617,7 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent stringStaticParent()` + /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent stringStaticParent()` /// The returned object must be released after use, by calling the [release] method. static GrandParent$StaticParent? stringStaticParent() { return _stringStaticParent(_class.reference.pointer, @@ -4642,7 +4643,7 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent varStaticParent(S object)` + /// from: `static public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent varStaticParent(S object)` /// The returned object must be released after use, by calling the [release] method. static GrandParent$StaticParent<$S?>? varStaticParent<$S extends jni$_.JObject?>( @@ -4673,7 +4674,7 @@ class GrandParent<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent staticParentWithSameType()` + /// from: `public com.github.dart_lang.jnigen.generics.GrandParent$StaticParent staticParentWithSameType()` /// The returned object must be released after use, by calling the [release] method. GrandParent$StaticParent<$T?>? staticParentWithSameType() { return _staticParentWithSameType(reference.pointer, @@ -4869,7 +4870,7 @@ class MyMap$MyEntry<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $outerClass, K object, V object1)` + /// from: `public void (com.github.dart_lang.jnigen.generics.MyMap $outerClass, K object, V object1)` /// The returned object must be released after use, by calling the [release] method. factory MyMap$MyEntry( MyMap<$K?, $V?> $outerClass, @@ -5156,7 +5157,7 @@ class MyMap<$K extends jni$_.JObject?, $V extends jni$_.JObject?> jni$_.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.generics.MyStack entryStack()` + /// from: `public com.github.dart_lang.jnigen.generics.MyStack> entryStack()` /// The returned object must be released after use, by calling the [release] method. MyStack?>? entryStack() { return _entryStack(reference.pointer, _id_entryStack as jni$_.JMethodIDPtr) @@ -5348,7 +5349,7 @@ class MyStack<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(java.lang.Object[] objects)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArray(T[] objects)` /// The returned object must be released after use, by calling the [release] method. static MyStack<$T?>? fromArray<$T extends jni$_.JObject?>( jni$_.JArray<$T?>? objects, { @@ -5377,7 +5378,7 @@ class MyStack<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(java.lang.Object[] grandParents)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack fromArrayOfArrayOfGrandParents(com.github.dart_lang.jnigen.generics.GrandParent[][] grandParents)` /// The returned object must be released after use, by calling the [release] method. static MyStack<$S?>? fromArrayOfArrayOfGrandParents<$S extends jni$_.JObject?>( @@ -5409,7 +5410,7 @@ class MyStack<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of()` /// The returned object must be released after use, by calling the [release] method. static MyStack<$T?>? of<$T extends jni$_.JObject?>({ required jni$_.JObjType<$T> T, @@ -5434,7 +5435,7 @@ class MyStack<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object)` /// The returned object must be released after use, by calling the [release] method. static MyStack<$T?>? of$1<$T extends jni$_.JObject?>( $T? object, { @@ -5468,7 +5469,7 @@ class MyStack<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object, T object1)` + /// from: `static public com.github.dart_lang.jnigen.generics.MyStack of(T object, T object1)` /// The returned object must be released after use, by calling the [release] method. static MyStack<$T?>? of$2<$T extends jni$_.JObject?>( $T? object, @@ -6259,7 +6260,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public abstract java.lang.Object[] genericArrayOf(U object)` + /// from: `public abstract U[] genericArrayOf(U object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JArray<$U?>? genericArrayOf<$U extends jni$_.JObject?>( $U? object, { @@ -6288,7 +6289,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public abstract java.lang.Object[] arrayOf(T object)` + /// from: `public abstract T[] arrayOf(T object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JArray<$T?>? arrayOf( $T? object, @@ -6322,7 +6323,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public abstract java.util.Map mapOf(T object, U object1)` + /// from: `public abstract java.util.Map mapOf(T object, U object1)` /// The returned object must be released after use, by calling the [release] method. jni$_.JMap<$T?, $U?>? mapOf<$U extends jni$_.JObject?>( $T? object, @@ -6353,7 +6354,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public abstract U firstOfGenericArray(java.lang.Object[] objects)` + /// from: `public abstract U firstOfGenericArray(U[] objects)` /// The returned object must be released after use, by calling the [release] method. $U? firstOfGenericArray<$U extends jni$_.JObject?>( jni$_.JArray<$U?>? objects, { @@ -6381,7 +6382,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public abstract T firstOfArray(java.lang.Object[] objects)` + /// from: `public abstract T firstOfArray(T[] objects)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfArray( jni$_.JArray<$T?>? objects, @@ -6408,7 +6409,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public abstract T firstKeyOf(java.util.Map map)` + /// from: `public abstract T firstKeyOf(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $T? firstKeyOf<$U extends jni$_.JObject?>( jni$_.JMap<$T?, $U?>? map, { @@ -6436,7 +6437,7 @@ class GenericInterface<$T extends jni$_.JObject?> extends jni$_.JObject { jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public abstract U firstValueOf(java.util.Map map)` + /// from: `public abstract U firstValueOf(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $U? firstValueOf<$U extends jni$_.JObject?>( jni$_.JMap<$T?, $U?>? map, { @@ -7891,7 +7892,7 @@ class MyInterfaceConsumer extends jni$_.JObject { double, jni$_.Pointer)>(); - /// from: `static public void consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` + /// from: `static public void consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` static void consumeOnAnotherThread<$T extends jni$_.JObject?>( MyInterface<$T?>? myInterface, jni$_.JString? string, @@ -7950,7 +7951,7 @@ class MyInterfaceConsumer extends jni$_.JObject { double, jni$_.Pointer)>(); - /// from: `static public void consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` + /// from: `static public void consumeOnSameThread(com.github.dart_lang.jnigen.interfaces.MyInterface myInterface, java.lang.String string, int i, boolean z, char c, double d, T object)` static void consumeOnSameThread<$T extends jni$_.JObject?>( MyInterface<$T?>? myInterface, jni$_.JString? string, @@ -8933,7 +8934,7 @@ class StringConverterConsumer extends jni$_.JObject { jni$_.Pointer, jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String string)` + /// from: `static public java.util.concurrent.Future consumeOnAnotherThread(com.github.dart_lang.jnigen.interfaces.StringConverter stringConverter, java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. static jni$_.JObject? consumeOnAnotherThread( StringConverter? stringConverter, @@ -10285,7 +10286,7 @@ class Annotated$Nested<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.Pointer, jni$_.Pointer)>(); - /// from: `public void (com.github.dart_lang.jnigen.annotations.Annotated $outerClass, V object)` + /// from: `public void (com.github.dart_lang.jnigen.annotations.Annotated $outerClass, V object)` /// The returned object must be released after use, by calling the [release] method. factory Annotated$Nested( Annotated<$T?, $U, $W> $outerClass, @@ -10858,7 +10859,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List list()` + /// from: `public java.util.List list()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList list() { return _list(reference.pointer, _id_list as jni$_.JMethodIDPtr) @@ -10883,7 +10884,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List listOfNullable()` + /// from: `public java.util.List listOfNullable()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList listOfNullable() { return _listOfNullable( @@ -10907,7 +10908,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List nullableList(boolean z)` + /// from: `public java.util.List nullableList(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList? nullableList( bool z, @@ -10933,7 +10934,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List nullableListOfNullable(boolean z)` + /// from: `public java.util.List nullableListOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList? nullableListOfNullable( bool z, @@ -11275,7 +11276,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List classGenericList()` + /// from: `public java.util.List classGenericList()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$T> classGenericList() { return _classGenericList( @@ -11301,7 +11302,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List classGenericListOfNullable()` + /// from: `public java.util.List classGenericListOfNullable()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$T?> classGenericListOfNullable() { return _classGenericListOfNullable(reference.pointer, @@ -11324,7 +11325,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List nullableClassGenericList(boolean z)` + /// from: `public java.util.List nullableClassGenericList(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$T>? nullableClassGenericList( bool z, @@ -11349,7 +11350,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List nullableClassGenericListOfNullable(boolean z)` + /// from: `public java.util.List nullableClassGenericListOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$T?>? nullableClassGenericListOfNullable( bool z, @@ -11378,7 +11379,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public java.util.List methodGenericList(V object)` + /// from: `public java.util.List methodGenericList(V object)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$V> methodGenericList<$V extends jni$_.JObject?>( $V object, { @@ -11408,7 +11409,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List methodGenericListOfNullable()` + /// from: `public java.util.List methodGenericListOfNullable()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$V?> methodGenericListOfNullable<$V extends jni$_.JObject?>({ required jni$_.JObjType<$V> V, @@ -11435,7 +11436,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); - /// from: `public java.util.List nullableMethodGenericList(V object, boolean z)` + /// from: `public java.util.List nullableMethodGenericList(V object, boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$V>? nullableMethodGenericList<$V extends jni$_.JObject?>( $V object, @@ -11467,7 +11468,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List nullableMethodGenericListOfNullable(boolean z)` + /// from: `public java.util.List nullableMethodGenericListOfNullable(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList<$V?>? nullableMethodGenericListOfNullable<$V extends jni$_.JObject?>( @@ -11498,7 +11499,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstOfClassGenericList(java.util.List list)` + /// from: `public T firstOfClassGenericList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericList( jni$_.JList<$T> list, @@ -11526,7 +11527,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstOfClassGenericNullableList(java.util.List list)` + /// from: `public T firstOfClassGenericNullableList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericNullableList( jni$_.JList<$T>? list, @@ -11556,7 +11557,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstOfClassGenericListOfNullable(java.util.List list)` + /// from: `public T firstOfClassGenericListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericListOfNullable( jni$_.JList<$T?> list, @@ -11587,7 +11588,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstOfClassGenericNullableListOfNullable(java.util.List list)` + /// from: `public T firstOfClassGenericNullableListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $T? firstOfClassGenericNullableListOfNullable( jni$_.JList<$T?>? list, @@ -11616,7 +11617,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstOfMethodGenericList(java.util.List list)` + /// from: `public V firstOfMethodGenericList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $V? firstOfMethodGenericList<$V extends jni$_.JObject?>( jni$_.JList<$V> list, { @@ -11648,7 +11649,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstOfMethodGenericNullableList(java.util.List list)` + /// from: `public V firstOfMethodGenericNullableList(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $V? firstOfMethodGenericNullableList<$V extends jni$_.JObject?>( jni$_.JList<$V>? list, { @@ -11679,7 +11680,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstOfMethodGenericListOfNullable(java.util.List list)` + /// from: `public V firstOfMethodGenericListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $V? firstOfMethodGenericListOfNullable<$V extends jni$_.JObject?>( jni$_.JList<$V?> list, { @@ -11714,7 +11715,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstOfMethodGenericNullableListOfNullable(java.util.List list)` + /// from: `public V firstOfMethodGenericNullableListOfNullable(java.util.List list)` /// The returned object must be released after use, by calling the [release] method. $V? firstOfMethodGenericNullableListOfNullable<$V extends jni$_.JObject?>( jni$_.JList<$V?>? list, { @@ -11745,7 +11746,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstKeyOfComboMap(java.util.Map map)` + /// from: `public T firstKeyOfComboMap(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $T? firstKeyOfComboMap<$V extends jni$_.JObject?>( jni$_.JMap<$T, $V> map, { @@ -11776,7 +11777,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstValueOfComboMap(java.util.Map map)` + /// from: `public V firstValueOfComboMap(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $V? firstValueOfComboMap<$V extends jni$_.JObject?>( jni$_.JMap<$T, $V> map, { @@ -11808,7 +11809,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstKeyOfComboMapNullableKey(java.util.Map map)` + /// from: `public T firstKeyOfComboMapNullableKey(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $T? firstKeyOfComboMapNullableKey<$V extends jni$_.JObject?>( jni$_.JMap<$T?, $V> map, { @@ -11842,7 +11843,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstValueOfComboMapNullableKey(java.util.Map map)` + /// from: `public V firstValueOfComboMapNullableKey(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $V? firstValueOfComboMapNullableKey<$V extends jni$_.JObject?>( jni$_.JMap<$T?, $V> map, { @@ -11876,7 +11877,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstKeyOfComboMapNullableValue(java.util.Map map)` + /// from: `public T firstKeyOfComboMapNullableValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $T? firstKeyOfComboMapNullableValue<$V extends jni$_.JObject?>( jni$_.JMap<$T, $V?> map, { @@ -11910,7 +11911,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstValueOfComboMapNullableValue(java.util.Map map)` + /// from: `public V firstValueOfComboMapNullableValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $V? firstValueOfComboMapNullableValue<$V extends jni$_.JObject?>( jni$_.JMap<$T, $V?> map, { @@ -11945,7 +11946,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public T firstKeyOfComboMapNullableKeyAndValue(java.util.Map map)` + /// from: `public T firstKeyOfComboMapNullableKeyAndValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $T? firstKeyOfComboMapNullableKeyAndValue<$V extends jni$_.JObject?>( jni$_.JMap<$T?, $V?> map, { @@ -11980,7 +11981,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public V firstValueOfComboMapNullableKeyAndValue(java.util.Map map)` + /// from: `public V firstValueOfComboMapNullableKeyAndValue(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. $V? firstValueOfComboMapNullableKeyAndValue<$V extends jni$_.JObject?>( jni$_.JMap<$T?, $V?> map, { @@ -12013,7 +12014,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public java.util.Map$Entry firstEntryOfComboMap(java.util.Map map)` + /// from: `public java.util.Map$Entry firstEntryOfComboMap(java.util.Map map)` /// The returned object must be released after use, by calling the [release] method. jni$_.JObject? firstEntryOfComboMap<$V extends jni$_.JObject?>( jni$_.JMap<$T, $V> map, { @@ -12094,7 +12095,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List list3dOfT()` + /// from: `public java.util.List>> list3dOfT()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList>> list3dOfT() { return _list3dOfT(reference.pointer, _id_list3dOfT as jni$_.JMethodIDPtr) @@ -12121,7 +12122,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List list3dOfU()` + /// from: `public java.util.List>> list3dOfU()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList>> list3dOfU() { return _list3dOfU(reference.pointer, _id_list3dOfU as jni$_.JMethodIDPtr) @@ -12147,7 +12148,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List list3dOfW()` + /// from: `public java.util.List>> list3dOfW()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList>> list3dOfW() { return _list3dOfW(reference.pointer, _id_list3dOfW as jni$_.JMethodIDPtr) @@ -12171,7 +12172,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List list3dOfNullableU(boolean z)` + /// from: `public java.util.List>> list3dOfNullableU(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList>> list3dOfNullableU( bool z, @@ -12199,7 +12200,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `public java.util.List list3dOfNullableW(boolean z)` + /// from: `public java.util.List>> list3dOfNullableW(boolean z)` /// The returned object must be released after use, by calling the [release] method. jni$_.JList>> list3dOfNullableW( bool z, @@ -12229,7 +12230,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public com.github.dart_lang.jnigen.annotations.Annotated.Nested nested()` + /// from: `public com.github.dart_lang.jnigen.annotations.Annotated$Nested nested()` /// The returned object must be released after use, by calling the [release] method. Annotated$Nested<$T?, $U, $W, jni$_.JInteger>? nested() { return _nested(reference.pointer, _id_nested as jni$_.JMethodIDPtr) @@ -12255,7 +12256,7 @@ class Annotated<$T extends jni$_.JObject?, $U extends jni$_.JObject, jni$_.JMethodIDPtr, )>(); - /// from: `public java.util.List intList()` + /// from: `public java.util.List intList()` /// The returned object must be released after use, by calling the [release] method. jni$_.JList intList() { return _intList(reference.pointer, _id_intList as jni$_.JMethodIDPtr) diff --git a/pkgs/jnigen/test/summary_test.dart b/pkgs/jnigen/test/summary_test.dart index 9dc5190f5e..8868168983 100644 --- a/pkgs/jnigen/test/summary_test.dart +++ b/pkgs/jnigen/test/summary_test.dart @@ -78,20 +78,20 @@ void registerCommonTests(Classes classes) { expect(example.getMethod('finalMethod').modifiers, isFinal); }); - void assertToBeStringListType(TypeUsage listType) { - expect(listType.kind, equals(Kind.declared)); - final listClassType = listType.type as DeclaredType; + void assertToBeStringListType(ReferredType listType) { + expect(listType, isA()); + final listClassType = listType as DeclaredType; expect(listClassType.binaryName, equals('java.util.List')); expect(listClassType.params, hasLength(1)); final listTypeParam = listClassType.params[0]; - expect(listTypeParam.kind, equals(Kind.declared)); - expect(listTypeParam.type.name, equals('java.lang.String')); + expect(listTypeParam, isA()); + expect(listTypeParam.name, equals('java.lang.String')); } test('return types', () { final example = classes.getExampleClass(); - expect(example.getMethod('getNumber').returnType.shorthand, equals('int')); - expect(example.getMethod('getName').returnType.shorthand, + expect(example.getMethod('getNumber').returnType.name, equals('int')); + expect(example.getMethod('getName').returnType.name, equals('java.lang.String')); expect(example.getMethod('getNestedInstance').returnType.name, equals('$simplePackage.Example\$Nested')); @@ -105,8 +105,8 @@ void registerCommonTests(Classes classes) { final listType = joinStrings.params[0].type; assertToBeStringListType(listType); final stringType = joinStrings.params[1].type; - expect(stringType.kind, Kind.declared); - expect((stringType.type as DeclaredType).binaryName, 'java.lang.String'); + expect(stringType, isA()); + expect((stringType as DeclaredType).binaryName, 'java.lang.String'); }); test('Parameters of several types', () { @@ -117,51 +117,51 @@ void registerCommonTests(Classes classes) { expect(method.typeParams[0].bounds[0].name, 'java.lang.CharSequence'); final charParam = method.params[0]; - expect(charParam.type.kind, equals(Kind.primitive)); + expect(charParam.type, isA()); expect(charParam.type.name, equals('char')); final stringParam = method.params[1]; - expect(stringParam.type.kind, equals(Kind.declared)); - expect((stringParam.type.type as DeclaredType).binaryName, + expect(stringParam.type, isA()); + expect((stringParam.type as DeclaredType).binaryName, equals('java.lang.String')); final arrayParam = method.params[2]; - expect(arrayParam.type.kind, equals(Kind.array)); - expect((arrayParam.type.type as ArrayType).elementType.name, equals('int')); + expect(arrayParam.type, isA()); + expect((arrayParam.type as ArrayType).elementType.name, equals('int')); final typeVarParam = method.params[3]; - expect(typeVarParam.type.kind, equals(Kind.typeVariable)); - expect((typeVarParam.type.type as TypeVar).name, equals('T')); + expect(typeVarParam.type, isA()); + expect((typeVarParam.type as TypeVar).name, equals('T')); final listParam = method.params[4]; - expect(listParam.type.kind, equals(Kind.declared)); - final listType = listParam.type.type as DeclaredType; + expect(listParam.type, isA()); + final listType = listParam.type as DeclaredType; expect(listType.binaryName, equals('java.util.List')); expect(listType.params, hasLength(1)); final tType = listType.params[0]; - expect(tType.kind, Kind.typeVariable); - expect((tType.type as TypeVar).name, equals('T')); + expect(tType, isA()); + expect((tType as TypeVar).name, equals('T')); final wildcardMapParam = method.params[5]; - expect(wildcardMapParam.type.kind, equals(Kind.declared)); - final mapType = wildcardMapParam.type.type as DeclaredType; + expect(wildcardMapParam.type, isA()); + final mapType = wildcardMapParam.type as DeclaredType; expect(mapType.binaryName, equals('java.util.Map')); expect(mapType.params, hasLength(2)); final strType = mapType.params[0]; expect(strType.name, 'java.lang.String'); final wildcardType = mapType.params[1]; - expect(wildcardType.kind, equals(Kind.wildcard)); - expect((wildcardType.type as Wildcard).extendsBound?.name, + expect(wildcardType, isA()); + expect((wildcardType as Wildcard).extendsBound?.name, equals('java.lang.CharSequence')); }); test('typeParameters', () { final grandParent = classes.getClass('generics', 'GrandParent'); final stringParent = grandParent.getMethod('stringParent'); - final returnType = stringParent.returnType.type as DeclaredType; + final returnType = stringParent.returnType as DeclaredType; expect(returnType.params, hasLength(2)); - expect(returnType.params[0].type, isA()); - expect(returnType.params[1].type, isA()); + expect(returnType.params[0], isA()); + expect(returnType.params[1], isA()); }); test('superclass', () { @@ -174,9 +174,9 @@ void registerCommonTests(Classes classes) { final specific = classes.getClass('inheritance', 'SpecificDerivedClass'); expect(specific.typeParams, hasLength(0)); expect(specific.superclass, isNotNull); - final specificSuper = specific.superclass!.type as DeclaredType; - expect(specificSuper.params[0].type, isA()); - expect(specificSuper.params[0].type.name, equals('java.lang.String')); + final specificSuper = specific.superclass! as DeclaredType; + expect(specificSuper.params[0], isA()); + expect(specificSuper.params[0].name, equals('java.lang.String')); final generic = classes.getClass('inheritance', 'GenericDerivedClass'); expect(generic.typeParams, hasLength(1)); @@ -184,9 +184,9 @@ void registerCommonTests(Classes classes) { expect(generic.typeParams[0].bounds.map((b) => b.name).toList(), ['java.lang.CharSequence']); expect(generic.superclass, isNotNull); - final genericSuper = generic.superclass!.type as DeclaredType; - expect(genericSuper.params[0].type, isA()); - expect(genericSuper.params[0].type.name, equals('T')); + final genericSuper = generic.superclass! as DeclaredType; + expect(genericSuper.params[0], isA()); + expect(genericSuper.params[0].name, equals('T')); }); test('constructor is included', () { @@ -261,14 +261,14 @@ void registerCommonTests(Classes classes) { expect(typeParams[0].bounds.map((e) => e.name), ['java.lang.CharSequence']); expect(typeParams[1].name, equals('K')); final selfBound = typeParams[1].bounds[0]; - expect(selfBound.kind, Kind.declared); + expect(selfBound, isA()); expect(selfBound.name, equals('com.github.dart_lang.jnigen.generics.GenericTypeParams')); - final selfBoundType = selfBound.type as DeclaredType; + final selfBoundType = selfBound as DeclaredType; expect(selfBoundType.params, hasLength(2)); expect(selfBoundType.params.map((e) => e.name), ['S', 'K']); - expect(selfBoundType.params.map((e) => e.kind), - [Kind.typeVariable, Kind.typeVariable]); + expect(selfBoundType.params[0], isA()); + expect(selfBoundType.params[1], isA()); }); } diff --git a/pkgs/jnigen/test/user_visitor_test.dart b/pkgs/jnigen/test/user_visitor_test.dart index 478b395e8b..1a621665d9 100644 --- a/pkgs/jnigen/test/user_visitor_test.dart +++ b/pkgs/jnigen/test/user_visitor_test.dart @@ -107,31 +107,31 @@ void main() { 'Foo': ast.ClassDecl( binaryName: 'Foo', declKind: ast.DeclKind.classKind, - superclass: ast.TypeUsage.object, + superclass: ast.DeclaredType.object, methods: [ - ast.Method(name: 'foo', returnType: ast.TypeUsage.object), - ast.Method(name: 'Bar', returnType: ast.TypeUsage.object), - ast.Method(name: 'foo1', returnType: ast.TypeUsage.object), - ast.Method(name: 'Bar', returnType: ast.TypeUsage.object), + ast.Method(name: 'foo', returnType: ast.DeclaredType.object), + ast.Method(name: 'Bar', returnType: ast.DeclaredType.object), + ast.Method(name: 'foo1', returnType: ast.DeclaredType.object), + ast.Method(name: 'Bar', returnType: ast.DeclaredType.object), ], fields: [ - ast.Field(name: 'foo', type: ast.TypeUsage.object), - ast.Field(name: 'Bar', type: ast.TypeUsage.object), - ast.Field(name: 'foo1', type: ast.TypeUsage.object), - ast.Field(name: 'Bar', type: ast.TypeUsage.object), + ast.Field(name: 'foo', type: ast.DeclaredType.object), + ast.Field(name: 'Bar', type: ast.DeclaredType.object), + ast.Field(name: 'foo1', type: ast.DeclaredType.object), + ast.Field(name: 'Bar', type: ast.DeclaredType.object), ], ), 'y.Foo': ast.ClassDecl( binaryName: 'y.Foo', declKind: ast.DeclKind.classKind, - superclass: ast.TypeUsage.object, + superclass: ast.DeclaredType.object, methods: [ - ast.Method(name: 'foo', returnType: ast.TypeUsage.object), - ast.Method(name: 'Bar', returnType: ast.TypeUsage.object), + ast.Method(name: 'foo', returnType: ast.DeclaredType.object), + ast.Method(name: 'Bar', returnType: ast.DeclaredType.object), ], fields: [ - ast.Field(name: 'foo', type: ast.TypeUsage.object), - ast.Field(name: 'Bar', type: ast.TypeUsage.object), + ast.Field(name: 'foo', type: ast.DeclaredType.object), + ast.Field(name: 'Bar', type: ast.DeclaredType.object), ]), }); @@ -153,30 +153,30 @@ void main() { 'Foo': ast.ClassDecl( binaryName: 'Foo', declKind: ast.DeclKind.classKind, - superclass: ast.TypeUsage.object, + superclass: ast.DeclaredType.object, methods: [ - ast.Method(name: 'Foo', returnType: ast.TypeUsage.object), - ast.Method(name: 'Foo', returnType: ast.TypeUsage.object), - ast.Method(name: 'Foo1', returnType: ast.TypeUsage.object), - ast.Method(name: 'Foo1', returnType: ast.TypeUsage.object), + ast.Method(name: 'Foo', returnType: ast.DeclaredType.object), + ast.Method(name: 'Foo', returnType: ast.DeclaredType.object), + ast.Method(name: 'Foo1', returnType: ast.DeclaredType.object), + ast.Method(name: 'Foo1', returnType: ast.DeclaredType.object), ], fields: [ - ast.Field(name: 'Foo', type: ast.TypeUsage.object), - ast.Field(name: 'Foo', type: ast.TypeUsage.object), - ast.Field(name: 'Foo1', type: ast.TypeUsage.object), - ast.Field(name: 'Foo1', type: ast.TypeUsage.object), + ast.Field(name: 'Foo', type: ast.DeclaredType.object), + ast.Field(name: 'Foo', type: ast.DeclaredType.object), + ast.Field(name: 'Foo1', type: ast.DeclaredType.object), + ast.Field(name: 'Foo1', type: ast.DeclaredType.object), ], ), 'y.Foo': ast.ClassDecl( binaryName: 'y.Foo', declKind: ast.DeclKind.classKind, - superclass: ast.TypeUsage.object, + superclass: ast.DeclaredType.object, methods: [ - ast.Method(name: 'Foo', returnType: ast.TypeUsage.object, params: [ - ast.Param(name: 'Foo', type: ast.TypeUsage.object), - ast.Param(name: 'Foo1', type: ast.TypeUsage.object), + ast.Method(name: 'Foo', returnType: ast.DeclaredType.object, params: [ + ast.Param(name: 'Foo', type: ast.DeclaredType.object), + ast.Param(name: 'Foo1', type: ast.DeclaredType.object), ]), - ast.Method(name: '', returnType: ast.TypeUsage.object) + ast.Method(name: '', returnType: ast.DeclaredType.object) ], ), });