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));
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/ToolBarOptionPane.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ContextOptionPane.java
Method name: void ToolBarEditDialog(Component, DefaultComboBoxModel, ToolBarOptionPane.Button) Method name: void ContextAddDialog(Component)
Number of AST nodes: 13 Number of AST nodes: 13
1
ActionSet[] actionsList = jEdit.getActionSets();
1
ActionSet[] actionsList = jEdit.getActionSets();
2
		Vector vec = new Vector(actionsList.length);
2
		Vector vec = new Vector(actionsList.length);
3
		for(int i = 0; i < actionsList.length; i++)
3
		for(int i = 0; i < actionsList.length; i++)
4
		{
4
		{
5
			ActionSet actionSet = actionsList[i];
5
			ActionSet actionSet = actionsList[i];
6
			if(actionSet.getActionCount() != 0)
6
			if(actionSet.getActionCount() != 0)
7
				vec.addElement(actionSet);
7
				vec.addElement(actionSet);
8
		}
8
		}
9
		combo = new JComboBox(vec);
9
		combo = new JComboBox(vec);
10
		combo.addActionListener(actionHandler);
10
		combo.addActionListener(actionHandler);
11
		actionPanel.add(BorderLayout.NORTH,combo);
11
		actionPanel.add(BorderLayout.NORTH,combo);
12
		list = new JList();
12
		list = new JList();
13
		list.setVisibleRowCount(8);
13
		list.setVisibleRowCount(8);
14
		list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
14
		list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
15
		actionPanel.add(BorderLayout.CENTER,new JScrollPane(list));
15
		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 comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    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.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    20
    ActionSet[] actionsList = jEdit.getActionSets();
    21
    ActionSet[] actionsList = jEdit.getActionSets();
    21
    Vector vec = new Vector(actionsList.length);
    22
    Vector vec = new Vector(actionsList.length);
    22
    for (int i = 0; i < actionsList.length; i++)
    23
    for (int i = 0; i < actionsList.length; i++)
    23
    ActionSet actionSet = actionsList[i];
    24
    ActionSet actionSet = actionsList[i];
    24
    if (actionSet.getActionCount() != 0)
    25
    if (actionSet.getActionCount() != 0)
    25
    vec.addElement(actionSet);
    26
    vec.addElement(actionSet);
    26
    combo = new JComboBox(vec);
    27
    combo = new JComboBox(vec);
    27
    combo.addActionListener(actionHandler);
    27
    combo.addActionListener(actionHandler);
    28
    combo.addActionListener(actionHandler);
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandlerorg.gjt.sp.jedit.options.ContextAddDialog.ActionHandlerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextAddDialog.ActionHandler of variable actionHandler
    • Make classes org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandler and org.gjt.sp.jedit.options.ContextAddDialog.ActionHandler extend a common superclass
    28
    combo.addActionListener(actionHandler);
    28
    actionPanel.add(BorderLayout.NORTH, combo);
    29
    actionPanel.add(BorderLayout.NORTH, combo);
    29
    list = new JList();
    30
    list = new JList();
    30
    list.setVisibleRowCount(8);
    31
    list.setVisibleRowCount(8);
    31
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    32
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    32
    actionPanel.add(BorderLayout.CENTER, new JScrollPane(list));
    33
    actionPanel.add(BorderLayout.CENTER, new JScrollPane(list));
    Precondition Violations (1)
    Row Violation
    1Type org.gjt.sp.jedit.options.ToolBarEditDialog.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextAddDialog.ActionHandler of variable actionHandler