From 61ad54ea3bf6b920db4a3a1c25a50637ef204b23 Mon Sep 17 00:00:00 2001 From: "liana.bakradze" Date: Thu, 21 Jan 2016 10:31:49 +0300 Subject: [PATCH] cleanup (cherry picked from commit 4439aaf) --- .../PyIsNotNonePostfixTemplate/description.html | 2 +- .../postfix/PyBinaryConditionSurrounder.java | 7 ++++--- .../postfix/PyExpressionAsConditionSurrounder.java | 6 +++--- .../PyParenthesizedExpressionPostfixTemplate.java | 10 +--------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/python/resources/postfixTemplates/PyIsNotNonePostfixTemplate/description.html b/python/resources/postfixTemplates/PyIsNotNonePostfixTemplate/description.html index 650a5b3af3c4..15caa6d2639a 100644 --- a/python/resources/postfixTemplates/PyIsNotNonePostfixTemplate/description.html +++ b/python/resources/postfixTemplates/PyIsNotNonePostfixTemplate/description.html @@ -1,5 +1,5 @@ -Checks if the expression if not None. +Checks if the expression is not None. \ No newline at end of file diff --git a/python/src/com/jetbrains/python/codeInsight/postfix/PyBinaryConditionSurrounder.java b/python/src/com/jetbrains/python/codeInsight/postfix/PyBinaryConditionSurrounder.java index c11890829fe9..c45b89ef7540 100644 --- a/python/src/com/jetbrains/python/codeInsight/postfix/PyBinaryConditionSurrounder.java +++ b/python/src/com/jetbrains/python/codeInsight/postfix/PyBinaryConditionSurrounder.java @@ -16,14 +16,15 @@ package com.jetbrains.python.codeInsight.postfix; import com.jetbrains.python.psi.*; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; public class PyBinaryConditionSurrounder extends PyExpressionAsConditionSurrounder { - private String myTextToGenerate; - private String myTemplateDescription; + private final String myTextToGenerate; + private final String myTemplateDescription; - public PyBinaryConditionSurrounder(String textToGenerate, String templateDescription) { + public PyBinaryConditionSurrounder(@NotNull String textToGenerate, @NotNull String templateDescription) { myTextToGenerate = textToGenerate; myTemplateDescription = templateDescription; } diff --git a/python/src/com/jetbrains/python/codeInsight/postfix/PyExpressionAsConditionSurrounder.java b/python/src/com/jetbrains/python/codeInsight/postfix/PyExpressionAsConditionSurrounder.java index 7011a5f7f9ad..37b2c488f968 100644 --- a/python/src/com/jetbrains/python/codeInsight/postfix/PyExpressionAsConditionSurrounder.java +++ b/python/src/com/jetbrains/python/codeInsight/postfix/PyExpressionAsConditionSurrounder.java @@ -28,13 +28,13 @@ import org.jetbrains.annotations.Nullable; public abstract class PyExpressionAsConditionSurrounder extends PyExpressionSurrounder { - abstract protected String getTextToGenerate(); + protected abstract String getTextToGenerate(); @Nullable - abstract protected PyExpression getCondition(PyStatement statement); + protected abstract PyExpression getCondition(PyStatement statement); @Nullable - abstract protected PyStatementListContainer getStatementListContainer(PyStatement statement); + protected abstract PyStatementListContainer getStatementListContainer(PyStatement statement); @Override public TextRange surroundExpression(@NotNull Project project, @NotNull Editor editor, @NotNull PyExpression expression) diff --git a/python/src/com/jetbrains/python/codeInsight/postfix/PyParenthesizedExpressionPostfixTemplate.java b/python/src/com/jetbrains/python/codeInsight/postfix/PyParenthesizedExpressionPostfixTemplate.java index 1a7a1d722a99..cfceda4a2d51 100644 --- a/python/src/com/jetbrains/python/codeInsight/postfix/PyParenthesizedExpressionPostfixTemplate.java +++ b/python/src/com/jetbrains/python/codeInsight/postfix/PyParenthesizedExpressionPostfixTemplate.java @@ -16,17 +16,9 @@ package com.jetbrains.python.codeInsight.postfix; import com.intellij.codeInsight.template.postfix.templates.ParenthesizedPostfixTemplate; -import com.intellij.codeInsight.template.postfix.templates.PostfixTemplateExpressionSelector; -import com.intellij.codeInsight.template.postfix.templates.PostfixTemplatePsiInfo; -import org.jetbrains.annotations.NotNull; public class PyParenthesizedExpressionPostfixTemplate extends ParenthesizedPostfixTemplate { public PyParenthesizedExpressionPostfixTemplate() { - this(PyPostfixUtils.PY_PSI_INFO, PyPostfixUtils.selectorAllExpressionsWithCurrentOffset()); - } - - public PyParenthesizedExpressionPostfixTemplate(PostfixTemplatePsiInfo psiInfo, - @NotNull PostfixTemplateExpressionSelector selector) { - super(psiInfo, selector); + super(PyPostfixUtils.PY_PSI_INFO, PyPostfixUtils.selectorAllExpressionsWithCurrentOffset()); } }