JPanel loopPanel = new JPanel(new BorderLayout(5, 0)); // SECONDS LABEL JLabel secondsLabel = new JLabel(JMeterUtils.getResString("runtime_seconds")); // $NON-NLS-1$ loopPanel.add(secondsLabel, BorderLayout.WEST); JPanel loopSubPanel = new JPanel(new BorderLayout(5, 0)); // TEXT FIELD seconds = new JTextField("1", 5); // $NON-NLS-1$ secondsLabel.setLabelFor(seconds); loopSubPanel.add(seconds, BorderLayout.CENTER); loopPanel.add(loopSubPanel, BorderLayout.CENTER); loopPanel.add(Box.createHorizontalStrut(secondsLabel.getPreferredSize().width + seconds.getPreferredSize().width), BorderLayout.NORTH); return loopPanel;
JPanel jndiPanel = new JPanel(new BorderLayout()); jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("jms_jndi_props"))); //$NON-NLS-1$ JPanel contextPanel = new JPanel(new BorderLayout(10, 0)); contextPanel.add(initialContextFactory); jndiPanel.add(contextPanel, BorderLayout.NORTH); JPanel providerPanel = new JPanel(new BorderLayout(10, 0)); providerPanel.add(providerUrl); jndiPanel.add(providerPanel, BorderLayout.SOUTH); jndiPropertiesPanel = new ArgumentsPanel(JMeterUtils.getResString("jms_jndi_props")); //$NON-NLS-1$ jndiPanel.add(jndiPropertiesPanel); return jndiPanel;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/control/gui/RunTimeGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/protocol/jms/control/gui/JMSConfigGui.java
Method name: JPanel createLoopCountPanel() Method name: JPanel createJNDIPanel()
Number of AST nodes: 10 Number of AST nodes: 11
1
JPanel loopPanel = new JPanel(new BorderLayout(5, 0));
1
JPanel jndiPanel = new JPanel(new BorderLayout());
2
		// SECONDS LABEL
3
		JLabel secondsLabel = new JLabel(
2
		jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), 
4
JMeterUtils.getResString("runtime_seconds")); // $NON-NLS-1$
3
				JMeterUtils.getResString("jms_jndi_props"))); //$NON-NLS-1$
5
		loopPanel.add(secondsLab
4
		JPanel contextPanel = new JPanel(new BorderLayout(10, 0));
5
		contextPanel.add(initialContextFactory);
6
el, BorderLayout.WEST);
6
		jndiPanel.add(contextPanel, BorderLayout.NORTH);
7
		JPanel loopSubPanel = new JPanel(new BorderLayout(5, 0));
7
		JPanel providerPanel = new JPanel(new BorderLayout(10, 0));
8
		// TEXT FIELD
9
		seconds = new JTextField("1", 5); // $NON-NLS-1$
10
		secondsLabel.setLabelFor(seconds);
11
		loopSubPanel.add(seconds, BorderLayout.CENTER);
12
		loop
8
		providerPanel.add(providerUrl);
13
Panel.add(loopSubPanel, BorderLayout.CENTER);
9
		jndiPanel.add(providerPanel, BorderLayout.SOUTH);
14
		loopPanel.add(Box.createHorizontalStrut(secondsLabel.getPreferredSize().width
10
		
15
				+ seconds.getPreferredSize().width), BorderLayout.NORTH
11
jndiPropertiesPanel = new ArgumentsPanel(JMeterUtils.getResString("jms_jndi_props")); //$NON-NLS-1$
16
);
12
		jndiPanel.add(jndiPropertiesPanel);
17
		return loopPanel;
13
		return jndiPanel;
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 comparisons70
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment3
    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
    JPanel loopPanel = new JPanel(new BorderLayout(5, 0));
    1
    JPanel loopPanel = new JPanel(new BorderLayout(5, 0));
    1
    JPanel jndiPanel = new JPanel(new BorderLayout());
    Differences
    Expression1Expression2Difference
    loopPaneljndiPanelVARIABLE_NAME_MISMATCH
    new BorderLayout(5,0)new BorderLayout()ARGUMENT_NUMBER_MISMATCH
    1
    JPanel jndiPanel = new JPanel(new BorderLayout());
    2
    JLabel secondsLabel = new JLabel(JMeterUtils.getResString("runtime_seconds"));
                                                                                                                                                                  
    3
    loopPanel.add(secondsLabel, BorderLayout.WEST);
    3
    loopPanel.add(secondsLabel, BorderLayout.WEST);
    2
    jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("jms_jndi_props")));
    Differences
    Expression1Expression2Difference
    addsetBorderMETHOD_INVOCATION_NAME_MISMATCH
    loopPaneljndiPanelVARIABLE_NAME_MISMATCH
    loopPanel.add(secondsLabel,BorderLayout.WEST)jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props")))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression loopPanel.add(secondsLabel,BorderLayout.WEST) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression loopPanel.add(secondsLabel,BorderLayout.WEST) is a void method call, and thus it cannot be parameterized
    Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) is a void method call, and thus it cannot be parameterized
    Expression loopPanel.add(secondsLabel,BorderLayout.WEST) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression loopPanel.add(secondsLabel,BorderLayout.WEST) is a void method call, and thus it cannot be parameterized
    Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) is a void method call, and thus it cannot be parameterized
    2
    jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), JMeterUtils.getResString("jms_jndi_props")));
                                                                                                                        
    3
    JPanel contextPanel = new JPanel(new BorderLayout(10, 0));
                                                                                          
    4
    contextPanel.add(initialContextFactory);
    4
    JPanel loopSubPanel = new JPanel(new BorderLayout(5, 0));
    4
    JPanel loopSubPanel = new JPanel(new BorderLayout(5, 0));
    6
    JPanel providerPanel = new JPanel(new BorderLayout(10, 0));
    Differences
    Expression1Expression2Difference
    loopSubPanelproviderPanelVARIABLE_NAME_MISMATCH
    510LITERAL_VALUE_MISMATCH
    6
    JPanel providerPanel = new JPanel(new BorderLayout(10, 0));
                                                                        
    7
    providerPanel.add(providerUrl);
    5
    seconds = new JTextField("1", 5);
    5
    seconds = new JTextField("1", 5);
    9
    jndiPropertiesPanel = new ArgumentsPanel(JMeterUtils.getResString("jms_jndi_props"));
    Differences
    Expression1Expression2Difference
    secondsjndiPropertiesPanelVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldorg.apache.jmeter.config.gui.ArgumentsPanelSUBCLASS_TYPE_MISMATCH
    javax.swing.JTextFieldorg.apache.jmeter.config.gui.ArgumentsPanelSUBCLASS_TYPE_MISMATCH
    new JTextField("1",5)new ArgumentsPanel(JMeterUtils.getResString("jms_jndi_props"))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression seconds is a field being modified, and thus it cannot be parameterized
    Expression jndiPropertiesPanel is a field being modified, and thus it cannot be parameterized
    9
    jndiPropertiesPanel = new ArgumentsPanel(JMeterUtils.getResString("jms_jndi_props"));
    6
    secondsLabel.setLabelFor(seconds);
                                                                              
    7
    loopSubPanel.add(seconds, BorderLayout.CENTER);
                                                                                                      
    8
    loopPanel.add(loopSubPanel, BorderLayout.CENTER);
    8
    loopPanel.add(loopSubPanel, BorderLayout.CENTER);
    5
    jndiPanel.add(contextPanel, BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    loopSubPanelcontextPanelVARIABLE_NAME_MISMATCH
    CENTERNORTHVARIABLE_NAME_MISMATCH
    loopPaneljndiPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression loopSubPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    jndiPanel.add(contextPanel, BorderLayout.NORTH);
    9
    loopPanel.add(Box.createHorizontalStrut(secondsLabel.getPreferredSize().width + seconds.getPreferredSize().width), BorderLayout.NORTH);
    9
    loopPanel.add(Box.createHorizontalStrut(secondsLabel.getPreferredSize().width + seconds.getPreferredSize().width), BorderLayout.NORTH);
    8
    jndiPanel.add(providerPanel, BorderLayout.SOUTH);
    Differences
    Expression1Expression2Difference
    Box.createHorizontalStrut(secondsLabel.getPreferredSize().width + seconds.getPreferredSize().width)providerPanelTYPE_COMPATIBLE_REPLACEMENT
    NORTHSOUTHVARIABLE_NAME_MISMATCH
    loopPaneljndiPanelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression Box.createHorizontalStrut(secondsLabel.getPreferredSize().width + seconds.getPreferredSize().width) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression providerPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    jndiPanel.add(providerPanel, BorderLayout.SOUTH);
                                                                                  
    10
    jndiPanel.add(jndiPropertiesPanel);
    10
    return loopPanel;
    10
    return loopPanel;
    11
    return jndiPanel;
    Differences
    Expression1Expression2Difference
    loopPaneljndiPanelVARIABLE_NAME_MISMATCH
    11
    return jndiPanel;
    Precondition Violations (14)
    Row Violation
    1Expression loopPanel.add(secondsLabel,BorderLayout.WEST) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression loopPanel.add(secondsLabel,BorderLayout.WEST) is a void method call, and thus it cannot be parameterized
    4Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) is a void method call, and thus it cannot be parameterized
    5Expression loopPanel.add(secondsLabel,BorderLayout.WEST) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression loopPanel.add(secondsLabel,BorderLayout.WEST) is a void method call, and thus it cannot be parameterized
    8Expression jndiPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),JMeterUtils.getResString("jms_jndi_props"))) is a void method call, and thus it cannot be parameterized
    9Expression seconds is a field being modified, and thus it cannot be parameterized
    10Expression jndiPropertiesPanel is a field being modified, and thus it cannot be parameterized
    11Expression loopSubPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression Box.createHorizontalStrut(secondsLabel.getPreferredSize().width + seconds.getPreferredSize().width) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression providerPanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Clone fragment #1 returns variables loopSubPanel , while Clone fragment #2 returns variables providerPanel, jndiPanel