this(); subPanel.setBackground(bkg); this.setBackground(bkg);
toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2); toBeCentered.validate(); toBeCentered.repaint();
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/util/VerticalPanel.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/ComponentUtil.java
Method name: void VerticalPanel(Color) Method name: void centerComponentInComponent(Component, Component)
Number of AST nodes: 3 Number of AST nodes: 3
1
this();
1
t
2
        subPanel.setBackground(bkg);
3
        this.setBackground(bkg
2
oBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY()
3
				+ (parent.getHeight() - toBeCentered.getHeight()) / 2);
4
		toBeCentered.validate();
4
);
5
		toBeCentered.repaint();
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 comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                                                                                                                                                                          
    1
    toBeCentered.setLocation(parent.getX() + (parent.getWidth() - toBeCentered.getWidth()) / 2, parent.getY() + (parent.getHeight() - toBeCentered.getHeight()) / 2);
    1
    this();
                        
    2
    subPanel.setBackground(bkg);
    2
    subPanel.setBackground(bkg);
    2
    toBeCentered.validate();
    Differences
    Expression1Expression2Difference
    setBackgroundvalidateMETHOD_INVOCATION_NAME_MISMATCH
    subPaneltoBeCenteredVARIABLE_NAME_MISMATCH
    javax.swing.Boxjava.awt.ComponentSUBCLASS_TYPE_MISMATCH
    subPanel.setBackground(bkg)toBeCentered.validate()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression subPanel.setBackground(bkg) 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 subPanel.setBackground(bkg) 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
    2
    toBeCentered.validate();
    3
    this.setBackground(bkg);
    3
    this.setBackground(bkg);
    3
    toBeCentered.repaint();
    Differences
    Expression1Expression2Difference
    setBackgroundrepaintMETHOD_INVOCATION_NAME_MISMATCH
    thistoBeCenteredTYPE_COMPATIBLE_REPLACEMENT
    this.setBackground(bkg)toBeCentered.repaint()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression this.setBackground(bkg) 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 this.setBackground(bkg) 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
    3
    toBeCentered.repaint();
    Precondition Violations (8)
    Row Violation
    1Expression subPanel.setBackground(bkg) is a void method call, and thus it cannot be parameterized
    2Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    3Expression subPanel.setBackground(bkg) is a void method call, and thus it cannot be parameterized
    4Expression toBeCentered.validate() is a void method call, and thus it cannot be parameterized
    5Expression this.setBackground(bkg) is a void method call, and thus it cannot be parameterized
    6Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized
    7Expression this.setBackground(bkg) is a void method call, and thus it cannot be parameterized
    8Expression toBeCentered.repaint() is a void method call, and thus it cannot be parameterized