Class PatchIdDiffFormatter


  • public class PatchIdDiffFormatter
    extends DiffFormatter
    A DiffFormatter used to calculate the patch-id of the diff.
    • Constructor Detail

      • PatchIdDiffFormatter

        public PatchIdDiffFormatter()
        Initialize a formatter to compute a patch id.
    • Method Detail

      • getCalulatedPatchId

        public ObjectId getCalulatedPatchId()
        Should be called after having called one of the format methods
        Returns:
        the patch id calculated for the provided diff.
      • writeHunkHeader

        protected void writeHunkHeader​(int aStartLine,
                                       int aEndLine,
                                       int bStartLine,
                                       int bEndLine)
                                throws java.io.IOException
        Description copied from class: DiffFormatter
        Output a hunk header
        Overrides:
        writeHunkHeader in class DiffFormatter
        Parameters:
        aStartLine - within first source
        aEndLine - within first source
        bStartLine - within second source
        bEndLine - within second source
        Throws:
        java.io.IOException
      • formatIndexLine

        protected void formatIndexLine​(java.io.OutputStream o,
                                       DiffEntry ent)
                                throws java.io.IOException
        Overrides:
        formatIndexLine in class DiffFormatter
        Parameters:
        o - the stream the formatter will write line data to
        ent - the DiffEntry to create the FileHeader for
        Throws:
        java.io.IOException - writing to the supplied stream failed.