if ("".equals(nsPrefix))
{
return name;
}
else if (name.length() == 0)
{
return nsPrefix;
}
else
{
return nsPrefix + ":" + name;
}
if ("".equals(nsPrefix))
{
return name;
}
else if (name.length() == 0)
{
return nsPrefix;
}
else
{
return nsPrefix + ":" + name;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
|
Method name: String getQName(NameInfo, EPackage, String, boolean)
|
|
Method name: String getQName(EPackage, String, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if ("".equals(nsPrefix))↵ | | 1 | if ("".equals(nsPrefix))↵
|
2 | {↵ | | 2 | {↵
|
3 | return name;↵ | | 3 | return name;↵
|
4 | }↵ | | 4 | }↵
|
5 | else if (name.length() == 0)↵ | | 5 | else if (name.length() == 0)↵
|
6 | {↵ | | 6 | {↵
|
7 | return nsPrefix;↵ | | 7 | return nsPrefix;↵
|
8 | }↵ | | 8 | }↵
|
9 | else↵ | | 9 | else↵
|
10 | {↵ | | 10 | {↵
|
11 | return nsPrefix + ":" + name;↵ | | 11 | return nsPrefix + ":" + name;↵
|
12 | } | | 12 | }
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 20 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.7 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if ("".equals(nsPrefix)) | | 2 | if ("".equals(nsPrefix)) |
4 | | | 3 | |
5 | else if (name.length() == 0) | | 4 | else if (name.length() == 0) |
6 | | | 5 | |
| | | | |
7 | return nsPrefix + ":" + name; | | 6 | return nsPrefix + ":" + name; |
Precondition Violations (0)
Row |
Violation |