From b89b79b1a33e52731cd314ebda95a8f8ad34a5f6 Mon Sep 17 00:00:00 2001 From: Daniil Ovchinnikov Date: Tue, 21 May 2019 15:10:01 +0300 Subject: [PATCH] deprecate and schedule for removal #createCreateConstructorFromSuperFix and #createCreateConstructorFromThisFix GitOrigin-RevId: 3a91be0b7ad2507d6041f75816f1553997dc9487 --- .../intention/QuickFixFactory.java | 13 ++++++++++++- .../CreateConstructorFromSuperFix.java | 19 ++++--------------- .../CreateConstructorFromThisFix.java | 19 ++++--------------- .../CreateConstructorFromThisOrSuperFix.java | 19 ++++--------------- .../impl/config/QuickFixFactoryImpl.java | 16 ++++++++-------- 5 files changed, 32 insertions(+), 54 deletions(-) diff --git a/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java b/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java index 879cc9d505b5..9723ea5bf995 100644 --- a/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java +++ b/java/java-analysis-api/src/com/intellij/codeInsight/intention/QuickFixFactory.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 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. +// 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.codeInsight.intention; import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; @@ -13,6 +13,7 @@ import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.*; import com.intellij.psi.tree.IElementType; import com.intellij.psi.util.PropertyMemberType; +import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -303,9 +304,19 @@ public abstract class QuickFixFactory { @NotNull public abstract IntentionAction createCreatePropertyFromUsageFix(@NotNull PsiMethodCallExpression call); + /** + * @deprecated use {@link #createCreateConstructorFromCallExpressionFixes} + */ + @Deprecated + @ScheduledForRemoval(inVersion = "2019.3") @NotNull public abstract IntentionAction createCreateConstructorFromSuperFix(@NotNull PsiMethodCallExpression call); + /** + * @deprecated use {@link #createCreateConstructorFromCallExpressionFixes} + */ + @Deprecated + @ScheduledForRemoval(inVersion = "2019.3") @NotNull public abstract IntentionAction createCreateConstructorFromThisFix(@NotNull PsiMethodCallExpression call); diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromSuperFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromSuperFix.java index 92f206423973..bed6583acdb3 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromSuperFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromSuperFix.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. /* * @author ven @@ -22,11 +8,14 @@ package com.intellij.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.daemon.QuickFixBundle; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; +import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; import org.jetbrains.annotations.NotNull; import java.util.Collections; import java.util.List; +@Deprecated +@ScheduledForRemoval(inVersion = "2019.3") public class CreateConstructorFromSuperFix extends CreateConstructorFromThisOrSuperFix { public CreateConstructorFromSuperFix(@NotNull PsiMethodCallExpression methodCall) { diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisFix.java index 7356f95e6a91..91de558c2cf8 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisFix.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 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. /* * @author ven @@ -25,11 +11,14 @@ import com.intellij.psi.PsiElement; import com.intellij.psi.PsiMethodCallExpression; import com.intellij.psi.PsiTypeParameter; import com.intellij.psi.util.PsiTreeUtil; +import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; import org.jetbrains.annotations.NotNull; import java.util.Collections; import java.util.List; +@Deprecated +@ScheduledForRemoval(inVersion = "2019.3") public class CreateConstructorFromThisFix extends CreateConstructorFromThisOrSuperFix { public CreateConstructorFromThisFix(@NotNull PsiMethodCallExpression methodCall) { diff --git a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java index a21515b3b239..7d2ac883e714 100644 --- a/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java +++ b/java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateConstructorFromThisOrSuperFix.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2013 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.codeInsight.daemon.impl.quickfix; import com.intellij.codeInsight.CodeInsightUtil; @@ -32,11 +18,14 @@ import com.intellij.openapi.util.TextRange; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.util.IncorrectOperationException; +import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import java.util.List; +@Deprecated +@ScheduledForRemoval(inVersion = "2019.3") public abstract class CreateConstructorFromThisOrSuperFix extends CreateFromUsageBaseFix { private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.quickfix.CreateConstructorFromThisOrSuperFix"); diff --git a/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java b/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java index c320ad6eb95e..c45331ec22f3 100644 --- a/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java +++ b/java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2018 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. +// 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.codeInsight.intention.impl.config; import com.intellij.codeInsight.CodeInsightWorkspaceSettings; @@ -45,6 +45,8 @@ import com.intellij.util.DocumentUtil; import com.intellij.util.IncorrectOperationException; import com.siyeh.ig.fixes.CreateDefaultBranchFix; import com.siyeh.ig.fixes.CreateMissingSwitchBranchesFix; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.ApiStatus.ScheduledForRemoval; import org.jetbrains.annotations.Nls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -507,12 +509,16 @@ public class QuickFixFactoryImpl extends QuickFixFactory { return new CreatePropertyFromUsageFix(call); } + @Deprecated + @ScheduledForRemoval(inVersion = "2019.3") @NotNull @Override public IntentionAction createCreateConstructorFromSuperFix(@NotNull PsiMethodCallExpression call) { return new CreateConstructorFromSuperFix(call); } + @Deprecated + @ScheduledForRemoval(inVersion = "2019.3") @NotNull @Override public IntentionAction createCreateConstructorFromThisFix(@NotNull PsiMethodCallExpression call) { @@ -522,13 +528,7 @@ public class QuickFixFactoryImpl extends QuickFixFactory { @NotNull @Override public List createCreateConstructorFromCallExpressionFixes(@NotNull PsiMethodCallExpression call) { - if (JvmElementActionFactories.useInterlaguageActions()) { - return CreateConstructorFromUsage.generateConstructorActions(call); - } - return Arrays.asList( - createCreateConstructorFromSuperFix(call), - createCreateConstructorFromThisFix(call) - ); + return CreateConstructorFromUsage.generateConstructorActions(call); } @NotNull