AdapterFactory factory = adapterFactories.get(i); if (factory.isFactoryForType(type)) { return factory; }
EStructuralFeature result = allAttributes.get(i); if (matches(getWildcards(result), namespace)) { return result; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: AdapterFactory getAdapterFactory(List, Object) Method name: EStructuralFeature getAttributeWildcardAffiliation(EClass, String, String)
Number of AST nodes: 3 Number of AST nodes: 3
1
AdapterFactory factory = adapterFactories.get(i);
2
      if (factory.isFactoryForType(typ
1
EStructuralFeature result = allAttributes.get(i);
3
e))
2
      if (matches(getWildcards(result), namespace))
4
      {
3
      {
5
        return factory;
4
        return result;
6
      }
5
      }
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.3
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    AdapterFactory factory = adapterFactories.get(i);
    2
    AdapterFactory factory = adapterFactories.get(i);
    Preondition Violations
    Unmatched statement AdapterFactory factory=adapterFactories.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                        
                                                                                                        
    3
    EStructuralFeature result = allAttributes.get(i);
    Preondition Violations
    Unmatched statement EStructuralFeature result=allAttributes.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    EStructuralFeature result = allAttributes.get(i);
    3
    if (factory.isFactoryForType(type))
    3
    if (factory.isFactoryForType(type))
    4
    if (matches(getWildcards(result), namespace))
    Differences
    Expression1Expression2Difference
    isFactoryForTypematchesMETHOD_INVOCATION_NAME_MISMATCH
    factory.isFactoryForType(type)matches(getWildcards(result),namespace)ARGUMENT_NUMBER_MISMATCH
    factoryMISSING_METHOD_INVOCATION_EXPRESSION
    4
    if (matches(getWildcards(result), namespace))
    4
    return factory;
    4
    return factory;
    Preondition Violations
    Unmatched return factory;
                                        
                                      
    5
    return result;
    Preondition Violations
    Unmatched return result;
    5
    return result;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement AdapterFactory factory=adapterFactories.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement EStructuralFeature result=allAttributes.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched return factory;
    4Unmatched return result;