From 45df1a9e36a0eeef1f679826c1ee7bd0b1e48a0d Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Thu, 4 Sep 2014 20:28:21 +0400 Subject: [PATCH] Removed obsolete "Converting old skeletons" warning (PY-13507) Changes in skeletons versioning happend several versions ago, it's time to remove this warning. --- .../python/sdk/PythonSdkUpdater.java | 3 +-- .../sdk/skeletons/PySkeletonRefresher.java | 21 ++----------------- .../python/sdkTools/PyTestSdkTools.java | 2 +- 3 files changed, 4 insertions(+), 22 deletions(-) diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java b/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java index b4b968fdb108..fb77cdb26f8f 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java @@ -32,7 +32,6 @@ import com.intellij.openapi.projectRoots.SdkModificator; import com.intellij.openapi.projectRoots.SdkTypeId; import com.intellij.openapi.roots.OrderRootType; import com.intellij.openapi.startup.StartupActivity; -import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.io.FileUtilRt; import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; @@ -149,7 +148,7 @@ public class PythonSdkUpdater implements StartupActivity { } public static void updateSdk(@Nullable Project project, @Nullable Component ownerComponent, @NotNull final Sdk sdk, String skeletonsPath) throws InvalidSdkException { - PySkeletonRefresher.refreshSkeletonsOfSdk(project, ownerComponent, skeletonsPath, new Ref(false), sdk); // NOTE: whole thing would need a rename + PySkeletonRefresher.refreshSkeletonsOfSdk(project, ownerComponent, skeletonsPath, sdk); // NOTE: whole thing would need a rename if (!PySdkUtil.isRemote(sdk)) { updateSysPath(sdk); } diff --git a/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java b/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java index 0c7fd6fc3f46..6288a11f248f 100644 --- a/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java +++ b/python/src/com/jetbrains/python/sdk/skeletons/PySkeletonRefresher.java @@ -19,9 +19,6 @@ import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer; import com.intellij.execution.ExecutionException; -import com.intellij.notification.Notification; -import com.intellij.notification.NotificationType; -import com.intellij.notification.Notifications; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.PathManager; import com.intellij.openapi.diagnostic.Logger; @@ -31,7 +28,6 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.roots.OrderRootType; import com.intellij.openapi.util.Pair; -import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.text.StringUtil; @@ -116,7 +112,6 @@ public class PySkeletonRefresher { public static void refreshSkeletonsOfSdk(@Nullable Project project, Component ownerComponent, String skeletonsPath, - @Nullable Ref migrationFlag, @NotNull Sdk sdk) throws InvalidSdkException { final Map> errors = new TreeMap>(); @@ -133,7 +128,7 @@ public class PySkeletonRefresher { changeGeneratingSkeletons(1); try { - List sdkErrors = refresher.regenerateSkeletons(checker, migrationFlag); + List sdkErrors = refresher.regenerateSkeletons(checker); if (sdkErrors.size() > 0) { String sdkName = sdk.getName(); List knownErrors = errors.get(sdkName); @@ -282,8 +277,7 @@ public class PySkeletonRefresher { return mySkeletonsPath; } - public List regenerateSkeletons(@Nullable SkeletonVersionChecker cachedChecker, - @Nullable Ref migrationFlag) throws InvalidSdkException { + public List regenerateSkeletons(@Nullable SkeletonVersionChecker cachedChecker) throws InvalidSdkException { final List errorList = new SmartList(); final String homePath = mySdk.getHomePath(); final String skeletonsPath = getSkeletonsPath(); @@ -321,17 +315,6 @@ public class PySkeletonRefresher { final SkeletonHeader oldHeader = readSkeletonHeader(builtinsFile); final boolean oldOrNonExisting = oldHeader == null || oldHeader.getVersion() == 0; - if (migrationFlag != null && !migrationFlag.get() && oldOrNonExisting) { - migrationFlag.set(true); - Notifications.Bus.notify( - new Notification( - PythonSdkType.SKELETONS_TOPIC, PyBundle.message("sdk.gen.notify.converting.old.skels"), - PyBundle.message("sdk.gen.notify.converting.text"), - NotificationType.INFORMATION - ) - ); - } - if (myPregeneratedSkeletons != null && oldOrNonExisting) { indicate("Unpacking pregenerated skeletons..."); try { diff --git a/python/testSrc/com/jetbrains/python/sdkTools/PyTestSdkTools.java b/python/testSrc/com/jetbrains/python/sdkTools/PyTestSdkTools.java index 2d97e747f00b..0b5cdadbbc43 100644 --- a/python/testSrc/com/jetbrains/python/sdkTools/PyTestSdkTools.java +++ b/python/testSrc/com/jetbrains/python/sdkTools/PyTestSdkTools.java @@ -136,7 +136,7 @@ public final class PyTestSdkTools { final SkeletonVersionChecker checker = new SkeletonVersionChecker(0); final PySkeletonRefresher refresher = new PySkeletonRefresher(project, null, sdk, skeletonsPath, null, null); - final List errors = refresher.regenerateSkeletons(checker, null); + final List errors = refresher.regenerateSkeletons(checker); Assert.assertThat("Errors found", errors, Matchers.empty()); } }