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
			}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    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.6
    Clone typeType 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