EDU-717 Adaptive/Nonadaptive sorting breaks "Preview Course" action
[idea/community.git] / python / educational-core / student / src / com / jetbrains / edu / learning / StudyUtils.java
index c82a0379c2d1751881e5e8fd03726b1934fddc32..8c926e52ceeace1cf0b2fe286d26cdbffa6fbf6e 100644 (file)
@@ -59,7 +59,6 @@ import com.jetbrains.edu.learning.core.EduUtils;
 import com.jetbrains.edu.learning.courseFormat.*;
 import com.jetbrains.edu.learning.courseGeneration.StudyProjectGenerator;
 import com.jetbrains.edu.learning.editor.StudyEditor;
-import com.jetbrains.edu.learning.stepic.CourseInfo;
 import com.jetbrains.edu.learning.ui.StudyToolWindow;
 import com.jetbrains.edu.learning.ui.StudyToolWindowFactory;
 import com.petebevin.markdown.MarkdownProcessor;
@@ -69,7 +68,9 @@ import org.jetbrains.annotations.Nullable;
 import javax.swing.*;
 import java.awt.*;
 import java.io.*;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
 import java.util.List;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
@@ -722,17 +723,6 @@ public class StudyUtils {
     showCheckPopUp(project, balloon);
   }
 
-  public static void sortCourses(List<CourseInfo> result) {
-    // sort courses so as to have non-adaptive courses in the beginning of the list
-    Collections.sort(result, (c1, c2) -> {
-      if ((c1.isAdaptive() && c2.isAdaptive()) || (!c1.isAdaptive() && !c2.isAdaptive())) {
-        return 0;
-      }
-
-      return c1.isAdaptive() ? 1 : -1;
-    });
-  }
-
   public static void selectFirstAnswerPlaceholder(@Nullable final StudyEditor studyEditor, @NotNull final Project project) {
     if (studyEditor == null) return;
     final Editor editor = studyEditor.getEditor();