From 10d3affbe3d1e072c81afbe3223c4fc6ea7fd7ab Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 3 Apr 2019 09:21:24 +0200 Subject: [PATCH] get rid of deprecated Throwables.propagateIfInstanceOf --- .../download/impl/FileDownloaderImpl.java | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java b/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java index c76774701458..d53f114e12ac 100644 --- a/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java +++ b/platform/lang-impl/src/com/intellij/util/download/impl/FileDownloaderImpl.java @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.util.download.impl; -import com.google.common.base.Throwables; import com.google.common.util.concurrent.AtomicDouble; import com.intellij.concurrency.SensitiveProgressWrapper; import com.intellij.ide.IdeBundle; @@ -214,8 +199,12 @@ public class FileDownloaderImpl implements FileDownloader { throw new ProcessCanceledException(); } catch (ExecutionException e) { - Throwables.propagateIfInstanceOf(e.getCause(), IOException.class); - Throwables.propagateIfInstanceOf(e.getCause(), ProcessCanceledException.class); + if (e.getCause() instanceof IOException) { + throw ((IOException)e.getCause()); + } + if (e.getCause() instanceof ProcessCanceledException) { + throw ((ProcessCanceledException)e.getCause()); + } LOG.error(e); } }