use of com.intellij.psi.stubs.SerializerNotFoundException in project intellij-community by JetBrains.
the class GroovyTraitMethodsFileIndex method read.
@Override
public PsiJavaFileStub read(@NotNull DataInput in) throws IOException {
try {
byte[] buffer = new byte[in.readInt()];
in.readFully(buffer);
return (PsiJavaFileStub) SerializationManagerEx.getInstanceEx().deserialize(new ByteArrayInputStream(buffer));
} catch (SerializerNotFoundException e) {
throw new IOException(e);
}
}
use of com.intellij.psi.stubs.SerializerNotFoundException in project smali by JesusFreke.
the class LightCodeInsightParsingTestCase method doTest.
protected void doTest(boolean checkResult) {
String name = getTestName(false);
try {
String text = loadFile(name + "." + myFileExt);
PsiFile f = createPsiFile(name, text);
if (f instanceof PsiFileImpl) {
// Also want to test stub serialization/deserialization
StubTree stubTree = ((PsiFileImpl) f).calcStubTree();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
SerializationManagerImpl.getInstanceEx().serialize(stubTree.getRoot(), baos);
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
SerializationManagerImpl.getInstanceEx().deserialize(bais);
}
ensureParsed(f);
assertEquals("light virtual file text mismatch", text, ((LightVirtualFile) f.getVirtualFile()).getContent().toString());
assertEquals("virtual file text mismatch", text, LoadTextUtil.loadText(f.getVirtualFile()));
assertEquals("doc text mismatch", text, f.getViewProvider().getDocument().getText());
assertEquals("psi text mismatch", text, f.getText());
if (checkResult) {
checkResult(name, f);
} else {
toParseTreeText(f, skipSpaces(), includeRanges());
}
} catch (IOException e) {
throw new RuntimeException(e);
} catch (SerializerNotFoundException e) {
throw new RuntimeException(e);
}
}
Aggregations