int caret = textArea.getCaretPosition(); Completion[] completions = getCompletions(buffer,word, caret); if(completions.length == 0) { dispose(); return; } words.setListData(completions); words.setSelectedIndex(0); words.setVisibleRowCount(Math.min(completions.length,8));
int caret = textArea.getCaretPosition(); Completion[] completions = getCompletions( buffer,word,caret); if(completions.length == 0) { dispose(); return; } words.setListData(completions); words.setSelectedIndex(0); words.setVisibleRowCount(Math.min(completions.length,8));
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/CompleteWord.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/CompleteWord.java
Method name: void keyPressed(KeyEvent) Method name: void keyTyped(KeyEvent)
Number of AST nodes: 8 Number of AST nodes: 8
1
int caret = textArea.getCaretPosition();
1
int caret = textArea.getCaretPosition();
2
					Completion[] completions
2
				Completion[] completions
3
						= getCompletions(
3
 = getCompletions(
4
buffer,word,
4
					buffer,word,
5
						caret);
5
caret);
6
					if(completions.length == 0)
6
				if(completions.length == 0)
7
					{
7
				{
8
						dispose();
8
					dispose();
9
						return;
9
					return;
10
					}
10
				}
11
					words.setListData(completions);
11
				words.setListData(completions);
12
					words.setSelectedIndex(0);
12
				words.setSelectedIndex(0);
13
					words.setVisibleRowCount(Math.min(completions.length,8));
13
				words.setVisibleRowCount(Math.min(completions.length,8));
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.2
Clones locationClones are declared in the same class
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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.8
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    40
    int caret = textArea.getCaretPosition();
    24
    int caret = textArea.getCaretPosition();
    41
    Completion[] completions = getCompletions(buffer, word, caret);
    25
    Completion[] completions = getCompletions(buffer, word, caret);
    42
    if (completions.length == 0)
    26
    if (completions.length == 0)
    43
    dispose();
    27
    dispose();
    44
    return;
    44
    return;
    28
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    28
    return;
    45
    words.setListData(completions);
    29
    words.setListData(completions);
    46
    words.setSelectedIndex(0);
    30
    words.setSelectedIndex(0);
    47
    words.setVisibleRowCount(Math.min(completions.length, 8));
    31
    words.setVisibleRowCount(Math.min(completions.length, 8));
    Precondition Violations (2)
    Row Violation
    1Conditional return;
    2Conditional return;