Collection<?> oldValues = (Collection<?>)notification.getOldValue(); ListDiffEntry [] listDiffEntries = new ListDiffEntry [oldValues.size()]; int position = notification.getPosition(); int index = 0; for (Object oldValue : oldValues) { listDiffEntries[index++] = Diffs.createListDiffEntry(position++, false, oldValue); } diff = Diffs.createListDiff(listDiffEntries); break;
Collection<?> newValues = (Collection<?>)notification.getNewValue(); ListDiffEntry [] listDiffEntries = new ListDiffEntry [newValues.size()]; int position = notification.getPosition(); int index = 0; for (Object newValue : newValues) { listDiffEntries[index++] = Diffs.createListDiffEntry(position++, true, newValue); } diff = Diffs.createListDiff(listDiffEntries); break;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/databinding/EObjectObservableList.java File path: /emf-2.4.1/src/org/eclipse/emf/databinding/EObjectObservableList.java
Method name: void notifyChanged(Notification) Method name: void notifyChanged(Notification)
Number of AST nodes: 8 Number of AST nodes: 8
1
Collection<?> oldValues = (Collection<?>)notification.getOldValue();
1
Collection<?> newValues = (Collection<?>)notification.getNewValue();
2
                ListDiffEntry [] listDiffEntries = new ListDiffEntry [oldValues.size()];
2
                ListDiffEntry [] listDiffEntries = new ListDiffEntry [newValues.size()];
3
                int position = notification.getPosition();
3
                int position = notification.getPosition();
4
                int index = 0;
4
                int index = 0;
5
                for (Object oldValue : oldValues)
5
                for (Object newValue : newValues)
6
                {
6
                {
7
                  listDiffEntries[index++] = Diffs.createListDiffEntry(position++, false, oldValue);
7
                  listDiffEntries[index++] = Diffs.createListDiffEntry(position++, true, newValue);
8
                }
8
                }
9
                diff = Diffs.createListDiff(listDiffEntries);
9
                diff = Diffs.createListDiff(listDiffEntries);
10
                break;
10
                break;
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in the same method
Number of node comparisons1