Skip to content

Commit

Permalink
fix: exception fixed, related to #534
Browse files Browse the repository at this point in the history
  • Loading branch information
iromeo committed Oct 10, 2024
1 parent 3b04830 commit 12dbfd6
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.intellij.ui.ComboboxSpeedSearch;
import com.intellij.ui.components.JBLabel;
import com.intellij.ui.components.JBTextField;
import com.intellij.util.SlowOperations;
import com.intellij.util.messages.MessageBusConnection;
import com.intellij.util.ui.UIUtil;
import com.intellij.xml.util.XmlStringUtil;
Expand Down Expand Up @@ -134,16 +135,19 @@ public void jdkNameChanged(@NotNull Sdk jdk, @NotNull String previousName) {
refreshSdkList(null);
}

@SuppressWarnings("UnstableApiUsage")
private void refreshSdkList(Sdk sdkToSelect) {
final List<Sdk> sdks = new ArrayList<>();
sdks.add(null);

final List<Sdk> committedSdks = new ArrayList<>(getPythonSdks());
final ArrayList<Sdk> committedSdks = new ArrayList<>();
try (var ignored = SlowOperations.knownIssue("https://github.com/JetBrains-Research/snakecharm/issues/534")) {
committedSdks.addAll(getPythonSdks());
}
committedSdks.sort(new PreferredSdkComparator());
sdks.addAll(committedSdks);

//noinspection unchecked
pythonSdkCB.setModel(new CollectionComboBoxModel(sdks, sdkToSelect));
pythonSdkCB.setModel(new CollectionComboBoxModel<>(sdks, sdkToSelect));
}

@NotNull
Expand Down

0 comments on commit 12dbfd6

Please sign in to comment.