if (null != expandedDname) {
throw new BuildException("DName sub-element can only be "
+ "specified once.");
}
if (null != dname) {
throw new BuildException("It is not possible to specify dname "
+ " both as attribute and element.");
}
expandedDname = new DistinguishedName();
return expandedDname;
if (change != null) {
P4CmdOpts = "-c " + change;
}
if (P4View == null) {
throw new BuildException("No view specified to edit");
}
execP4Command("-s edit " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler(this));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/GenerateKey.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java
|
Method name: DistinguishedName createDname()
|
|
Method name: void execute()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 5
|
|
1 | if (null != expandedDname) {↵ | | 1 | if (↵
|
2 | throw new BuildException("DName sub-element can only be "↵ | | |
|
3 | + "specified once.")↵ | | 2 | change != null) {↵
|
4 | ;↵ | | 3 | P4CmdOpts = "-c " + change;↵
|
5 | }↵ | | 4 | }↵
|
6 | if (null != dname) {↵ | | 5 | if (P4View == null) {↵
|
7 | throw new BuildException("It is not possible to specify dname "↵ | | 6 | throw new BuildException("↵
|
8 | + " both as attribute and element.");↵ | | |
|
9 | }↵ | | |
|
10 | expandedDname = new DistinguishedName();↵ | | |
|
11 | return expandedDname↵ | | 7 | No view specified to edit");↵
|
| | | 8 | }↵
|
12 | ; | | 9 | execP4Command("-s edit " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler(this));
|
See real code fragment |
|
See real code fragment |
Summary
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 7 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (null != expandedDname) | | 1 | if (change != null) |
| | | 2 | P4CmdOpts = "-c " + change; |
2 | throw new BuildException("DName sub-element can only be " + "specified once."); | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched throw new BuildException("DName sub-element can only be " + "specified once."); |