toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2); toBeCentered.validate(); toBeCentered.repaint();
super(); mLabel.setText(pLabel); choiceList = new JComboBox(items); choiceList.setEditable(editable); init();
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/ComponentUtil.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/JLabeledChoice.java
Method name: void centerComponentInComponent(Component, Component) Method name: void JLabeledChoice(String, String[], boolean)
Number of AST nodes: 3 Number of AST nodes: 5
1
toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY()
1
super();
2
		mLabel.setText(pLabel);
2
				+ (parent.getHeight() - toBeCentered.getHeight()) / 2);
3
		
3
		toBeCentered.validate();
4
		toBeCentered.repa
4
choiceList = new JComboBox(items);
5
		choiceList.setEditable(editable);
5
int();
6
		init();
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.0
Clones locationClones are in different classes
Number of node comparisons15
  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 fragment2
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                          
    1
    super();
    1
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2);
    1
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2);
    5
    init();
    Differences
    Expression1Expression2Difference
    setLocationinitMETHOD_INVOCATION_NAME_MISMATCH
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2)init()ARGUMENT_NUMBER_MISMATCH
    toBeCenteredMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression init() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method init
    Expression toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2) is a void method call, and thus it cannot be parameterized
    Expression init() is a void method call, and thus it cannot be parameterized
    Expression init() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method init
    Expression toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2) is a void method call, and thus it cannot be parameterized
    Expression init() is a void method call, and thus it cannot be parameterized
    5
    init();
    2
    toBeCentered.validate();
    2
    toBeCentered.validate();
    2
    mLabel.setText(pLabel);
    Differences
    Expression1Expression2Difference
    validatesetTextMETHOD_INVOCATION_NAME_MISMATCH
    toBeCenteredmLabelVARIABLE_NAME_MISMATCH
    java.awt.Componentjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    toBeCentered.validate()mLabel.setText(pLabel)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    Expression mLabel.setText(pLabel) is a void method call, and thus it cannot be parameterized
    Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    Expression mLabel.setText(pLabel) is a void method call, and thus it cannot be parameterized
    2
    mLabel.setText(pLabel);
                                                                          
    3
    choiceList = new JComboBox(items);
    3
    toBeCentered.repaint();
    3
    toBeCentered.repaint();
    4
    choiceList.setEditable(editable);
    Differences
    Expression1Expression2Difference
    repaintsetEditableMETHOD_INVOCATION_NAME_MISMATCH
    toBeCenteredchoiceListVARIABLE_NAME_MISMATCH
    java.awt.Componentjavax.swing.JComboBoxSUBCLASS_TYPE_MISMATCH
    toBeCentered.repaint()choiceList.setEditable(editable)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    Expression choiceList.setEditable(editable) is a void method call, and thus it cannot be parameterized
    Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    Expression choiceList.setEditable(editable) is a void method call, and thus it cannot be parameterized
    4
    choiceList.setEditable(editable);
    Precondition Violations (14)
    Row Violation
    1Expression init() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2) is a void method call, and thus it cannot be parameterized
    3Expression init() is a void method call, and thus it cannot be parameterized
    4Expression init() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2,parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2) is a void method call, and thus it cannot be parameterized
    6Expression init() is a void method call, and thus it cannot be parameterized
    7Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    8Expression mLabel.setText(pLabel) is a void method call, and thus it cannot be parameterized
    9Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    10Expression mLabel.setText(pLabel) is a void method call, and thus it cannot be parameterized
    11Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    12Expression choiceList.setEditable(editable) is a void method call, and thus it cannot be parameterized
    13Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    14Expression choiceList.setEditable(editable) is a void method call, and thus it cannot be parameterized