Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
699a49aa
Commit
699a49aa
authored
7 years ago
by
Aleksey Pivovarov
Browse files
Options
Download
Email Patches
Plain Diff
BackgroundTaskUtil: do not ignore PCE in runUnderDisposeAwareIndicator
parent
127f19cc
Branches unavailable
Tags unavailable
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
platform/platform-impl/src/com/intellij/openapi/progress/util/BackgroundTaskUtil.java
+14
-11
...om/intellij/openapi/progress/util/BackgroundTaskUtil.java
with
14 additions
and
11 deletions
+14
-11
platform/platform-impl/src/com/intellij/openapi/progress/util/BackgroundTaskUtil.java
+
14
-
11
View file @
699a49aa
...
...
@@ -216,23 +216,26 @@ public class BackgroundTaskUtil {
boolean
onPooledThread
)
{
ProgressIndicator
indicator
=
new
EmptyProgressIndicator
(
modalityState
);
indicator
.
start
();
Runnable
toRun
=
()
->
{
try
{
ProgressManager
.
getInstance
().
runProcess
(
task
,
indicator
);
}
catch
(
ProcessCanceledException
pce
)
{
// ignore: expected cancellation
}
};
if
(
onPooledThread
)
{
CompletableFuture
<?>
future
=
CompletableFuture
.
runAsync
(
toRun
,
AppExecutorUtil
.
getAppExecutorService
());
CompletableFuture
<?>
future
=
CompletableFuture
.
runAsync
(()
->
{
ProgressManager
.
getInstance
().
runProcess
(
task
,
indicator
);
},
AppExecutorUtil
.
getAppExecutorService
());
Disposable
disposable
=
()
->
{
if
(
indicator
.
isRunning
())
indicator
.
cancel
();
try
{
future
.
get
(
1
,
TimeUnit
.
SECONDS
);
}
catch
(
InterruptedException
|
ExecutionException
|
TimeoutException
e
)
{
catch
(
ExecutionException
e
)
{
if
(
e
.
getCause
()
instanceof
ProcessCanceledException
)
{
// ignore: expected cancellation
}
else
{
LOG
.
error
(
e
);
}
}
catch
(
InterruptedException
|
TimeoutException
e
)
{
LOG
.
error
(
e
);
}
};
...
...
@@ -254,7 +257,7 @@ public class BackgroundTaskUtil {
}
try
{
toRun
.
run
(
);
ProgressManager
.
getInstance
().
runProcess
(
task
,
indicator
);
}
finally
{
Disposer
.
dispose
(
disposable
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help