File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Arc.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Ellipse.java | |||
Method name: PlanarImage executeDrawOperation()
|
Method name: PlanarImage executeDrawOperation()
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
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 img = ((DrawOperation) instr).executeDrawOperation();↵ | 4 | PlanarImage img = ((DrawOperation) instr).executeDrawOperation();↵ | |
5 | graphics.drawImage(img.getAsBufferedImage(), null, 0, 0);↵ | 5 | graphics.drawImage(img.getAsBufferedImage(), null, 0, 0);↵ | |
6 | } else if (instr instanceof TransformOperation) {↵ | 6 | } else if (instr instanceof TransformOperation) {↵ | |
7 | graphics = (Graphics2D) bi.getGraphics();↵ | 7 | graphics = (Graphics2D) bi.getGraphics();↵ | |
8 | PlanarImage image = ((TransformOperation) instr)↵ | 8 | PlanarImage image = ((TransformOperation) instr)↵ | |
9 | .executeTransformOperation(PlanarImage.wrapRenderedImage(bi));↵ | 9 | .executeTransformOperation(PlanarImage.wrapRenderedImage(bi));↵ | |
10 | bi = image.getAsBufferedImage();↵ | 10 | bi = image.getAsBufferedImage();↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | return PlanarImage.wrapRenderedImage(bi); | 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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 43 |
Number of mapped statements | 10 |
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) | 18.5 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
11 | for (int i = 0; i < instructions.size(); i++) | 11 | for (int i = 0; i < instructions.size(); i++) | |
12 | ImageOperation instr = ((ImageOperation)instructions.elementAt(i)); | 12 | ImageOperation instr = ((ImageOperation)instructions.elementAt(i)); | |
13 | if (instr instanceof DrawOperation) | 13 | if (instr instanceof DrawOperation) | |
14 | PlanarImage img = ((DrawOperation)instr).executeDrawOperation(); | 14 | PlanarImage img = ((DrawOperation)instr).executeDrawOperation(); | |
15 | graphics.drawImage(img.getAsBufferedImage(), null, 0, 0); | 15 | graphics.drawImage(img.getAsBufferedImage(), null, 0, 0); | |
16 | else if (instr instanceof TransformOperation) | 16 | else if (instr instanceof TransformOperation) | |
17 | graphics = (Graphics2D)bi.getGraphics(); | 17 | graphics = (Graphics2D)bi.getGraphics(); | |
18 | PlanarImage image = ((TransformOperation)instr).executeTransformOperation(PlanarImage.wrapRenderedImage(bi)); | 18 | PlanarImage image = ((TransformOperation)instr).executeTransformOperation(PlanarImage.wrapRenderedImage(bi)); | |
19 | bi = image.getAsBufferedImage(); | 19 | bi = image.getAsBufferedImage(); | |
20 | return PlanarImage.wrapRenderedImage(bi); | 20 | return PlanarImage.wrapRenderedImage(bi); |
Row | Violation |
---|