public class ConcreteDiffFileProcessor extends java.lang.Object implements DiffFileProcessor
| Constructor and Description |
|---|
ConcreteDiffFileProcessor() |
| Modifier and Type | Method and Description |
|---|---|
private void |
createOneLineChange(DiffPartFileLine line,
ChangeType classification,
java.util.Set<VariableDefinitionChange> changes)
creates a one line change for the line.
|
private void |
createOneLineChanges(java.util.List<DiffPartFileLine> removedLines,
java.util.List<DiffPartFileLine> addedLines,
java.util.Set<VariableDefinitionChange> changes)
create the one line change entries for the remaining lines.
|
private void |
detectRenominations(java.util.List<DiffPartFileLine> removedLines,
java.util.List<DiffPartFileLine> addedLines,
java.util.Set<VariableDefinitionChange> changes,
DiffFile diffFile)
Detects all renamed definitions.
|
private void |
detectShiftsAndContentChanges(java.util.List<DiffPartFileLine> removedLines,
java.util.List<DiffPartFileLine> addedLines,
java.util.Set<VariableDefinitionChange> changes)
Detects all shifted and content-changed variable definitions.
|
private void |
fillAddedAndRemovedLinesLists(DiffFile diffFile,
java.util.List<DiffPartFileLine> removedLines,
java.util.List<DiffPartFileLine> addedLines)
Adds all Added/removed lines to the respective list, if they contain a variable definition.
|
ProcessedDiffFile |
process(DiffFile diffFile) |
private void |
processRemainingLines(java.util.List<DiffPartFileLine> remainingLines,
ChangeType classification,
java.util.Set<VariableDefinitionChange> changes)
creates one line changes with the given classification for each line.
|
public ProcessedDiffFile process(DiffFile diffFile)
process in interface DiffFileProcessordiffFile - passed from scanner that needs to be processedprivate void fillAddedAndRemovedLinesLists(DiffFile diffFile, java.util.List<DiffPartFileLine> removedLines, java.util.List<DiffPartFileLine> addedLines)
diffFile - the diffFileremovedLines - the list for the removed linesaddedLines - the list for the added linesprivate void detectShiftsAndContentChanges(java.util.List<DiffPartFileLine> removedLines, java.util.List<DiffPartFileLine> addedLines, java.util.Set<VariableDefinitionChange> changes)
removedLines - the list of removed linesaddedLines - the list of added lineschanges - the list for the changes to be storedprivate void detectRenominations(java.util.List<DiffPartFileLine> removedLines, java.util.List<DiffPartFileLine> addedLines, java.util.Set<VariableDefinitionChange> changes, DiffFile diffFile)
removedLines - the list of removed linesaddedLines - the list of added lineschanges - the list for the changes to be storeddiffFile - the diffFile to be processedprivate void createOneLineChanges(java.util.List<DiffPartFileLine> removedLines, java.util.List<DiffPartFileLine> addedLines, java.util.Set<VariableDefinitionChange> changes)
addedLines - the remaining add linesremovedLines - the remaining remove lineschanges - the list for the changes to be storedprivate void processRemainingLines(java.util.List<DiffPartFileLine> remainingLines, ChangeType classification, java.util.Set<VariableDefinitionChange> changes)
remainingLines - the list of removed linesclassification - the classification of the changechanges - the list for the changes to be storedprivate void createOneLineChange(DiffPartFileLine line, ChangeType classification, java.util.Set<VariableDefinitionChange> changes)
line - the line to be processedclassification - the classification of the changechanges - the list for the changes to be stored