Number result = null; int row = getRowIndex(rowKey); TaskSeries series = (TaskSeries) this.data.get(row); Task task = series.get(columnKey.toString()); if (task != null) { TimePeriod duration = task.getDuration(); if (duration != null) { result = new Long(duration.getStart().getTime()); } } return result;
Number result = null; int row = getRowIndex(rowKey); TaskSeries series = (TaskSeries) this.data.get(row); Task task = series.get(columnKey.toString()); if (task != null) { TimePeriod duration = task.getDuration(); if (duration != null) { result = new Long(duration.getEnd().getTime()); } } return result;
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) Method name: Number getEndValue(Comparable, Comparable)
Number of AST nodes: 9 Number of AST nodes: 9
1
Number result = null;
1
Number result = null;
2
        int row = getRowIndex(rowKey);
2
        int row = getRowIndex(rowKey);
3
        TaskSeries series = (TaskSeries) this.data.get(row);
3
        TaskSeries series = (TaskSeries) this.data.get(row);
4
        Task task = series.get(columnKey.toString());
4
        Task task = series.get(columnKey.toString());
5
        if (task != null) {
5
        if (task != null) {
6
            TimePeriod duration = task.getDuration();
6
            TimePeriod duration = task.getDuration();
7
            if (duration != null) {
7
            if (duration != null) {
8
                result = new Long(duration.getStart().getTime());
8
                result = new Long(duration.getEnd().getTime());
9
            }
9
            }
10
        }
10
        }
11
        return result;
11
        return result;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons33
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Number result = null;
    1
    Number result = null;
    2
    int row = getRowIndex(rowKey);
    2
    int row = getRowIndex(rowKey);
    3
    TaskSeries series = (TaskSeries)this.data.get(row);
    3
    TaskSeries series = (TaskSeries)this.data.get(row);
    4
    Task task = series.get(columnKey.toString());
    4
    Task task = series.get(columnKey.toString());
    5
    if (task != null)
    5
    if (task != null)
    6
    TimePeriod duration = task.getDuration();
    6
    TimePeriod duration = task.getDuration();
    7
    if (duration != null)
    7
    if (duration != null)
    8
    result = new Long(duration.getStart().getTime());
    8
    result = new Long(duration.getStart().getTime());
    8
    result = new Long(duration.getEnd().getTime());
    Differences
    Expression1Expression2Difference
    getStartgetEndMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression duration.getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression duration.getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    result = new Long(duration.getEnd().getTime());
    9
    return result;
    9
    return result;
    Precondition Violations (2)
    Row Violation
    1Expression duration.getStart() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression duration.getEnd() cannot be parameterized, because it has dependencies to/from statements that will be extracted