int (final AbstractFilePatchInProgress<TextFilePatch> patch) { final VirtualFile base = patch.getCurrentBase(); if (base == null) return -1; String text; try { if (base.getLength() > BIG_FILE_BOUND) { // partially text = VfsUtilCore.loadText(base, BIG_FILE_BOUND); } else { text = VfsUtilCore.loadText(base); } } catch (IOException e) { return 0; } return new GenericPatchApplier(text, patch.getPatch().getHunks()).weightContextMatch(100, 5); }