cleanup
authorliana.bakradze <liana.bakradze@jetbrains.com>
Thu, 21 Jan 2016 07:31:49 +0000 (10:31 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Thu, 11 Feb 2016 20:37:22 +0000 (23:37 +0300)
(cherry picked from commit 4439aaf)

python/resources/postfixTemplates/PyIsNotNonePostfixTemplate/description.html
python/src/com/jetbrains/python/codeInsight/postfix/PyBinaryConditionSurrounder.java
python/src/com/jetbrains/python/codeInsight/postfix/PyExpressionAsConditionSurrounder.java
python/src/com/jetbrains/python/codeInsight/postfix/PyParenthesizedExpressionPostfixTemplate.java

index 650a5b3af3c427ee545ba60b7d667b280044b466..15caa6d2639a22a1087035fe5e3d468254d2b45f 100644 (file)
@@ -1,5 +1,5 @@
 <html>
 <body>
-Checks if the expression if not None.
+Checks if the expression is not None.
 </body>
 </html>
\ No newline at end of file
index c11890829fe9fbf34031667537df7c0f313042fb..c45b89ef7540ad71ea5aa61dc33042964468a698 100644 (file)
 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;
   }
index 7011a5f7f9ade979085b9651a6fe0774dbc1d620..37b2c488f968273645b0c4c2b80a40204c2a2332 100644 (file)
@@ -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)
index 1a7a1d722a99a31351e381281f2dd6fdead52bd3..cfceda4a2d512565a1b407431a6aefc652cb94b9 100644 (file)
 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());
   }
 }