if (tolerant == null) { tolerant = new JCheckBox(JMeterUtils.getResString("xml_tolerant_button")); //$NON-NLS-1$ tolerant.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tolerant(); } }); } return tolerant;
if (checkXPath == null) { checkXPath = new JButton(JMeterUtils.getResString("xpath_assertion_button")); //$NON-NLS-1$ checkXPath.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { validXPath(xpath.getText(), true); } }); } return checkXPath;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XMLConfPanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/XPathPanel.java
Method name: JCheckBox getTolerant() Method name: JButton getCheckXPathButton()
Number of AST nodes: 4 Number of AST nodes: 4
1
if (tolerant == null) {
1
if (checkXPath == null) {
2
			tolerant = new JCheckBox(JMeterUtils.getResString("xml_tolerant_button")); //$NON-NLS-1$
2
			checkXPath = new JButton(JMeterUtils.getResString("xpath_assertion_button")); //$NON-NLS-1$
3
			tolerant.addActionListener(new ActionListener() {
3
			checkXPath.addActionListener(new ActionListener() {
4
				public void actionPerformed(ActionEvent e) {
4
				public void actionPerformed(ActionEvent e) {
5
					tolerant();
5
					validXPath(xpath.getText(), true);
6
				}
6
				}
7
			});
7
			});
8
		}
8
		}
9
		return tolerant;
9
		return checkXPath;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
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 comparisons10
  1. {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)23.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (tolerant == null)
    1
    if (tolerant == null)
    1
    if (checkXPath == null)
    Differences
    Expression1Expression2Difference
    tolerantcheckXPathVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    1
    if (checkXPath == null)
    2
    tolerant = new JCheckBox(JMeterUtils.getResString("xml_tolerant_button"));
    2
    tolerant = new JCheckBox(JMeterUtils.getResString("xml_tolerant_button"));
    2
    checkXPath = new JButton(JMeterUtils.getResString("xpath_assertion_button"));
    Differences
    Expression1Expression2Difference
    tolerantcheckXPathVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    "xml_tolerant_button""xpath_assertion_button"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression new JCheckBox(JMeterUtils.getResString("xml_tolerant_button")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new JButton(JMeterUtils.getResString("xpath_assertion_button")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    checkXPath = new JButton(JMeterUtils.getResString("xpath_assertion_button"));
                                                                                                                                                                                                                                                                                                            
    3
    checkXPath.addActionListener(new ActionListener() {...});
    Preondition Violations
    Unmatched statement checkXPath.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ validXPath(xpath.getText(),true); } } ); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement checkXPath.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ validXPath(xpath.getText(),true); } } ); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    3
    checkXPath.addActionListener(new ActionListener() {...});
    3
    tolerant.addActionListener(new ActionListener() {...});
    3
    tolerant.addActionListener(new ActionListener() {...});
    Preondition Violations
    Unmatched statement tolerant.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ tolerant(); } } ); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                                                                            
    4
    return tolerant;
    4
    return tolerant;
    4
    return checkXPath;
    Differences
    Expression1Expression2Difference
    tolerantcheckXPathVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JButtonSUBCLASS_TYPE_MISMATCH
    4
    return checkXPath;
    Precondition Violations (5)
    Row Violation
    1Expression new JCheckBox(JMeterUtils.getResString("xml_tolerant_button")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new JButton(JMeterUtils.getResString("xpath_assertion_button")) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement checkXPath.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ validXPath(xpath.getText(),true); } } ); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement checkXPath.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ validXPath(xpath.getText(),true); } } ); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    5Unmatched statement tolerant.addActionListener(new ActionListener(){ public void actionPerformed( ActionEvent e){ tolerant(); } } ); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted