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: 9 | Number of AST nodes: 9 | |||
1 | if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_TIME_STAMP))↵ | 1 | if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_LENGTH))↵ | |
2 | {↵ | 2 | {↵ | |
3 | if (urlConnection == null)↵ | 3 | if (urlConnection == null)↵ | |
4 | {↵ | 4 | {↵ | |
5 | urlConnection = url.openConnection();↵ | 5 | urlConnection = url.openConnection();↵ | |
6 | if (urlConnection instanceof HttpURLConnection)↵ | 6 | if (urlConnection instanceof HttpURLConnection)↵ | |
7 | {↵ | 7 | {↵ | |
8 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection;↵ | 8 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection;↵ | |
9 | httpURLConnection.setRequestMethod("HEAD");↵ | 9 | httpURLConnection.setRequestMethod("HEAD");↵ | |
10 | httpURLConnection.getResponseCode();↵ | 10 | httpURLConnection.getResponseCode();↵ | |
11 | }↵ | 11 | }↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (urlConnection.getHeaderField("last-modified") != null)↵ | 13 | if (urlConnection.getHeaderField("content-length") != null)↵ | |
14 | {↵ | 14 | {↵ | |
15 | result.put(URIConverter.ATTRIBUTE_TIME_STAMP, urlConnection.getLastModified());↵ | 15 | result.put(URIConverter.ATTRIBUTE_LENGTH, urlConnection.getContentLength());↵ | |
16 | }↵ | 16 | }↵ | |
17 | } | 17 |
| |
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.5 |
Clones location | Clones are in the same method |
Number of node comparisons | 26 |
Number of mapped statements | 8 |
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.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17 | if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_TIME_STAMP)) |
| 26 | if (requestedAttributes == null || requestedAttributes.contains(URIConverter.ATTRIBUTE_LENGTH)) | ||||||||||
18 | if (urlConnection == null) | 27 | if (urlConnection == null) | |||||||||||
19 | urlConnection = url.openConnection(); | 28 | urlConnection = url.openConnection(); | |||||||||||
20 | if (urlConnection instanceof HttpURLConnection) | 29 | if (urlConnection instanceof HttpURLConnection) | |||||||||||
21 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection; | 30 | HttpURLConnection httpURLConnection = (HttpURLConnection)urlConnection; | |||||||||||
22 | httpURLConnection.setRequestMethod("HEAD"); | 31 | httpURLConnection.setRequestMethod("HEAD"); | |||||||||||
23 | httpURLConnection.getResponseCode(); | 32 | httpURLConnection.getResponseCode(); | |||||||||||
24 | if (urlConnection.getHeaderField("last-modified") != null) |
| 33 | if (urlConnection.getHeaderField("content-length") != 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 |