Entry entry = (Entry)entries.get(row); switch(col) { case 0: return entry.glob; case 1: return entry.color; default: return null; }
Entry window = (Entry)windows.elementAt(row); switch(col) { case 0: return window.title; case 1: return window.dockPosition; default: throw new InternalError(); }
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/DockingOptionPane.java
Method name: Object getValueAt(int, int) Method name: Object getValueAt(int, int)
Number of AST nodes: 8 Number of AST nodes: 8
1
Entry entry = (Entry)entries.get(row);
1
Entry window = (Entry)windows.elementAt(row);
2
		switch(col)
2
		switch(col)
3
		{
3
		{
4
		case 0:
4
		case 0:
5
			return entry.glob;
5
			return window.title;
6
		case 1:
6
		case 1:
7
			return entry.color;
7
			return 
8
		default:
9
			return null
8
window.dockPosition;
9
		default:
10
;
10
			throw new InternalError();
11
		}
11
		}
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 comparisons27
  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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                                                                
    1
    Entry window = (Entry)windows.elementAt(row);
    1
    Entry entry = (Entry)entries.get(row);
                                                                                  
    2
    switch (col)
    2
    switch (col)
    3
    case 0:
    3
    case 0:
    4
    return entry.glob;
    4
    return entry.glob;
    4
    return window.title;
    Differences
    Expression1Expression2Difference
    entrywindowVARIABLE_NAME_MISMATCH
    org.gjt.sp.jedit.options.BrowserColorsModel.Entryorg.gjt.sp.jedit.options.WindowTableModel.EntryVARIABLE_TYPE_MISMATCH
    globtitleVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.gjt.sp.jedit.options.BrowserColorsModel.Entry of variable entry does not match with type org.gjt.sp.jedit.options.WindowTableModel.Entry of variable window
    • Make classes org.gjt.sp.jedit.options.BrowserColorsModel.Entry and org.gjt.sp.jedit.options.WindowTableModel.Entry extend a common superclass
    4
    return window.title;
    5
    case 1:
    5
    case 1:
    6
    return entry.color;
    6
    return entry.color;
    Preondition Violations
    Unmatched return entry.color;
                                                
    7
    default:
    7
    default:
    8
    return null;
    8
    return null;
    6
    return window.dockPosition;
    Differences
    Expression1Expression2Difference
    nullwindow.dockPositionTYPE_COMPATIBLE_REPLACEMENT
    6
    return window.dockPosition;
                                                              
    8
    throw new InternalError();
    Preondition Violations
    Unmatched throw new InternalError();
    8
    throw new InternalError();
    Precondition Violations (3)
    Row Violation
    1Type org.gjt.sp.jedit.options.BrowserColorsModel.Entry of variable entry does not match with type org.gjt.sp.jedit.options.WindowTableModel.Entry of variable window
    2Unmatched return entry.color;
    3Unmatched throw new InternalError();