Do not pass disposed sdk: may lead to exception
authorIlya.Kazakevich <ilya.kazakevich@jetbrains.com>
Wed, 25 May 2022 18:50:39 +0000 (21:50 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Wed, 25 May 2022 20:42:44 +0000 (20:42 +0000)
GitOrigin-RevId: 868a825566810c6af04a335d1c626583a678f606

python/openapi/src/com/jetbrains/python/packaging/PyPackageManager.java
python/openapi/src/com/jetbrains/python/packaging/PyPackageManagers.java

index ff5193eca0d8bcffdb4f19ad206a286a538fa07a..c2393b4946156ad439045fd15a9e132f1f33ea95 100644 (file)
@@ -22,6 +22,9 @@ public abstract class PyPackageManager implements Disposable {
   @Topic.AppLevel
   public static final Topic<Listener> PACKAGE_MANAGER_TOPIC = new Topic<>(Listener.class, Topic.BroadcastDirection.TO_DIRECT_CHILDREN);
 
+  /**
+   * @param sdk must not be disposed if {@link Disposable}
+   */
   @NotNull
   public static PyPackageManager getInstance(@NotNull Sdk sdk) {
     return PyPackageManagers.getInstance().forSdk(sdk);
index 52444b44ed4123f63e64f9fef748ac77e89fc1ed..29e00c07be08fcb51699becbd6a03e48657658f0 100644 (file)
@@ -15,6 +15,9 @@ public abstract class PyPackageManagers implements Disposable {
     return ApplicationManager.getApplication().getService(PyPackageManagers.class);
   }
 
+  /**
+   * @param sdk must not be disposed if {@link Disposable}
+   */
   @NotNull
   public abstract PyPackageManager forSdk(@NotNull Sdk sdk);