if (modCount == 0) return object;
Entry result = super.validate(index, object);
EStructuralFeature eStructuralFeature = object.getEStructuralFeature();
if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature))
{
throw
new RuntimeException
("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'");
}
return result;
if (modCount == 0) return object;
Entry result = super.validate(index, object);
EStructuralFeature eStructuralFeature = object.getEStructuralFeature();
if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature))
{
throw
new RuntimeException
("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'");
}
return result;
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: Entry validate(int, Entry)
|
|
Method name: Entry validate(int, Entry)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (modCount == 0) return object;↵ | | 1 | if (modCount == 0) return object;↵
|
|
2 | Entry result = super.validate(index, object);↵ | | 2 | Entry result = super.validate(index, object);↵
|
3 | EStructuralFeature eStructuralFeature = object.getEStructuralFeature();↵ | | 3 | EStructuralFeature eStructuralFeature = object.getEStructuralFeature();↵
|
4 | if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature))↵ | | 4 | if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature))↵
|
5 | {↵ | | 5 | {↵
|
6 | throw↵ | | 6 | throw↵
|
7 | new RuntimeException↵ | | 7 | new RuntimeException↵
|
8 | ("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'");↵ | | 8 | ("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'");↵
|
9 | }↵ | | 9 | }↵
|
10 | return result; | | 10 | return result;
|
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 22 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 1.2 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (modCount == 0) | | 1 | if (modCount == 0) |
2 | | | 2 | |
3 | Entry result = super.validate(index, object); | | 3 | Entry result = super.validate(index, object); |
4 | EStructuralFeature eStructuralFeature = object.getEStructuralFeature(); | | 4 | EStructuralFeature eStructuralFeature = object.getEStructuralFeature(); |
5 | if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature)) | | 5 | if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature)) |
6 | throw new RuntimeException("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'"); | | 6 | throw new RuntimeException("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'"); |
7 | return result; | | 7 | return result; |
Precondition Violations (0)
Row |
Violation |