Abbrev abbrev = (Abbrev)abbrevs.elementAt(row);
switch(col)
{
case 0:
return abbrev.abbrev;
case 1:
return abbrev.expand;
default:
return null;
}
Entry entry = (Entry)entries.get(row);
switch(col)
{
case 0:
return entry.glob;
case 1:
return entry.color;
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/BrowserColorsOptionPane.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 | Entry entry = (Entry)entries.get(row);↵
|
|
2 | switch(col)↵ | | 2 | switch(col)↵
|
3 | {↵ | | 3 | {↵
|
4 | case 0:↵ | | 4 | case 0:↵
|
5 | return abbrev.abbrev;↵ | | 5 | return entry.glob;↵
|
6 | case 1:↵ | | 6 | case 1:↵
|
7 | return abbrev.expand;↵ | | 7 | return entry.color;↵
|
8 | default:↵ | | 8 | default:↵
|
9 | return null;↵ | | 9 | return null;↵
|
10 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 26 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | Entry entry = (Entry)entries.get(row); |
1 | Abbrev abbrev = (Abbrev)abbrevs.elementAt(row); | | | |
2 | switch (col) | | 2 | switch (col) |
3 | | | 3 | |
4 | | | 4 | |
5 | | | 5 | |
| | | 6 | |
6 | | | | |
7 | | | 7 | |
8 | | | 8 | |
Precondition Violations (3)
Row |
Violation |
1 | Type org.gjt.sp.jedit.options.Abbrev of variable abbrev does not match with type org.gjt.sp.jedit.options.BrowserColorsModel.Entry of variable entry |
2 | Unmatched return entry.color; |
3 | Unmatched return abbrev.expand; |