Skip to content

Commit

Permalink
Close #1516
Browse files Browse the repository at this point in the history
  • Loading branch information
HosseinYousefi committed Dec 9, 2024
1 parent 8ea1a9d commit 7dc45f2
Show file tree
Hide file tree
Showing 12 changed files with 1,156 additions and 1,083 deletions.
2 changes: 2 additions & 0 deletions pkgs/jnigen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 0.13.0-wip

- **Breaking Change**([#1516](https://github.com/dart-lang/native/issues/1516)):
Inner classes are now generated as `OuterClass$InnerClass`.
- **Breaking Change**([#1644](https://github.com/dart-lang/native/issues/1644)):
Generate null-safe Dart bindings for Java and Kotlin.
- Fixed a potential name collision when generating in multi-file mode.
Expand Down
24 changes: 24 additions & 0 deletions pkgs/jnigen/doc/java_differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,27 @@ class $_Example extends JObject {
void $_printMessage() { /* ... */ }
}
```

### Inner classes

Java has the concept of inner classes, while Dart does not. Therefore, inner
classes are generated as separate classes named by the name of their outer class
followed by a dollar sign (`$`) followed by their original name.

For example:

```java
// Java
public class Outer {
public class Inner {}
}
```

will be turned into:

```dart
// Dart Bindings - Boilerplate omitted for clarity.
class Outer extends JObject {}
class Outer$Inner extends JObject {}
```
Loading

0 comments on commit 7dc45f2

Please sign in to comment.