File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Rotate.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Scale.java | |||
Method name: PlanarImage executeDrawOperation()
|
Method name: PlanarImage executeDrawOperation()
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | for (int i = 0; i < instructions.size(); i++) {↵ | 1 | for (int i = 0; i < instructions.size(); i++) {↵ | |
2 | ImageOperation instr = ((ImageOperation) instructions.elementAt(i));↵ | 2 | ImageOperation instr = ((ImageOperation) instructions.elementAt(i));↵ | |
3 | if (instr instanceof DrawOperation) {↵ | 3 | if (instr instanceof DrawOperation) {↵ | |
4 | PlanarImage image = null;↵ | |||
4 | // If this TransformOperation has DrawOperation children↵ | 5 | // If this TransformOperation has DrawOperation children↵ | |
5 | // then Rotate the first child and return.↵ | 6 | // then Rotate the first child and return.↵ | |
6 | PlanarImage op = ((DrawOperation) instr).executeDrawOperation();↵ | 7 | ↵ | |
7 | op = performRotate(op);↵ | 8 | performScale(image);↵ | |
8 | return op;↵ | 9 | return image;↵ | |
9 | }↵ | 10 | }↵ | |
10 | }↵ | 11 | }↵ | |
11 | return null; | 12 |
| |
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 in different classes having the same super class |
Number of node comparisons | 21 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | for (int i = 0; i < instructions.size(); i++) | 1 | for (int i = 0; i < instructions.size(); i++) | |||||||||||||||
2 | ImageOperation instr = ((ImageOperation)instructions.elementAt(i)); | 2 | ImageOperation instr = ((ImageOperation)instructions.elementAt(i)); | |||||||||||||||
3 | if (instr instanceof DrawOperation) | 3 | if (instr instanceof DrawOperation) | |||||||||||||||
4 | PlanarImage op = ((DrawOperation)instr).executeDrawOperation(); |
| 4 | PlanarImage image = null; | ||||||||||||||
|
| 5 | performScale(image); | |||||||||||||||
5 | op = performRotate(op); |
| | |||||||||||||||
6 | return op; |
| 6 | return image; | ||||||||||||||
7 | return null; | 7 | return null; |
Row | Violation |
---|---|
1 | Expression ((DrawOperation)instr).executeDrawOperation() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement performScale(image); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement op=performRotate(op); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |