File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java | |||
Method name: boolean isRebuildRequired(File, File)
|
Method name: boolean isRebuildRequired(File, File)
|
|||
Number of AST nodes: 20 | Number of AST nodes: 20 | |||
1 | if (wlEntries.containsKey(filepath)) {↵ | 1 | if (wasEntries.containsKey(filepath)) {↵ | |
2 | // File name/path match↵ | 2 | // File name/path match↵ | |
3 | // Check files see if same↵ | 3 | // Check files see if same↵ | |
4 | JarEntry genericEntry = (JarEntry) genericEntries.get(filepath);↵ | 4 | JarEntry genericEntry = (JarEntry) genericEntries.get(filepath);↵ | |
5 | JarEntry wlEntry = (JarEntry) wlEntries.get(filepath);↵ | 5 | JarEntry wasEntry = (JarEntry) wasEntries.get(filepath);↵ | |
6 | if ((genericEntry.getCrc() != wlEntry.getCrc())↵ | 6 | if ((genericEntry.getCrc() != wasEntry.getCrc())↵ | |
7 | || (genericEntry.getSize() != wlEntry.getSize())) {↵ | 7 | || (genericEntry.getSize() != wasEntry.getSize())) {↵ | |
8 | if (genericEntry.getName().endsWith(".class")) {↵ | 8 | if (genericEntry.getName().endsWith(".class")) {↵ | |
9 | //File are different see if its an object or an interface↵ | 9 | //File are different see if its an object or an interface↵ | |
10 | String classname↵ | 10 | String classname↵ | |
11 | = genericEntry.getName().replace(File.separatorChar, '.');↵ | 11 | = genericEntry.getName().replace(File.separatorChar, '.');↵ | |
12 | classname = classname.substring(0, classname.lastIndexOf(".class"));↵ | 12 | classname = classname.substring(0, classname.lastIndexOf(".class"));↵ | |
13 | Class genclass = genericLoader.loadClass(classname);↵ | 13 | Class genclass = genericLoader.loadClass(classname);↵ | |
14 | if (genclass.isInterface()) {↵ | 14 | if (genclass.isInterface()) {↵ | |
15 | //Interface changed rebuild jar.↵ | 15 | //Interface changed rebuild jar.↵ | |
16 | log("Interface " + genclass.getName()↵ | 16 | log("Interface " + genclass.getName()↵ | |
17 | + " has changed", Project.MSG_VERBOSE);↵ | 17 | + " has changed", Project.MSG_VERBOSE);↵ | |
18 | rebuild = true;↵ | 18 | rebuild = true;↵ | |
19 | break;↵ | 19 | break;↵ | |
20 | } else {↵ | 20 | } else {↵ | |
21 | //Object class Changed update it.↵ | 21 | //Object class Changed update it.↵ | |
22 | replaceEntries.put(filepath, genericEntry);↵ | 22 | replaceEntries.put(filepath, genericEntry);↵ | |
23 | }↵ | 23 | }↵ | |
24 | } else {↵ | 24 | } else {↵ | |
25 | // is it the manifest. If so ignore it↵ | 25 | // is it the manifest. If so ignore it↵ | |
26 | if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) {↵ | 26 | if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) {↵ | |
27 | //File other then class changed rebuild↵ | 27 | //File other then class changed rebuild↵ | |
28 | log("Non class file " + genericEntry.getName()↵ | 28 | log("Non class file " + genericEntry.getName()↵ | |
29 | + " has changed", Project.MSG_VERBOSE);↵ | 29 | + " has changed", Project.MSG_VERBOSE);↵ | |
30 | rebuild = true;↵ | 30 | rebuild = true;↵ | |
31 | break;↵ | 31 | }↵ | |
32 | }↵ | 32 | break;↵ | |
33 | }↵ | 33 | }↵ | |
34 | }↵ | 34 | }↵ | |
35 | } else {↵ | 35 | } else {↵ | |
36 | // a file doesnt exist rebuild↵ | 36 | // a file doesn't exist rebuild↵ | |
37 | log("File " + filepath + " not present in weblogic jar",↵ | 37 | log("File " + filepath + " not present in websphere jar",↵ | |
38 | Project.MSG_VERBOSE);↵ | 38 | Project.MSG_VERBOSE);↵ | |
39 | rebuild = true;↵ | 39 | rebuild = true;↵ | |
40 | break;↵ | 40 | break;↵ | |
41 | } | 41 |
| |
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) | 2.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 115 |
Number of mapped statements | 19 |
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) | 12.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24 | if (wlEntries.containsKey(filepath)) |
| 23 | if (wasEntries.containsKey(filepath)) | |||||||||||||
25 | JarEntry genericEntry = (JarEntry)genericEntries.get(filepath); | 24 | JarEntry genericEntry = (JarEntry)genericEntries.get(filepath); | ||||||||||||||
26 | JarEntry wlEntry = (JarEntry)wlEntries.get(filepath); |
| 25 | JarEntry wasEntry = (JarEntry)wasEntries.get(filepath); | |||||||||||||
27 | if ((genericEntry.getCrc() != wlEntry.getCrc()) || (genericEntry.getSize() != wlEntry.getSize())) |
| 26 | if ((genericEntry.getCrc() != wasEntry.getCrc()) || (genericEntry.getSize() != wasEntry.getSize())) | |||||||||||||
28 | if (genericEntry.getName().endsWith(".class")) | 27 | if (genericEntry.getName().endsWith(".class")) | ||||||||||||||
29 | String classname = genericEntry.getName().replace(File.separatorChar, '.'); | 28 | String classname = genericEntry.getName().replace(File.separatorChar, '.'); | ||||||||||||||
30 | classname = classname.substring(0, classname.lastIndexOf(".class")); | 29 | classname = classname.substring(0, classname.lastIndexOf(".class")); | ||||||||||||||
31 | Class genclass = genericLoader.loadClass(classname); | 30 | Class genclass = genericLoader.loadClass(classname); | ||||||||||||||
32 | if (genclass.isInterface()) | 31 | if (genclass.isInterface()) | ||||||||||||||
33 | log("Interface " + genclass.getName() + " has changed", Project.MSG_VERBOSE); | 32 | log("Interface " + genclass.getName() + " has changed", Project.MSG_VERBOSE); | ||||||||||||||
34 | rebuild = true; | 33 | rebuild = true; | ||||||||||||||
35 | break; |
| 34 | break; | |||||||||||||
else | else | ||||||||||||||||
36 | replaceEntries.put(filepath, genericEntry); | 35 | replaceEntries.put(filepath, genericEntry); | ||||||||||||||
else | else | ||||||||||||||||
37 | if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) | 36 | if (!genericEntry.getName().equals("META-INF/MANIFEST.MF")) | ||||||||||||||
38 | log("Non class file " + genericEntry.getName() + " has changed", Project.MSG_VERBOSE); | 37 | log("Non class file " + genericEntry.getName() + " has changed", Project.MSG_VERBOSE); | ||||||||||||||
39 | rebuild = true; | 38 | rebuild = true; | ||||||||||||||
40 | break; |
| | ||||||||||||||
|
| 39 | break; | ||||||||||||||
else | else | ||||||||||||||||
41 | log("File " + filepath + " not present in weblogic jar", Project.MSG_VERBOSE); |
| 40 | log("File " + filepath + " not present in websphere jar", Project.MSG_VERBOSE); | |||||||||||||
42 | rebuild = true; | 41 | rebuild = true; | ||||||||||||||
43 | break; |
| 42 | break; |
Row | Violation |
---|---|
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |
3 | Unmatched break; |
4 | Unmatched break; |
5 | Statement break; without innermost loop |
6 | Statement break; without innermost loop |