cmd.createArgument().setPath(cp);
// kjc-1.5A doesn't support -encoding option now.
// but it will be supported near the feature.
if (encoding != null) {
cmd.createArgument().setValue("-encoding");
cmd.createArgument().setValue(encoding);
}
cmd.createArgument().setPath(classpath);
if (encoding != null) {
cmd.createArgument().setValue("-encoding");
cmd.createArgument().setValue(encoding);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Kjc.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/compilers/Jikes.java
|
Method name: Commandline setupKjcCommand()
|
|
Method name: boolean execute()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | cmd.createArgument().setPath(cp);↵ | | 1 | cmd.createArgument().setPath(c↵
|
|
2 | // kjc-1.5A doesn't support -encoding option now.↵ | | |
|
3 | // but it will be supported near the feature.↵ | | 2 | lasspath);↵
|
|
4 | if (encoding != null) {↵ | | 3 | if (encoding != null) {↵
|
5 | cmd.createArgument().setValue("-encoding");↵ | | 4 | cmd.createArgument().setValue("-encoding");↵
|
6 | cmd.createArgument().setValue(encoding);↵ | | 5 | cmd.createArgument().setValue(encoding);↵
|
7 | } | | 6 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 22.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
19 | cmd.createArgument().setPath(cp); | | 28 | cmd.createArgument().setPath(classpath); |
20 | if (encoding != null) | | 29 | if (encoding != null) |
21 | cmd.createArgument().setValue("-encoding"); | | 30 | cmd.createArgument().setValue("-encoding"); |
22 | cmd.createArgument().setValue(encoding); | | 31 | cmd.createArgument().setValue(encoding); |
Precondition Violations (0)
Row |
Violation |