File path: /jEdit-4.2/src/org/gjt/sp/jedit/JARClassLoader.java | File path: /jEdit-4.2/src/org/gjt/sp/jedit/JARClassLoader.java | |||
Method name: URL getResource(String)
|
Method name: InputStream getResourceAsStream(String)
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | ZipFile zipFile = jar.getZipFile();↵ | 1 | ZipFile zipFile = jar.getZipFile();↵ | |
2 | ZipEntry entry = zipFile.getEntry(name);↵ | 2 | ZipEntry entry = zipFile.getEntry(name);↵ | |
3 | if(entry == null)↵ | 3 | if(entry == null)↵ | |
4 | return getSystemResource(name);↵ | 4 | return getSystemResourceAsStream(name);↵ | |
5 | else↵ | 5 | else↵ | |
6 | return new URL(getResourceAsPath(name)); | 6 | return zipFile.getInputStream(entry); | |
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.8 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 14 |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 2.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||
---|---|---|---|---|---|---|---|---|---|
4 | ZipFile zipFile = jar.getZipFile(); | 4 | ZipFile zipFile = jar.getZipFile(); | ||||||
5 | ZipEntry entry = zipFile.getEntry(name); | 5 | ZipEntry entry = zipFile.getEntry(name); | ||||||
6 | if (entry == null) | 6 | if (entry == null) | ||||||
|
| 7 | return getSystemResourceAsStream(name); | ||||||
7 | return getSystemResource(name); |
| | ||||||
else | | ||||||||
|
| 8 | return zipFile.getInputStream(entry); | ||||||
8 | return new URL(getResourceAsPath(name)); |
| |
Row | Violation |
---|---|
1 | Unmatched statement return getSystemResourceAsStream(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched return getSystemResourceAsStream(name); |
3 | Unmatched statement return getSystemResource(name); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Unmatched return getSystemResource(name); |
5 | Unmatched statement return zipFile.getInputStream(entry); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement return zipFile.getInputStream(entry); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
7 | Unmatched return zipFile.getInputStream(entry); |
8 | Unmatched statement return new URL(getResourceAsPath(name)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
9 | Unmatched statement return new URL(getResourceAsPath(name)); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
10 | Unmatched return new URL(getResourceAsPath(name)); |
11 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables zipFile, entry |