Abbrev abbrev = (Abbrev)abbrevs.elementAt(row); switch(col) { case 0: return abbrev.abbrev; case 1: return abbrev.expand; default: return null; }
StyleChoice ch = (StyleChoice)styleChoices.elementAt(row); switch(col) { case 0: return ch.label; case 1: return ch.style; default: return null; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/AbbrevsOptionPane.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/options/SyntaxHiliteOptionPane.java
Method name: Object getValueAt(int, int) Method name: Object getValueAt(int, int)
Number of AST nodes: 8 Number of AST nodes: 8
1
Abbrev abbrev = (Abbrev)abbrevs.elementAt(row);
1
StyleChoice ch = (StyleChoice)styleChoices.elementAt(row);
2
		switch(col)
2
		switch(col)
3
		{
3
		{
4
		case 0:
4
		case 0:
5
			return abbrev.abbrev;
5
			return ch.label;
6
		case 1:
6
		case 1:
7
			return abbrev.expand;
7
			return ch.style;
8
		default:
8
		default:
9
			return null;
9
			return null;
10
		}
10
		}
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.1
Clones locationClones are in different classes having the same super class
Number of node comparisons26
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                                          
    1
    StyleChoice ch = (StyleChoice)styleChoices.elementAt(row);
    1
    Abbrev abbrev = (Abbrev)abbrevs.elementAt(row);
                                                                                                    
    2
    switch (col)
    2
    switch (col)
    3
    case 0:
    3
    case 0:
    4
    return abbrev.abbrev;
    4
    return abbrev.abbrev;
    4
    return ch.label;
    Differences
    Expression1Expression2Difference
    abbrevchVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.options.Abbrevorg.gjt.sp.jedit.options.StyleTableModel.StyleChoiceVARIABLE_TYPE_MISMATCH
    abbrevlabelVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.Abbrev of variable abbrev does not match with type org.gjt.sp.jedit.options.StyleTableModel.StyleChoice of variable ch
    • Make classes org.gjt.sp.jedit.options.Abbrev and org.gjt.sp.jedit.options.StyleTableModel.StyleChoice extend a common superclass
    4
    return ch.label;
    5
    case 1:
    5
    case 1:
                                          
    6
    return ch.style;
    Preondition Violations
    Unmatched return ch.style;
    6
    return ch.style;
    6
    return abbrev.expand;
    6
    return abbrev.expand;
    Preondition Violations
    Unmatched return abbrev.expand;
                                                    
    7
    default:
    7
    default:
    8
    return null;
    8
    return null;
    Precondition Violations (3)
    Row Violation
    1Type org.gjt.sp.jedit.options.Abbrev of variable abbrev does not match with type org.gjt.sp.jedit.options.StyleTableModel.StyleChoice of variable ch
    2Unmatched return ch.style;
    3Unmatched return abbrev.expand;