summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/codeInsight/template/postfix
diff options
context:
space:
mode:
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/template/postfix')
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ElseExpressionPostfixTemplateBase.java3
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/IfPostfixTemplateBase.java3
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java7
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StatementWrapPostfixTemplate.java3
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/SurroundPostfixTemplateBase.java3
5 files changed, 11 insertions, 8 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ElseExpressionPostfixTemplateBase.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ElseExpressionPostfixTemplateBase.java
index 1e9c58488f33..4c810dcf4ff3 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ElseExpressionPostfixTemplateBase.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ElseExpressionPostfixTemplateBase.java
@@ -16,6 +16,7 @@
package com.intellij.codeInsight.template.postfix.templates;
import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -28,7 +29,7 @@ public abstract class ElseExpressionPostfixTemplateBase extends SurroundPostfixT
@SuppressWarnings("unchecked")
protected ElseExpressionPostfixTemplateBase(@NotNull PostfixTemplatePsiInfo psiInfo) {
- super("else", "if (!expr)", psiInfo, Condition.TRUE);
+ super("else", "if (!expr)", psiInfo, Conditions.<PsiElement>alwaysTrue());
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/IfPostfixTemplateBase.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/IfPostfixTemplateBase.java
index 90a21a269fed..b7e402f31f66 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/IfPostfixTemplateBase.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/IfPostfixTemplateBase.java
@@ -17,6 +17,7 @@ package com.intellij.codeInsight.template.postfix.templates;
import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -29,6 +30,6 @@ public abstract class IfPostfixTemplateBase extends SurroundPostfixTemplateBase
@SuppressWarnings("unchecked")
protected IfPostfixTemplateBase(@NotNull PostfixTemplatePsiInfo psiInfo) {
- super("if", "if (expr)", psiInfo, Condition.TRUE);
+ super("if", "if (expr)", psiInfo, Conditions.<PsiElement>alwaysTrue());
}
}
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java
index 0190fadbcf02..61544faf2c81 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java
@@ -32,6 +32,7 @@ import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
@@ -266,15 +267,13 @@ public class PostfixLiveTemplate extends CustomLiveTemplateBase {
PsiFile copyFile = copyFile(file, fileContentWithoutKey);
Document copyDocument = copyFile.getViewProvider().getDocument();
if (copyDocument == null) {
- //noinspection unchecked
- return Condition.FALSE;
+ return Conditions.alwaysFalse();
}
copyFile = provider.preCheck(copyFile, editor, newOffset);
copyDocument = copyFile.getViewProvider().getDocument();
if (copyDocument == null) {
- //noinspection unchecked
- return Condition.FALSE;
+ return Conditions.alwaysFalse();
}
final PsiElement context = CustomTemplateCallback.getContext(copyFile, positiveOffset(newOffset));
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StatementWrapPostfixTemplate.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StatementWrapPostfixTemplate.java
index 5b5c3624f33b..33b8ba541f66 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StatementWrapPostfixTemplate.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StatementWrapPostfixTemplate.java
@@ -17,6 +17,7 @@ package com.intellij.codeInsight.template.postfix.templates;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -28,7 +29,7 @@ public abstract class StatementWrapPostfixTemplate extends PostfixTemplateWithEx
protected StatementWrapPostfixTemplate(@NotNull String name,
@NotNull String descr,
@NotNull PostfixTemplatePsiInfo psiInfo) {
- super(name, descr, psiInfo, Condition.TRUE);
+ super(name, descr, psiInfo, Conditions.<PsiElement>alwaysTrue());
}
protected StatementWrapPostfixTemplate(@NotNull String name,
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/SurroundPostfixTemplateBase.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/SurroundPostfixTemplateBase.java
index 29ea4d39ac64..09ca27a3f948 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/SurroundPostfixTemplateBase.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/SurroundPostfixTemplateBase.java
@@ -18,6 +18,7 @@ package com.intellij.codeInsight.template.postfix.templates;
import com.intellij.lang.surroundWith.Surrounder;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import org.jetbrains.annotations.NotNull;
@@ -35,7 +36,7 @@ public abstract class SurroundPostfixTemplateBase extends StatementWrapPostfixTe
protected SurroundPostfixTemplateBase(@NotNull String name,
@NotNull String descr,
@NotNull PostfixTemplatePsiInfo psiInfo) {
- super(name, descr, psiInfo, Condition.TRUE);
+ super(name, descr, psiInfo, Conditions.<PsiElement>alwaysTrue());
}