String extension = new Path(getFileName()).getFileExtension();
if (extension == null || !FILE_EXTENSIONS.contains(extension))
{
String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
setErrorMessage(EcoreEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
return false;
}
return true;
String extension = new Path(getFileName()).getFileExtension();
if (extension == null || !FILE_EXTENSIONS.contains(extension))
{
String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; //$NON-NLS-1$ //$NON-NLS-2$
setErrorMessage(Ecore2XMLUIPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));
return false;
}
return true;
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: boolean validatePage()
|
|
Method name: boolean validatePage()
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | String extension = new Path(getFileName()).getFileExtension();↵ | | 1 | String extension = new Path(getFileName()).getFileExtension();↵
|
2 | if (extension == null || !FILE_EXTENSIONS.contains(extension))↵ | | 2 | if (extension == null || !FILE_EXTENSIONS.contains(extension))↵
|
3 | {↵ | | 3 | {↵
|
4 | String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";↵ | | 4 | String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; //$NON-NLS-1$ //$NON-NLS-2$↵
|
5 | setErrorMessage(EcoreEditorPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));↵ | | 5 | setErrorMessage(Ecore2XMLUIPlugin.INSTANCE.getString(key, new Object [] { FORMATTED_FILE_EXTENSIONS }));↵
|
6 | return false;↵ | | 6 | return false;↵
|
7 | }↵ | | 7 | }↵
|
8 | return true; | | 8 | return true;
|
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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 21 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
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.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | String extension = new Path(getFileName()).getFileExtension(); | | 2 | String extension = new Path(getFileName()).getFileExtension(); |
3 | if (extension == null || !FILE_EXTENSIONS.contains(extension)) | | 3 | if (extension == null || !FILE_EXTENSIONS.contains(extension)) |
4 | String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; | | 4 | String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; |
5 | setErrorMessage(EcoreEditorPlugin.INSTANCE.getString(key, new Object[] {FORMATTED_FILE_EXTENSIONS})); | | 5 | setErrorMessage(Ecore2XMLUIPlugin.INSTANCE.getString(key, new Object[] {FORMATTED_FILE_EXTENSIONS})); |
6 | | | 6 | |
7 | return true; | | 7 | return true; |
Precondition Violations (0)
Row |
Violation |