use of com.intellij.psi.compiled.ClassFileDecompilers.Full in project intellij-community by JetBrains.
the class ClassFileStubBuilder method buildStubTree.
@Override
public StubElement buildStubTree(@NotNull FileContent fileContent) {
VirtualFile file = fileContent.getFile();
byte[] content = fileContent.getContent();
try {
try {
file.setPreloadedContentHint(content);
ClassFileDecompilers.Decompiler decompiler = ClassFileDecompilers.find(file);
if (decompiler instanceof Full) {
return ((Full) decompiler).getStubBuilder().buildFileStub(fileContent);
}
} catch (ClsFormatException e) {
if (LOG.isDebugEnabled())
LOG.debug(file.getPath(), e);
else
LOG.info(file.getPath() + ": " + e.getMessage());
}
try {
PsiFileStub<?> stub = ClsFileImpl.buildFileStub(file, content);
if (stub == null && fileContent.getFileName().indexOf('$') < 0) {
LOG.info("No stub built for file " + fileContent);
}
return stub;
} catch (ClsFormatException e) {
if (LOG.isDebugEnabled())
LOG.debug(file.getPath(), e);
else
LOG.info(file.getPath() + ": " + e.getMessage());
}
} finally {
file.setPreloadedContentHint(null);
}
return null;
}
Aggregations