result = false;
if (diagnostics != null)
{
diagnostics.add
(createDiagnostic
(Diagnostic.ERROR,
DIAGNOSTIC_SOURCE,
EOBJECT__EVERY_MULTIPCITY_CONFORMS,
"_UI_FeatureHasTooManyValues_diagnostic",
new Object []
{
getFeatureLabel(eStructuralFeature, context),
getObjectLabel(eObject, context),
new Integer(size),
new Integer(upperBound)
},
new Object [] { eObject, eStructuralFeature },
context));
}
result = false;
if (diagnostics != null)
{
diagnostics.add
(createDiagnostic
(Diagnostic.ERROR,
DIAGNOSTIC_SOURCE,
EOBJECT__EVERY_MULTIPCITY_CONFORMS,
"_UI_FeatureHasTooManyValues_diagnostic",
new Object []
{
getFeatureLabel(eStructuralFeature, context),
getObjectLabel(eObject, context),
new Integer(size),
new Integer(upperBound)
},
new Object [] { eObject, eStructuralFeature },
context));
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EObjectValidator.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EObjectValidator.java
|
Method name: boolean validate_MultiplicityConforms(EObject, EStructuralFeature, DiagnosticChain, Map
|
|
Method name: boolean validate_MultiplicityConforms(EObject, EStructuralFeature, DiagnosticChain, Map
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | result = false;↵ | | 1 | result = false;↵
|
2 | if (diagnostics != null)↵ | | 2 | if (diagnostics != null)↵
|
3 | {↵ | | 3 | {↵
|
4 | diagnostics.add↵ | | 4 | diagnostics.add↵
|
5 | (createDiagnostic↵ | | 5 | (createDiagnostic↵
|
6 | (Diagnostic.ERROR,↵ | | 6 | (Diagnostic.ERROR,↵
|
7 | DIAGNOSTIC_SOURCE,↵ | | 7 | DIAGNOSTIC_SOURCE,↵
|
8 | EOBJECT__EVERY_MULTIPCITY_CONFORMS,↵ | | 8 | EOBJECT__EVERY_MULTIPCITY_CONFORMS,↵
|
9 | "_UI_FeatureHasTooManyValues_diagnostic",↵ | | 9 | "_UI_FeatureHasTooManyValues_diagnostic",↵
|
10 | new Object []↵ | | 10 | new Object []↵
|
11 | {↵ | | 11 | ↵
|
| | | 12 | {↵
|
12 | getFeatureLabel(eStructuralFeature, context),↵ | | 13 | getFeatureLabel(eStructuralFeature, context),↵
|
13 | getObjectLabel(eObject, context),↵ | | 14 | getObjectLabel(eObject, context),↵
|
14 | new Integer(size),↵ | | 15 | new Integer(size),↵
|
15 | new Integer(upperBound)↵ | | 16 | new Integer(upperBound)↵
|
16 | },↵ | | 17 | },↵
|
17 | new Object [] { eObject, eStructuralFeature },↵ | | 18 | new Object [] { eObject, eStructuralFeature },↵
|
18 | context));↵ | | 19 | context));↵
|
19 | } | | 20 | }
|
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.1 |
Clones location | Clones are in the same method |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
12 | result = false; | | 19 | result = false; |
13 | if (diagnostics != null) | | 20 | if (diagnostics != null) |
14 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, EOBJECT__EVERY_MULTIPCITY_CONFORMS, "_UI_FeatureHasTooManyValues_diagnostic", new Object[] {getFeatureLabel(eStructuralFeature, context), getObjectLabel(eObject, context), new Integer(size), new Integer(upperBound)}, new Object[] {eObject, eStructuralFeature}, context)); | | 21 | diagnostics.add(createDiagnostic(Diagnostic.ERROR, DIAGNOSTIC_SOURCE, EOBJECT__EVERY_MULTIPCITY_CONFORMS, "_UI_FeatureHasTooManyValues_diagnostic", new Object[] {getFeatureLabel(eStructuralFeature, context), getObjectLabel(eObject, context), new Integer(size), new Integer(upperBound)}, new Object[] {eObject, eStructuralFeature}, context)); |
Precondition Violations (0)
Row |
Violation |