From 4cc68873773d7d93ba44afa2a17d0ba4ba0be45f Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Tue, 5 Apr 2022 18:25:56 +0200 Subject: [PATCH] avoid deprecated method GitOrigin-RevId: feb4ccd53cd8a49261f449f859bc1cb2823d81ae --- .../codeInspection/RefactoringQuickFix.java | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/platform/lang-api/src/com/intellij/codeInspection/RefactoringQuickFix.java b/platform/lang-api/src/com/intellij/codeInspection/RefactoringQuickFix.java index 09d66a169762..a161f510279e 100644 --- a/platform/lang-api/src/com/intellij/codeInspection/RefactoringQuickFix.java +++ b/platform/lang-api/src/com/intellij/codeInspection/RefactoringQuickFix.java @@ -1,18 +1,4 @@ -/* - * 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-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.codeInspection; import com.intellij.ide.DataManager; @@ -21,10 +7,11 @@ import com.intellij.openapi.project.Project; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiNamedElement; import com.intellij.refactoring.RefactoringActionHandler; -import com.intellij.util.Consumer; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import java.util.function.Consumer; + /** * @author Bas Leijdekkers */ @@ -65,7 +52,7 @@ public interface RefactoringQuickFix extends LocalQuickFix { final RefactoringActionHandler handler = getHandler(dataContext); handler.invoke(element.getProject(), new PsiElement[] {elementToRefactor}, dataContext); }; - DataManager.getInstance().getDataContextFromFocus().doWhenDone(consumer); + DataManager.getInstance().getDataContextFromFocusAsync().onSuccess(consumer); } @Override