File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/URIHandlerImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/URIHandlerImpl.java | |||
Method name: Map
|
Method name: Map
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (urlConnection == null)↵ | 1 | if (urlConnection == null)↵ | |
2 | {↵ | 2 | {↵ | |
3 | urlConnection = url.openConnection();↵ | 3 | urlConnection = url.openConnection();↵ | |
4 | if (urlConnection instanceof HttpURLConnection)↵ | 4 | if (urlConnection instanceof HttpURLConnection)↵ | |
5 | {↵ | 5 | {↵ | |
6 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection;↵ | 6 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection;↵ | |
7 | httpURLConnection.setRequestMethod("HEAD");↵ | 7 | httpURLConnection.setRequestMethod("HEAD");↵ | |
8 | httpURLConnection.getResponseCode();↵ | 8 | httpURLConnection.getResponseCode();↵ | |
9 | }↵ | 9 | }↵ | |
10 | }↵ | 10 | }↵ | |
11 | if (urlConnection.getHeaderField("content-length") != null)↵ | 11 | if (urlConnection.getHeaderField("last-modified") != null)↵ | |
12 | {↵ | 12 | {↵ | |
13 | result.put(URIConverter.ATTRIBUTE_LENGTH, urlConnection.getContentLength());↵ | 13 | result.put(URIConverter.ATTRIBUTE_TIME_STAMP, urlConnection.getLastModified());↵ | |
14 | } | 14 |
| |
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 the same method |
Number of node comparisons | 25 |
Number of mapped statements | 7 |
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) | 1.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
27 | if (urlConnection == null) | 18 | if (urlConnection == null) | |||||||||||
28 | urlConnection = url.openConnection(); | 19 | urlConnection = url.openConnection(); | |||||||||||
29 | if (urlConnection instanceof HttpURLConnection) | 20 | if (urlConnection instanceof HttpURLConnection) | |||||||||||
30 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection; | 21 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection; | |||||||||||
31 | httpURLConnection.setRequestMethod("HEAD"); | 22 | httpURLConnection.setRequestMethod("HEAD"); | |||||||||||
32 | httpURLConnection.getResponseCode(); | 23 | httpURLConnection.getResponseCode(); | |||||||||||
33 | if (urlConnection.getHeaderField("content-length") != null) |
| 24 | if (urlConnection.getHeaderField("last-modified") != null) | ||||||||||
|
| 25 | result.put(URIConverter.ATTRIBUTE_TIME_STAMP, urlConnection.getLastModified()); | |||||||||||
34 | result.put(URIConverter.ATTRIBUTE_LENGTH, urlConnection.getContentLength()); |
| |
Row | Violation |
---|---|
1 | Unmatched statement result.put(URIConverter.ATTRIBUTE_TIME_STAMP,urlConnection.getLastModified()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement result.put(URIConverter.ATTRIBUTE_LENGTH,urlConnection.getContentLength()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |