/** * Notify all registered change listeners that the text in the text field * has changed. */ protected void notifyChangeListeners() { ChangeEvent ce = new ChangeEvent(this); for (int index = 0; index < mChangeListeners.size(); index++) { mChangeListeners.get(index).stateChanged(ce); } }
private void fireFileChanged() { Iterator<ChangeListener> iter = listeners.iterator(); while (iter.hasNext()) { iter.next().stateChanged(new ChangeEvent(this)); } }
Clone fragments detected by clone detection tool
File path: /apache-jmeter-2.11/src/jorphan/org/apache/jorphan/gui/JLabeledTextField.java File path: /apache-jmeter-2.11/src/reports/org/apache/jmeter/gui/util/ReportFilePanel.java
Method name: void notifyChangeListeners() Method name: void fireFileChanged()
Number of AST nodes: 2 Number of AST nodes: 2
1
/**
1
private void fireFileChanged() {
2
     * Notify all registered change listeners that the text in the text field
2
        Iterator<ChangeListener> iter = listeners.iterator();
3
     * has changed.
3
        while (iter.hasNext()) {
4
     */
4
            iter.next().stateChanged(new ChangeEvent(this));
5
    protected void notifyChangeListeners() {
5
        }
6
        ChangeEvent ce = new ChangeEvent(this);
6
    }
7
        for (int index = 0; index < mChangeListeners.size(); index++) {
8
            mChangeListeners.get(index).stateChanged(ce);
9
        }
10
    }
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score0.500
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (int index = 0; index < mChangeListeners.size(); index++)
    2
    for (int index = 0; index < mChangeListeners.size(); index++)
    2
    while (iter.hasNext())
    Differences
    Expression1Expression2Difference
    cenew ChangeEvent(this)TYPE_COMPATIBLE_REPLACEMENT
    index < mChangeListeners.size()iter.hasNext()TYPE_COMPATIBLE_REPLACEMENT
    mChangeListenerslistenersVARIABLE_NAME_MISMATCH
    mChangeListenerslistenersVARIABLE_NAME_MISMATCH
    2
    while (iter.hasNext())
                                                                                                          
    3
    iter.next().stateChanged(new ChangeEvent(this));
    Differences
    Expression1Expression2Difference
    cenew ChangeEvent(this)TYPE_COMPATIBLE_REPLACEMENT
    3
    iter.next().stateChanged(new ChangeEvent(this));
    3
    mChangeListeners.get(index).stateChanged(ce);
    3
    mChangeListeners.get(index).stateChanged(ce);
    Differences
    Expression1Expression2Difference
    cenew ChangeEvent(this)TYPE_COMPATIBLE_REPLACEMENT
    mChangeListenerslistenersVARIABLE_NAME_MISMATCH
                                                                                                    
    Precondition Violations (0)
    Row Violation