setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); Box myBox = Box.createVerticalBox(); myBox.add(createPortPanel()); mainPanel.add(myBox, BorderLayout.NORTH); mainPanel.add(createControls(), BorderLayout.CENTER); add(mainPanel, BorderLayout.CENTER);
setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP)); setBorder(makeBorder()); add(makeTitlePanel()); Box delayPanel = Box.createHorizontalBox(); JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));//$NON-NLS-1$ delayPanel.add(delayLabel); delayField = new JTextField(6); delayField.setText(DEFAULT_DELAY); delayField.setName(DELAY_FIELD); delayPanel.add(delayField); add(delayPanel);
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/http/control/gui/HttpMirrorControlGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/timers/gui/ConstantTimerGui.java
Method name: void init() Method name: void init()
Number of AST nodes: 9 Number of AST nodes: 11
1
setLayout(new BorderLayout(0, 5));
1
setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
2
		setBorder(makeBorder());
2
		setBorder(makeBorder());
3
		add(makeTitlePanel(), BorderLayout.NORTH);
3
		add(makeTitlePanel()
4
		JPanel mainPanel = new JPanel(new BorderLayout());
5
		Box myBox = Box.createVerticalBox();
6
		myBox.add(createPortPanel());
7
		mainPanel.add(myBox, BorderLayout.NORTH);
8
        mainPanel.add(createControls(), BorderLayout.CENTER);
9
		add(mainPanel, BorderLayout.CENTER
4
);
5
		Box delayPanel = Box.createHorizontalBox();
6
		JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));//$NON-NLS-1$
7
		delayPanel.add(delayLabel);
8
		delayField = new JTextField(6);
9
		delayField.setText(DEFAULT_DELAY);
10
		delayField.setName(DELAY_FIELD);
11
		delayPanel.add(delayField);
10
);
12
		add(delayPanel);
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 having the same super class
Number of node comparisons75
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    setLayout(new BorderLayout(0, 5));
                                                                            
    2
    setBorder(makeBorder());
    2
    setBorder(makeBorder());
    3
    add(makeTitlePanel(), BorderLayout.NORTH);
    3
    add(makeTitlePanel(), BorderLayout.NORTH);
    1
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    Differences
    Expression1Expression2Difference
    addsetLayoutMETHOD_INVOCATION_NAME_MISMATCH
    add(makeTitlePanel(),BorderLayout.NORTH)setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    1
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
                                                      
    3
    add(makeTitlePanel());
    4
    JPanel mainPanel = new JPanel(new BorderLayout());
    4
    JPanel mainPanel = new JPanel(new BorderLayout());
    4
    Box delayPanel = Box.createHorizontalBox();
    Differences
    Expression1Expression2Difference
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    mainPaneldelayPanelVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    new JPanel(new BorderLayout())Box.createHorizontalBox()TYPE_COMPATIBLE_REPLACEMENT
    4
    Box delayPanel = Box.createHorizontalBox();
    5
    Box myBox = Box.createVerticalBox();
    5
    Box myBox = Box.createVerticalBox();
    5
    JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));
    Differences
    Expression1Expression2Difference
    javax.swing.Boxjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    myBoxdelayLabelVARIABLE_NAME_MISMATCH
    javax.swing.Boxjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    Box.createVerticalBox()new JLabel(JMeterUtils.getResString("constant_timer_delay"))TYPE_COMPATIBLE_REPLACEMENT
    5
    JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));
    6
    myBox.add(createPortPanel());
    6
    myBox.add(createPortPanel());
    6
    delayPanel.add(delayLabel);
    Differences
    Expression1Expression2Difference
    createPortPanel()delayLabelTYPE_COMPATIBLE_REPLACEMENT
    myBoxdelayPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression delayLabel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    delayPanel.add(delayLabel);
                                                                    
    7
    delayField = new JTextField(6);
    7
    mainPanel.add(myBox, BorderLayout.NORTH);
    7
    mainPanel.add(myBox, BorderLayout.NORTH);
    9
    delayField.setName(DELAY_FIELD);
    Differences
    Expression1Expression2Difference
    addsetNameMETHOD_INVOCATION_NAME_MISMATCH
    mainPaneldelayFieldVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    mainPanel.add(myBox,BorderLayout.NORTH)delayField.setName(DELAY_FIELD)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression mainPanel.add(myBox,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mainPanel.add(myBox,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression delayField.setName(DELAY_FIELD) is a void method call, and thus it cannot be parameterized
    Expression mainPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mainPanel.add(myBox,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mainPanel.add(myBox,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression delayField.setName(DELAY_FIELD) is a void method call, and thus it cannot be parameterized
    9
    delayField.setName(DELAY_FIELD);
    8
    mainPanel.add(createControls(), BorderLayout.CENTER);
    8
    mainPanel.add(createControls(), BorderLayout.CENTER);
    8
    delayField.setText(DEFAULT_DELAY);
    Differences
    Expression1Expression2Difference
    addsetTextMETHOD_INVOCATION_NAME_MISMATCH
    mainPaneldelayFieldVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    mainPanel.add(createControls(),BorderLayout.CENTER)delayField.setText(DEFAULT_DELAY)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression mainPanel.add(createControls(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mainPanel.add(createControls(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    Expression delayField.setText(DEFAULT_DELAY) is a void method call, and thus it cannot be parameterized
    Expression mainPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mainPanel.add(createControls(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mainPanel.add(createControls(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    Expression delayField.setText(DEFAULT_DELAY) is a void method call, and thus it cannot be parameterized
    8
    delayField.setText(DEFAULT_DELAY);
    9
    add(mainPanel, BorderLayout.CENTER);
                                                                                
                                                                  
    10
    delayPanel.add(delayField);
                                            
    11
    add(delayPanel);
    Precondition Violations (20)
    Row Violation
    1Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    2Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    3Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    4Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    5Expression delayLabel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression mainPanel.add(myBox,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression mainPanel.add(myBox,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    8Expression delayField.setName(DELAY_FIELD) is a void method call, and thus it cannot be parameterized
    9Expression mainPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression mainPanel.add(myBox,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression mainPanel.add(myBox,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    12Expression delayField.setName(DELAY_FIELD) is a void method call, and thus it cannot be parameterized
    13Expression mainPanel.add(createControls(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression mainPanel.add(createControls(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    15Expression delayField.setText(DEFAULT_DELAY) is a void method call, and thus it cannot be parameterized
    16Expression mainPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression mainPanel.add(createControls(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression mainPanel.add(createControls(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    19Expression delayField.setText(DEFAULT_DELAY) is a void method call, and thus it cannot be parameterized
    20Clone fragment #1 returns variable mainPanel with type javax.swing.JPanel , while Clone fragment #2 returns variable delayPanel with type javax.swing.Box