1165-5-6

String label = ((FeatureMapEntry)object).getFeatureName(); return label == null || label.length() == 0 ? getString("_UI_FeatureMapEntry_type") : getString("_UI_FeatureMapEntry_type") + " " + label;
String label = ((XMLMap)object).getIDAttributeName(); return label == null || label.length() == 0 ? getString("_UI_XMLMap_type") : //$NON-NLS-1$ getString("_UI_XMLMap_type") + " " + label;

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/provider/FeatureMapEntryItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/provider/XMLMapItemProvider.java
Method name: `String getText(Object)` |  | Method name: `String getText(Object)`
Number of AST nodes: 2 |  | Number of AST nodes: 2

1

    String label = ((FeatureMapEntry)object).getFeatureName();↵

1

    String label = ((XMLMap)object).getIDAttributeName();↵

2

        return label == null || label.length() == 0 ?↵

2

        return label == null || label.length() == 0 ?↵

3

          getString("_UI_FeatureMapEntry_type") :↵

3

          getString("_UI_XMLMap_type") : //$NON-NLS-1$↵

4

          getString("_UI_FeatureMapEntry_type") + " " + label;

4

          getString("_UI_XMLMap_type") + " " + label;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 4

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 2
   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) | 0.0
   Clone type | Type 2

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       String label = ((FeatureMapEntry)object).getFeatureName();

   1 | String label = ((FeatureMapEntry)object).getFeatureName();
   1 | String label = ((XMLMap)object).getIDAttributeName();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   getFeatureName | getIDAttributeName | METHOD_INVOCATION_NAME_MISMATCH
   org.eclipse.emf.ecore.change.FeatureMapEntry | org.eclipse.emf.mapping.ecore2xml.XMLMap | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.eclipse.emf.ecore.change.FeatureMapEntry of variable (FeatureMapEntry)object does not match with type org.eclipse.emf.mapping.ecore2xml.XMLMap of variable (XMLMap)object
   - Make classes org.eclipse.emf.ecore.change.FeatureMapEntry and org.eclipse.emf.mapping.ecore2xml.XMLMap extend a common superclass

   1

       String label = ((XMLMap)object).getIDAttributeName();

   2

       return label == null || label.length() == 0 ? getString("_UI_FeatureMapEntry_type") : getString("_UI_FeatureMapEntry_type") + " " + label;

   2 | return label == null || label.length() == 0 ? getString("_UI_FeatureMapEntry_type") : getString("_UI_FeatureMapEntry_type") + " " + label;
   2 | return label == null || label.length() == 0 ? getString("_UI_XMLMap_type") : getString("_UI_XMLMap_type") + " " + label;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   "_UI_FeatureMapEntry_type" | "_UI_XMLMap_type" | LITERAL_VALUE_MISMATCH
   "_UI_FeatureMapEntry_type" | "_UI_XMLMap_type" | LITERAL_VALUE_MISMATCH

   2

       return label == null || label.length() == 0 ? getString("_UI_XMLMap_type") : getString("_UI_XMLMap_type") + " " + label;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Type org.eclipse.emf.ecore.change.FeatureMapEntry of variable (FeatureMapEntry)object does not match with type org.eclipse.emf.mapping.ecore2xml.XMLMap of variable (XMLMap)object