int start; JEditTextArea textArea = view.getTextArea(); Selection s = textArea.getSelectionAtOffset( textArea.getCaretPosition()); if(s == null) start = textArea.getCaretPosition(); else start = s.getStart(); timerIncrementalSearch(start,false);
int start; JEditTextArea textArea = view.getTextArea(); Selection s = textArea.getSelectionAtOffset( textArea.getCaretPosition()); if(s == null) start = textArea.getCaretPosition(); else start = s.getStart(); timerIncrementalSearch(start,true);
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchBar.java File path: /jEdit-4.2/src/org/gjt/sp/jedit/search/SearchBar.java
Method name: void insertUpdate(DocumentEvent) Method name: void removeUpdate(DocumentEvent)
Number of AST nodes: 7 Number of AST nodes: 7
1
int start;
1
int start;
2
				JEditTextArea textArea = view.getTextArea();
2
						JEditTextArea textArea = view.getTextArea();
3
				Selection s = textArea.getSelectionAtOffset(
3
						Selection s = textArea.getSelectionAtOffset(
4
					textArea.getCaretPosition());
4
							textArea.getCaretPosition());
5
				if(s == null)
5
						if(s == null)
6
					start = textArea.getCaretPosition();
6
							start = textArea.getCaretPosition();
7
				else
7
						else
8
					start = s.getStart();
8
							start = s.getStart();
9
				timerIncrementalSearch(start,false);
9
						timerIncrementalSearch(start,true);
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.1
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    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.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    int start;
    6
    int start;
    3
    JEditTextArea textArea = view.getTextArea();
    7
    JEditTextArea textArea = view.getTextArea();
    4
    Selection s = textArea.getSelectionAtOffset(textArea.getCaretPosition());
    8
    Selection s = textArea.getSelectionAtOffset(textArea.getCaretPosition());
    5
    if (s == null)
    9
    if (s == null)
    6
    start = textArea.getCaretPosition();
    10
    start = textArea.getCaretPosition();
    else
    else
    7
    start = s.getStart();
    11
    start = s.getStart();
    8
    timerIncrementalSearch(start, false);
    8
    timerIncrementalSearch(start, false);
    12
    timerIncrementalSearch(start, true);
    Differences
    Expression1Expression2Difference
    falsetrueLITERAL_VALUE_MISMATCH
    12
    timerIncrementalSearch(start, true);
    Precondition Violations (0)
    Row Violation