Commit 2bdf2bc
authored
[Java.Base] Bind package java.util.concurrent (#1274)
Context: 0aec86a
Commit 0aec86a mentioned:
> * Use of `JNIEnv.GetJniName()`
>
> string __id = "(L" + global::Android.Runtime.JNIEnv.GetJniName (GetType ().DeclaringType) + ";)V";
>
> Impacts: NestedTypes.cs
This issue also impacts
[`java.util.concurrent.locks.AbstractQueuedSynchronizer.ConditionObject`][0].
Update `Java.Base` to bind the `java.util.concurrent` package, which
will cause `AbstractQueuedSynchronizer` to be bound, which in turn
forces us to update `generator` to not emit `JNIEnv.GetJniName()`.
Instead of using `JNIEnv.GetJniName(GetType().DeclaringType)`, use:
JniEnvironment.Runtime.TypeManager.GetTypeSignature (GetType ().DeclaringType).SimpleReference
Update NestedTypes.cs to enable `TryJavaInterop1 => true`.
Update `Java.Base.csproj` to ignore C# warning [CS0109][1], as
[`CompletableFuture.handle()`][2] is emitted with a `new` which is
not required:
Java.Util.Concurrent.CompletableFuture.cs(629,76): warning CS0109: The member
'CompletableFuture.Handle(IBiFunction?)' does not hide an accessible member.
The new keyword is not required.
Add a test to `tests/Java.Base-Tests` which tests nested type support.
Update `JavaNativeTypeManager.cs` so that `IsNonStaticInnerClass()`
supports JavaInterop1-style attributes, not just XAJavaInterop1.
Aside: I updated my local JDK to JDK-17 (from JDK-11), which caused
many changes to `src/Java.Base-ref.cs`, particularly parameter names.
TODO? Update `Java.Interop.Tools.JavaCallableWrappers` so that
non-static inner classes don't have a prefix of their declaring type.
This would result in `example/MyQueuedSynchronizer$MyConditionObject`
instead of
`example/MyQueuedSynchronizer$MyQueuedSynchronizer_MyConditionObject`.
[0]: https://developer.android.com/reference/java/util/concurrent/locks/AbstractQueuedSynchronizer.ConditionObject
[1]: https://learn.microsoft.com/dotnet/csharp/misc/cs0109
[2]: https://developer.android.com/reference/java/util/concurrent/CompletableFuture#handle(java.util.function.BiFunction%3C?%20super%20T,java.lang.Throwable,?%20extends%20U%3E)1 parent 87fdb8e commit 2bdf2bc
File tree
10 files changed
+3072
-35
lines changed- src
- Java.Base
- Transforms
- Java.Interop.Tools.TypeNameMappings/Java.Interop.Tools.TypeNameMappings
- tests
- Java.Base-Tests/Java.Base
- generator-Tests
- Integration-Tests
- expected.ji/NestedTypes
- tools/generator/Java.Interop.Tools.Generator.ObjectModel
10 files changed
+3072
-35
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
90 | 123 | | |
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
740 | | - | |
| 740 | + | |
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
756 | 764 | | |
757 | 765 | | |
758 | 766 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
1 | 11 | | |
2 | 12 | | |
3 | 13 | | |
| |||
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
1 | 11 | | |
2 | 12 | | |
3 | 13 | | |
| |||
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
| 27 | + | |
17 | 28 | | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
21 | 60 | | |
22 | 61 | | |
23 | 62 | | |
| |||
64 | 103 | | |
65 | 104 | | |
66 | 105 | | |
| 106 | + | |
67 | 107 | | |
68 | 108 | | |
69 | | - | |
| 109 | + | |
70 | 110 | | |
71 | 111 | | |
72 | 112 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| |||
0 commit comments