better method names

This commit is contained in:
Maxim.Mossienko
2014-11-13 20:47:31 +01:00
parent 0fcf995aad
commit bfc6f945be
4 changed files with 8 additions and 8 deletions
@@ -58,7 +58,7 @@ public class StubTreeBuilder {
CharSequence contentAsText = inputData.getContentAsText();
FileContentImpl fileContent = (FileContentImpl)inputData;
PsiFile psi = fileContent.getPsiFileAccountingForUnsavedDocument();
PsiFile psi = fileContent.getPsiFileForPsiDependentIndex();
psi = psi.getViewProvider().getStubBindingRoot();
psi.putUserData(IndexingDataKeys.FILE_TEXT_CONTENT_KEY, contentAsText);
@@ -82,7 +82,7 @@ public class StubTreeBuilder {
if (stubFileElementType != null) {
StubBuilder stubBuilder = stubFileElementType.getBuilder();
if (stubBuilder instanceof LightStubBuilder) {
LightStubBuilder.FORCED_AST.set(fileContent.getLighterAST());
LightStubBuilder.FORCED_AST.set(fileContent.getLighterASTForPsiDependentIndex());
}
data = stubBuilder.buildStubTree(psi);
}
@@ -79,10 +79,10 @@ public final class FileContentImpl extends UserDataHolderBase implements FileCon
return psi;
}
public @NotNull LighterAST getLighterAST() {
public @NotNull LighterAST getLighterASTForPsiDependentIndex() {
LighterAST lighterAST = getUserData(IndexingDataKeys.LIGHTER_AST_NODE_KEY);
if (lighterAST == null) {
lighterAST = getPsiFileAccountingForUnsavedDocument().getNode().getLighterAST();
lighterAST = getPsiFileForPsiDependentIndex().getNode().getLighterAST();
assert lighterAST != null;
putUserData(IndexingDataKeys.LIGHTER_AST_NODE_KEY, lighterAST);
}
@@ -229,7 +229,7 @@ public final class FileContentImpl extends UserDataHolderBase implements FileCon
myHash = hash;
}
public PsiFile getPsiFileAccountingForUnsavedDocument() {
public PsiFile getPsiFileForPsiDependentIndex() {
Document document = FileDocumentManager.getInstance().getCachedDocument(getFile());
PsiFile psi = null;
if (document != null) {
@@ -119,7 +119,7 @@ public class DuplicatesIndex extends FileBasedIndexExtension<Integer, TIntArrayL
if (profile instanceof LightDuplicateProfile && ourEnabledLightProfiles) {
final THashMap<Integer, TIntArrayList> result = new THashMap<Integer, TIntArrayList>();
LighterAST ast = fileContent.getLighterAST();
LighterAST ast = fileContent.getLighterASTForPsiDependentIndex();
assert ast != null;
((LightDuplicateProfile)profile).process(ast, new LightDuplicateProfile.Callback() {
@Override
@@ -134,7 +134,7 @@ public class DuplicatesIndex extends FileBasedIndexExtension<Integer, TIntArrayL
MyFragmentsCollector collector = new MyFragmentsCollector(profile, ((LanguageFileType)type).getLanguage());
DuplocateVisitor visitor = profile.createVisitor(collector, true);
visitor.visitNode(fileContent.getPsiFileAccountingForUnsavedDocument());
visitor.visitNode(fileContent.getPsiFileForPsiDependentIndex());
return collector.getMap();
}
@@ -567,7 +567,7 @@ public class MapReduceIndex<Key, Value, Input> implements UpdatableIndex<Key,Val
private Integer getHashOfContent(FileContent content) throws IOException {
if (myIsPsiBackedIndex && myHasSnapshotMapping && content instanceof FileContentImpl) {
// psi backed index should use existing psi to build index value (FileContentImpl.getPsiFileAccountingForUnsavedDocument())
// psi backed index should use existing psi to build index value (FileContentImpl.getPsiFileForPsiDependentIndex())
// so we should use different bytes to calculate hash(Id)
Integer previouslyCalculatedUncommittedHashId = content.getUserData(ourSavedUncommittedHashIdKey);