File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java | File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/taskdefs/optional/net/FTPTest.java | |||
Method name: void testProhibitSymlinks()
|
Method name: void testFileSymlink()
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | if (!supportsSymlinks) {↵ | 1 | if (!supportsSymlinks) {↵ | |
2 | return;↵ | 2 | return;↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (!loginSuceeded) {↵ | 4 | if (!loginSuceeded) {↵ | |
5 | return;↵ | 5 | return;↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (!changeRemoteDir(remoteTmpDir)) {↵ | 7 | if (!changeRemoteDir(remoteTmpDir)) {↵ | |
8 | return;↵ | 8 | return;↵ | |
9 | }↵ | 9 | }↵ | |
10 | getProject().executeTarget("symlink-setup");↵ | 10 | getProject().executeTarget("symlink-file-setup");↵ | |
11 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);↵ | 11 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp);↵ | |
12 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));↵ | 12 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp"));↵ | |
13 | ds.setIncludes(new String[] {"alpha/beta/gamma/"});↵ | 13 | ds.setIncludes(new String[] {"alpha/beta/gamma/"});↵ | |
14 | ds.setFollowSymlinks(false);↵ | 14 | ds.setFollowSymlinks(true);↵ | |
15 | ds.scan();↵ | 15 | ds.scan();↵ | |
16 | compareFiles(ds, new String[] {}, new String[] {↵ | 16 | compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"},↵ | |
17 | }); | 17 | new String[] {"alpha/beta/gamma"}); | |
See real code fragment | See real code fragment |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 56 |
Number of mapped statements | 13 |
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) | 3.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!supportsSymlinks) | 1 | if (!supportsSymlinks) | ||||||||||||||
2 | return; | 2 | return; | ||||||||||||||
3 | if (!loginSuceeded) | 3 | if (!loginSuceeded) | ||||||||||||||
4 | return; | 4 | return; | ||||||||||||||
5 | if (!changeRemoteDir(remoteTmpDir)) | 5 | if (!changeRemoteDir(remoteTmpDir)) | ||||||||||||||
6 | return; | 6 | return; | ||||||||||||||
7 | getProject().executeTarget("symlink-setup"); |
| 7 | getProject().executeTarget("symlink-file-setup"); | |||||||||||||
8 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); | 8 | FTP.FTPDirectoryScanner ds = myFTPTask.newScanner(ftp); | ||||||||||||||
9 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); | 9 | ds.setBasedir(new File(getProject().getBaseDir(), "tmp")); | ||||||||||||||
10 | ds.setIncludes(new String[] {"alpha/beta/gamma/"}); | 10 | ds.setIncludes(new String[] {"alpha/beta/gamma/"}); | ||||||||||||||
11 | ds.setFollowSymlinks(false); |
| 11 | ds.setFollowSymlinks(true); | |||||||||||||
12 | ds.scan(); | 12 | ds.scan(); | ||||||||||||||
13 | compareFiles(ds, new String[] {}, new String[] {}); |
| 13 | compareFiles(ds, new String[] {"alpha/beta/gamma/gamma.xml"}, new String[] {"alpha/beta/gamma"}); |
Row | Violation |
---|