if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable())
{
Object defaultValue = feature.getDefaultValue();
return defaultValue == null ? value == null : defaultValue.equals(value);
}
else
{
return false;
}
if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable())
{
Object defaultValue = feature.getDefaultValue();
return defaultValue == null ? value == null : defaultValue.equals(value);
}
else
{
return false;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
|
Method name: boolean shouldUnset(EStructuralFeature, Object)
|
|
Method name: boolean shouldUnset(EStructuralFeature, Object)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable())↵ | | 1 | if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable())↵
|
2 | {↵ | | 2 | {↵
|
3 | Object defaultValue = feature.getDefaultValue();↵ | | 3 | Object defaultValue = feature.getDefaultValue();↵
|
4 | return defaultValue == null ? value == null : defaultValue.equals(value);↵ | | 4 | return defaultValue == null ? value == null : defaultValue.equals(value);↵
|
5 | }↵ | | 5 | }↵
|
6 | else↵ | | 6 | else↵
|
7 | {↵ | | 7 | {↵
|
8 | return false;↵ | | 8 | return false;↵
|
9 | } | | 9 | }
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 16 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable()) | | 1 | if (feature.getUpperBound() != ETypedElement.UNSPECIFIED_MULTIPLICITY && !feature.isUnsettable()) |
2 | Object defaultValue = feature.getDefaultValue(); | | 2 | Object defaultValue = feature.getDefaultValue(); |
3 | return defaultValue == null ? value == null : defaultValue.equals(value); | | 3 | return defaultValue == null ? value == null : defaultValue.equals(value); |
| | | | |
4 | | | 4 | |
Precondition Violations (0)
Row |
Violation |