if (doUpdate) { renamedFile = FILE_UTILS.createTempFile("zip", ".tmp", zipFile.getParentFile()); renamedFile.deleteOnExit(); try { FILE_UTILS.rename(zipFile, renamedFile); } catch (SecurityException e) { throw new BuildException( "Not allowed to rename old file (" + zipFile.getAbsolutePath() + ") to temporary file"); } catch (IOException e) { throw new BuildException( "Unable to rename old file (" + zipFile.getAbsolutePath() + ") to temporary file"); } }
if (testFile.exists() && testFile.canRead()) { log("uri : '" + uri + "' matches a readable file", Project.MSG_DEBUG); try { url = FILE_UTILS.getFileURL(testFile); } catch (MalformedURLException ex1) { throw new BuildException( "could not find an URL for :" + testFile.getAbsolutePath()); } } else { log("uri : '" + uri + "' does not match a readable file", Project.MSG_DEBUG); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Zip.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/XMLCatalog.java
Method name: void executeMain() Method name: InputSource filesystemLookup(ResourceLocation)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (doUpdate) {
1
if (
2
                renamedFile =
3
                    FILE_UTILS.createTempFile("zip", ".tmp",
2
testFile.exists() && testFile.canRead()) {
4
                  
3
                log("uri : '"
5
                            zipFile.getParentFile());
4
                    
6
                renamedFile.deleteOnExit();
5
+ uri + "' matches a readable file", Project.MSG_DEBUG);
7
                try {
6
                try {
8
                    FILE_UTILS.rename(zipFile, renamedFile);
7
                    url = FILE_UTILS.getFileURL(testFile);
9
                } catch (SecurityException e) {
8
                } catch (MalformedURLException ex1) {
10
                    throw new BuildException(
9
                    throw new BuildException(
11
                        "Not allowed to rename old file ("
10
                        "
12
                        + zipFile.getAbsolutePath()
11
could not find an URL for :" + testFile.getAbsolutePath()
13
      
12
);
14
                  + ") to temporary file");
13
                
15
                } catch (IOException e) {
16
                    throw new BuildException(
17
                        "Unable to rename old file ("
18
                        + zipFile.getAbsolutePath()
19
                        + ") to temporary file");
20
                }
14
}
15
            } else {
16
                log("uri : '"
17
                    + uri + "' does not match a readable file", Project.MSG_DEBUG);
21
            }
18
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones locationClones are in different classes having the same super class
Number of node comparisons0
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements0
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeUnknown type
    Mapped Statements
    ID Statement ID Statement
    Precondition Violations (0)
    Row Violation