File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/XMLCatalogTest.java | |||
Method name: void testEntryReference()
|
Method name: void testNestedCatalog()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | String publicId = "-//stevo//DTD doc 1.0//EN";↵ | 1 | String publicId = "-//stevo//DTD doc 1.0//EN";↵ | |
2 | String sysid = "src/etc/testcases/taskdefs/optional/xml/doc.dtd";↵ | 2 | String dtdLoc = "src/etc/testcases/taskdefs/optional/xml/doc.dtd";↵ | |
3 | // catalog2 --> catalog1 --> catalog↵ | |||
4 | ResourceLocation dtd = new ResourceLocation();↵ | 3 | ResourceLocation dtd = new ResourceLocation();↵ | |
5 | dtd.setPublicId(publicId);↵ | 4 | dtd.setPublicId(publicId);↵ | |
6 | dtd.setLocation(sysid);↵ | 5 | dtd.setLocation(dtdLoc);↵ | |
7 | catalog.addDTD(dtd);↵ | 6 | catalog.addDTD(dtd);↵ | |
8 | File dtdFile = project.resolveFile(sysid);↵ | 7 | File dtdFile = project.resolveFile(dtdLoc);↵ | |
9 | String uri = "http://foo.com/bar/blah.xml";↵ | 8 | String uri = "http://foo.com/bar/blah.xml";↵ | |
10 | String uriLoc = "src/etc/testcases/taskdefs/optional/xml/about.xml";↵ | 9 | String uriLoc = "src/etc/testcases/taskdefs/optional/xml/about.xml";↵ | |
11 | ResourceLocation entity = new ResourceLocation();↵ | 10 | ResourceLocation entity = new ResourceLocation();↵ | |
12 | entity.setPublicId(uri);↵ | 11 | entity.setPublicId(uri);↵ | |
13 | entity.setLocation(uriLoc);↵ | 12 | entity.setLocation(uriLoc);↵ | |
14 | catalog.addEntity(entity);↵ | 13 | catalog.addEntity(entity);↵ | |
15 | File xmlFile = project.resolveFile(uriLoc); | 14 |
| |
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 declared in the same class |
Number of node comparisons | 91 |
Number of mapped statements | 14 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | String publicId = "-//stevo//DTD doc 1.0//EN"; | 1 | String publicId = "-//stevo//DTD doc 1.0//EN"; | |||||||||||
2 | String sysid = "src/etc/testcases/taskdefs/optional/xml/doc.dtd"; |
| 2 | String dtdLoc = "src/etc/testcases/taskdefs/optional/xml/doc.dtd"; | ||||||||||
3 | ResourceLocation dtd = new ResourceLocation(); | 3 | ResourceLocation dtd = new ResourceLocation(); | |||||||||||
4 | dtd.setPublicId(publicId); | 4 | dtd.setPublicId(publicId); | |||||||||||
5 | dtd.setLocation(sysid); |
| 5 | dtd.setLocation(dtdLoc); | ||||||||||
6 | catalog.addDTD(dtd); | 6 | catalog.addDTD(dtd); | |||||||||||
7 | File dtdFile = project.resolveFile(sysid); |
| 7 | File dtdFile = project.resolveFile(dtdLoc); | ||||||||||
8 | String uri = "http://foo.com/bar/blah.xml"; | 8 | String uri = "http://foo.com/bar/blah.xml"; | |||||||||||
9 | String uriLoc = "src/etc/testcases/taskdefs/optional/xml/about.xml"; | 9 | String uriLoc = "src/etc/testcases/taskdefs/optional/xml/about.xml"; | |||||||||||
10 | ResourceLocation entity = new ResourceLocation(); | 10 | ResourceLocation entity = new ResourceLocation(); | |||||||||||
11 | entity.setPublicId(uri); | 11 | entity.setPublicId(uri); | |||||||||||
12 | entity.setLocation(uriLoc); | 12 | entity.setLocation(uriLoc); | |||||||||||
13 | catalog.addEntity(entity); | 13 | catalog.addEntity(entity); | |||||||||||
14 | File xmlFile = project.resolveFile(uriLoc); | 14 | File xmlFile = project.resolveFile(uriLoc); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables publicId, dtdFile, uri, xmlFile , while Clone fragment #2 returns variables publicId, dtdFile, uri, xmlFile |