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