173-5-183

if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addKindPropertyDescriptor(object); addIndexPropertyDescriptor(object); addMoveToIndexPropertyDescriptor(object); addValuesPropertyDescriptor(object); } return itemPropertyDescriptors;
if (stringBuffer == null) { stringBuffer = new StringBuffer(); } stringBuffer.append(text, start, length);

Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/provider/ListChangeItemProvider.java |  | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeResourceImpl.java
Method name: `List getPropertyDescriptors(Object)` |  | Method name: `void characters(char[], int, int)`
Number of AST nodes: 7 |  | Number of AST nodes: 3

1

    if (itemPropertyDescriptors == null)↵

1

    if (stringBuffer == null)↵

2

        {↵

2

          {↵

3

          super.getPropertyDescriptors(object);↵

3

          ↵

4

          addKindPropertyDescriptor(object);↵

5

          addIndexPropertyDescriptor(object);↵

6

          addMoveToIndexPropertyDescriptor(object);↵

7

          addValuesPropertyDescriptor(object);↵

8

        }↵

9

        return itemPropertyDescriptors↵

4

      stringBuffer = new StringBuffer();↵

5

          }↵

10

    ;

6

          stringBuffer.append(text, start, length);

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.2
Clones location | Clones are in different classes
Number of node comparisons | 13

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 1
   Number of unmapped statements in the first code fragment | 6
   Number of unmapped statements in the second code fragment | 2
   Time elapsed for statement mapping (ms) | 61.0
   Clone type | Type 3

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

   1

       if (itemPropertyDescriptors == null)

   1 | if (itemPropertyDescriptors == null)
   1 | if (stringBuffer == null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   itemPropertyDescriptors | stringBuffer | VARIABLE_NAME_MISMATCH
   java.util.List | java.lang.StringBuffer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.lang.StringBuffer of variable stringBuffer
   - Make classes java.util.List and java.lang.StringBuffer extend a common superclass

   1

       if (stringBuffer == null)

   2 | stringBuffer = new StringBuffer();

   Preondition Violations
   Unmatched statement stringBuffer=new StringBuffer(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   2

       stringBuffer = new StringBuffer();

   2

       super.getPropertyDescriptors(object);

   3

       addKindPropertyDescriptor(object);

   3 | addKindPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addKindPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   4

       addIndexPropertyDescriptor(object);

   4 | addIndexPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   5

       addMoveToIndexPropertyDescriptor(object);

   5 | addMoveToIndexPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addMoveToIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   6

       addValuesPropertyDescriptor(object);

   6 | addValuesPropertyDescriptor(object);

   Preondition Violations
   Unmatched statement addValuesPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   3 | stringBuffer.append(text, start, length);

   Preondition Violations
   Unmatched statement stringBuffer.append(text,start,length); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted

   3

       stringBuffer.append(text, start, length);

   7

       return itemPropertyDescriptors;

   7 | return itemPropertyDescriptors;

   Preondition Violations
   Unmatched return itemPropertyDescriptors;

   Precondition Violations (9)
   Row | Violation
   --- | ---
   1 | Type java.util.List<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> of variable itemPropertyDescriptors does not match with type java.lang.StringBuffer of variable stringBuffer
   2 | Unmatched statement stringBuffer=new StringBuffer(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   3 | Unmatched statement addKindPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   4 | Unmatched statement addIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   5 | Unmatched statement addMoveToIndexPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   6 | Unmatched statement addValuesPropertyDescriptor(object); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   7 | Unmatched statement stringBuffer.append(text,start,length); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
   8 | Unmatched return itemPropertyDescriptors;
   9 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero