This commit is contained in:
Anna Kozlova
2015-01-29 20:39:23 +03:00
parent 6f7c59c930
commit 1de917d3d6
5 changed files with 10 additions and 6 deletions
@@ -92,7 +92,7 @@ public abstract class AbstractJavaInplaceIntroducer extends AbstractInplaceIntro
}
@Override
protected void restoreState(PsiVariable psiField) {
protected void restoreState(@NotNull PsiVariable psiField) {
final SmartTypePointer typePointer = SmartTypePointerManager.getInstance(myProject).createSmartTypePointer(getType());
super.restoreState(psiField);
for (PsiExpression occurrence : myOccurrences) {
@@ -46,6 +46,7 @@ import com.intellij.refactoring.rename.inplace.VariableInplaceRenamer;
import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
import com.intellij.refactoring.util.RefactoringUtil;
import com.intellij.ui.NonFocusableCheckBox;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.*;
@@ -128,7 +129,7 @@ public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer
}
@Override
protected void restoreState(PsiVariable psiField) {
protected void restoreState(@NotNull PsiVariable psiField) {
if (myDeleteSelf) return;
super.restoreState(psiField);
}
@@ -142,7 +143,10 @@ public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer
@Override
protected void performCleanup() {
super.performCleanup();
super.restoreState(getVariable());
PsiVariable variable = getVariable();
if (variable != null) {
super.restoreState(variable);
}
}
@Override
@@ -464,7 +464,7 @@ public abstract class AbstractInplaceIntroducer<V extends PsiNameIdentifierOwner
}
}
protected void restoreState(final V psiField) {
protected void restoreState(@NotNull final V psiField) {
if (!ReadonlyStatusHandler.ensureDocumentWritable(myProject, InjectedLanguageUtil.getTopLevelEditor(myEditor).getDocument())) return;
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
@@ -226,7 +226,7 @@ public abstract class GrAbstractInplaceIntroducer<Settings extends GrIntroduceSe
protected abstract Settings getSettings();
@Override
protected void restoreState(GrVariable psiField) {
protected void restoreState(@NotNull GrVariable psiField) {
PsiType declaredType = psiField.getDeclaredType();
myTypePointer = declaredType != null ? SmartTypePointerManager.getInstance(myProject).createSmartTypePointer(declaredType) : null;
super.restoreState(psiField);
@@ -238,7 +238,7 @@ public class GrInplaceFieldIntroducer extends GrAbstractInplaceIntroducer<GrIntr
}
@Override
protected void restoreState(GrVariable psiField) {
protected void restoreState(@NotNull GrVariable psiField) {
myIsStatic = psiField.hasModifierProperty(PsiModifier.STATIC);
super.restoreState(psiField);