String message = null; if (location == null || location.equals("")) { message = packageName == null ? ExporterPlugin.INSTANCE.getString("_UI_ArtifactFileNameCannotBeEmpty_message") : ExporterPlugin.INSTANCE.getString("_UI_ArtifactFileNameForPackageCannotBeEmpty_message", new Object []{packageName}); } else { message = doCheckEPackageArtifactLocation(location, packageName); } if (message == null) { return Diagnostic.OK_INSTANCE; } else { return new BasicDiagnostic(Diagnostic.ERROR, ConverterPlugin.ID, ConverterUtil.ACTION_DEFAULT, message, null); }
String message = null; if (fileName == null || fileName.equals("")) { message = packageName == null ? ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameCannotBeEmpty_message") : ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameForPackageCannotBeEmpty_message", new Object []{ packageName }); } else if (!fileName.endsWith(".ecore") && !fileName.endsWith(".emof")) { message = packageName == null ? ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameMustEndWithEcore_message") : ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameForPackageMustEndWithEcore_message", new Object []{ packageName }); } if (message == null) { return Diagnostic.OK_INSTANCE; } else { return new BasicDiagnostic(Diagnostic.ERROR, ConverterPlugin.ID, ConverterUtil.ACTION_DEFAULT, message, null); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/exporter/ModelExporter.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/ModelImporter.java
Method name: Diagnostic checkEPackageArtifactLocation(String, String) Method name: Diagnostic checkEcoreModelFileName(String, String)
Number of AST nodes: 7 Number of AST nodes: 8
1
String message = null;
1
String message = null;
2
    if (location == null || location.equals(""))
2
    if (fileName == null || fileName.equals(""))
3
    {
3
    {
4
      message = packageName == null ?
4
      message = packageName == null ?
5
        ExporterPlugin.INSTANCE.getString("_UI_ArtifactFileNameCannotBeEmpty_message") :
5
        ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameCannotBeEmpty_message") :
6
        ExporterPlugin.INSTANCE.getString("_UI_ArtifactFileNameForPackageCannotBeEmpty_message", new Object []{packageName});
6
        ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameForPackageCannotBeEmpty_message", new Object []{ packageName });
7
    }
7
    }
8
    else
8
    else
9
    {
10
      message = doCheckEPackageArtifactLocation(location,
9
 if (!fileName.endsWith(".ecore") && !fileName.endsWith(".emof"))
10
    {
11
      message = packageName == null ?
12
        ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameMustEndWithEcore_message") :
11
 packageName);
13
        ImporterPlugin.INSTANCE.getString("_UI_EcoreModelFileNameForPackageMustEndWithEcore_message", new Object []{ packageName });
12
    }
14
    }
13
    
14
    if (message == null)
15
    if (message == null)
15
    {
16
    {
16
      return Diagnostic.OK_INSTANCE;
17
      return Diagnostic.OK_INSTANCE;
17
    }
18
    }
18
    else
19
    else
19
    {
20
    {
20
      return new BasicDiagnostic(Diagnostic.ERROR, ConverterPlugin.ID, ConverterUtil.ACTION_DEFAULT, message, null);
21
      return new BasicDiagnostic(Diagnostic.ERROR, ConverterPlugin.ID, ConverterUtil.ACTION_DEFAULT, message, null);
21
    }
22
    }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.6
Clones locationClones are in different classes having the same super class
Number of node comparisons6