try
{
return
feature instanceof EAttribute ?
feature.isMany() ?
!((List<?>)eObject.eGet(feature)).isEmpty() :
eObject.eIsSet(feature) :
eObject.eGet(feature) != null;
}
catch (Throwable exception)
{
return false;
}
try
{
return Boolean.TRUE.equals(FILE_INFO_EXISTS_METHOD.invoke(getInfo(uri, options)));
}
catch (Exception exception)
{
return false;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemPropertyDescriptor.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/resource/impl/EFSURIHandlerImpl.java
|
Method name: boolean isPropertySet(Object)
|
|
Method name: boolean exists(URI, Map,?>)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | try↵ | | 1 | try↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | return ↵ | | 4 | return ↵
|
5 | feature instanceof EAttribute ? ↵ | | |
|
6 | feature.isMany() ?↵ | | |
|
7 | !((List<?>)eObject.eGet(feature)).isEmpty() : ↵ | | |
|
8 | eObject.eIsSet(feature) : ↵ | | |
|
9 | eObject.eGet(feature) != null;↵ | | |
|
10 | }↵ | | |
|
11 | ↵ | | 5 | Boolean.TRUE.equals(FILE_INFO_EXISTS_METHOD.invoke(getInfo(uri, options)));↵
|
| | | 6 | }↵
|
12 | catch (Throwable exception)↵ | | 7 | catch (Exception exception)↵
|
13 | {↵ | | 8 | {↵
|
14 | return false;↵ | | 9 | return false;↵
|
15 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 4 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
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) | 0.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | try | | 1 | try |
| | | 2 | return Boolean.TRUE.equals(FILE_INFO_EXISTS_METHOD.invoke(getInfo(uri, options))); |
8 | return feature instanceof EAttribute ? feature.isMany() ? !((List<?>)eObject.eGet(feature)).isEmpty() : eObject.eIsSet(feature) : eObject.eGet(feature) != null; | | | |
Precondition Violations (4)
Row |
Violation |
1 | Unmatched statement return Boolean.TRUE.equals(FILE_INFO_EXISTS_METHOD.invoke(getInfo(uri,options))); 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 |
2 | Unmatched return Boolean.TRUE.equals(FILE_INFO_EXISTS_METHOD.invoke(getInfo(uri,options))); |
3 | Unmatched statement return feature instanceof EAttribute ? feature.isMany() ? !((List<?>)eObject.eGet(feature)).isEmpty() : eObject.eIsSet(feature) : eObject.eGet(feature) != null; 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 |
4 | Unmatched return feature instanceof EAttribute ? feature.isMany() ? !((List<?>)eObject.eGet(feature)).isEmpty() : eObject.eIsSet(feature) : eObject.eGet(feature) != null; |