try { if (marker.getType().equals(EValidator.MARKER)) { String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); if (uriAttribute != null) { URI uri = URI.createURI(uriAttribute); EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); if (eObject != null) { setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); } } } } catch (CoreException exception) { EcoreEditorPlugin.INSTANCE.log(exception); } setSelectionToViewer(markerHelper.getTargetObjects(editingDomain, marker));
try { if (marker.getType().equals(EValidator.MARKER)) { String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null); if (uriAttribute != null) { URI uri = URI.createURI(uriAttribute); EObject eObject = editingDomain.getResourceSet().getEObject(uri, true); if (eObject != null) { setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject))); } } } } catch (CoreException exception) { Ecore2XMLUIPlugin.INSTANCE.log(exception); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLEditor.java
Method name: void gotoMarker(IMarker) Method name: void gotoMarker(IMarker)
Number of AST nodes: 9 Number of AST nodes: 8
1
try
1
try
2
    {
2
    {
3
      if (marker.getType().equals(EValidator.MARKER))
3
      if (marker.getType().equals(EValidator.MARKER))
4
      {
4
      {
5
        String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
5
        String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
6
        if (uriAttribute != null)
6
        if (uriAttribute != null)
7
        {
7
        {
8
          URI uri = URI.createURI(uriAttribute);
8
          URI uri = URI.createURI(uriAttribute);
9
          EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
9
          EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
10
          if (eObject != null)
10
          if (eObject != null)
11
          {
11
          {
12
            setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
12
            setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
13
          }
13
          }
14
        }
14
        }
15
      }
15
      }
16
    }
16
    }
17
    catch (CoreException exception)
17
    catch (CoreException exception)
18
    {
18
    {
19
      EcoreEditorPlugin.INSTANCE.log(exception);
19
      Ecore2XMLUIPlugin.INSTANCE.log(exception);
20
    }
20
    }
21
    setSelectionToViewer(markerHelper.getTargetObjects(editingDomain, marker));
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
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 comparisons18
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    1
    try
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.presentation.EcoreEditorPluginorg.eclipse.emf.mapping.ecore2xml.ui.Ecore2XMLUIPluginSUBCLASS_TYPE_MISMATCH
    1
    try
    3
    if (marker.getType().equals(EValidator.MARKER))
    2
    if (marker.getType().equals(EValidator.MARKER))
    4
    String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
    3
    String uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);
    5
    if (uriAttribute != null)
    4
    if (uriAttribute != null)
    6
    URI uri = URI.createURI(uriAttribute);
    5
    URI uri = URI.createURI(uriAttribute);
    7
    EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
    6
    EObject eObject = editingDomain.getResourceSet().getEObject(uri, true);
    8
    if (eObject != null)
    7
    if (eObject != null)
    9
    setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
    8
    setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));
    Precondition Violations (0)
    Row Violation