File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java | File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java | |||
Method name: boolean isRebuildRequired(File, File)
|
Method name: boolean isRebuildRequired(File, File)
|
|||
Number of AST nodes: 10 | Number of AST nodes: 10 | |||
1 | JarEntry genericEntry = (JarEntry) genericEntries.get(filepath);↵ | 1 | JarEntry genericEntry = (JarEntry) genericEntries.get(filepath);↵ | |
2 | JarEntry wasEntry = (JarEntry) wasEntries.get(filepath);↵ | 2 | JarEntry wlEntry = (JarEntry) wlEntries.get(filepath);↵ | |
3 | if ((genericEntry.getCrc() != wasEntry.getCrc())↵ | 3 | if ((genericEntry.getCrc() != wlEntry.getCrc())↵ | |
4 | || (genericEntry.getSize() != wasEntry.getSize())) {↵ | 4 | || (genericEntry.getSize() != wlEntry.getSize())) {↵ | |
5 | if (genericEntry.getName().endsWith(".class")) {↵ | 5 | if (genericEntry.getName().endsWith(".class")) {↵ | |
6 | //File are different see if its an object or an interface↵ | 6 | //File are different see if its an object or an interface↵ | |
7 | String classname↵ | 7 | String classname↵ | |
8 | = genericEntry.getName().replace(File.separatorChar, '.');↵ | 8 | = genericEntry.getName().replace(File.separatorChar, '.');↵ | |
9 | classname = classname.substring(0, classname.lastIndexOf(".class"));↵ | 9 | classname = classname.substring(0, classname.lastIndexOf(".class"));↵ | |
10 | Class genclass = genericLoader.loadClass(classname);↵ | 10 | Class genclass = genericLoader.loadClass(classname);↵ | |
11 | if (genclass.isInterface()) {↵ | 11 | if (genclass.isInterface()) {↵ | |
12 | //Interface changed rebuild jar.↵ | 12 | //Interface changed rebuild jar.↵ | |
13 | log("Interface " + genclass.getName()↵ | 13 | log("Interface " + genclass.getName()↵ | |
14 | + " has changed", Project.MSG_VERBOSE);↵ | 14 | + " has changed", Project.MSG_VERBOSE);↵ | |
15 | rebuild = true;↵ | 15 | rebuild = true;↵ | |
16 | break;↵ | 16 | break;↵ | |
17 | } else {↵ | 17 | } else {↵ | |
18 | //Object class Changed update it.↵ | 18 | //Object class Changed update it.↵ | |
19 | replaceEntries.put(filepath, genericEntry);↵ | 19 | replaceEntries.put(filepath, genericEntry);↵ | |
20 | } | 20 |
| |
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) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 36 |
Number of mapped statements | 8 |
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) | 33.0 |
Clone type | Type 1 |
ID | Statement | ID | Statement | |||||||
---|---|---|---|---|---|---|---|---|---|---|
28 | String classname = genericEntry.getName().replace(File.separatorChar, '.'); | 29 | String classname = genericEntry.getName().replace(File.separatorChar, '.'); | |||||||
29 | classname = classname.substring(0, classname.lastIndexOf(".class")); | 30 | classname = classname.substring(0, classname.lastIndexOf(".class")); | |||||||
30 | Class genclass = genericLoader.loadClass(classname); | 31 | Class genclass = genericLoader.loadClass(classname); | |||||||
31 | if (genclass.isInterface()) | 32 | if (genclass.isInterface()) | |||||||
32 | log("Interface " + genclass.getName() + " has changed", Project.MSG_VERBOSE); | 33 | log("Interface " + genclass.getName() + " has changed", Project.MSG_VERBOSE); | |||||||
33 | rebuild = true; | 34 | rebuild = true; | |||||||
34 | break; |
| 35 | break; | ||||||
else | else | |||||||||
35 | replaceEntries.put(filepath, genericEntry); | 36 | replaceEntries.put(filepath, genericEntry); |
Row | Violation |
---|---|
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |