File path: /apache-ant-1.7.0/src/org/apache/tools/ant/Task.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/Rpm.java | |||
Method name: void replaceChildren(RuntimeConfigurable, UnknownElement)
|
Method name: Execute getExecute(Commandline, ExecuteStreamHandler)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | RuntimeConfigurable childWrapper =↵ | |||
2 | (RuntimeConfigurable) e.nextElement();↵ | 1 | Execute exe = new Execute(streamhandler, null);↵ | |
3 | UnknownElement childElement =↵ | 2 | ↵ | |
4 | new UnknownElement(childWrapper.getElementTag());↵ | |||
5 | parentElement.addChild(childElement);↵ | |||
6 | childElement.s↵ | 3 | exe.setAntRun(getProject());↵ | |
4 | if (topDir == null) {↵ | |||
7 | etProject(getProject());↵ | 5 | topDir = getProject().getBaseDir();↵ | |
8 | ↵ | 6 | }↵ | |
9 | childElement.setRuntimeConfigurableWrapper(childWrapper);↵ | 7 | ↵ | |
10 | childWrapper.setProxy(childElement↵ | 8 | exe.setWorkingDirectory(topDir);↵ | |
11 | );↵ | 9 | exe.setCommandline(toExecute.getCommandline());↵ | |
12 | replaceChildren(childWrapper, childElement); | 10 | return exe; | |
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 having the same super class |
Number of node comparisons | 33 |
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 6 |
Number of unmapped statements in the second code fragment | 6 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Execute exe = new Execute(streamhandler, null); | ||||||||||||||||||||||
| 2 | exe.setAntRun(getProject()); | ||||||||||||||||||||||
| 3 | if (topDir == null) | ||||||||||||||||||||||
| 4 | topDir = getProject().getBaseDir(); | ||||||||||||||||||||||
3 | RuntimeConfigurable childWrapper = (RuntimeConfigurable)e.nextElement(); |
| | |||||||||||||||||||||
4 | UnknownElement childElement = new UnknownElement(childWrapper.getElementTag()); |
| | |||||||||||||||||||||
| 5 | exe.setWorkingDirectory(topDir); | ||||||||||||||||||||||
5 | parentElement.addChild(childElement); | | ||||||||||||||||||||||
6 | childElement.setProject(getProject()); | | ||||||||||||||||||||||
|
| 7 | return exe; | |||||||||||||||||||||
7 | childElement.setRuntimeConfigurableWrapper(childWrapper); | | ||||||||||||||||||||||
8 | childWrapper.setProxy(childElement); | | ||||||||||||||||||||||
9 | replaceChildren(childWrapper, childElement); |
| 6 | exe.setCommandline(toExecute.getCommandline()); |
Row | Violation |
---|---|
1 | Unmatched statement RuntimeConfigurable childWrapper=(RuntimeConfigurable)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 UnknownElement childElement=new UnknownElement(childWrapper.getElementTag()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched return exe; |
4 | Expression replaceChildren(childWrapper,childElement) is a void method call, and thus it cannot be parameterized |
5 | Expression exe.setCommandline(toExecute.getCommandline()) is a void method call, and thus it cannot be parameterized |
6 | Expression replaceChildren(childWrapper,childElement) is a void method call, and thus it cannot be parameterized |
7 | Expression exe.setCommandline(toExecute.getCommandline()) is a void method call, and thus it cannot be parameterized |