for (int i = 0; i < columns.count(); i++) { XmlElement column = columns.getElement(i); String name = column.getAttribute("name"); v.add(name); }
for (int i = 0; i < profiles.count(); i++) { XmlElement p = profiles.getElement(i); String name = p.getAttribute("name"); model.addElement(name); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/table/action/SortMessagesMenu.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/profiles/ProfileManagerDialog.java
Method name: void createSubMenu() Method name: void initComponents()
Number of AST nodes: 4 Number of AST nodes: 4
1
for (int i = 0; i < columns.count(); i++) {
1
for (int i = 0; i < profiles.count(); i++) {
2
				XmlElement column = columns.getElement(i);
2
			XmlElement p = profiles.getElement(i);
3
				String name = column.getAttribute("name");
3
			String name = p.getAttribute("name");
4
				v.add(name);
4
			model.addElement(name);
5
			}
5
		}
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)4.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    for (int i = 0; i < columns.count(); i++)
    5
    for (int i = 0; i < columns.count(); i++)
    34
    for (int i = 0; i < profiles.count(); i++)
    Differences
    Expression1Expression2Difference
    columnsprofilesVARIABLE_NAME_MISMATCH
    34
    for (int i = 0; i < profiles.count(); i++)
    6
    XmlElement column = columns.getElement(i);
    6
    XmlElement column = columns.getElement(i);
    35
    XmlElement p = profiles.getElement(i);
    Differences
    Expression1Expression2Difference
    columnpVARIABLE_NAME_MISMATCH
    columnsprofilesVARIABLE_NAME_MISMATCH
    35
    XmlElement p = profiles.getElement(i);
    7
    String name = column.getAttribute("name");
    7
    String name = column.getAttribute("name");
    36
    String name = p.getAttribute("name");
    Differences
    Expression1Expression2Difference
    columnpVARIABLE_NAME_MISMATCH
    36
    String name = p.getAttribute("name");
    8
    v.add(name);
    8
    v.add(name);
    Preondition Violations
    Unmatched statement v.add(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                  
                                                          
    37
    model.addElement(name);
    Preondition Violations
    Unmatched statement model.addElement(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    37
    model.addElement(name);
    Precondition Violations (3)
    Row Violation
    1Unmatched statement v.add(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement model.addElement(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3The refactoring of the clones is infeasible, because classes org.columba.mail.gui.table.action.SortMessagesMenu and org.columba.core.gui.profiles.ProfileManagerDialog do not have a common superclass