Commit 99c68a8
authored
[Java.Interop] JniTypeSignature & CultureInfo, empty strings (#1002)
Fixes: #335
Context: 920ea64
Commit 920ea64 optimized `JniTypeManager.AssertSimpleReference()` by
using `string.IndexOf(char)`.
This dovetails with Issue #335, which wanted to optimize
`JniTypeSignature` by removing calls to `string.Contains(string)`.
Fix #335, and update the `JniTypeSignature` constructor to use
`string.IndexOf(char)` instead of `string.Contains(string)`, and use
string indexers instead of `string.StartsWith()` and
`string.EndsWith()`.
`Java.Interop.dll` has no remaining usage of `string.StartsWith()`
and `string.EndsWith()`.
Additionally, update `JniTypeSignature` so that the empty string `""`
is *not* treated as a valid type signature. This is arguably a
breaking change, but the empty string never made sense, *and* would
throw an `IndexOutOfRangeException` with `JniTypeManager.Parse()`.1 parent 920ea64 commit 99c68a8
File tree
2 files changed
+22
-3
lines changed- src/Java.Interop/Java.Interop
- tests/Java.Interop-Tests/Java.Interop
2 files changed
+22
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
| 110 | + | |
| 111 | + | |
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
19 | 27 | | |
20 | 28 | | |
| |||
55 | 63 | | |
56 | 64 | | |
57 | 65 | | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
78 | 87 | | |
79 | 88 | | |
80 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
81 | 96 | | |
82 | 97 | | |
83 | 98 | | |
0 commit comments