Commit c6e3893
authored
Context: #1184 (comment)
Previously we were using `Assembly.Load()` and `Assembly.GetType()`,
which require us to ignore various trimmer warnings.
During code review, @vitek-karas asked:
> Is there a reason
> [`JniRuntime.JniMarshalMemberBuilder.SetMarshalMemberBuilder()`]
> can't use
> `Type.GetType("Java.Interop.MarshalMemberBuilder, Java.Interop.Export")`.
> That is something both trimmer and AOT understand and will handle
> without warnings and correctly preserve the .ctor in the call to
> `Activator.CreateInstance`.
Indeed, there isn't a reason to avoid `Type.GetType()` in
`JniRuntime.JniMarshalMemberBuilder.SetMarshalMemberBuilder()`.
If we use `Type.GetType()` with a constant string instead, the
trimmer knows how to handle this properly.
(The code is also simpler.)
1 parent 7d1e705 commit c6e3893
File tree
1 file changed
+1
-14
lines changed- src/Java.Interop/Java.Interop
1 file changed
+1
-14
lines changedLines changed: 1 addition & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | 30 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | 31 | | |
38 | 32 | | |
39 | 33 | | |
| |||
45 | 39 | | |
46 | 40 | | |
47 | 41 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 42 | + | |
56 | 43 | | |
57 | 44 | | |
58 | 45 | | |
| |||
0 commit comments