This commit is contained in:
Alexey Kudravtsev
2011-03-25 11:09:58 +03:00
parent 210b57eb86
commit c7ce764cff
2 changed files with 3 additions and 2 deletions
@@ -93,7 +93,7 @@ public class ChunkExtractor {
}
};
public static TextChunk[] extractChunks(PsiFile file, UsageInfo2UsageAdapter usageAdapter) {
public static TextChunk[] extractChunks(@NotNull PsiFile file, UsageInfo2UsageAdapter usageAdapter) {
return ourExtractors.get().getValue().get(file).extractChunks(usageAdapter);
}
@@ -120,7 +120,8 @@ public class UsageInfo2UsageAdapter implements UsageInModule,
}
private TextChunk[] initChunks() {
TextChunk[] chunks = ChunkExtractor.extractChunks(getPsiFile(), this);
PsiFile file = getPsiFile();
TextChunk[] chunks = file == null ? TextChunk.EMPTY_ARRAY : ChunkExtractor.extractChunks(file, this);
myTextChunks = new SoftReference<TextChunk[]>(chunks);
return chunks;
}