try
{
ch = KeyEvent.class.getField("VK_".concat(key))
.getInt(null);
}
catch(Exception e)
{
Log.log(Log.ERROR,DefaultInputHandler.class,
"Invalid key stroke: "
+ keyStroke);
return null;
}
try
{
ch = KeyEvent.class.getField("VK_".concat(key))
.getInt(null);
}
catch(Exception e)
{
Log.log(Log.ERROR,DefaultInputHandler.class,
"Invalid key stroke: "
+ keyStroke);
return null;
}
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/DefaultInputHandler.java
|
|
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/KeyEventTranslator.java
|
Method name: KeyStroke parseKeyStroke(String)
|
|
Method name: Key parseKey(String)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | try↵ | | 1 | try↵
|
2 | {↵ | | 2 | {↵
|
3 | ch = KeyEvent.class.getField("VK_".concat(key))↵ | | 3 | ch = KeyEvent.class.getField("VK_".concat(key))↵
|
4 | .getInt(null);↵ | | 4 | .getInt(null);↵
|
5 | }↵ | | 5 | }↵
|
6 | catch(Exception e)↵ | | 6 | catch(Exception e)↵
|
7 | {↵ | | 7 | {↵
|
8 | Log.log(Log.ERROR,DefaultInputHandler.class,↵ | | 8 | Log.log(Log.ERROR,DefaultInputHandler.class,↵
|
9 | "Invalid key stroke: "↵ | | 9 | "Invalid key stroke: "↵
|
10 | + keyStroke);↵ | | 10 | + keyStroke);↵
|
11 | return null;↵ | | 11 | return null;↵
|
12 | } | | 12 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
30 | try | | 29 | try |
31 | ch = KeyEvent.class.getField("VK_".concat(key)).getInt(null); | | 30 | ch = KeyEvent.class.getField("VK_".concat(key)).getInt(null); |
Precondition Violations (0)
Row |
Violation |