if (this.from != null) {
throw new BuildException("Emails can only be from one address");
}
this.from = address;
if (this.from != null) {
throw new BuildException("Emails can only be from one address");
}
this.from = new EmailAddress(address);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/email/EmailTask.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/email/EmailTask.java
|
Method name: void addFrom(EmailAddress)
|
|
Method name: void setFrom(String)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (this.from != null) {↵ | | 1 | if (this.from != null) {↵
|
2 | throw new BuildException("Emails can only be from one address");↵ | | 2 | throw new BuildException("Emails can only be from one address");↵
|
3 | }↵ | | 3 | }↵
|
4 | this.from = address; | | 4 | this.from = new EmailAddress(address);
|
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 declared in the same class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (this.from != null) | | 1 | if (this.from != null) |
2 | throw new BuildException("Emails can only be from one address"); | | 2 | throw new BuildException("Emails can only be from one address"); |
3 | this.from = address; | | 3 | this.from = new EmailAddress(address); |
Precondition Violations (0)
Row |
Violation |