File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreValidator.java | |||
Method name: boolean isBounded(EGenericType, EGenericType, Map extends ETypeParameter,? extends EGenericType>)
|
Method name: boolean isMatching(EGenericType, EGenericType, Map extends ETypeParameter,? extends EGenericType>)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | EGenericType eBoundEUpperBound = eBound.getEUpperBound();↵ | 1 | EGenericType eBoundEUpperBound = eBound.getEUpperBound();↵ | |
2 | if (eBoundEUpperBound != null)↵ | 2 | if (eBoundEUpperBound != null)↵ | |
3 | {↵ | 3 | ↵ | |
4 | {↵ | |||
4 | return isBounded(eGenericType, eBoundEUpperBound, substitutions);↵ | 5 | return isBounded(eGenericType, eBoundEUpperBound, substitutions);↵ | |
5 | }↵ | 6 | ↵ | |
7 | }↵ | |||
6 | else↵ | 8 | else↵ | |
7 | {↵ | 9 | ↵ | |
10 | {↵ | |||
8 | EGenericType eBoundELowerBound = eBound.getELowerBound();↵ | 11 | EGenericType eBoundELowerBound = eBound.getELowerBound();↵ | |
9 | if (eBoundELowerBound != null)↵ | 12 | if (eBoundELowerBound != null)↵ | |
10 | {↵ | 13 | ↵ | |
14 | {↵ | |||
11 | // If there is an lower bound, the type argument must bound it.↵ | 15 | // ↵ | |
16 | Reverse the test.↵ | |||
12 | //↵ | 17 | //↵ | |
13 | return isBounded(eBoundELowerBound, eGenericType, substitutions);↵ | 18 | return isMatching(eBoundELowerBound, eGenericType, substitutions);↵ | |
14 | }↵ | 19 | }↵ | |
15 | ↵ | 20 | ↵ | |
21 | ↵ | |||
16 | // The bound is a wildcard with no constraints.↵ | 22 | // The bound is a wildcard with no constraints.↵ | |
17 | //↵ | 23 | //↵ | |
18 | return false;↵ | 24 | return true;↵ | |
19 | } | 25 | } | |
See real code fragment | See real code fragment |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
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) | 2.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
74 | EGenericType eBoundEUpperBound = eBound.getEUpperBound(); | 27 | EGenericType eBoundEUpperBound = eBound.getEUpperBound(); | |||||||||||||||||
75 | if (eBoundEUpperBound != null) | 28 | if (eBoundEUpperBound != null) | |||||||||||||||||
76 | return isBounded(eGenericType, eBoundEUpperBound, substitutions); |
| 29 | return isBounded(eGenericType, eBoundEUpperBound, substitutions); | ||||||||||||||||
else | else | |||||||||||||||||||
77 | EGenericType eBoundELowerBound = eBound.getELowerBound(); | 30 | EGenericType eBoundELowerBound = eBound.getELowerBound(); | |||||||||||||||||
78 | if (eBoundELowerBound != null) | 31 | if (eBoundELowerBound != null) | |||||||||||||||||
79 | return isBounded(eBoundELowerBound, eGenericType, substitutions); |
| 32 | return isMatching(eBoundELowerBound, eGenericType, substitutions); | ||||||||||||||||
80 | return false; |
| 33 | return true; |
Row | Violation |
---|---|
1 | Type java.util.Map<,> of variable substitutions does not match with type java.util.Map<,> of variable substitutions |
2 | Expression isBounded(eBoundELowerBound,eGenericType,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression isMatching(eBoundELowerBound,eGenericType,substitutions) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Type java.util.Map<,> of variable substitutions does not match with type java.util.Map<,> of variable substitutions |
5 | Conditional return false; |
6 | Conditional return true; |