Class UnifiedDiff

java.lang.Object
io.jenkins.plugins.batchcontrol.store.UnifiedDiff

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class UnifiedDiff extends Object
Minimal unified-diff generator for config.xml change records (SPEC item 9). LCS-based, three context lines per hunk, standard @@ -a,b +c,d @@ hunk headers.

Size guard: pathological inputs (huge configs or a diff longer than 2000 lines) are replaced by a short "diff too large" note so a single change can never bloat the store or the UI.

  • Method Details

    • diff

      public static String diff(String oldText, String newText)
      Computes the unified diff between two texts.
      Returns:
      the diff text, or null when the texts are line-identical