typePanel.add(action); content.add(BorderLayout.NORTH,typePanel); JPanel actionPanel = new JPanel(new BorderLayout(6,6)); ActionSet[] actionsList = jEdit.getActionSets(); Vector vec = new Vector(actionsList.length); for(int i = 0; i < actionsList.length; i++) { ActionSet actionSet = actionsList[i]; if(actionSet.getActionCount() != 0) vec.addElement(actionSet); } combo = new JComboBox(vec); combo.addActionListener(actionHandler); actionPanel.add(BorderLayout.NORTH,combo); list = new JList(); list.setVisibleRowCount(8); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); actionPanel.add(BorderLayout.CENTER,new JScrollPane(list));
typePanel.add(action); content.add(BorderLayout.NORTH,typePanel); JPanel actionPanel = new JPanel(new BorderLayout(6,6)); ActionSet[] actionsList = jEdit.getActionSets(); Vector vec = new Vector(actionsList.length); for(int i = 0; i < actionsList.length; i++) { ActionSet actionSet = actionsList[i]; if(actionSet.getActionCount() != 0) vec.addElement(actionSet); } combo = new JComboBox(vec); combo.addActionListener(actionHandler); actionPanel.add(BorderLayout.NORTH,combo); list = new JList(); list.setVisibleRowCount(8); list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); actionPanel.add(BorderLayout.CENTER,new JScrollPane(list));
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ContextOptionPane.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ToolBarOptionPane.java
Method name: void ContextAddDialog(Component) Method name: void ToolBarEditDialog(Component, DefaultComboBoxModel, ToolBarOptionPane.Button)
Number of AST nodes: 16 Number of AST nodes: 16
1
typePanel.add(action);
1
typePanel.add(action);
2
		content.add(BorderLayout.NORTH,typePanel);
2
		content.add(BorderLayout.NORTH,typePanel);
3
		JPanel actionPanel = new JPanel(new BorderLayout(6,6));
3
		JPanel actionPanel = new JPanel(new BorderLayout(6,6));
4
		ActionSet[] actionsList = jEdit.getActionSets();
4
		ActionSet[] actionsList = jEdit.getActionSets();
5
		Vector vec = new Vector(actionsList.length);
5
		Vector vec = new Vector(actionsList.length);
6
		for(int i = 0; i < actionsList.length; i++)
6
		for(int i = 0; i < actionsList.length; i++)
7
		{
7
		{
8
			ActionSet actionSet = actionsList[i];
8
			ActionSet actionSet = actionsList[i];
9
			if(actionSet.getActionCount() != 0)
9
			if(actionSet.getActionCount() != 0)
10
				vec.addElement(actionSet);
10
				vec.addElement(actionSet);
11
		}
11
		}
12
		combo = new JComboBox(vec);
12
		combo = new JComboBox(vec);
13
		combo.addActionListener(actionHandler);
13
		combo.addActionListener(actionHandler);
14
		actionPanel.add(BorderLayout.NORTH,combo);
14
		actionPanel.add(BorderLayout.NORTH,combo);
15
		list = new JList();
15
		list = new JList();
16
		list.setVisibleRowCount(8);
16
		list.setVisibleRowCount(8);
17
		list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
17
		list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
18
		actionPanel.add(BorderLayout.CENTER,new JScrollPane(list));
18
		actionPanel.add(BorderLayout.CENTER,new JScrollPane(list));
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons68
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements16
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    18
    typePanel.add(action);
    17
    typePanel.add(action);
    19
    content.add(BorderLayout.NORTH, typePanel);
    18
    content.add(BorderLayout.NORTH, typePanel);
    20
    JPanel actionPanel = new JPanel(new BorderLayout(6, 6));
    19
    JPanel actionPanel = new JPanel(new BorderLayout(6, 6));
    21
    ActionSet[] actionsList = jEdit.getActionSets();
    20
    ActionSet[] actionsList = jEdit.getActionSets();
    22
    Vector vec = new Vector(actionsList.length);
    21
    Vector vec = new Vector(actionsList.length);
    23
    for (int i = 0; i < actionsList.length; i++)
    22
    for (int i = 0; i < actionsList.length; i++)
    24
    ActionSet actionSet = actionsList[i];
    23
    ActionSet actionSet = actionsList[i];
    25
    if (actionSet.getActionCount() != 0)
    24
    if (actionSet.getActionCount() != 0)
    26
    vec.addElement(actionSet);
    25
    vec.addElement(actionSet);
    27
    combo = new JComboBox(vec);
    26
    combo = new JComboBox(vec);
    28
    combo.addActionListener(actionHandler);
    28
    combo.addActionListener(actionHandler);
    27
    combo.addActionListener(actionHandler);
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.options.ContextAddDialog.ActionHandlerorg.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandlerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.ContextAddDialog.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandler of variable actionHandler
    • Make classes org.gjt.sp.jedit.options.ContextAddDialog.ActionHandler and org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandler extend a common superclass
    27
    combo.addActionListener(actionHandler);
    29
    actionPanel.add(BorderLayout.NORTH, combo);
    28
    actionPanel.add(BorderLayout.NORTH, combo);
    30
    list = new JList();
    29
    list = new JList();
    31
    list.setVisibleRowCount(8);
    30
    list.setVisibleRowCount(8);
    32
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    31
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    33
    actionPanel.add(BorderLayout.CENTER, new JScrollPane(list));
    32
    actionPanel.add(BorderLayout.CENTER, new JScrollPane(list));
    Precondition Violations (1)
    Row Violation
    1Type org.gjt.sp.jedit.options.ContextAddDialog.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandler of variable actionHandler