if (that instanceof URLImageDescriptor) { URLImageDescriptor otherURLImageDescriptor = (URLImageDescriptor)that; return url.equals(otherURLImageDescriptor.url) && (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) && (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2)); } else { return false; }
if (object instanceof MappingIndicatorCompositeImage) { MappingIndicatorCompositeImage that = (MappingIndicatorCompositeImage)object; return that.mainImage == mainImage && that.overlayImage == overlayImage; } else { return false; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/ExtendedImageRegistry.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/presentation/MappingDomainLabelProvider.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (that instanceof URLImageDescriptor)
1
if (object instanceof 
2
    {
3
      URLImageDescriptor otherURLImageDescriptor = (URLImageDescriptor)that;
4
      return 
5
        url.equals(otherURLImageDescriptor.url) &&
6
          (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) &&
7
          (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2));
2
MappingIndicatorCompositeImage)
3
      {
4
        MappingIndicatorCompositeImage that = (MappingIndicatorCompositeImage)object;
5
        return that.mainImage == mainImage && that.overlayImage == overlayImage;
8
    }
6
      }
9
    else
7
      else
10
    {
8
    
9
  {
11
      return false;
10
        return false;
12
    }
11
      }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (that instanceof URLImageDescriptor)
    1
    if (that instanceof URLImageDescriptor)
    1
    if (object instanceof MappingIndicatorCompositeImage)
    Differences
    Expression1Expression2Difference
    thatobjectVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.ui.provider.URLImageDescriptororg.eclipse.emf.mapping.presentation.MappingDomainLabelProvider.MappingIndicatorCompositeImageSUBCLASS_TYPE_MISMATCH
    1
    if (object instanceof MappingIndicatorCompositeImage)
    2
    URLImageDescriptor otherURLImageDescriptor = (URLImageDescriptor)that;
    2
    URLImageDescriptor otherURLImageDescriptor = (URLImageDescriptor)that;
    2
    MappingIndicatorCompositeImage that = (MappingIndicatorCompositeImage)object;
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.edit.ui.provider.URLImageDescriptororg.eclipse.emf.mapping.presentation.MappingDomainLabelProvider.MappingIndicatorCompositeImageSUBCLASS_TYPE_MISMATCH
    otherURLImageDescriptorthatVARIABLE_NAME_MISMATCH
    org.eclipse.emf.edit.ui.provider.URLImageDescriptororg.eclipse.emf.mapping.presentation.MappingDomainLabelProvider.MappingIndicatorCompositeImageSUBCLASS_TYPE_MISMATCH
    org.eclipse.emf.edit.ui.provider.URLImageDescriptororg.eclipse.emf.mapping.presentation.MappingDomainLabelProvider.MappingIndicatorCompositeImageSUBCLASS_TYPE_MISMATCH
    thatobjectVARIABLE_NAME_MISMATCH
    2
    MappingIndicatorCompositeImage that = (MappingIndicatorCompositeImage)object;
    3
    return url.equals(otherURLImageDescriptor.url) && (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) && (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2));
    3
    return url.equals(otherURLImageDescriptor.url) && (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) && (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2));
    3
    return that.mainImage == mainImage && that.overlayImage == overlayImage;
    Differences
    Expression1Expression2Difference
    url.equals(otherURLImageDescriptor.url) && (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) && (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2))that.mainImage == mainImage && that.overlayImage == overlayImageINFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    url.equals(otherURLImageDescriptor.url)that.mainImage == mainImageINFIX_LEFT_OPERAND_MISMATCH
    (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1))that.overlayImage == overlayImageINFIX_RIGHT_OPERAND_MISMATCH
    Preondition Violations
    Expression url.equals(otherURLImageDescriptor.url) && (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) && (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.mainImage == mainImage && that.overlayImage == overlayImage cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return that.mainImage == mainImage && that.overlayImage == overlayImage;
    else
    else
    4
    return false;
    4
    return false;
    Precondition Violations (2)
    Row Violation
    1Expression url.equals(otherURLImageDescriptor.url) && (key1 == null ? otherURLImageDescriptor.key1 == null : key1.equals(otherURLImageDescriptor.key1)) && (key2 == null ? otherURLImageDescriptor.key2 == null : key2.equals(otherURLImageDescriptor.key2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.mainImage == mainImage && that.overlayImage == overlayImage cannot be parameterized, because it has dependencies to/from statements that will be extracted