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.find();↵ | 1 | int position = finder.findnext();↵ | |
2 | if(position>=0) {↵ | 2 | if(position>=0) {↵ | |
3 | // mark found pattern↵ | 3 | // mark found pattern↵ | |
4 | //text.grabFocus();↵ | 4 | ↵ | |
5 | mark(position,position + findTextField.getText().length());↵ | 5 | mark(position,position + findTextField.getText().length());↵ | |
6 | ↵ | 6 | //text.grabFocus();↵ | |
7 | } else↵ | 7 | } else↵ | |
8 | ↵ | 8 | {↵ | |
9 | // delete marks↵ | 9 | // delete marks↵ | |
10 | {↵ | 10 | ↵ | |
11 | mark(0, 0);↵ | 11 | mark(0, 0);↵ | |
12 | JOptionPane.showMessageDialog(this, "String was not found!");↵ | 12 | JOptionPane.showMessageDialog(this, GlobalResourceLoader.getString(RESOURCE_PATH,"findreplace","string_not_found"));↵ | |
13 | } | 13 | } | |
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.5 |
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) | 12.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11 | int position = finder.find(); |
| 10 | int position = finder.findnext(); | ||||||||||||
12 | if (position >= 0) | 11 | if (position >= 0) | |||||||||||||
13 | mark(position, position + findTextField.getText().length()); | 12 | mark(position, position + findTextField.getText().length()); | |||||||||||||
else | else | |||||||||||||||
14 | mark(0, 0); | 13 | mark(0, 0); | |||||||||||||
15 | JOptionPane.showMessageDialog(this, "String was not found!"); |
| 14 | JOptionPane.showMessageDialog(this, GlobalResourceLoader.getString(RESOURCE_PATH, "findreplace", "string_not_found")); |
Row | Violation |
---|---|
1 | Expression finder.find() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression finder.findnext() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression GlobalResourceLoader.getString(RESOURCE_PATH,"findreplace","string_not_found") cannot be parameterized, because it has dependencies to/from statements that will be extracted |