EA-64708 - IAE: InjectedSelfElementInfo.<init>

This commit is contained in:
Alexey Kudravtsev
2015-02-19 16:18:09 +03:00
parent 7bc362a988
commit fef21c60cb
3 changed files with 7 additions and 7 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@ public class ImplicitVariableElementInfoFactory implements SmartPointerElementIn
}
private static class ImplicitVariableInfo extends HardElementInfo {
public ImplicitVariableInfo(@NotNull ImplicitVariable var, @NotNull Project project) {
private ImplicitVariableInfo(@NotNull ImplicitVariable var, @NotNull Project project) {
super(project, var);
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@ public class ImportListElementInfoFactory implements SmartPointerElementInfoFact
}
private static class ImportListInfo extends FileElementInfo {
public ImportListInfo(@NotNull PsiJavaFile file) {
private ImportListInfo(@NotNull PsiJavaFile file) {
super(file);
}
@@ -146,11 +146,12 @@ class SmartPsiElementPointerImpl<E extends PsiElement> implements SmartPointerEx
}
FileViewProvider viewProvider = containingFile.getViewProvider();
if (viewProvider instanceof FreeThreadedFileViewProvider) {
TextRange elementRange = element.getTextRange();
if (viewProvider instanceof FreeThreadedFileViewProvider && elementRange != null) {
PsiLanguageInjectionHost hostContext = InjectedLanguageManager.getInstance(containingFile.getProject()).getInjectionHost(containingFile);
if (hostContext != null) {
SmartPsiElementPointer<PsiLanguageInjectionHost> hostPointer = SmartPointerManager.getInstance(project).createSmartPsiElementPointer(hostContext);
return new InjectedSelfElementInfo(project, element, element.getTextRange(), containingFile, hostPointer);
return new InjectedSelfElementInfo(project, element, elementRange, containingFile, hostPointer);
}
}
@@ -163,7 +164,6 @@ class SmartPsiElementPointerImpl<E extends PsiElement> implements SmartPointerEx
return new FileElementInfo((PsiFile)element);
}
TextRange elementRange = element.getTextRange();
if (elementRange == null) {
return new HardElementInfo(project, element);
}