File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/util/FindDialog.java | File path: /columba-1.4-src/core/src/main/java/org/columba/core/gui/util/FindReplaceDialog.java | |||
Method name: void actionPerformed(ActionEvent)
|
Method name: void actionPerformed(ActionEvent)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | int position = finder.findnext();↵ | 1 | int position = finder.findnext();↵ | |
2 | ↵ | 2 | ↵ | |
3 | if(position>=0) {↵ | 3 | if(position>=0) {↵ | |
4 | // mark found pattern (select)↵ | 4 | // mark found pattern↵ | |
5 | //text.grabFocus(); ↵ | |||
6 | mark(position,position + findTextField.getText().length());↵ | 5 | mark(position,position + findTextField.getText().length());↵ | |
7 | ↵ | 6 | //text.grabFocus();↵ | |
8 | } else↵ | 7 | } else↵ | |
9 | ↵ | 8 | {↵ | |
10 | // delete marks (unselect)↵ | 9 | // delete marks↵ | |
11 | {↵ | |||
12 | mark(0, 0);↵ | 10 | mark(0, 0);↵ | |
13 | JOptionPane.showMessageDialog(this, "String was not found!");↵ | 11 | JOptionPane.showMessageDialog(this, GlobalResourceLoader.getString(RESOURCE_PATH,"findreplace","string_not_found"));↵ | |
14 | } | 12 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 18 |
Number of mapped statements | 5 |
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) | 10.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | int position = finder.findnext(); | 10 | int position = finder.findnext(); | ||||||||||||
18 | if (position >= 0) | 11 | if (position >= 0) | ||||||||||||
19 | mark(position, position + findTextField.getText().length()); | 12 | mark(position, position + findTextField.getText().length()); | ||||||||||||
else | else | ||||||||||||||
20 | mark(0, 0); | 13 | mark(0, 0); | ||||||||||||
21 | JOptionPane.showMessageDialog(this, "String was not found!"); |
| 14 | JOptionPane.showMessageDialog(this, GlobalResourceLoader.getString(RESOURCE_PATH, "findreplace", "string_not_found")); |
Row | Violation |
---|---|
1 | Expression GlobalResourceLoader.getString(RESOURCE_PATH,"findreplace","string_not_found") cannot be parameterized, because it has dependencies to/from statements that will be extracted |