Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions pkgs/jnigen/test/jackson_core_test/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,6 @@ Config getConfig({
'com.fasterxml.jackson.core.JsonToken',
],
logLevel: Level.INFO,
exclude: BindingExclusions(
// TODO(#31): Remove field exclusions.
fields: excludeAll<Field>([
['com.fasterxml.jackson.core.JsonFactory', 'DEFAULT_QUOTE_CHAR'],
['com.fasterxml.jackson.core.Base64Variant', 'PADDING_CHAR_NONE'],
['com.fasterxml.jackson.core.base.ParserMinimalBase', 'CHAR_NULL'],
['com.fasterxml.jackson.core.io.UTF32Reader', 'NC'],
]),
// TODO(#159): Remove class exclusions.
classes: ClassNameFilter.exclude(
'com.fasterxml.jackson.core.JsonFactoryBuilder',
),
),
);
return config;
}
Expand Down
272 changes: 272 additions & 0 deletions pkgs/jnigen/test/simple_package_test/bindings/simple_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13731,3 +13731,275 @@ final class $R2250$Type<$T extends jni$_.JObject?>
T == other.T;
}
}

/// from: `com.github.dart_lang.jnigen.regressions.R693$Child`
class R693$Child extends R693<R693$Child?> {
@jni$_.internal
@core$_.override
final jni$_.JObjType<R693$Child> $type;

@jni$_.internal
R693$Child.fromReference(
jni$_.JReference reference,
) : $type = type,
super.fromReference(const $R693$Child$NullableType(), reference);

static final _class = jni$_.JClass.forName(
r'com/github/dart_lang/jnigen/regressions/R693$Child');

/// The type which includes information such as the signature of this class.
static const nullableType = $R693$Child$NullableType();
static const type = $R693$Child$Type();
static final _id_new$ = _class.constructorId(
r'()V',
);

static final _new$ = jni$_.ProtectedJniExtensions.lookup<
jni$_.NativeFunction<
jni$_.JniResult Function(
jni$_.Pointer<jni$_.Void>,
jni$_.JMethodIDPtr,
)>>('globalEnv_NewObject')
.asFunction<
jni$_.JniResult Function(
jni$_.Pointer<jni$_.Void>,
jni$_.JMethodIDPtr,
)>();

/// from: `public void <init>()`
/// The returned object must be released after use, by calling the [release] method.
factory R693$Child() {
return R693$Child.fromReference(
_new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr)
.reference);
}
}

final class $R693$Child$NullableType extends jni$_.JObjType<R693$Child?> {
@jni$_.internal
const $R693$Child$NullableType();

@jni$_.internal
@core$_.override
String get signature =>
r'Lcom/github/dart_lang/jnigen/regressions/R693$Child;';

@jni$_.internal
@core$_.override
R693$Child? fromReference(jni$_.JReference reference) => reference.isNull
? null
: R693$Child.fromReference(
reference,
);
@jni$_.internal
@core$_.override
jni$_.JObjType get superType =>
const $R693$NullableType<R693$Child?>($R693$Child$NullableType());

@jni$_.internal
@core$_.override
jni$_.JObjType<R693$Child?> get nullableType => this;

@jni$_.internal
@core$_.override
final superCount = 2;

@core$_.override
int get hashCode => ($R693$Child$NullableType).hashCode;

@core$_.override
bool operator ==(Object other) {
return other.runtimeType == ($R693$Child$NullableType) &&
other is $R693$Child$NullableType;
}
}

final class $R693$Child$Type extends jni$_.JObjType<R693$Child> {
@jni$_.internal
const $R693$Child$Type();

@jni$_.internal
@core$_.override
String get signature =>
r'Lcom/github/dart_lang/jnigen/regressions/R693$Child;';

@jni$_.internal
@core$_.override
R693$Child fromReference(jni$_.JReference reference) =>
R693$Child.fromReference(
reference,
);
@jni$_.internal
@core$_.override
jni$_.JObjType get superType =>
const $R693$NullableType<R693$Child?>($R693$Child$NullableType());

@jni$_.internal
@core$_.override
jni$_.JObjType<R693$Child?> get nullableType =>
const $R693$Child$NullableType();

@jni$_.internal
@core$_.override
final superCount = 2;

@core$_.override
int get hashCode => ($R693$Child$Type).hashCode;

@core$_.override
bool operator ==(Object other) {
return other.runtimeType == ($R693$Child$Type) && other is $R693$Child$Type;
}
}

/// from: `com.github.dart_lang.jnigen.regressions.R693`
class R693<$T extends jni$_.JObject?> extends jni$_.JObject {
@jni$_.internal
@core$_.override
final jni$_.JObjType<R693<$T>> $type;

@jni$_.internal
final jni$_.JObjType<$T> T;

@jni$_.internal
R693.fromReference(
this.T,
jni$_.JReference reference,
) : $type = type<$T>(T),
super.fromReference(reference);

static final _class =
jni$_.JClass.forName(r'com/github/dart_lang/jnigen/regressions/R693');

/// The type which includes information such as the signature of this class.
static $R693$NullableType<$T> nullableType<$T extends jni$_.JObject?>(
jni$_.JObjType<$T> T,
) {
return $R693$NullableType<$T>(
T,
);
}

static $R693$Type<$T> type<$T extends jni$_.JObject?>(
jni$_.JObjType<$T> T,
) {
return $R693$Type<$T>(
T,
);
}

static final _id_new$ = _class.constructorId(
r'()V',
);

static final _new$ = jni$_.ProtectedJniExtensions.lookup<
jni$_.NativeFunction<
jni$_.JniResult Function(
jni$_.Pointer<jni$_.Void>,
jni$_.JMethodIDPtr,
)>>('globalEnv_NewObject')
.asFunction<
jni$_.JniResult Function(
jni$_.Pointer<jni$_.Void>,
jni$_.JMethodIDPtr,
)>();

/// from: `public void <init>()`
/// The returned object must be released after use, by calling the [release] method.
factory R693({
required jni$_.JObjType<$T> T,
}) {
return R693<$T>.fromReference(
T,
_new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr)
.reference);
}
}

final class $R693$NullableType<$T extends jni$_.JObject?>
extends jni$_.JObjType<R693<$T>?> {
@jni$_.internal
final jni$_.JObjType<$T> T;

@jni$_.internal
const $R693$NullableType(
this.T,
);

@jni$_.internal
@core$_.override
String get signature => r'Lcom/github/dart_lang/jnigen/regressions/R693;';

@jni$_.internal
@core$_.override
R693<$T>? fromReference(jni$_.JReference reference) => reference.isNull
? null
: R693<$T>.fromReference(
T,
reference,
);
@jni$_.internal
@core$_.override
jni$_.JObjType get superType => const jni$_.JObjectNullableType();

@jni$_.internal
@core$_.override
jni$_.JObjType<R693<$T>?> get nullableType => this;

@jni$_.internal
@core$_.override
final superCount = 1;

@core$_.override
int get hashCode => Object.hash($R693$NullableType, T);

@core$_.override
bool operator ==(Object other) {
return other.runtimeType == ($R693$NullableType<$T>) &&
other is $R693$NullableType<$T> &&
T == other.T;
}
}

final class $R693$Type<$T extends jni$_.JObject?>
extends jni$_.JObjType<R693<$T>> {
@jni$_.internal
final jni$_.JObjType<$T> T;

@jni$_.internal
const $R693$Type(
this.T,
);

@jni$_.internal
@core$_.override
String get signature => r'Lcom/github/dart_lang/jnigen/regressions/R693;';

@jni$_.internal
@core$_.override
R693<$T> fromReference(jni$_.JReference reference) => R693<$T>.fromReference(
T,
reference,
);
@jni$_.internal
@core$_.override
jni$_.JObjType get superType => const jni$_.JObjectNullableType();

@jni$_.internal
@core$_.override
jni$_.JObjType<R693<$T>?> get nullableType => $R693$NullableType<$T>(T);

@jni$_.internal
@core$_.override
final superCount = 1;

@core$_.override
int get hashCode => Object.hash($R693$Type, T);

@core$_.override
bool operator ==(Object other) {
return other.runtimeType == ($R693$Type<$T>) &&
other is $R693$Type<$T> &&
T == other.T;
}
}
1 change: 1 addition & 0 deletions pkgs/jnigen/test/simple_package_test/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ final javaFiles = [
join(javaPrefix, 'interfaces', 'StringConverterConsumer.java'),
join(javaPrefix, 'pkg2', 'C2.java'),
join(javaPrefix, 'pkg2', 'Example.java'),
join(javaPrefix, 'regressions', 'R693.java'),
join(javaPrefix, 'regressions', 'R2250.java'),
join(javaPrefix, 'simple_package', 'Example.java'),
join(javaPrefix, 'simple_package', 'Exceptions.java'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package com.github.dart_lang.jnigen.regressions;

// Regression test for https://github.com/dart-lang/native/issues/2250.
public interface R2250<T> {
public void foo(T t);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

package com.github.dart_lang.jnigen.regressions;

// Regression test for https://github.com/dart-lang/native/issues/693.
public class R693<T extends R693<T>> {
T foo() {
return null;
}

public static class Child extends R693<Child> {
Child foo() {
return new Child();
}
}
}
Loading