Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HosseinYousefi committed Sep 23, 2024
1 parent 1aba180 commit 8720fcc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions pkgs/jni/lib/src/lang/jcharacter.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Copyright (c) 2024, 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.

import 'package:meta/meta.dart' show internal;

import '../jobject.dart';
Expand Down
4 changes: 3 additions & 1 deletion pkgs/jni/lib/src/util/jlist.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ final class JListType<$E extends JObject> extends JObjType<JList<$E>> {

@override
bool operator ==(Object other) {
return other.runtimeType == JListType && other is JListType && E == other.E;
return other.runtimeType == (JListType<$E>) &&
other is JListType<$E> &&
E == other.E;
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkgs/jnigen/example/pdfbox_plugin/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class PDFFileInfo {
/// Converts JString to dart string and deletes the original.
/// Also handles the case where the underlying string is Null.
String _fromJavaStr(JString jstr) {
if (jstr.reference.pointer == nullptr) {
if (jstr.isNull) {
return '(null)';
}
return jstr.toDartString(releaseOriginal: true);
Expand Down

0 comments on commit 8720fcc

Please sign in to comment.