From 02bf8368c1f95ff07faa235cd4c2c27d0a147acd Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Feb 2015 16:21:09 +0300 Subject: [PATCH] Refactoring: Inline KotlinChangePropertyActions.declareValueOrVariable() method --- .../KotlinChangePropertyActions.java | 40 ------------------- .../KotlinInplaceVariableIntroducer.java | 5 ++- 2 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinChangePropertyActions.java diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinChangePropertyActions.java b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinChangePropertyActions.java deleted file mode 100644 index 46472ea545c..00000000000 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinChangePropertyActions.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010-2015 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. - */ - -package org.jetbrains.kotlin.idea.refactoring.introduce.introduceVariable; - -import com.intellij.lang.ASTNode; -import org.jetbrains.kotlin.psi.JetProperty; -import org.jetbrains.kotlin.psi.JetPsiFactory; - -import static org.jetbrains.kotlin.psi.PsiPackage.JetPsiFactory; - -public class KotlinChangePropertyActions { - private KotlinChangePropertyActions() { - } - - public static void declareValueOrVariable(boolean isVariable, JetProperty property) { - ASTNode node; - JetPsiFactory psiFactory = JetPsiFactory(property); - if (isVariable) { - node = psiFactory.createVarNode(); - } - else { - node = psiFactory.createValNode(); - } - property.getValOrVarNode().getPsi().replace(node.getPsi()); - } -} diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinInplaceVariableIntroducer.java b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinInplaceVariableIntroducer.java index 2562d960b98..dbc57300b45 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinInplaceVariableIntroducer.java +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinInplaceVariableIntroducer.java @@ -91,7 +91,10 @@ public class KotlinInplaceVariableIntroducer extends InplaceVariableIntroducer