From cdef71e42296cbadc674e72ebda2e6801d512b9c Mon Sep 17 00:00:00 2001 From: David Georg Reichelt Date: Sat, 6 Jul 2024 20:00:23 +0200 Subject: [PATCH] Also adapt analysis code to io.github java-diff-util --- .../analysis/properties/PropertyChangeGuesser.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/analysis/src/main/java/de/dagere/peass/analysis/properties/PropertyChangeGuesser.java b/analysis/src/main/java/de/dagere/peass/analysis/properties/PropertyChangeGuesser.java index af01936b6..7f8972fa9 100644 --- a/analysis/src/main/java/de/dagere/peass/analysis/properties/PropertyChangeGuesser.java +++ b/analysis/src/main/java/de/dagere/peass/analysis/properties/PropertyChangeGuesser.java @@ -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; @@ -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 { @@ -45,9 +45,9 @@ public Set getGuesses(final PeassFolders folders, final Entry changedLinesMethod = DiffUtils.diff(Arrays.asList(sourceOld.split("\n")), Arrays.asList(source.split("\n"))); - for (final Delta delta : changedLinesMethod.getDeltas()) { - getDeltaGuess(guessedTypes, (delta.getOriginal().getLines())); - getDeltaGuess(guessedTypes, (delta.getRevised().getLines())); + for (final AbstractDelta delta : changedLinesMethod.getDeltas()) { + getDeltaGuess(guessedTypes, (delta.getSource().getLines())); + getDeltaGuess(guessedTypes, (delta.getTarget().getLines())); } } }