for (int i = 0; i < members.size(); i++) { act = ((cPrintObject) members.get(i)).getSize(width); if (act.getWidth().getPoints() > maxWidth.getPoints()) { maxWidth = act.getWidth(); } max.addI(act.getHeight()); }
for (int i = 0; i < members.size(); i++) { act = ((cPrintObject) members.get(i)).getSize(width); if (act.getHeight().getPoints() > maxHeight.getPoints()) { maxHeight = act.getHeight(); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/print/cVGroup.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/print/cHGroup.java
Method name: cSize getSize(cUnit) Method name: cSize getSize(cUnit)
Number of AST nodes: 5 Number of AST nodes: 4
1
for (int i = 0; i < members.size(); i++) {
1
for (int i = 0; i < members.size(); i++) {
2
            act = ((cPrintObject) members.get(i)).getSize(width);
2
            act = ((cPrintObject) members.get(i)).getSize(width);
3
            if (act.getWidth().getPoints() > maxWidth.getPoints()) {
3
            if (act.getHeight().getPoints() > maxHeight.getPoints()) {
4
                maxWidth = act.getWidth();
4
                maxHeight = act.getHeight();
5
            }
5
            }
6
            max.addI(act.getHeight());
7
        }
6
        }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)9.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    for (int i = 0; i < members.size(); i++)
    4
    for (int i = 0; i < members.size(); i++)
    3
    for (int i = 0; i < members.size(); i++)
    Differences
    Expression1Expression2Difference
    java.util.Vectorjava.util.ListSUBCLASS_TYPE_MISMATCH
    3
    for (int i = 0; i < members.size(); i++)
    5
    act = ((cPrintObject)members.get(i)).getSize(width);
    5
    act = ((cPrintObject)members.get(i)).getSize(width);
    4
    act = ((cPrintObject)members.get(i)).getSize(width);
    Differences
    Expression1Expression2Difference
    java.util.Vectorjava.util.ListSUBCLASS_TYPE_MISMATCH
    4
    act = ((cPrintObject)members.get(i)).getSize(width);
    6
    if (act.getWidth().getPoints() > maxWidth.getPoints())
    6
    if (act.getWidth().getPoints() > maxWidth.getPoints())
    5
    if (act.getHeight().getPoints() > maxHeight.getPoints())
    Differences
    Expression1Expression2Difference
    getWidthgetHeightMETHOD_INVOCATION_NAME_MISMATCH
    maxWidthmaxHeightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression act.getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression act.getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    if (act.getHeight().getPoints() > maxHeight.getPoints())
    7
    maxWidth = act.getWidth();
    7
    maxWidth = act.getWidth();
    6
    maxHeight = act.getHeight();
    Differences
    Expression1Expression2Difference
    maxWidthmaxHeightVARIABLE_NAME_MISMATCH
    getWidthgetHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression act.getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression act.getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    maxHeight = act.getHeight();
    8
    max.addI(act.getHeight());
    8
    max.addI(act.getHeight());
    Preondition Violations
    Unmatched statement max.addI(act.getHeight()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                              
    Precondition Violations (6)
    Row Violation
    1Expression act.getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression act.getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression act.getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression act.getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement max.addI(act.getHeight()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Clone fragment #1 returns variables act, maxWidth , while Clone fragment #2 returns variables maxHeight