UndoableEdit edit = edits.elementAt(i--);
if (edit.isSignificant())
{
if (edit instanceof AbstractDocument.DefaultDocumentEvent)
{
if (DocumentEvent.EventType.CHANGE != ((AbstractDocument.DefaultDocumentEvent)edit).getType())
{
return edit;
}
}
else
{
return edit;
}
}
UndoableEdit edit = edits.elementAt(i++);
if (edit.isSignificant())
{
if (edit instanceof AbstractDocument.DefaultDocumentEvent)
{
if (DocumentEvent.EventType.CHANGE != ((AbstractDocument.DefaultDocumentEvent)edit).getType())
{
return edit;
}
}
else
{
return edit;
}
}
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SquirrelDefaultUndoManager.java
|
|
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/SquirrelDefaultUndoManager.java
|
Method name: UndoableEdit editToBeUndone()
|
|
Method name: UndoableEdit editToBeRedone()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | UndoableEdit edit = edits.elementAt(i--);↵ | | 1 | UndoableEdit edit = edits.elementAt(i++);↵
|
2 | if (edit.isSignificant())↵ | | 2 | if (edit.isSignificant())↵
|
3 | {↵ | | 3 | {↵
|
4 | if (edit instanceof AbstractDocument.DefaultDocumentEvent)↵ | | 4 | if (edit instanceof AbstractDocument.DefaultDocumentEvent)↵
|
5 | {↵ | | 5 | {↵
|
6 | if (DocumentEvent.EventType.CHANGE != ((AbstractDocument.DefaultDocumentEvent)edit).getType())↵ | | 6 | if (DocumentEvent.EventType.CHANGE != ((AbstractDocument.DefaultDocumentEvent)edit).getType())↵
|
7 | {↵ | | 7 | {↵
|
8 | return edit;↵ | | 8 | return edit;↵
|
9 | }↵ | | 9 | }↵
|
10 | }↵ | | 10 | }↵
|
11 | else↵ | | 11 | else↵
|
12 | {↵ | | 12 | {↵
|
13 | return edit;↵ | | 13 | return edit;↵
|
14 | }↵ | | 14 | }↵
|
15 | } | | 15 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 11 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | UndoableEdit edit = edits.elementAt(i--); | | 7 | UndoableEdit edit = edits.elementAt(i++); |
7 | if (edit.isSignificant()) | | 8 | if (edit.isSignificant()) |
8 | if (edit instanceof AbstractDocument.DefaultDocumentEvent) | | 9 | if (edit instanceof AbstractDocument.DefaultDocumentEvent) |
9 | if (DocumentEvent.EventType.CHANGE != ((AbstractDocument.DefaultDocumentEvent)edit).getType()) | | 10 | if (DocumentEvent.EventType.CHANGE != ((AbstractDocument.DefaultDocumentEvent)edit).getType()) |
10 | | | 11 | |
| | | | |
11 | | | 12 | |
Precondition Violations (1)
Row |
Violation |
1 | Not all possible execution flows end in a return statement |