if (encodings == null)
{
encodings = new ArrayList<String>();
for (StringTokenizer stringTokenizer = new StringTokenizer(EcoreEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); )
{
encodings.add(stringTokenizer.nextToken());
}
}
return encodings;
if (encodings == null)
{
encodings = new ArrayList<String>();
for (StringTokenizer stringTokenizer = new StringTokenizer(Ecore2XMLUIPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) //$NON-NLS-1$
{
encodings.add(stringTokenizer.nextToken());
}
}
return encodings;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreModelWizard.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLModelWizard.java
|
Method name: Collection getEncodings()
|
|
Method name: Collection getEncodings()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (encodings == null)↵ | | 1 | if (encodings == null)↵
|
2 | {↵ | | 2 | {↵
|
3 | encodings = new ArrayList<String>();↵ | | 3 | encodings = new ArrayList<String>();↵
|
4 | for (StringTokenizer stringTokenizer = new StringTokenizer(EcoreEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); )↵ | | 4 | for (StringTokenizer stringTokenizer = new StringTokenizer(Ecore2XMLUIPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) //$NON-NLS-1$↵
|
5 | {↵ | | 5 | {↵
|
6 | encodings.add(stringTokenizer.nextToken());↵ | | 6 | encodings.add(stringTokenizer.nextToken());↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | return encodings; | | 9 | return encodings;
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 9 |
-
{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) | 1.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (encodings == null) | | 1 | if (encodings == null) |
2 | encodings = new ArrayList<String>(); | | 2 | encodings = new ArrayList<String>(); |
3 | for (StringTokenizer stringTokenizer = new StringTokenizer(EcoreEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) | | 3 | for (StringTokenizer stringTokenizer = new StringTokenizer(Ecore2XMLUIPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens(); ) |
4 | encodings.add(stringTokenizer.nextToken()); | | 4 | encodings.add(stringTokenizer.nextToken()); |
5 | return encodings; | | 5 | return encodings; |
Precondition Violations (0)
Row |
Violation |