java.lang.Object
java.lang.Record
org.variantsync.studies.evolution.simulation.diff.components.FineDiff
Record Components:
content - The line-level changes of the changed files.
All Implemented Interfaces:
IDiffComponent

public record FineDiff(List<FileDiff> content) extends Record implements IDiffComponent
A FineDiff holds the difference between two versions of a software project. The difference is represented by the line-level patches of all changed files. The patches are grouped by file and represented by FileDiff objects. Each FileDiff contains the line-level patches made to a specific file.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a FineDiff record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the content record component.
    static List<Change>
    Parse all patches in the difference and extract the changes source code lines without the patches' context lines.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Parse this component back into a list of lines that can be added to a diff file meant as input for unix patch
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FineDiff

      public FineDiff(List<FileDiff> content)
      Creates an instance of a FineDiff record class.
      Parameters:
      content - the value for the content record component
  • Method Details

    • determineChangedLines

      public static List<Change> determineChangedLines(FineDiff diff)
      Parse all patches in the difference and extract the changes source code lines without the patches' context lines.
      Parameters:
      diff - The difference from which changed lines are to be extracted
      Returns:
      A list of all changed lines (i.e., added and removed source code)
    • toLines

      public List<String> toLines()
      Description copied from interface: IDiffComponent
      Parse this component back into a list of lines that can be added to a diff file meant as input for unix patch
      Specified by:
      toLines in interface IDiffComponent
      Returns:
      the lines of the part of the diff that this component represents
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • content

      public List<FileDiff> content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component