File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java | |||
Method name: void testTransform()
|
Method name: void testXalan2Redirect()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 7 | |||
1 | File xsl = getFile("/taskdefs/optional/xsltliaison-in.xsl");↵ | 1 | File xsl = getFile("/taskdefs/optional/xalan-redirect-in.xsl");↵ | |
2 | liaison.setStylesheet(xsl);↵ | 2 | liaison.setStylesheet(xsl);↵ | |
3 | liaison.addParam("param", "value");↵ | 3 | File out = new File("xalan2-redirect-out-dummy.tmp");↵ | |
4 | File in = getFile("/taskdefs/optional/xsltliaison-in.xml");↵ | 4 | File in = getFile("/taskdefs/optional/xsltliaison-in.xsl");↵ | |
5 | File out = new File("xsltliaison.tmp");↵ | 5 | ↵ | |
6 | out.deleteOnExit(); // just to be sure↵ | |||
7 | try {↵ | 6 | try {↵ | |
7 | liaison.addParam("xalan-version", "2");↵ | |||
8 | liaison.transform(in, out);↵ | 8 | liaison.transform(in, out);↵ | |
9 | } finally {↵ | 9 | } finally {↵ | |
10 | out.delete();↵ | 10 | out.delete();↵ | |
11 | } | 11 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 23 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | File xsl = getFile("/taskdefs/optional/xsltliaison-in.xsl"); |
| 1 | File xsl = getFile("/taskdefs/optional/xalan-redirect-in.xsl"); | ||||||||||
2 | liaison.setStylesheet(xsl); | 2 | liaison.setStylesheet(xsl); | |||||||||||
3 | liaison.addParam("param", "value"); | | ||||||||||||
4 | File in = getFile("/taskdefs/optional/xsltliaison-in.xml"); |
| 4 | File in = getFile("/taskdefs/optional/xsltliaison-in.xsl"); | ||||||||||
5 | File out = new File("xsltliaison.tmp"); |
| 3 | File out = new File("xalan2-redirect-out-dummy.tmp"); | ||||||||||
6 | out.deleteOnExit(); | | ||||||||||||
7 | try | 5 | try | |||||||||||
|
| 6 | liaison.addParam("xalan-version", "2"); | |||||||||||
8 | liaison.transform(in, out); | 7 | liaison.transform(in, out); |
Row | Violation |
---|---|
1 | Unmatched statement liaison.addParam("xalan-version","2"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
2 | Clone fragment #1 returns variables out , while Clone fragment #2 returns variables |