IDEA-133004 (do not check for comment injections in .class files)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 27 Nov 2014 19:39:42 +0000 (20:39 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Thu, 27 Nov 2014 19:39:42 +0000 (20:39 +0100)
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/ConcatenationInjector.java

index 65c6d88bfc6d19e5f44c88b8eb8727601ec5e995..041896a01eca8534d657df1c4daad323bd7070d2 100644 (file)
@@ -249,10 +249,14 @@ public class ConcatenationInjector implements ConcatenationAwareInjector {
     }
 
     private boolean processCommentInjections(PsiVariable owner) {
-      Ref<PsiElement> causeRef = Ref.create();
-      PsiElement anchor = owner.getFirstChild() instanceof PsiComment?
-                          (owner.getModifierList() != null? owner.getModifierList() : owner.getTypeElement()) : owner;
+      if (owner instanceof PsiCompiledElement) return true;
+
+      PsiElement anchor = !(owner.getFirstChild() instanceof PsiComment) ? owner :
+                          owner.getModifierList() != null ? owner.getModifierList() :
+                          owner.getTypeElement();
       if (anchor == null) return true;
+
+      Ref<PsiElement> causeRef = Ref.create();
       BaseInjection injection = mySupport.findCommentInjection(anchor, causeRef);
       return injection == null || processCommentInjectionInner(owner, causeRef.get(), injection);
     }