File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/gui/HistoryTextField.java | |||
Method name: void doBackwardSearch()
|
Method name: void doForwardSearch()
|
|||
Number of AST nodes: 16 | Number of AST nodes: 16 | |||
1 | if(historyModel == null)↵ | 1 | if(historyModel == null)↵ | |
2 | return;↵ | 2 | return;↵ | |
3 | if(getSelectionEnd() != getDocument().getLength())↵ | 3 | if(getSelectionEnd() != getDocument().getLength())↵ | |
4 | {↵ | 4 | {↵ | |
5 | setCaretPosition(getDocument().getLength());↵ | 5 | setCaretPosition(getDocument().getLength());↵ | |
6 | }↵ | 6 | }↵ | |
7 | String text = getText().substring(0,getSelectionStart());↵ | 7 | String text = getText().substring(0,getSelectionStart());↵ | |
8 | if(text == null)↵ | 8 | if(text == null)↵ | |
9 | {↵ | 9 | {↵ | |
10 | historyPrevious();↵ | 10 | historyNext();↵ | |
11 | return;↵ | 11 | return;↵ | |
12 | }↵ | 12 | }↵ | |
13 | for(int i = index + 1; i < historyModel.getSize(); i++)↵ | 13 | for(int i = index - 1; i >= 0; i--)↵ | |
14 | {↵ | 14 | {↵ | |
15 | String item = historyModel.getItem(i);↵ | 15 | String item = historyModel.getItem(i);↵ | |
16 | if(item.startsWith(text))↵ | 16 | if(item.startsWith(text))↵ | |
17 | {↵ | 17 | {↵ | |
18 | replaceSelection(item.substring(text.length()));↵ | 18 | replaceSelection(item.substring(text.length()));↵ | |
19 | select(text.length(),getDocument().getLength());↵ | 19 | select(text.length(),getDocument().getLength());↵ | |
20 | index = i;↵ | 20 | index = i;↵ | |
21 | return;↵ | 21 | return;↵ | |
22 | }↵ | 22 | }↵ | |
23 | }↵ | 23 | }↵ | |
24 | getToolkit().beep(); | 24 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 27 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.8 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |||||||
---|---|---|---|---|---|---|---|---|---|---|
10 | String item = historyModel.getItem(i); | 10 | String item = historyModel.getItem(i); | |||||||
11 | if (item.startsWith(text)) | 11 | if (item.startsWith(text)) | |||||||
12 | replaceSelection(item.substring(text.length())); | 12 | replaceSelection(item.substring(text.length())); | |||||||
13 | select(text.length(), getDocument().getLength()); | 13 | select(text.length(), getDocument().getLength()); | |||||||
14 | index = i; | 14 | index = i; | |||||||
15 | return; |
| 15 | return; |
Row | Violation |
---|---|
1 | Conditional return; |
2 | Conditional return; |