From 7d5e20ae9305f134b418ec9c81a91e3417f4bca7 Mon Sep 17 00:00:00 2001 From: "Gregory.Shrago" Date: Sat, 12 Nov 2022 14:16:54 +0400 Subject: [PATCH] drop ancient and now dangerous "idea.ProcessCanceledException" See IDEA-304945 and async action update. GitOrigin-RevId: 7a10430fcdf52c65bd110114627fa5b0bb6b2a93 --- bin/idea.properties | 8 -------- .../openapi/progress/impl/CoreProgressManager.java | 4 +--- .../openapi/application/impl/ReadMostlyRWLock.java | 3 +-- updater/testData/bin/idea.properties | 8 -------- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/bin/idea.properties b/bin/idea.properties index 3a5463dd9dc4..39b56b56707c 100644 --- a/bin/idea.properties +++ b/bin/idea.properties @@ -52,14 +52,6 @@ idea.no.launcher=false #--------------------------------------------------------------------- idea.dynamic.classpath=false -#--------------------------------------------------------------------- -# Uncomment this property to prevent IDE from throwing ProcessCanceledException when user activity -# detected. This option is only useful for plugin developers, while debugging PSI related activities -# performed in background error analysis thread. -# DO NOT UNCOMMENT THIS UNLESS YOU'RE DEBUGGING IDE ITSELF. Significant slowdowns and lockups will happen otherwise. -#--------------------------------------------------------------------- -#idea.ProcessCanceledException=disabled - #--------------------------------------------------------------------- # There are two possible values of idea.popup.weight property: "heavy" and "medium". # If you have WM configured as "Focus follows mouse with Auto Raise" then you have to diff --git a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java index 48709bdd7c18..f2db03716126 100644 --- a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java +++ b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java @@ -44,8 +44,6 @@ public class CoreProgressManager extends ProgressManager implements Disposable { static final int CHECK_CANCELED_DELAY_MILLIS = 10; private final AtomicInteger myUnsafeProgressCount = new AtomicInteger(0); - public static final boolean ENABLED = !"disabled".equals(System.getProperty("idea.ProcessCanceledException")); - private ScheduledFuture myCheckCancelledFuture; // guarded by threadsUnderIndicator // indicator -> threads which are running under this indicator. @@ -706,7 +704,7 @@ public class CoreProgressManager extends ProgressManager implements Disposable { synchronized (threadsUnderIndicator) { boolean hasCanceledIndicator = !threadsUnderCanceledIndicator.isEmpty(); ourCheckCanceledBehavior = !hasCheckCanceledHooks() && !hasCanceledIndicator ? CheckCanceledBehavior.NONE : - hasCanceledIndicator && ENABLED ? CheckCanceledBehavior.INDICATOR_PLUS_HOOKS : + hasCanceledIndicator ? CheckCanceledBehavior.INDICATOR_PLUS_HOOKS : CheckCanceledBehavior.ONLY_HOOKS; } } diff --git a/platform/platform-impl/src/com/intellij/openapi/application/impl/ReadMostlyRWLock.java b/platform/platform-impl/src/com/intellij/openapi/application/impl/ReadMostlyRWLock.java index 75f8f7939884..fadf6d6e11a7 100644 --- a/platform/platform-impl/src/com/intellij/openapi/application/impl/ReadMostlyRWLock.java +++ b/platform/platform-impl/src/com/intellij/openapi/application/impl/ReadMostlyRWLock.java @@ -6,7 +6,6 @@ import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.ProgressIndicatorProvider; import com.intellij.openapi.progress.ProgressManager; -import com.intellij.openapi.progress.impl.CoreProgressManager; import com.intellij.util.containers.ConcurrentList; import com.intellij.util.containers.ContainerUtil; import org.jetbrains.annotations.NonNls; @@ -150,7 +149,7 @@ final class ReadMostlyRWLock { private void throwIfImpatient(Reader status) throws ApplicationUtil.CannotRunReadActionException { // when client explicitly runs in non-cancelable block do not throw from within nested read actions - if (status.impatientReads && writeRequested && !ProgressManager.getInstance().isInNonCancelableSection() && CoreProgressManager.ENABLED) { + if (status.impatientReads && writeRequested && !ProgressManager.getInstance().isInNonCancelableSection()) { throw ApplicationUtil.CannotRunReadActionException.create(); } } diff --git a/updater/testData/bin/idea.properties b/updater/testData/bin/idea.properties index 37bc736fb833..c3a3e93dab8f 100644 --- a/updater/testData/bin/idea.properties +++ b/updater/testData/bin/idea.properties @@ -85,14 +85,6 @@ idea.fatal.error.notification=disabled # Workaround for slow scrolling in JDK6 swing.bufferPerWindow=false -#----------------------------------------------------------------------- -# Uncomment this property to prevent IDEA from throwing ProcessCanceledException when user activity -# detected. This option is only useful for plugin developers, while debugging PSI related activities -# performed in background error analysis thread. -# DO NOT UNCOMMENT THIS UNLESS YOU'RE DEBUGGING IDEA ITSELF. Significant slowdowns and lockups will happen otherwise. -#----------------------------------------------------------------------- -#idea.ProcessCanceledException=disabled - #---------------------------------------------------------------------- # Removing this property may lead to editor performance degradation under X-Windows. #----------------------------------------------------------------------