File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/sos/SOS.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java | |||
Method name: String getLocalPath()
|
Method name: String getLocalpath()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 9 | |||
1 | if (localPath != null) {↵ | |||
2 | //make sure m_LocalDir exists, create it if it doesn't↵ | |||
1 | File dir = getProject().resolveFile(localPath);↵ | 3 | File dir = getProject().resolveFile(localPath);↵ | |
2 | if (!dir.exists()) {↵ | 4 | if (!dir.exists()) {↵ | |
3 | boolean done = dir.mkdirs();↵ | 5 | boolean done = dir.mkdirs();↵ | |
4 | if (!done) {↵ | 6 | if (!done) {↵ | |
5 | String msg = "Directory " + localPath + " creation was not "↵ | 7 | String msg = "Directory " + localPath + " creation was not "↵ | |
6 | + "successful for an unknown reason";↵ | 8 | + "successful for an unknown reason";↵ | |
7 | throw new BuildException(msg, getLocation());↵ | 9 | throw new BuildException(msg, getLocation());↵ | |
8 | }↵ | 10 | }↵ | |
9 | getProject().log("Created dir: " + dir.getAbsolutePath());↵ | 11 | getProject().log("Created dir: " + dir.getAbsolutePath());↵ | |
10 | }↵ | 12 | }↵ | |
11 | return dir.getAbsolutePath(); | 13 | lclPath = FLAG_OVERRIDE_WORKING_DIR + localPath;↵ | |
14 |
| |||
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 22 |
Number of mapped statements | 7 |
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) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
3 | File dir = getProject().resolveFile(localPath); | 3 | File dir = getProject().resolveFile(localPath); | |
4 | if (!dir.exists()) | 4 | if (!dir.exists()) | |
5 | boolean done = dir.mkdirs(); | 5 | boolean done = dir.mkdirs(); | |
6 | if (!done) | 6 | if (!done) | |
7 | String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason"; | 7 | String msg = "Directory " + localPath + " creation was not " + "successful for an unknown reason"; | |
8 | throw new BuildException(msg, getLocation()); | 8 | throw new BuildException(msg, getLocation()); | |
9 | getProject().log("Created dir: " + dir.getAbsolutePath()); | 9 | getProject().log("Created dir: " + dir.getAbsolutePath()); | |
| 10 | lclPath = FLAG_OVERRIDE_WORKING_DIR + localPath; | ||
10 | return dir.getAbsolutePath(); | |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variables dir , while Clone fragment #2 returns variables |