setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP)); setBorder(makeBorder()); add(makeTitlePanel()); // USER_INPUT JPanel sizePanel = new JPanel(); sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), getSizeAttributesTitle())); sizePanel.add(new JLabel(JMeterUtils.getResString("size_assertion_label"))); //$NON-NLS-1$ size = new JTextField(5); size.addFocusListener(this); sizePanel.add(size); sizePanel.add(createComparatorButtonPanel()); add(sizePanel);
JPanel p = this; setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); p = new JPanel(); p.setLayout(new BorderLayout()); p.add(makeLabelPanel(), BorderLayout.NORTH); p.add(makeMainPanel(), BorderLayout.CENTER); // Force a minimum table height of 70 pixels p.add(Box.createVerticalStrut(70), BorderLayout.WEST); //p.add(makeButtonPanel(), BorderLayout.SOUTH); add(p, BorderLayout.CENTER); table.revalidate();
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/assertions/gui/SizeAssertionGui.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/visualizers/PropertyControlGui.java
Method name: void init() Method name: void init()
Number of AST nodes: 11 Number of AST nodes: 11
1
JPanel p = this;
1
setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
2
			setLayout(new BorderLayout(0, 5));
2
		setBorder(makeBorder());
3
			setBorder(makeBorder());
3
		add(makeTitlePanel());
4
			add(makeTitlePanel()
4
		// USER_INPUT
5
		JPanel sizePanel = new JPanel();
6
		sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
7
				getSizeAttributesTitle
5
, BorderLayout.NORTH);
6
			p = new JPanel();
8
()));
7
		p.setLayout(new BorderLayout());
9
		sizePanel.add(new JLabel(JMeterUtils.getResString("size_assertion_label"))); //$NON-NLS-1$
8
		
10
		size = new JTextField(5);
11
		size.addFocusLis
9
p.add(makeLabelPanel(), BorderLayout.NORTH);
10
		p.add(makeMainPanel(), BorderLayout.CENTER);
11
		// Force a minimum table height of 70 pixels
12
tener(this);
12
		p.add(Box.createVer
13
		sizePanel.add(size);
14
		sizePanel.add(createComparatorButtonPanel());
15
		add(sizePanel
13
ticalStrut(70), BorderLayout.WEST);
14
		//p.add(makeButtonPanel(), BorderLayout.SOUTH);
15
		add(p, BorderLayout.CENTER);
16
);
16
		table.revalidate();
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 comparisons99
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    1
    setLayout(new VerticalLayout(5, VerticalLayout.BOTH, VerticalLayout.TOP));
    4
    add(makeTitlePanel(), BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    setLayoutaddMETHOD_INVOCATION_NAME_MISMATCH
    setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP))add(makeTitlePanel(),BorderLayout.NORTH)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    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
    Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    4
    add(makeTitlePanel(), BorderLayout.NORTH);
    2
    setBorder(makeBorder());
    3
    setBorder(makeBorder());
    3
    add(makeTitlePanel());
                                                      
    4
    JPanel sizePanel = new JPanel();
    4
    JPanel sizePanel = new JPanel();
    1
    JPanel p = this;
    Differences
    Expression1Expression2Difference
    sizePanelpVARIABLE_NAME_MISMATCH
    new JPanel()thisTYPE_COMPATIBLE_REPLACEMENT
    1
    JPanel p = this;
                                                                            
    2
    setLayout(new BorderLayout(0, 5));
    5
    sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), getSizeAttributesTitle()));
    5
    sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), getSizeAttributesTitle()));
    7
    p.add(makeLabelPanel(), BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    setBorderaddMETHOD_INVOCATION_NAME_MISMATCH
    sizePanelpVARIABLE_NAME_MISMATCH
    sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle()))p.add(makeLabelPanel(),BorderLayout.NORTH)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.add(makeLabelPanel(),BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) is a void method call, and thus it cannot be parameterized
    Expression p.add(makeLabelPanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    Expression sizePanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.add(makeLabelPanel(),BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) is a void method call, and thus it cannot be parameterized
    Expression p.add(makeLabelPanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    7
    p.add(makeLabelPanel(), BorderLayout.NORTH);
    6
    sizePanel.add(new JLabel(JMeterUtils.getResString("size_assertion_label")));
                                                                                                                                                                  
    7
    size = new JTextField(5);
    7
    size = new JTextField(5);
    5
    p = new JPanel();
    Differences
    Expression1Expression2Difference
    sizepVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    javax.swing.JTextFieldjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    new JTextField(5)new JPanel()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression p cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression size is a field being modified, and thus it cannot be parameterized
    5
    p = new JPanel();
                                                                          
    6
    p.setLayout(new BorderLayout());
    Preondition Violations
    Unmatched statement p.setLayout(new BorderLayout()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    p.setLayout(new BorderLayout());
    8
    size.addFocusListener(this);
    8
    size.addFocusListener(this);
    8
    p.add(makeMainPanel(), BorderLayout.CENTER);
    Differences
    Expression1Expression2Difference
    addFocusListeneraddMETHOD_INVOCATION_NAME_MISMATCH
    sizepVARIABLE_NAME_MISMATCH
    javax.swing.JTextFieldjavax.swing.JPanelSUBCLASS_TYPE_MISMATCH
    size.addFocusListener(this)p.add(makeMainPanel(),BorderLayout.CENTER)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression size.addFocusListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.add(makeMainPanel(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression size.addFocusListener(this) is a void method call, and thus it cannot be parameterized
    Expression p.add(makeMainPanel(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    Expression size cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression size.addFocusListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression p.add(makeMainPanel(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression size.addFocusListener(this) is a void method call, and thus it cannot be parameterized
    Expression p.add(makeMainPanel(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    8
    p.add(makeMainPanel(), BorderLayout.CENTER);
                                                                                                                    
    9
    p.add(Box.createVerticalStrut(70), BorderLayout.WEST);
    9
    sizePanel.add(size);
                                                  
                                                                  
    10
    add(p, BorderLayout.CENTER);
    10
    sizePanel.add(createComparatorButtonPanel());
                                                                                                      
                                                  
    11
    table.revalidate();
    11
    add(sizePanel);
                                          
    Precondition Violations (27)
    Row Violation
    1Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    2Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    3Expression setLayout(new VerticalLayout(5,VerticalLayout.BOTH,VerticalLayout.TOP)) is a void method call, and thus it cannot be parameterized
    4Expression add(makeTitlePanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    5Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression p.add(makeLabelPanel(),BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) is a void method call, and thus it cannot be parameterized
    8Expression p.add(makeLabelPanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    9Expression sizePanel cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression p cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression p.add(makeLabelPanel(),BorderLayout.NORTH) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression sizePanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),getSizeAttributesTitle())) is a void method call, and thus it cannot be parameterized
    14Expression p.add(makeLabelPanel(),BorderLayout.NORTH) is a void method call, and thus it cannot be parameterized
    15Expression p cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression size is a field being modified, and thus it cannot be parameterized
    17Unmatched statement p.setLayout(new BorderLayout()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Expression size.addFocusListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression p.add(makeMainPanel(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression size.addFocusListener(this) is a void method call, and thus it cannot be parameterized
    21Expression p.add(makeMainPanel(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized
    22Expression size cannot be parameterized, because it has dependencies to/from statements that will be extracted
    23Expression p cannot be parameterized, because it has dependencies to/from statements that will be extracted
    24Expression size.addFocusListener(this) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression p.add(makeMainPanel(),BorderLayout.CENTER) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression size.addFocusListener(this) is a void method call, and thus it cannot be parameterized
    27Expression p.add(makeMainPanel(),BorderLayout.CENTER) is a void method call, and thus it cannot be parameterized