if (needToRebuild(ejbFiles, jarFile)) {
// Log that we are going to build...
log("building "
+ jarFile.getName()
+ " with "
+ String.valueOf(ejbFiles.size())
+ " files",
Project.MSG_INFO);
// Use helper method to write the jarfile
String publicId = getPublicId();
writeJar(baseName, jarFile, ejbFiles, publicId);
} else {
// Log that the file is up to date...
log(jarFile.toString() + " is up to date.",
Project.MSG_VERBOSE);
}
try {
assertTrue(j+" is absolute", (new File(j)).isAbsolute());
String javaHomeParent =
FILE_UTILS.normalize(javaHome+"/..").getAbsolutePath();
assertTrue(j+" is normalized and in the JDK dir",
j.startsWith(javaHomeParent));
assertTrue(j+" is normalized and not in the JRE dir",
!j.startsWith(javaHome));
} catch (AssertionFailedError e) {
// java.home is bogus
assertEquals("javac.exe", j);
}
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
|
|
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/JavaEnvUtilsTest.java
|
Method name: void processDescriptor(String, SAXParser)
|
|
Method name: void testGetExecutableWindows()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (needToRebuild(ejbFiles, jarFile)) {↵ | | |
|
2 | // Log that we are going to build...↵ | | |
|
3 | log("building "↵ | | |
|
4 | + jarFile.getNam↵ | | 1 | try {↵
|
5 | e()↵ | | 2 | assertTrue(j+" is absolute", (new File(j)).isAbsolute());↵
|
6 | + " with "↵ | | 3 | ↵
|
7 | + String.valueOf(ejbFiles.size↵ | | 4 | String javaHomeParent =↵
|
8 | ())↵ | | 5 | FILE_UTILS.normalize(javaHome+"/..").getAbsolutePath();↵
|
9 | + " files",↵ | | 6 | assertTrue(j+" is normalized and in the JDK dir",↵
|
10 | Project.MSG_INFO);↵ | | 7 | j.startsWith(javaHomeParent));↵
|
|
11 | // Use helper method to write the jarfile↵ | | 8 | ↵
|
12 | String publicId = getPublicId();↵ | | |
|
13 | writeJar(baseName, jarFile, ejbFiles, publicId);↵ | | |
|
|
14 | } else↵ | | 9 | assertTrue(j+" is normalized and not in the JRE dir",↵
|
| | | 10 | !j.startsWith(javaHome));↵
|
|
15 | {↵ | | 11 | } catch (AssertionFailedError e) {↵
|
16 | // Log that the file is up to date...↵ | | 12 | // ↵
|
17 | log(jarFile.toString() + " is up to date.",↵ | | |
|
18 | Project.MSG_VERBOSE↵ | | 13 | java.home is bogus↵
|
19 | );↵ | | 14 | assertEquals("javac.exe", j);↵
|
20 | } | | 15 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 1 |