From d3b0ad08df39204c6d3f62a42e598f86f09d9b00 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Tue, 6 Mar 2012 12:56:03 +0400 Subject: [PATCH] cleanup --- .../tree/injected/InjectedLanguageUtil.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java index cc640abac7db..84129b3b623a 100644 --- a/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java +++ b/platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java @@ -91,12 +91,7 @@ public class InjectedLanguageUtil { } } }); - if (result.isEmpty()) { - return null; - } - else { - return result; - } + return result.isEmpty() ? null : result; } public static List> getHighlightTokens(PsiFile file) { @@ -206,7 +201,6 @@ public class InjectedLanguageUtil { private static final InjectedPsiCachedValueProvider INJECTED_PSI_PROVIDER = new InjectedPsiCachedValueProvider(); private static final Key> INJECTED_PSI = Key.create("INJECTED_PSI"); - private static final boolean DEBUG = false; private static MultiHostRegistrarImpl probeElementsUp(@NotNull PsiElement element, @NotNull PsiFile hostPsiFile, boolean probeUp) { PsiManager psiManager = hostPsiFile.getManager(); @@ -228,7 +222,6 @@ public class InjectedLanguageUtil { else { registrar = data.getValue(current); } - if (DEBUG) log(current, (registrar == null ? "!": "")+" computed result="+registrar); current = current.getParent(); // cache no injection for current @@ -256,7 +249,6 @@ public class InjectedLanguageUtil { ProgressManager.checkCanceled(); if (registrar == null) { e.putUserData(INJECTED_PSI, null); - if (DEBUG) log(e, "Cache .INJECTED_PSI=null"); } else { ParameterizedCachedValue cachedValue = @@ -266,20 +258,12 @@ public class InjectedLanguageUtil { ((PsiParameterizedCachedValue)cachedValue).setValue(result); e.putUserData(INJECTED_PSI, cachedValue); - - if (DEBUG) log(e, "Cache .INJECTED_PSI="+result); } } } return registrar; } - private static void log(PsiElement e, String msg) { - //if (e.getClass().getName().equals("com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl")) { - // System.out.println(e+": "+ msg + " ("+Thread.currentThread()+")"); - //} - } - public static PsiElement findInjectedElementNoCommit(@NotNull PsiFile hostFile, final int offset) { if (hostFile instanceof PsiCompiledElement) return null; Project project = hostFile.getProject();