forked from mirror/monocles_chat
Code cleanup
This commit is contained in:
parent
3069ec76fc
commit
004504b04c
2 changed files with 3 additions and 5 deletions
1
proguard-rules.pro
vendored
1
proguard-rules.pro
vendored
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
-keep class com.kyleduo.switchbutton.Configuration
|
-keep class com.kyleduo.switchbutton.Configuration
|
||||||
|
|
||||||
|
# Needed for proper GSON deserialization
|
||||||
-keep class com.google.gson.reflect.TypeToken
|
-keep class com.google.gson.reflect.TypeToken
|
||||||
-keep class * extends com.google.gson.reflect.TypeToken
|
-keep class * extends com.google.gson.reflect.TypeToken
|
||||||
-keep public class * implements java.lang.reflect.Type
|
-keep public class * implements java.lang.reflect.Type
|
||||||
|
|
|
@ -21,8 +21,6 @@ import com.google.gson.stream.JsonWriter;
|
||||||
import eu.siacs.conversations.xmpp.Jid;
|
import eu.siacs.conversations.xmpp.Jid;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
@ -76,9 +74,8 @@ public class Reaction {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Type type = new TypeToken<ArrayList<Reaction>>() {}.getType();
|
return GSON.fromJson(asString, new TypeToken<List<Reaction>>() {}.getType());
|
||||||
return GSON.fromJson(asString, type);
|
} catch (final IllegalArgumentException | JsonSyntaxException e) {
|
||||||
} catch (final JsonSyntaxException e) {
|
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue