- Timestamp:
- 12/23/14 11:19:04 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/utils/TaskTraversalMyersDiff.java
r1767 r1848 15 15 package de.ugoe.cs.autoquest.tasktrees.temporalrelation.utils; 16 16 17 import de.ugoe.cs.autoquest.tasktrees.temporalrelation.Task InstanceComparator;17 import de.ugoe.cs.autoquest.tasktrees.temporalrelation.TaskComparator; 18 18 import difflib.ChangeDelta; 19 19 import difflib.Chunk; … … 33 33 34 34 /** */ 35 private final Task InstanceComparator comparator;35 private final TaskComparator comparator; 36 36 37 37 /** 38 38 * 39 39 */ 40 public TaskTraversalMyersDiff(Task InstanceComparator comparator) {40 public TaskTraversalMyersDiff(TaskComparator comparator) { 41 41 this.comparator = comparator; 42 42 } … … 102 102 // but the algorithm is one-based 103 103 // that's why there's no +1 when indexing the sequences 104 synchronized (comparator) { 105 while ((i < N) && (j < M) && comparator.equals(variant1.get(i), variant2.get(j))) 106 { 107 i++; 108 j++; 109 } 104 while ((i < N) && (j < M) && comparator.equals(variant1.get(i), variant2.get(j))) { 105 i++; 106 j++; 110 107 } 111 108 … … 169 166 170 167 Chunk original = new Chunk(ianchor, variant1.subList(ianchor, i)); 168 int originalSize = original.size(); 171 169 Chunk revised = new Chunk(janchor, variant2.subList(janchor, j)); 170 int revisedSize = revised.size(); 172 171 Delta delta = null; 173 172 174 if ((original .size() == 0) && (revised.size()!= 0)) {173 if ((originalSize == 0) && (revisedSize != 0)) { 175 174 delta = new InsertDelta(original, revised); 176 175 } 177 else if ((original .size() > 0) && (revised.size()== 0)) {176 else if ((originalSize > 0) && (revisedSize == 0)) { 178 177 delta = new DeleteDelta(original, revised); 179 178 }
Note: See TracChangeset
for help on using the changeset viewer.