setBorder(makeBorder()); setLayout(new BorderLayout()); JPanel vertPanel = new VerticalPanel(); vertPanel.add(makeTitlePanel()); perIterationCheck = new JCheckBox(JMeterUtils.getResString("update_per_iter"), true); // $NON-NLS-1$ Box perIterationPanel = Box.createHorizontalBox(); perIterationPanel.add(perIterationCheck); perIterationPanel.add(Box.createHorizontalGlue()); vertPanel.add(perIterationPanel); add(vertPanel, BorderLayout.NORTH); add(makeParameterPanel(), 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/modifiers/gui/UserParametersGui.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: 11 Number of AST nodes: 11
1
setBorder(makeBorder());
1
set
2
		setLayout(new BorderLayout());
3
		JPanel vertPanel = new VerticalPanel();
2
Layout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
4
		vertPanel.add(makeTitlePanel());
5
		perIterationCheck = new JCheckBox
3
		setBorder(makeBorder());
4
		add(makeTitlePanel());
5
		Box delayPanel = Box.createHorizontalBox();
6
(JMeterUtils.getResString("update_per_iter"), true); // $NON-NLS-1$
6
		JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));//$NON-NLS-1$
7
		Box perIterationPanel = Box.createHorizontalBox();
7
		delayPanel.add(delayLabel);
8
		perIterationPanel.add(perIterationCheck);
9
		perIterationPanel.add(Box.createHorizontalGlue());
10
		vertPanel.add(perIterationPanel);
11
		add(vertPanel, BorderLayout.NORTH
8
		delayField = new JTextField(6);
9
		delayField.setText(DEFAULT_DELAY);
10
		delayField.setName(DELAY_FIELD);
12
);
11
		delayPanel.add(delayField);
13
		add(makeParameterPanel(), BorderLayout.CENTER);
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 comparisons58
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    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
    setBorder(makeBorder());
    2
    setBorder(makeBorder());
    2
    setLayout(new BorderLayout());
                                                                      
    3
    JPanel vertPanel = new VerticalPanel();
    3
    JPanel vertPanel = new VerticalPanel();
    4
    Box delayPanel = Box.createHorizontalBox();
    Differences
    Expression1Expression2Difference
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    vertPaneldelayPanelVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    new VerticalPanel()Box.createHorizontalBox()TYPE_COMPATIBLE_REPLACEMENT
    4
    Box delayPanel = Box.createHorizontalBox();
    4
    vertPanel.add(makeTitlePanel());
    4
    vertPanel.add(makeTitlePanel());
    6
    delayPanel.add(delayLabel);
    Differences
    Expression1Expression2Difference
    makeTitlePanel()delayLabelTYPE_COMPATIBLE_REPLACEMENT
    vertPaneldelayPanelVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression delayLabel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    delayPanel.add(delayLabel);
    5
    perIterationCheck = new JCheckBox(JMeterUtils.getResString("update_per_iter"), true);
    5
    perIterationCheck = new JCheckBox(JMeterUtils.getResString("update_per_iter"), true);
    7
    delayField = new JTextField(6);
    Differences
    Expression1Expression2Difference
    perIterationCheckdelayFieldVARIABLE_NAME_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    javax.swing.JCheckBoxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    new JCheckBox(JMeterUtils.getResString("update_per_iter"),true)new JTextField(6)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression perIterationCheck is a field being modified, and thus it cannot be parameterized
    Expression delayField is a field being modified, and thus it cannot be parameterized
    7
    delayField = new JTextField(6);
    6
    Box perIterationPanel = Box.createHorizontalBox();
    6
    Box perIterationPanel = Box.createHorizontalBox();
    5
    JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));
    Differences
    Expression1Expression2Difference
    javax.swing.Boxjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    perIterationPaneldelayLabelVARIABLE_NAME_MISMATCH
    javax.swing.Boxjavax.swing.JLabelSUBCLASS_TYPE_MISMATCH
    Box.createHorizontalBox()new JLabel(JMeterUtils.getResString("constant_timer_delay"))TYPE_COMPATIBLE_REPLACEMENT
    5
    JLabel delayLabel = new JLabel(JMeterUtils.getResString("constant_timer_delay"));
    7
    perIterationPanel.add(perIterationCheck);
    7
    perIterationPanel.add(perIterationCheck);
    3
    add(makeTitlePanel());
    Differences
    Expression1Expression2Difference
    perIterationCheckmakeTitlePanel()TYPE_COMPATIBLE_REPLACEMENT
    perIterationPanelMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression perIterationCheck cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression perIterationPanel.add(perIterationCheck) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    add(makeTitlePanel());
                                                                              
    8
    delayField.setText(DEFAULT_DELAY);
    8
    perIterationPanel.add(Box.createHorizontalGlue());
    8
    perIterationPanel.add(Box.createHorizontalGlue());
    11
    add(delayPanel);
    Differences
    Expression1Expression2Difference
    Box.createHorizontalGlue()delayPanelTYPE_COMPATIBLE_REPLACEMENT
    perIterationPanelMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression delayPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression perIterationPanel.add(Box.createHorizontalGlue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(delayPanel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11
    add(delayPanel);
    9
    vertPanel.add(perIterationPanel);
    9
    vertPanel.add(perIterationPanel);
    10
    delayPanel.add(delayField);
    Differences
    Expression1Expression2Difference
    perIterationPaneldelayFieldVARIABLE_NAME_MISMATCH
    javax.swing.Boxjavax.swing.JTextFieldSUBCLASS_TYPE_MISMATCH
    vertPaneldelayPanelVARIABLE_NAME_MISMATCH
    javax.swing.JPaneljavax.swing.BoxSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression perIterationPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression delayField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    delayPanel.add(delayField);
    10
    add(vertPanel, BorderLayout.NORTH);
    10
    add(vertPanel, BorderLayout.NORTH);
    1
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    Differences
    Expression1Expression2Difference
    addsetLayoutMETHOD_INVOCATION_NAME_MISMATCH
    add(vertPanel,BorderLayout.NORTH)setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression add(vertPanel,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(vertPanel,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(vertPanel,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(vertPanel,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));
    11
    add(makeParameterPanel(), BorderLayout.CENTER);
    11
    add(makeParameterPanel(), BorderLayout.CENTER);
    9
    delayField.setName(DELAY_FIELD);
    Differences
    Expression1Expression2Difference
    addsetNameMETHOD_INVOCATION_NAME_MISMATCH
    add(makeParameterPanel(),BorderLayout.CENTER)delayField.setName(DELAY_FIELD)ARGUMENT_NUMBER_MISMATCH
    delayFieldMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression delayField.setName(DELAY_FIELD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(makeParameterPanel(),BorderLayout.CENTER) 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 delayField.setName(DELAY_FIELD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression add(makeParameterPanel(),BorderLayout.CENTER) 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);
    Precondition Violations (22)
    Row Violation
    1Expression delayLabel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression perIterationCheck is a field being modified, and thus it cannot be parameterized
    3Expression delayField is a field being modified, and thus it cannot be parameterized
    4Expression perIterationCheck cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression perIterationPanel.add(perIterationCheck) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression delayPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression perIterationPanel.add(Box.createHorizontalGlue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression add(delayPanel) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression perIterationPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression delayField cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression add(vertPanel,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression add(vertPanel,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    13Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    14Expression add(vertPanel,BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression add(vertPanel,BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    16Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    17Expression delayField.setName(DELAY_FIELD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression add(makeParameterPanel(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    19Expression delayField.setName(DELAY_FIELD) is a void method call, and thus it cannot be parameterized
    20Expression delayField.setName(DELAY_FIELD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression add(makeParameterPanel(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    22Expression delayField.setName(DELAY_FIELD) is a void method call, and thus it cannot be parameterized