boolean () { try { debug("GenericPatchApplier execute started"); if (!myHunks.isEmpty()) { mySuppressNewLineInEnd = myHunks.get(myHunks.size() - 1).isNoNewLineAtEnd(); } for (final PatchHunk hunk : myHunks) { myNotExact.addAll(SplitHunk.read(hunk)); } for (Iterator<SplitHunk> iterator = myNotExact.iterator(); iterator.hasNext(); ) { SplitHunk splitHunk = iterator.next(); final SplitHunk copy = createWithAllContextCopy(splitHunk); if (testForExactMatch(copy, splitHunk)) { iterator.remove(); } } printTransformations("after exact match"); /*for (SplitHunk hunk : myNotExact) { complementInsertAndDelete(hunk); }*/ for (Iterator<SplitHunk> iterator = myNotExact.iterator(); iterator.hasNext(); ) { SplitHunk hunk = iterator.next(); final SplitHunk copy = createWithAllContextCopy(hunk); if (copy.isInsertion()) continue; if (testForPartialContextMatch(copy, new ExactMatchSolver(copy), ourMaxWalk, hunk)) { iterator.remove(); } } printTransformations("after exact but without context"); for (Iterator<SplitHunk> iterator = myNotExact.iterator(); iterator.hasNext(); ) { SplitHunk hunk = iterator.next(); SplitHunk original = copySplitHunk(hunk, hunk.getContextAfter(), hunk.getContextBefore()); complementInsertAndDelete(hunk); if (hunk.isInsertion()) { processAppliedInfoForUnApplied(original); continue; } if (testForPartialContextMatch(hunk, new ExactMatchSolver(hunk), ourMaxWalk, original)) { iterator.remove(); } else { processAppliedInfoForUnApplied(original); } } printTransformations("after variable place match"); return myNotExact.isEmpty(); } catch (ProcessCanceledException e) { throw e; } catch (Throwable e) { LOG.error(e); // GenericPatchApplier is buggy, limit AIOOB impact on user } resetToFallbackStateOnError(false); return myNotExact.isEmpty(); }