UsageInfo (final Project project) { final GenericElementSignatureProvider provider = new GenericElementSignatureProvider(); final String path = readNext(false); if (path == null) return null; final VirtualFile file = LocalFileSystem.getInstance().findFileByIoFile(new File(path)); if (file == null) return null; PsiFile psiFile = PsiManager.getInstance(project).findFile(file); if (psiFile == null) return null; final String signature = readNext(false); final PsiElement element = provider.restoreBySignature(psiFile, signature, new StringBuilder()); if (element == null) return null; final String startStr = readNext(false); if (startStr == null) return null; final String endStr = readNext(false); if (endStr == null) return null; final String nonCodeUsageStr = readNext(false); if (nonCodeUsageStr == null) return null; final String dynamicUsageStr = readNext(false); if (dynamicUsageStr == null) return null; final String text = readNext(true); if (text == null) return null; final boolean nonCodeUsage = Boolean.parseBoolean(nonCodeUsageStr); final int start = Integer.parseInt(startStr); final int end = Integer.parseInt(endStr); final UsageInfo info = new UsageInfo(element, start, end, nonCodeUsage); final boolean dynamicUsage = Boolean.parseBoolean(dynamicUsageStr); info.setDynamicUsage(dynamicUsage); return info; /*final String newText = new UsageInfo2UsageAdapter(info).getPlainText(); if (! Comparing.equal(newText, text)) { LOG.info("Usage not restored, oldText:\n'" + text + "'\nnew text: '\n" + newText + "'"); return null; }*/ }