File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/optional/image/Draw.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/IntrospectionHelperTest.java | |||
Method name: PlanarImage executeTransformOperation(PlanarImage)
|
Method name: void testGetAttributes()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 5 | |||
1 | if (instr instanceof TransformOperation) {↵ | 1 | Strin↵ | |
2 | PlanarImage op↵ | 2 | g name = (String) e.nextElement();↵ | |
3 | = ((TransformOperation) instr).executeTransformOperation(null);↵ | 3 | Class expect = (Class) attrMap.get(name);↵ | |
4 | BufferedImage child = op.getAsBufferedImage();↵ | 4 | ↵ | |
5 | log("\tDrawing to x=" + xloc + " y=" + yloc);↵ | |||
6 | graphics.drawImage(child, null, xloc, yloc);↵ | |||
7 | PlanarImage.wrapRenderedImage(bi);↵ | |||
8 | } | 5 | assertNotNull("Support for "+name+" in IntrospectionHelperTest?",↵ | |
6 | expect);↵ | |||
7 | assertEquals("Type of "+name, expect, ih.getAttributeType(name));↵ | |||
8 |
| |||
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.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 25 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| 4 | String name = (String)e.nextElement(); | |||||||||||||||||||||
|
| 5 | Class expect = (Class)attrMap.get(name); | |||||||||||||||||||||
10 | PlanarImage op = ((TransformOperation)instr).executeTransformOperation(null); | | ||||||||||||||||||||||
11 | BufferedImage child = op.getAsBufferedImage(); |
| | |||||||||||||||||||||
12 | log("\tDrawing to x=" + xloc + " y=" + yloc); |
| 6 | assertNotNull("Support for " + name + " in IntrospectionHelperTest?", expect); | ||||||||||||||||||||
13 | graphics.drawImage(child, null, xloc, yloc); |
| 7 | assertEquals("Type of " + name, expect, ih.getAttributeType(name)); | ||||||||||||||||||||
| 8 | attrMap.remove(name); | ||||||||||||||||||||||
14 | PlanarImage.wrapRenderedImage(bi); | |
Row | Violation |
---|---|
1 | Unmatched statement String name=(String)e.nextElement(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement Class expect=(Class)attrMap.get(name); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement BufferedImage child=op.getAsBufferedImage(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression log("\tDrawing to x=" + xloc + " y="+ yloc) is a void method call, and thus it cannot be parameterized |
5 | Expression assertNotNull("Support for " + name + " in IntrospectionHelperTest?",expect) is a void method call, and thus it cannot be parameterized |
6 | Expression log("\tDrawing to x=" + xloc + " y="+ yloc) is a void method call, and thus it cannot be parameterized |
7 | Expression assertNotNull("Support for " + name + " in IntrospectionHelperTest?",expect) is a void method call, and thus it cannot be parameterized |
8 | Expression graphics.drawImage(child,null,xloc,yloc) is a void method call, and thus it cannot be parameterized |
9 | Expression assertEquals("Type of " + name,expect,ih.getAttributeType(name)) is a void method call, and thus it cannot be parameterized |
10 | Expression graphics.drawImage(child,null,xloc,yloc) is a void method call, and thus it cannot be parameterized |
11 | Expression assertEquals("Type of " + name,expect,ih.getAttributeType(name)) is a void method call, and thus it cannot be parameterized |