JPanel buttons = new JPanel(); buttons.setBorder(new EmptyBorder(3,0,0,0)); buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS)); ActionHandler actionHandler = new ActionHandler(); add = new RolloverButton(GUIUtilities.loadIcon("Plus.png")); add.setToolTipText(jEdit.getProperty("common.add")); add.addActionListener(actionHandler); buttons.add(add); buttons.add(Box.createHorizontalStrut(6)); remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png")); remove.setToolTipText(jEdit.getProperty("common.remove")); remove.addActionListener(actionHandler); buttons.add(remove); buttons.add(Box.createHorizontalStrut(6)); moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png")); moveUp.setToolTipText(jEdit.getProperty("common.moveUp")); moveUp.addActionListener(actionHandler); buttons.add(moveUp); buttons.add(Box.createHorizontalStrut(6)); moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png"));
JPanel buttons = new JPanel(); buttons.setBorder(new EmptyBorder(3,0,0,0)); buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS)); ActionHandler actionHandler = new ActionHandler(); add = new RolloverButton(GUIUtilities.loadIcon("Plus.png")); add.setToolTipText(jEdit.getProperty("common.add")); add.addActionListener(actionHandler); buttons.add(add); buttons.add(Box.createHorizontalStrut(6)); remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png")); remove.setToolTipText(jEdit.getProperty("common.remove")); remove.addActionListener(actionHandler); buttons.add(remove); buttons.add(Box.createHorizontalStrut(6)); moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png")); moveUp.setToolTipText(jEdit.getProperty("common.moveUp")); moveUp.addActionListener(actionHandler); buttons.add(moveUp); buttons.add(Box.createHorizontalStrut(6)); moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png"));
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/BrowserColorsOptionPane.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/ContextOptionPane.java
Method name: void _init() Method name: void _init()
Number of AST nodes: 20 Number of AST nodes: 20
1
JPanel buttons = new JPanel();
1
JPanel buttons = new JPanel();
2
		buttons.setBorder(new EmptyBorder(3,0,0,0));
2
		buttons.setBorder(new EmptyBorder(3,0,0,0));
3
		buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
3
		buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
4
		ActionHandler actionHandler = new ActionHandler();
4
		ActionHandler actionHandler = new ActionHandler();
5
		add = new RolloverButton(GUIUtilities.loadIcon("Plus.png"));
5
		add = new RolloverButton(GUIUtilities.loadIcon("Plus.png"));
6
		add.setToolTipText(jEdit.getProperty("common.add"));
6
		add.setToolTipText(jEdit.getProperty("common.add"));
7
		add.addActionListener(actionHandler);
7
		add.addActionListener(actionHandler);
8
		buttons.add(add);
8
		buttons.add(add);
9
		buttons.add(Box.createHorizontalStrut(6));
9
		buttons.add(Box.createHorizontalStrut(6));
10
		remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png"));
10
		remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png"));
11
		remove.setToolTipText(jEdit.getProperty("common.remove"));
11
		remove.setToolTipText(jEdit.getProperty("common.remove"));
12
		remove.addActionListener(actionHandler);
12
		remove.addActionListener(actionHandler);
13
		buttons.add(remove);
13
		buttons.add(remove);
14
		buttons.add(Box.createHorizontalStrut(6));
14
		buttons.add(Box.createHorizontalStrut(6));
15
		moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png"));
15
		moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png"));
16
		moveUp.setToolTipText(jEdit.getProperty("common.moveUp"));
16
		moveUp.setToolTipText(jEdit.getProperty("common.moveUp"));
17
		moveUp.addActionListener(actionHandler);
17
		moveUp.addActionListener(actionHandler);
18
		buttons.add(moveUp);
18
		buttons.add(moveUp);
19
		buttons.add(Box.createHorizontalStrut(6));
19
		buttons.add(Box.createHorizontalStrut(6));
20
		moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png"));
20
		moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png"));
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 comparisons189
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements19
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    15
    JPanel buttons = new JPanel();
    22
    JPanel buttons = new JPanel();
    16
    buttons.setBorder(new EmptyBorder(3, 0, 0, 0));
    23
    buttons.setBorder(new EmptyBorder(3, 0, 0, 0));
    17
    buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
    24
    buttons.setLayout(new BoxLayout(buttons, BoxLayout.X_AXIS));
    18
    ActionHandler actionHandler = new ActionHandler();
                                                                                                            
                                                                                                            
    25
    ActionHandler actionHandler = new ActionHandler();
    19
    add = new RolloverButton(GUIUtilities.loadIcon("Plus.png"));
    26
    add = new RolloverButton(GUIUtilities.loadIcon("Plus.png"));
    20
    add.setToolTipText(jEdit.getProperty("common.add"));
    27
    add.setToolTipText(jEdit.getProperty("common.add"));
    21
    add.addActionListener(actionHandler);
    21
    add.addActionListener(actionHandler);
    28
    add.addActionListener(actionHandler);
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandlerorg.gjt.sp.jedit.options.ContextOptionPane.ActionHandlerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler of variable actionHandler
    • Make classes org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler and org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler extend a common superclass
    28
    add.addActionListener(actionHandler);
    22
    buttons.add(add);
    29
    buttons.add(add);
    23
    buttons.add(Box.createHorizontalStrut(6));
    30
    buttons.add(Box.createHorizontalStrut(6));
    24
    remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png"));
    31
    remove = new RolloverButton(GUIUtilities.loadIcon("Minus.png"));
    25
    remove.setToolTipText(jEdit.getProperty("common.remove"));
    32
    remove.setToolTipText(jEdit.getProperty("common.remove"));
    26
    remove.addActionListener(actionHandler);
    26
    remove.addActionListener(actionHandler);
    33
    remove.addActionListener(actionHandler);
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandlerorg.gjt.sp.jedit.options.ContextOptionPane.ActionHandlerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler of variable actionHandler
    • Make classes org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler and org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler extend a common superclass
    33
    remove.addActionListener(actionHandler);
    27
    buttons.add(remove);
    34
    buttons.add(remove);
    28
    buttons.add(Box.createHorizontalStrut(6));
    35
    buttons.add(Box.createHorizontalStrut(6));
    29
    moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png"));
    36
    moveUp = new RolloverButton(GUIUtilities.loadIcon("ArrowU.png"));
    30
    moveUp.setToolTipText(jEdit.getProperty("common.moveUp"));
    37
    moveUp.setToolTipText(jEdit.getProperty("common.moveUp"));
    31
    moveUp.addActionListener(actionHandler);
    31
    moveUp.addActionListener(actionHandler);
    38
    moveUp.addActionListener(actionHandler);
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandlerorg.gjt.sp.jedit.options.ContextOptionPane.ActionHandlerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler of variable actionHandler
    • Make classes org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler and org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler extend a common superclass
    38
    moveUp.addActionListener(actionHandler);
    32
    buttons.add(moveUp);
    39
    buttons.add(moveUp);
    33
    buttons.add(Box.createHorizontalStrut(6));
    40
    buttons.add(Box.createHorizontalStrut(6));
    34
    moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png"));
    41
    moveDown = new RolloverButton(GUIUtilities.loadIcon("ArrowD.png"));
    Precondition Violations (3)
    Row Violation
    1Type org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler of variable actionHandler
    2Type org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler of variable actionHandler
    3Type org.gjt.sp.jedit.options.BrowserColorsOptionPane.ActionHandler of variable actionHandler does not match with type org.gjt.sp.jedit.options.ContextOptionPane.ActionHandler of variable actionHandler