if (instanceValue == null) return null;
if (instanceValue.isEmpty()) return "";
StringBuffer result = new StringBuffer();
for (Object item : instanceValue)
{
result.append(convertENTITY((String)item));
result.append(' ');
}
return result.substring(0, result.length() - 1);
if (instanceValue == null) return null;
if (instanceValue.isEmpty()) return "";
StringBuffer result = new StringBuffer();
for (Object item : instanceValue)
{
result.append(convertIDREF((String)item));
result.append(' ');
}
return result.substring(0, result.length() - 1);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/XMLTypeFactoryImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/XMLTypeFactoryImpl.java
|
Method name: String convertENTITIESBase(List extends String>)
|
|
Method name: String convertIDREFSBase(List extends String>)
|
Number of AST nodes: 9
|
|
Number of AST nodes: 9
|
|
1 | if (instanceValue == null) return null;↵ | | 1 | if (instanceValue == null) return null;↵
|
2 | if (instanceValue.isEmpty()) return "";↵ | | 2 | if (instanceValue.isEmpty()) return "";↵
|
3 | StringBuffer result = new StringBuffer();↵ | | 3 | StringBuffer result = new StringBuffer();↵
|
4 | for (Object item : instanceValue)↵ | | 4 | for (Object item : instanceValue)↵
|
5 | {↵ | | 5 | {↵
|
6 | result.append(convertENTITY((String)item));↵ | | 6 | result.append(convertIDREF((String)item));↵
|
7 | result.append(' ');↵ | | 7 | result.append(' ');↵
|
8 | }↵ | | 8 | }↵
|
9 | return result.substring(0, result.length() - 1); | | 9 | return result.substring(0, result.length() - 1);
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 18 |
-
{Non-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.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (instanceValue == null) | | 1 | if (instanceValue == null) |
2 | | | 2 | |
3 | if (instanceValue.isEmpty()) | | 3 | if (instanceValue.isEmpty()) |
4 | | | 4 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.util.List<> of variable instanceValue does not match with type java.util.List<> of variable instanceValue |
2 | Type java.util.List<> of variable instanceValue does not match with type java.util.List<> of variable instanceValue |