words.setSelectedIndex(index); textArea.setSelectedText(words.getModel() .getElementAt(index).toString() .substring(word.length())); dispose(); return;
insertSelected(); textArea.userInput(ch); dispose(); return;
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 keyTyped(KeyEvent) Method name: void keyTyped(KeyEvent)
Number of AST nodes: 4 Number of AST nodes: 4
1
words.setSelectedIndex(index);
1
insertSelected();
2
					textArea.setSelectedText(words.getModel()
2
					textArea.use
3
						.getElementAt(index).toString()
4
						.substring(word.length()));
3
rInput(ch);
5
					dispose();
4
					dispose();
6
					return;
5
					return;
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.0
Clones locationClones are in the same method
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    11
    words.setSelectedIndex(index);
    11
    words.setSelectedIndex(index);
    20
    dispose();
    Differences
    Expression1Expression2Difference
    setSelectedIndexdisposeMETHOD_INVOCATION_NAME_MISMATCH
    words.setSelectedIndex(index)dispose()ARGUMENT_NUMBER_MISMATCH
    wordsMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression words.setSelectedIndex(index) is a void method call, and thus it cannot be parameterized
    Expression dispose() is a void method call, and thus it cannot be parameterized
    Expression dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression words.setSelectedIndex(index) is a void method call, and thus it cannot be parameterized
    Expression dispose() is a void method call, and thus it cannot be parameterized
    20
    dispose();
    12
    textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length()));
    12
    textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length()));
    18
    insertSelected();
    Differences
    Expression1Expression2Difference
    setSelectedTextinsertSelectedMETHOD_INVOCATION_NAME_MISMATCH
    textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length()))insertSelected()ARGUMENT_NUMBER_MISMATCH
    textAreaMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length())) is a void method call, and thus it cannot be parameterized
    Expression insertSelected() is a void method call, and thus it cannot be parameterized
    Expression textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length())) is a void method call, and thus it cannot be parameterized
    Expression insertSelected() is a void method call, and thus it cannot be parameterized
    18
    insertSelected();
    13
    dispose();
    13
    dispose();
    19
    textArea.userInput(ch);
    Differences
    Expression1Expression2Difference
    disposeuserInputMETHOD_INVOCATION_NAME_MISMATCH
    dispose()textArea.userInput(ch)ARGUMENT_NUMBER_MISMATCH
    textAreaMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression textArea.userInput(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dispose() is a void method call, and thus it cannot be parameterized
    Expression textArea.userInput(ch) is a void method call, and thus it cannot be parameterized
    Expression textArea.userInput(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dispose() is a void method call, and thus it cannot be parameterized
    Expression textArea.userInput(ch) is a void method call, and thus it cannot be parameterized
    19
    textArea.userInput(ch);
    14
    return;
    14
    return;
    21
    return;
    Preondition Violations
    Conditional return;
    Conditional return;
    21
    return;
    Precondition Violations (18)
    Row Violation
    1Expression dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression words.setSelectedIndex(index) is a void method call, and thus it cannot be parameterized
    3Expression dispose() is a void method call, and thus it cannot be parameterized
    4Expression dispose() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression words.setSelectedIndex(index) is a void method call, and thus it cannot be parameterized
    6Expression dispose() is a void method call, and thus it cannot be parameterized
    7Expression textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length())) is a void method call, and thus it cannot be parameterized
    8Expression insertSelected() is a void method call, and thus it cannot be parameterized
    9Expression textArea.setSelectedText(words.getModel().getElementAt(index).toString().substring(word.length())) is a void method call, and thus it cannot be parameterized
    10Expression insertSelected() is a void method call, and thus it cannot be parameterized
    11Expression textArea.userInput(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression dispose() is a void method call, and thus it cannot be parameterized
    13Expression textArea.userInput(ch) is a void method call, and thus it cannot be parameterized
    14Expression textArea.userInput(ch) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression dispose() is a void method call, and thus it cannot be parameterized
    16Expression textArea.userInput(ch) is a void method call, and thus it cannot be parameterized
    17Conditional return;
    18Conditional return;