if (task != null) {
Task sub = task.getSubtask(subinterval);
if (sub != null) {
TimePeriod duration = sub.getDuration();
result = new Long(duration.getStart().getTime());
}
}
if (task != null) {
Task sub = task.getSubtask(subinterval);
if (sub != null) {
TimePeriod duration = sub.getDuration();
result = new Long(duration.getEnd().getTime());
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/TaskSeriesCollection.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/TaskSeriesCollection.java
|
Method name: Number getStartValue(Comparable, Comparable, int)
|
|
Method name: Number getEndValue(Comparable, Comparable, int)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (task != null) {↵ | | 1 | if (task != null) {↵
|
2 | Task sub = task.getSubtask(subinterval);↵ | | 2 | Task sub = task.getSubtask(subinterval);↵
|
3 | if (sub != null) {↵ | | 3 | if (sub != null) {↵
|
4 | TimePeriod duration = sub.getDuration();↵ | | 4 | TimePeriod duration = sub.getDuration();↵
|
5 | result = new Long(duration.getStart().getTime());↵ | | 5 | result = new Long(duration.getEnd().getTime());↵
|
6 | }↵ | | 6 | }↵
|
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 declared in the same class |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | if (task != null) | | 5 | if (task != null) |
6 | Task sub = task.getSubtask(subinterval); | | 6 | Task sub = task.getSubtask(subinterval); |
7 | | | 7 | |
8 | TimePeriod duration = sub.getDuration(); | | 8 | TimePeriod duration = sub.getDuration(); |
9 | result = new Long(duration.getStart().getTime()); | | 9 | result = new Long(duration.getEnd().getTime()); |
Precondition Violations (2)
Row |
Violation |
1 | Expression duration.getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression duration.getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted |