mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
notnull
This commit is contained in:
@@ -62,7 +62,7 @@ public class SingleRootFileViewProvider extends UserDataHolderBase implements Fi
|
||||
@NotNull private final VirtualFile myVirtualFile;
|
||||
private final boolean myEventSystemEnabled;
|
||||
private final boolean myPhysical;
|
||||
@NotNull private final AtomicReference<PsiFile> myPsiFile = new AtomicReference<PsiFile>();
|
||||
private final AtomicReference<PsiFile> myPsiFile = new AtomicReference<PsiFile>();
|
||||
private volatile Content myContent;
|
||||
private volatile SoftReference<Document> myDocument;
|
||||
@NotNull private final Language myBaseLanguage;
|
||||
@@ -178,7 +178,7 @@ public class SingleRootFileViewProvider extends UserDataHolderBase implements Fi
|
||||
|
||||
public void beforeDocumentChanged() {
|
||||
final PsiFileImpl psiFile = (PsiFileImpl)getCachedPsi(getBaseLanguage());
|
||||
if (psiFile != null && psiFile.isContentsLoaded() && getContent()instanceof DocumentContent) {
|
||||
if (psiFile != null && psiFile.isContentsLoaded() && getContent() instanceof DocumentContent) {
|
||||
setContent(new PsiFileContent(psiFile, getModificationStamp()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ import com.intellij.util.PatchedSoftReference;
|
||||
import com.intellij.util.PatchedWeakReference;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.text.CharArrayUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -145,7 +146,7 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
if (pointer instanceof FileElement) {
|
||||
return (FileElement)pointer;
|
||||
}
|
||||
else if (pointer instanceof Reference) {
|
||||
if (pointer instanceof Reference) {
|
||||
FileElement treeElement = (FileElement)((Reference)pointer).get();
|
||||
if (treeElement != null) return treeElement;
|
||||
|
||||
@@ -185,9 +186,14 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
//return valid;
|
||||
}
|
||||
|
||||
protected boolean isPsiUpToDate(VirtualFile vFile) {
|
||||
protected boolean isPsiUpToDate(@NotNull VirtualFile vFile) {
|
||||
final FileViewProvider provider = myManager.findViewProvider(vFile);
|
||||
return provider.getPsi(getLanguage()) == this || provider.getPsi(provider.getBaseLanguage()) == this;
|
||||
Language language = getLanguage();
|
||||
if (provider.getPsi(language) == this) {
|
||||
return true;
|
||||
}
|
||||
Language baseLanguage = provider.getBaseLanguage();
|
||||
return baseLanguage != language && provider.getPsi(baseLanguage) == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -977,14 +983,13 @@ public abstract class PsiFileImpl extends ElementBase implements PsiFileEx, PsiF
|
||||
if (tree == null) {
|
||||
IElementType contentElementType = getContentElementType();
|
||||
if (!(contentElementType instanceof IStubFileElementType)) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
builder.append("ContentElementType: ").append(contentElementType).append("; file: ").append(this);
|
||||
builder.append("\n\t").append("Boolean.TRUE.equals(getUserData(BUILDING_STUB)) = ").append(Boolean.TRUE.equals(getUserData(BUILDING_STUB)));
|
||||
builder.append("\n\t").append("getTreeElementNoLock() = ").append(getTreeElementNoLock());
|
||||
final VirtualFile vFile = getVirtualFile();
|
||||
builder.append("\n\t").append("vFile instanceof VirtualFileWithId = ").append(vFile instanceof VirtualFileWithId);
|
||||
builder.append("\n\t").append("StubUpdatingIndex.canHaveStub(vFile) = ").append(StubTreeLoader.getInstance().canHaveStub(vFile));
|
||||
LOG.error(builder.toString());
|
||||
VirtualFile vFile = getVirtualFile();
|
||||
@NonNls String builder = "ContentElementType: " + contentElementType + "; file: " + this +
|
||||
"\n\t" + "Boolean.TRUE.equals(getUserData(BUILDING_STUB)) = " + Boolean.TRUE.equals(getUserData(BUILDING_STUB)) +
|
||||
"\n\t" + "getTreeElementNoLock() = " + getTreeElementNoLock() +
|
||||
"\n\t" + "vFile instanceof VirtualFileWithId = " + (vFile instanceof VirtualFileWithId) +
|
||||
"\n\t" + "StubUpdatingIndex.canHaveStub(vFile) = " + StubTreeLoader.getInstance().canHaveStub(vFile);
|
||||
LOG.error(builder);
|
||||
}
|
||||
final StubElement currentStubTree = ((IStubFileElementType)contentElementType).getBuilder().buildStubTree(this);
|
||||
tree = new StubTree((PsiFileStub)currentStubTree);
|
||||
|
||||
Reference in New Issue
Block a user