if (displayName) { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(createLoopCountPanel(), BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); } else { // Embedded setLayout(new BorderLayout()); add(createLoopCountPanel(), BorderLayout.NORTH); }
if (displayName) { setLayout(new BorderLayout(0, 5)); setBorder(makeBorder()); add(makeTitlePanel(), BorderLayout.NORTH); JPanel mainPanel = new JPanel(new BorderLayout()); mainPanel.add(createConditionPanel(), BorderLayout.NORTH); add(mainPanel, BorderLayout.CENTER); } else { // Embedded setLayout(new BorderLayout()); add(createConditionPanel(), BorderLayout.NORTH); }
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/control/gui/IfControllerPanel.java
Method name: void init() Method name: void init()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (displayName) {
1
if (displayName) {
2
			setLayout(new BorderLayout(0, 5));
2
			setLayout(new BorderLayout(0, 5));
3
			setBorder(makeBorder());
3
			setBorder(makeBorder());
4
			add(makeTitlePanel(), BorderLayout.NORTH);
4
			add(makeTitlePanel(), BorderLayout.NORTH);
5
			JPanel mainPanel = new JPanel(new BorderLayout());
5
			JPanel mainPanel = new JPanel(new BorderLayout());
6
			mainPanel.add(createLoopCountPanel(), BorderLayout.NORTH);
6
			mainPanel.add(createConditionPanel(), BorderLayout.NORTH);
7
			add(mainPanel, BorderLayout.CENTER);
7
			add(mainPanel, BorderLayout.CENTER);
8
		} else {
8
		} else {
9
			// Embedded
9
			// Embedded
10
			setLayout(new BorderLayout());
10
			setLayout(new BorderLayout());
11
			add(createLoopCountPanel(), BorderLayout.NORTH);
11
			add(createConditionPanel(), BorderLayout.NORTH);
12
		}
12
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons81
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (displayName)
    1
    if (displayName)
    2
    setLayout(new BorderLayout(0, 5));
    2
    setLayout(new BorderLayout(0, 5));
    3
    setBorder(makeBorder());
    3
    setBorder(makeBorder());
    4
    add(makeTitlePanel(), BorderLayout.NORTH);
    4
    add(makeTitlePanel(), BorderLayout.NORTH);
    5
    JPanel mainPanel = new JPanel(new BorderLayout());
    5
    JPanel mainPanel = new JPanel(new BorderLayout());
    6
    mainPanel.add(createLoopCountPanel(), BorderLayout.NORTH);
    6
    mainPanel.add(createLoopCountPanel(), BorderLayout.NORTH);
    6
    mainPanel.add(createConditionPanel(), BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    createLoopCountPanelcreateConditionPanelMETHOD_INVOCATION_NAME_MISMATCH
    6
    mainPanel.add(createConditionPanel(), BorderLayout.NORTH);
    7
    add(mainPanel, BorderLayout.CENTER);
    7
    add(mainPanel, BorderLayout.CENTER);
    else
    else
    8
    setLayout(new BorderLayout());
    8
    setLayout(new BorderLayout());
    9
    add(createLoopCountPanel(), BorderLayout.NORTH);
    9
    add(createLoopCountPanel(), BorderLayout.NORTH);
    9
    add(createConditionPanel(), BorderLayout.NORTH);
    Differences
    Expression1Expression2Difference
    createLoopCountPanelcreateConditionPanelMETHOD_INVOCATION_NAME_MISMATCH
    9
    add(createConditionPanel(), BorderLayout.NORTH);
    Precondition Violations (0)
    Row Violation