choiceList.removeAllItems(); for (int i = 0; i < items.length; i++) { choiceList.addItem(items[i]); }
this.clearFiles(); for (int idx=0; idx < files.length; idx++) { addFilename(files[idx]); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/JLabeledChoice.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/FileListPanel.java
Method name: void setValues(String[]) Method name: void setFiles(String[])
Number of AST nodes: 3 Number of AST nodes: 3
1
choiceList.removeAllItems();
2
		
1
this.clearFiles();
3
for (int i = 0; i < items.length; i++) {
2
        for (int idx=0; idx < files.length; idx++) {
4
			choiceList.addItem(items[i]);
3
            addFilename(files[idx]);
5
		}
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  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)5.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    choiceList.removeAllItems();
    1
    choiceList.removeAllItems();
    1
    this.clearFiles();
    Differences
    Expression1Expression2Difference
    removeAllItemsclearFilesMETHOD_INVOCATION_NAME_MISMATCH
    javax.swing.JComboBoxorg.apache.jmeter.gui.util.FileListPanelSUBCLASS_TYPE_MISMATCH
    choiceListthisTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression choiceList.removeAllItems() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.clearFiles() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression choiceList.removeAllItems() is a void method call, and thus it cannot be parameterized
    Expression this.clearFiles() is a void method call, and thus it cannot be parameterized
    Expression choiceList cannot be unified with expression this , because common superclass javax.swing.JComponent does not declare member(s) public void removeAllItems() , public void clearFiles()
    1
    this.clearFiles();
    2
    for (int i = 0; i < items.length; i++)
    2
    for (int i = 0; i < items.length; i++)
    2
    for (int idx = 0; idx < files.length; idx++)
    Differences
    Expression1Expression2Difference
    iidxVARIABLE_NAME_MISMATCH
    iidxVARIABLE_NAME_MISMATCH
    itemsfilesVARIABLE_NAME_MISMATCH
    iidxVARIABLE_NAME_MISMATCH
    2
    for (int idx = 0; idx < files.length; idx++)
    3
    choiceList.addItem(items[i]);
    3
    choiceList.addItem(items[i]);
    3
    addFilename(files[idx]);
    Differences
    Expression1Expression2Difference
    itemsfilesVARIABLE_NAME_MISMATCH
    iidxVARIABLE_NAME_MISMATCH
    addItemaddFilenameMETHOD_INVOCATION_NAME_MISMATCH
    choiceListMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression choiceList.addItem(items[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addFilename(files[idx]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression choiceList.addItem(items[i]) is a void method call, and thus it cannot be parameterized
    Expression addFilename(files[idx]) is a void method call, and thus it cannot be parameterized
    Expression choiceList.addItem(items[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression addFilename(files[idx]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression choiceList.addItem(items[i]) is a void method call, and thus it cannot be parameterized
    Expression addFilename(files[idx]) is a void method call, and thus it cannot be parameterized
    3
    addFilename(files[idx]);
    Precondition Violations (13)
    Row Violation
    1Expression choiceList.removeAllItems() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.clearFiles() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression choiceList.removeAllItems() is a void method call, and thus it cannot be parameterized
    4Expression this.clearFiles() is a void method call, and thus it cannot be parameterized
    5Expression choiceList cannot be unified with expression this , because common superclass javax.swing.JComponent does not declare member(s) public void removeAllItems() , public void clearFiles()
    6Expression choiceList.addItem(items[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression addFilename(files[idx]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression choiceList.addItem(items[i]) is a void method call, and thus it cannot be parameterized
    9Expression addFilename(files[idx]) is a void method call, and thus it cannot be parameterized
    10Expression choiceList.addItem(items[i]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression addFilename(files[idx]) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression choiceList.addItem(items[i]) is a void method call, and thus it cannot be parameterized
    13Expression addFilename(files[idx]) is a void method call, and thus it cannot be parameterized