Minor Deserialize hints string to generic list properly
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 25 Jul 2016 10:43:45 +0000 (13:43 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 25 Jul 2016 16:25:34 +0000 (19:25 +0300)
python/educational-core/student/src/com/jetbrains/edu/learning/StudySerializationUtils.java

index 6926cb3796546f79dcd86fad0ae7746c86bc71db..4424fc76744a9b9b8e4d701fc0e2231db01ea8e2 100644 (file)
@@ -1,6 +1,7 @@
 package com.jetbrains.edu.learning;
 
 import com.google.gson.*;
 package com.jetbrains.edu.learning;
 
 import com.google.gson.*;
+import com.google.gson.reflect.TypeToken;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.EditorFactory;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.EditorFactory;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
@@ -400,7 +401,8 @@ public class StudySerializationUtils {
           final JsonArray hintsArray = new JsonArray();
 
           try {
           final JsonArray hintsArray = new JsonArray();
 
           try {
-            final List<String> hints = gson.fromJson(hintString, List.class);
+            final Type listType = new TypeToken<List<String>>() {}.getType();
+            final List<String> hints = gson.fromJson(hintString, listType);
             for (String hint : hints) {
               hintsArray.add(hint);
             }
             for (String hint : hints) {
               hintsArray.add(hint);
             }