Parameter[] params = getParameters(); if (params != null) { for (int i = 0; i < params.length; i++) { if (LINES_KEY.equals(params[i].getName())) { lines = new Long(params[i].getValue()).longValue(); continue; } if (SKIP_KEY.equals(params[i].getName())) { skip = new Long(params[i].getValue()).longValue(); continue; } } }
Parameter[] params = getParameters(); if (params != null) { for (int i = 0; i < params.length; i++) { if (LINES_KEY.equals(params[i].getName())) { setLines(new Long(params[i].getValue()).longValue()); continue; } if (SKIP_KEY.equals(params[i].getName())) { skip = new Long(params[i].getValue()).longValue(); continue; } } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/HeadFilter.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TailFilter.java
Method name: void initialize() Method name: void initialize()
Number of AST nodes: 9 Number of AST nodes: 9
1
Parameter[] params = getParameters();
1
Parameter[] params = getParameters();
2
        if (params != null) {
2
        if (params != null) {
3
            for (int i = 0; i < params.length; i++) {
3
            for (int i = 0; i < params.length; i++) {
4
                if (LINES_KEY.equals(params[i].getName())) {
4
                if (LINES_KEY.equals(params[i].getName())) {
5
                    lines = new Long(params[i].getValue()).longValue();
5
                    setLines(new Long(params[i].getValue()).longValue());
6
                    continue;
6
                    continue;
7
                }
7
                }
8
                if (SKIP_KEY.equals(params[i].getName())) {
8
                if (SKIP_KEY.equals(params[i].getName())) {
9
                    skip = new Long(params[i].getValue()).longValue();
9
                    skip = new Long(params[i].getValue()).longValue();
10
                    continue;
10
                    continue;
11
                }
11
                }
12
            }
12
            }
13
        }
13
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons31
  1. {Non-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)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Parameter[] params = getParameters();
    1
    Parameter[] params = getParameters();
    2
    if (params != null)
    2
    if (params != null)
    3
    for (int i = 0; i < params.length; i++)
    3
    for (int i = 0; i < params.length; i++)
    4
    if (LINES_KEY.equals(params[i].getName()))
    4
    if (LINES_KEY.equals(params[i].getName()))
    5
    lines = new Long(params[i].getValue()).longValue();
    5
    lines = new Long(params[i].getValue()).longValue();
    5
    setLines(new Long(params[i].getValue()).longValue());
    Differences
    Expression1Expression2Difference
    lines=new Long(params[i].getValue()).longValue()setLines(new Long(params[i].getValue()).longValue())FIELD_ASSIGNMENT_REPLACED_WITH_SETTER
    Preondition Violations
    Expression lines=new Long(params[i].getValue()).longValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression setLines(new Long(params[i].getValue()).longValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    setLines(new Long(params[i].getValue()).longValue());
    6
    continue;
    6
    continue;
    7
    if (SKIP_KEY.equals(params[i].getName()))
    7
    if (SKIP_KEY.equals(params[i].getName()))
    8
    skip = new Long(params[i].getValue()).longValue();
    8
    skip = new Long(params[i].getValue()).longValue();
    9
    continue;
    9
    continue;
    Precondition Violations (2)
    Row Violation
    1Expression lines=new Long(params[i].getValue()).longValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression setLines(new Long(params[i].getValue()).longValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted