Skip to content

Commit

Permalink
Also adapt analysis code to io.github java-diff-util
Browse files Browse the repository at this point in the history
  • Loading branch information
DaGeRe committed Jul 6, 2024
1 parent 023bead commit cdef71e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import java.util.Map.Entry;
import java.util.Set;

import com.github.difflib.DiffUtils;
import com.github.difflib.patch.AbstractDelta;
import com.github.difflib.patch.Patch;
import com.github.javaparser.ast.CompilationUnit;

import de.dagere.nodeDiffDetector.data.MethodCall;
Expand All @@ -20,9 +23,6 @@
import de.dagere.nodeDiffDetector.utils.JavaParserProvider;
import de.dagere.peass.config.ExecutionConfig;
import de.dagere.peass.folders.PeassFolders;
import difflib.Delta;
import difflib.DiffUtils;
import difflib.Patch;

public class PropertyChangeGuesser {

Expand All @@ -45,9 +45,9 @@ public Set<String> getGuesses(final PeassFolders folders, final Entry<MethodCall
final String sourceOld = cache.getMethodSource(changedEntity.getKey(), method, fileOld);
final Patch<String> changedLinesMethod = DiffUtils.diff(Arrays.asList(sourceOld.split("\n")), Arrays.asList(source.split("\n")));

for (final Delta<String> delta : changedLinesMethod.getDeltas()) {
getDeltaGuess(guessedTypes, (delta.getOriginal().getLines()));
getDeltaGuess(guessedTypes, (delta.getRevised().getLines()));
for (final AbstractDelta<String> delta : changedLinesMethod.getDeltas()) {
getDeltaGuess(guessedTypes, (delta.getSource().getLines()));
getDeltaGuess(guessedTypes, (delta.getTarget().getLines()));
}
}
}
Expand Down

0 comments on commit cdef71e

Please sign in to comment.