editor.setBorder(new EmptyBorder(6,0,12,0)); content.add(BorderLayout.CENTER,editor); Box box = new Box(BoxLayout.X_AXIS); box.add(Box.createGlue()); global = new JButton(jEdit.getProperty("add-abbrev.global")); global.addActionListener(new ActionHandler());
editor.setBorder(new EmptyBorder(0,0,12,0)); content.add(BorderLayout.CENTER,editor); Box box = new Box(BoxLayout.X_AXIS); box.add(Box.createGlue()); ok = new JButton(jEdit.getProperty("common.ok")); ok.addActionListener(new ActionHandler());
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/AddAbbrevDialog.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/EditAbbrevDialog.java
Method name: void AddAbbrevDialog(View, String) Method name: void init(String, String, Map)
Number of AST nodes: 6 Number of AST nodes: 6
1
editor.setBorder(new EmptyBorder(6,0,12,0));
1
editor.setBorder(new EmptyBorder(0,0,12,0));
2
		content.add(BorderLayout.CENTER,editor);
2
		content.add(BorderLayout.CENTER,editor);
3
		Box box = new Box(BoxLayout.X_AXIS);
3
		Box box = new Box(BoxLayout.X_AXIS);
4
		box.add(Box.createGlue());
4
		box.add(Box.createGlue());
5
		global = new JButton(jEdit.getProperty("add-abbrev.global"));
5
		ok = new JButton(jEdit.getProperty("common.ok"));
6
		global.addActionListener(new ActionHandler());
6
		ok.addActionListener(new ActionHandler());
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 comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    editor.setBorder(new EmptyBorder(6, 0, 12, 0));
    8
    editor.setBorder(new EmptyBorder(6, 0, 12, 0));
    9
    editor.setBorder(new EmptyBorder(0, 0, 12, 0));
    Differences
    Expression1Expression2Difference
    60LITERAL_VALUE_MISMATCH
    9
    editor.setBorder(new EmptyBorder(0, 0, 12, 0));
    9
    content.add(BorderLayout.CENTER, editor);
    10
    content.add(BorderLayout.CENTER, editor);
    10
    Box box = new Box(BoxLayout.X_AXIS);
    11
    Box box = new Box(BoxLayout.X_AXIS);
    11
    box.add(Box.createGlue());
    12
    box.add(Box.createGlue());
    12
    global = new JButton(jEdit.getProperty("add-abbrev.global"));
    12
    global = new JButton(jEdit.getProperty("add-abbrev.global"));
    13
    ok = new JButton(jEdit.getProperty("common.ok"));
    Differences
    Expression1Expression2Difference
    globalokVARIABLE_NAME_MISMATCH
    "add-abbrev.global""common.ok"LITERAL_VALUE_MISMATCH
    Preondition Violations
    Expression global is a field being modified, and thus it cannot be parameterized
    Expression ok is a field being modified, and thus it cannot be parameterized
    13
    ok = new JButton(jEdit.getProperty("common.ok"));
    13
    global.addActionListener(new ActionHandler());
    13
    global.addActionListener(new ActionHandler());
    14
    ok.addActionListener(new ActionHandler());
    Differences
    Expression1Expression2Difference
    org.gjt.sp.jedit.gui.AddAbbrevDialog.ActionHandlerorg.gjt.sp.jedit.gui.EditAbbrevDialog.ActionHandlerVARIABLE_TYPE_MISMATCH
    globalokVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.gui.AddAbbrevDialog.ActionHandler of variable new ActionHandler() does not match with type org.gjt.sp.jedit.gui.EditAbbrevDialog.ActionHandler of variable new ActionHandler()
    • Make classes org.gjt.sp.jedit.gui.AddAbbrevDialog.ActionHandler and org.gjt.sp.jedit.gui.EditAbbrevDialog.ActionHandler extend a common superclass
    Expression global cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ok cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    ok.addActionListener(new ActionHandler());
    Precondition Violations (5)
    Row Violation
    1Expression global is a field being modified, and thus it cannot be parameterized
    2Expression ok is a field being modified, and thus it cannot be parameterized
    3Type org.gjt.sp.jedit.gui.AddAbbrevDialog.ActionHandler of variable new ActionHandler() does not match with type org.gjt.sp.jedit.gui.EditAbbrevDialog.ActionHandler of variable new ActionHandler()
    4Expression global cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression ok cannot be parameterized, because it has dependencies to/from statements that will be extracted