act = ((cPrintObject) members.get(i)).getSize(width); if (act.getWidth().getPoints() > maxWidth.getPoints()) { maxWidth = act.getWidth(); }
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: 3 Number of AST nodes: 3
1
act = ((cPrintObject) members.get(i)).getSize(width);
1
act = ((cPrintObject) members.get(i)).getSize(width);
2
            if (act.getWidth().getPoints() > maxWidth.getPoints()) {
2
            if (act.getHeight().getPoints() > maxHeight.getPoints()) {
3
                maxWidth = act.getWidth();
3
                maxHeight = act.getHeight();
4
            }
4
            }
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 comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    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.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Vector of variable members does not match with type java.util.List of variable members
    • Make classes java.util.Vector and java.util.List extend a common superclass
    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();
    Precondition Violations (6)
    Row Violation
    1Type java.util.Vector of variable members does not match with type java.util.List of variable members
    2Expression act.getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression act.getHeight() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression act.getWidth() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression act.getHeight() cannot be parameterized, 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