Commit 0dfe71c
Fix crash when changing username on Android API < 24.
Basically, the crash was caused by using `Collections.unmodifiableList()`, which creates an `UnmodifiableCollection` wrapper around the original `List`.
That `UnmodifiableCollection` wrapper contains methods that return `java.util.stream.Stream` – which was added in Java 8, but can be used on Android API < 24 through [desugaring](https://developer.android.com/studio/write/java8-support-table).
_However_, it appears that when Jackson is using reflection to serialize `ReserveUsernameRequest`, it examines all of the methods of that class. This results in a `java.lang.NoClassDefFoundError: java.util.stream.Stream`, because the reflection is looking at the actual runtime `UnmodifiableCollection` class and not desugared code.
As far as I can tell, that behavior is unavoidable and the only way to avoid this issue is to avoid using `Collections.unmodifiableList()` in classes that are serialized by Jackson on Android API < 24.1 parent dc66da0 commit 0dfe71c
File tree
1 file changed
+1
-2
lines changed- libsignal-service/src/main/java/org/whispersystems/signalservice/internal/push
1 file changed
+1
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | | - | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
0 commit comments