View view = getViewConfiguredByDate(raw);
if (view != null) {
return view;
// otherwise, use this view configured as the tip.
} else {
return new View(raw, ViewConfiguration.createTip());
}
View view = getViewConfiguredByDate(raw);
if (view != null) {
return view;
// otherwise, use this view configured as the tip.
} else {
return new View(raw, ViewConfiguration.createTip());
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamCheckout.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/starteam/StarTeamList.java
|
Method name: View createSnapshotView(View)
|
|
Method name: View createSnapshotView(View)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | View view = getViewConfiguredByDate(raw);↵ | | 1 | View view = getViewConfiguredByDate(raw);↵
|
2 | if (view != null) {↵ | | 2 | if (view != null) {↵
|
3 | return view;↵ | | 3 | return view;↵
|
4 | // otherwise, use this view configured as the tip.↵ | | 4 | // otherwise, use this view configured as the tip.↵
|
5 | } else {↵ | | 5 | } else {↵
|
6 | return new View(raw, ViewConfiguration.createTip());↵ | | 6 | return new View(raw, ViewConfiguration.createTip());↵
|
7 | } | | 7 | }
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 15.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | View view = getViewConfiguredByDate(raw); | | 4 | View view = getViewConfiguredByDate(raw); |
7 | if (view != null) | | 5 | if (view != null) |
8 | | | 6 | |
| | | | |
9 | return new View(raw, ViewConfiguration.createTip()); | | 7 | return new View(raw, ViewConfiguration.createTip()); |
Precondition Violations (1)
Row |
Violation |
1 | Not all possible execution flows end in a return statement |