if (scheme == null || EFS_GET_FILE_SYSTEM_METHOD == null)
{
return false;
}
else
{
Boolean result = efsScheme == null ? null : efsScheme.get(scheme);
if (result == null)
{
try
{
result = EFS_GET_FILE_SYSTEM_METHOD.invoke(null, scheme) != null;
}
catch (Throwable exception)
{
result = Boolean.FALSE;
}
Map<String, Boolean> map = new HashMap<String, Boolean>();
if (efsScheme != null)
{
map.putAll(efsScheme);
}
map.put(scheme, result);
efsScheme = map;
}
return result == Boolean.TRUE;
}
if (EFS_GET_FILE_SYSTEM_METHOD == null)
{
return false;
}
else
{
Boolean result = efsScheme == null ? null : efsScheme.get(scheme);
if (result == null)
{
try
{
result = EFS_GET_FILE_SYSTEM_METHOD.invoke(null, scheme) != null;
}
catch (Throwable exception)
{
result = Boolean.FALSE;
}
Map<String, Boolean> map = new HashMap<String, Boolean>();
if (efsScheme != null)
{
map.putAll(efsScheme);
}
map.put(scheme, result);
efsScheme = map;
}
return result == Boolean.TRUE;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/EFSURIHandlerImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/URIConverterImpl.java
|
Method name: boolean canHandle(URI)
|
|
Method name: boolean isEFSScheme(String)
|
Number of AST nodes: 12
|
|
Number of AST nodes: 12
|
|
1 | if (scheme == null || EFS_GET_FILE_SYSTEM_METHOD == null)↵ | | 1 | if (EFS_GET_FILE_SYSTEM_METHOD == null)↵
|
2 | {↵ | | 2 | {↵
|
3 | return false;↵ | | 3 | return false;↵
|
4 | }↵ | | 4 | }↵
|
5 | else↵ | | 5 | else↵
|
6 | {↵ | | 6 | {↵
|
7 | Boolean result = efsScheme == null ? null : efsScheme.get(scheme);↵ | | 7 | Boolean result = efsScheme == null ? null : efsScheme.get(scheme);↵
|
8 | if (result == null)↵ | | 8 | if (result == null)↵
|
9 | {↵ | | 9 | {↵
|
10 | try↵ | | 10 | try↵
|
11 | {↵ | | 11 | {↵
|
12 | result = EFS_GET_FILE_SYSTEM_METHOD.invoke(null, scheme) != null;↵ | | 12 | result = EFS_GET_FILE_SYSTEM_METHOD.invoke(null, scheme) != null;↵
|
13 | }↵ | | 13 | }↵
|
14 | catch (Throwable exception)↵ | | 14 | catch (Throwable exception)↵
|
15 | {↵ | | 15 | {↵
|
16 | result = Boolean.FALSE;↵ | | 16 | result = Boolean.FALSE;↵
|
17 | }↵ | | 17 | }↵
|
18 | Map<String, Boolean> map = new HashMap<String, Boolean>();↵ | | 18 | Map<String, Boolean> map = new HashMap<String, Boolean>();↵
|
19 | if (efsScheme != null)↵ | | 19 | if (efsScheme != null)↵
|
20 | {↵ | | 20 | {↵
|
21 | map.putAll(efsScheme);↵ | | 21 | map.putAll(efsScheme);↵
|
22 | }↵ | | 22 | }↵
|
23 | map.put(scheme, result);↵ | | 23 | map.put(scheme, result);↵
|
24 | efsScheme = map;↵ | | 24 | efsScheme = map;↵
|
25 | }↵ | | 25 | }↵
|
26 | return result == Boolean.TRUE;↵ | | 26 | return result == Boolean.TRUE;↵
|
27 | } | | 27 | }
|
See real code fragment |
|
See real code fragment |
Summary
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) | 0.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 31 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 9 |
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) | 2.0 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | Boolean result = efsScheme == null ? null : efsScheme.get(scheme); | | 3 | Boolean result = efsScheme == null ? null : efsScheme.get(scheme); |
5 | if (result == null) | | 4 | if (result == null) |
6 | | | 5 | |
7 | result = EFS_GET_FILE_SYSTEM_METHOD.invoke(null, scheme) != null; | | 6 | result = EFS_GET_FILE_SYSTEM_METHOD.invoke(null, scheme) != null; |
8 | Map<String, Boolean> map = new HashMap<String, Boolean>(); | | 7 | Map<String, Boolean> map = new HashMap<String, Boolean>(); |
9 | | | 8 | |
10 | | | 9 | |
11 | | | 10 | |
12 | | | 11 | |
Precondition Violations (0)
Row |
Violation |