PsiElement (@NotNull PsiFile file, @NotNull String signature, @Nullable StringBuilder processingInfoStorage) { int semicolonIndex = signature.indexOf(ELEMENTS_SEPARATOR); PsiElement parent; if (semicolonIndex >= 0) { String parentSignature = signature.substring(semicolonIndex + 1); if (processingInfoStorage != null) { processingInfoStorage.append(String.format( "Provider '%s'. Restoring parent by signature '%s'...%n", getClass().getName(), parentSignature )); } parent = restoreBySignature(file, parentSignature, processingInfoStorage); if (processingInfoStorage != null) { processingInfoStorage.append(String.format("Restored parent by signature '%s': %s%n", parentSignature, parent)); } if (parent == null) return null; signature = signature.substring(0, semicolonIndex); } else { parent = file; } StringTokenizer tokenizer = new StringTokenizer(signature, ELEMENT_TOKENS_SEPARATOR); String type = tokenizer.nextToken(); if (processingInfoStorage != null) { processingInfoStorage.append(String.format( "Provider '%s'. Restoring target element by signature '%s'. Parent: %s, same as the given parent: %b%n", getClass().getName(), signature, parent, parent == file )); } return restoreBySignatureTokens(file, parent, type, tokenizer, processingInfoStorage); }