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 execute()
|
Method name: void execute()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | if (encoding.equals(MIME)↵ | 1 | if (encoding.equals(UU)↵ | |
2 | || (encoding.equals(AUTO) && !autoFound)) {↵ | 2 | || (encoding.equals(AUTO) && !autoFound)) {↵ | |
3 | try {↵ | 3 | try {↵ | |
4 | mailer = (Mailer) ClasspathUtils.newInstance(↵ | 4 | mailer = (Mailer) ClasspathUtils.newInstance(↵ | |
5 | "org.apache.tools.ant.taskdefs.email.MimeMailer",↵ | 5 | "org.apache.tools.ant.taskdefs.email.UUMailer",↵ | |
6 | EmailTask.class.getClassLoader(), Mailer.class);↵ | 6 | EmailTask.class.getClassLoader(), Mailer.class);↵ | |
7 | autoFound = true;↵ | 7 | autoFound = true;↵ | |
8 | log("Using MIME mail", Project.MSG_VERBOSE);↵ | 8 | log("Using UU mail", Project.MSG_VERBOSE);↵ | |
9 | } catch (BuildException e) {↵ | 9 | } catch (BuildException e) {↵ | |
10 | Throwable t = e.getCause() == null ? e : e.getCause();↵ | 10 | Throwable t = e.getCause() == null ? e : e.getCause();↵ | |
11 | log("Failed to initialise MIME mail: " + t.getMessage(),↵ | 11 | log("Failed to initialise UU mail: " + t.getMessage(),↵ | |
12 | Project.MSG_WARN);↵ | 12 | Project.MSG_WARN);↵ | |
13 | return;↵ | 13 | return;↵ | |
14 | }↵ | 14 | }↵ | |
15 | } | 15 |
| |
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) | 1.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 18 |
Number of mapped statements | 5 |
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) | 1.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5 | if (encoding.equals(MIME) || (encoding.equals(AUTO) && !autoFound)) |
| 14 | if (encoding.equals(UU) || (encoding.equals(AUTO) && !autoFound)) | ||||||||||
6 | try |
| 15 | try | ||||||||||
7 | mailer = (Mailer)ClasspathUtils.newInstance("org.apache.tools.ant.taskdefs.email.MimeMailer", EmailTask.class.getClassLoader(), Mailer.class); |
| 16 | mailer = (Mailer)ClasspathUtils.newInstance("org.apache.tools.ant.taskdefs.email.UUMailer", EmailTask.class.getClassLoader(), Mailer.class); | ||||||||||
8 | autoFound = true; | 17 | autoFound = true; | |||||||||||
9 | log("Using MIME mail", Project.MSG_VERBOSE); |
| 18 | log("Using UU mail", Project.MSG_VERBOSE); |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables autoFound, mailer , while Clone fragment #2 returns variables autoFound, mailer |