Store language as a String in the course

Language can't be serialized because of there is no default constructor
This commit is contained in:
Ekaterina Tuzova
2015-01-26 19:16:58 +03:00
parent 84cdc8a88f
commit e8515fa4f8
2 changed files with 4 additions and 5 deletions
@@ -24,7 +24,7 @@ public class Course {
private String myCourseDirectory = "";
private String author="";
private boolean myUpToDate;
private Language myLanguage;
private String myLanguage;
public List<Lesson> getLessons() {
@@ -114,10 +114,10 @@ public class Course {
}
public Language getLanguage() {
return myLanguage;
return Language.findLanguageByID(myLanguage);
}
public void setLanguage(Language language) {
public void setLanguage(@NotNull final String language) {
myLanguage = language;
}
@@ -3,7 +3,6 @@ package com.jetbrains.edu.learning.stepic;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.intellij.lang.Language;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.io.HttpRequests;
import com.jetbrains.edu.learning.course.*;
@@ -49,7 +48,7 @@ public class StudyStepicConnector {
course.setDescription(info.getDescription());
course.setName(info.getName());
course.lessons = new ArrayList<Lesson>();
course.setLanguage(Language.findLanguageByID("Python")); // TODO: get from stepic
course.setLanguage("Python"); // TODO: get from stepic
if (info.equals(ourTestCourseInfo)) { // TODO: to be removed
try {