forked from mirror/monocles_chat_clean
Code cleanup
This commit is contained in:
parent
b031df5e75
commit
06fb90706e
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
|
||||
|
||||
# Needed for proper GSON deserialization
|
||||
-keep class com.google.gson.reflect.TypeToken
|
||||
-keep class * extends com.google.gson.reflect.TypeToken
|
||||
-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 java.io.IOException;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
@ -76,9 +74,8 @@ public class Reaction {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
try {
|
||||
Type type = new TypeToken<ArrayList<Reaction>>() {}.getType();
|
||||
return GSON.fromJson(asString, type);
|
||||
} catch (final JsonSyntaxException e) {
|
||||
return GSON.fromJson(asString, new TypeToken<List<Reaction>>() {}.getType());
|
||||
} catch (final IllegalArgumentException | JsonSyntaxException e) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue