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: 18 | Number of AST nodes: 18 | |||
1 | newJarStream.setLevel(0);↵ | 1 | newJarStream.setLevel(0);↵ | |
2 | //Copy files from old weblogic jar↵ | 2 | //Copy files from old websphere jar↵ | |
3 | for (Enumeration e = wlEntries.elements(); e.hasMoreElements();) {↵ | 3 | for (Enumeration e = wasEntries.elements(); e.hasMoreElements();) {↵ | |
4 | byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];↵ | 4 | byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];↵ | |
5 | int bytesRead;↵ | 5 | int bytesRead;↵ | |
6 | InputStream is;↵ | 6 | InputStream is;↵ | |
7 | JarEntry je = (JarEntry) e.nextElement();↵ | 7 | JarEntry je = (JarEntry) e.nextElement();↵ | |
8 | if (je.getCompressedSize() == -1↵ | 8 | if (je.getCompressedSize() == -1↵ | |
9 | || je.getCompressedSize() == je.getSize()) {↵ | 9 | || je.getCompressedSize() == je.getSize()) {↵ | |
10 | newJarStream.setLevel(0);↵ | 10 | newJarStream.setLevel(0);↵ | |
11 | } else {↵ | 11 | } else {↵ | |
12 | newJarStream.setLevel(JAR_COMPRESS_LEVEL);↵ | 12 | newJarStream.setLevel(JAR_COMPRESS_LEVEL);↵ | |
13 | }↵ | 13 | }↵ | |
14 | // Update with changed Bean class↵ | 14 | // Update with changed Bean class↵ | |
15 | if (replaceEntries.containsKey(je.getName())) {↵ | 15 | if (replaceEntries.containsKey(je.getName())) {↵ | |
16 | log("Updating Bean class from generic Jar "↵ | 16 | log("Updating Bean class from generic Jar " + je.getName(),↵ | |
17 | + je.getName(), Project.MSG_VERBOSE);↵ | 17 | Project.MSG_VERBOSE);↵ | |
18 | // Use the entry from the generic jar↵ | 18 | // Use the entry from the generic jar↵ | |
19 | je = (JarEntry) replaceEntries.get(je.getName());↵ | 19 | je = (JarEntry) replaceEntries.get(je.getName());↵ | |
20 | is = genericJar.getInputStream(je);↵ | 20 | is = genericJar.getInputStream(je);↵ | |
21 | } else {↵ | 21 | } else {↵ | |
22 | //use fle from original weblogic jar↵ | 22 | //use fle from original websphere jar↵ | |
23 | is = wlJar.getInputStream(je);↵ | 23 | is = wasJar.getInputStream(je);↵ | |
24 | }↵ | 24 | }↵ | |
25 | newJarStream.putNextEntry(new JarEntry(je.getName()));↵ | 25 | newJarStream.putNextEntry(new JarEntry(je.getName()));↵ | |
26 | while ((bytesRead = is.read(buffer)) != -1) {↵ | 26 | while ((bytesRead = is.read(buffer)) != -1) {↵ | |
27 | newJarStream.write(buffer, 0, bytesRead);↵ | 27 | newJarStream.write(buffer, 0, bytesRead);↵ | |
28 | }↵ | 28 | }↵ | |
29 | is.close();↵ | 29 | is.close();↵ | |
30 | } | 30 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.7 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 113 |
Number of mapped statements | 18 |
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) | 137.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
50 | newJarStream.setLevel(0); | 49 | newJarStream.setLevel(0); | |||||||||||
51 | for (Enumeration e = wlEntries.elements(); e.hasMoreElements(); ) |
| 50 | for (Enumeration e = wasEntries.elements(); e.hasMoreElements(); ) | ||||||||||
52 | byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; | 51 | byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; | |||||||||||
53 | int bytesRead; | 52 | int bytesRead; | |||||||||||
54 | InputStream is; | 53 | InputStream is; | |||||||||||
55 | JarEntry je = (JarEntry)e.nextElement(); | 54 | JarEntry je = (JarEntry)e.nextElement(); | |||||||||||
56 | if (je.getCompressedSize() == -1 || je.getCompressedSize() == je.getSize()) | 55 | if (je.getCompressedSize() == -1 || je.getCompressedSize() == je.getSize()) | |||||||||||
57 | newJarStream.setLevel(0); | 56 | newJarStream.setLevel(0); | |||||||||||
else | else | |||||||||||||
58 | newJarStream.setLevel(JAR_COMPRESS_LEVEL); | 57 | newJarStream.setLevel(JAR_COMPRESS_LEVEL); | |||||||||||
59 | if (replaceEntries.containsKey(je.getName())) | 58 | if (replaceEntries.containsKey(je.getName())) | |||||||||||
60 | log("Updating Bean class from generic Jar " + je.getName(), Project.MSG_VERBOSE); | 59 | log("Updating Bean class from generic Jar " + je.getName(), Project.MSG_VERBOSE); | |||||||||||
61 | je = (JarEntry)replaceEntries.get(je.getName()); | 60 | je = (JarEntry)replaceEntries.get(je.getName()); | |||||||||||
62 | is = genericJar.getInputStream(je); | 61 | is = genericJar.getInputStream(je); | |||||||||||
else | else | |||||||||||||
63 | is = wlJar.getInputStream(je); |
| 62 | is = wasJar.getInputStream(je); | ||||||||||
64 | newJarStream.putNextEntry(new JarEntry(je.getName())); | 63 | newJarStream.putNextEntry(new JarEntry(je.getName())); | |||||||||||
65 | while ((bytesRead = is.read(buffer)) != -1) | 64 | while ((bytesRead = is.read(buffer)) != -1) | |||||||||||
66 | newJarStream.write(buffer, 0, bytesRead); | 65 | newJarStream.write(buffer, 0, bytesRead); | |||||||||||
67 | is.close(); | 66 | is.close(); |
Row | Violation |
---|