if(isClosed()) return; // this is a weird hack. // we don't want C+e a to insert 'a' in the // search bar if the search bar has focus... if(inputHandler.isPrefixActive()) { if(getFocusOwner() instanceof JTextComponent) { prefixFocusOwner = getFocusOwner(); getTextArea().requestFocus(); } else if(focusOnTextArea) { getTextArea().requestFocus(); } else { prefixFocusOwner = null; } } else { prefixFocusOwner = null; }
if(isClosed()) return; // this is a weird hack. // we don't want C+e a to insert 'a' in the // search bar if the search bar has focus... if(inputHandler.isPrefixActive()) { if(getFocusOwner() instanceof JTextComponent) { prefixFocusOwner = getFocusOwner(); getTextArea().requestFocus(); } else if(focusOnTextArea) { getTextArea().requestFocus(); } else { prefixFocusOwner = null; } } else { prefixFocusOwner = null; }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/View.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/View.java
Method name: void processKeyEvent(KeyEvent, int) Method name: void processKeyEvent(KeyEvent, int)
Number of AST nodes: 10 Number of AST nodes: 10
1
if(isClosed())
1
if(isClosed())
2
				return;
2
					return;
3
			// this is a weird hack.
3
				// this is a weird hack.
4
			// we don't want C+e a to insert 'a' in the
4
				// we don't want C+e a to insert 'a' in the
5
			// search bar if the search bar has focus...
5
				// search bar if the search bar has focus...
6
			if(inputHandler.isPrefixActive())
6
				if(inputHandler.isPrefixActive())
7
			{
7
				{
8
				if(getFocusOwner() instanceof JTextComponent)
8
					if(getFocusOwner() instanceof JTextComponent)
9
				{
9
					{
10
					prefixFocusOwner = getFocusOwner();
10
						prefixFocusOwner = getFocusOwner();
11
					getTextArea().requestFocus();
11
						getTextArea().requestFocus();
12
				}
12
					}
13
				else if(focusOnTextArea)
13
					else if(focusOnTextArea)
14
				{
14
					{
15
					getTextArea().requestFocus();
15
						getTextArea().requestFocus();
16
				}
16
					}
17
				else
17
					else
18
				{
18
					{
19
					prefixFocusOwner = null;
19
						prefixFocusOwner = null;
20
				}
20
					}
21
			}
21
				}
22
			else
22
				else
23
			{
23
				{
24
				prefixFocusOwner = null;
24
					prefixFocusOwner = null;
25
			}
25
				}
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.4
Clones locationClones are in the same method
Number of node comparisons36
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.9
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    26
    if (isClosed())
    52
    if (isClosed())
    27
    return;
    27
    return;
    53
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    53
    return;
    28
    if (inputHandler.isPrefixActive())
    54
    if (inputHandler.isPrefixActive())
    29
    if (getFocusOwner() instanceof JTextComponent)
    55
    if (getFocusOwner() instanceof JTextComponent)
    30
    prefixFocusOwner = getFocusOwner();
    56
    prefixFocusOwner = getFocusOwner();
    31
    getTextArea().requestFocus();
    57
    getTextArea().requestFocus();
    32
    else if (focusOnTextArea)
    58
    else if (focusOnTextArea)
    33
    getTextArea().requestFocus();
    59
    getTextArea().requestFocus();
    else
    else
    34
    prefixFocusOwner = null;
    60
    prefixFocusOwner = null;
    else
    else
    35
    prefixFocusOwner = null;
    61
    prefixFocusOwner = null;
    Precondition Violations (2)
    Row Violation
    1Conditional return;
    2Conditional return;