int length = entities.size(); boolean result = length >= 1; if (!result && diagnostics != null) reportMinLengthViolation(XMLTypePackage.Literals.ENTITIES, entities, length, 1, diagnostics, context); return result;
int length = idrefs.size(); boolean result = length >= 1; if (!result && diagnostics != null) reportMinLengthViolation(XMLTypePackage.Literals.IDREFS, idrefs, length, 1, diagnostics, context); return result;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeValidator.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/util/XMLTypeValidator.java
Method name: boolean validateENTITIES_MinLength(List, DiagnosticChain, Map) Method name: boolean validateIDREFS_MinLength(List, DiagnosticChain, Map)
Number of AST nodes: 5 Number of AST nodes: 5
1
int length = entities.size();
1
int length = idrefs.size();
2
    boolean result = length >= 1;
2
    boolean result = length >= 1;
3
    if (!result && diagnostics != null)
3
    if (!result && diagnostics != null)
4
      reportMinLengthViolation(XMLTypePackage.Literals.ENTITIES, entities, length, 1, diagnostics, context);
4
      reportMinLengthViolation(XMLTypePackage.Literals.IDREFS, idrefs, length, 1, diagnostics, context);
5
    return result;
5
    return result;
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.2
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int length = entities.size();
    1
    int length = entities.size();
    1
    int length = idrefs.size();
    Differences
    Expression1Expression2Difference
    entitiesidrefsVARIABLE_NAME_MISMATCH
    java.util.List<>java.util.List<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<> of variable entities does not match with type java.util.List<> of variable idrefs
    • Make classes java.util.List<> and java.util.List<> extend a common superclass
    1
    int length = idrefs.size();
    2
    boolean result = length >= 1;
    2
    boolean result = length >= 1;
    3
    if (!result && diagnostics != null)
    3
    if (!result && diagnostics != null)
    4
    reportMinLengthViolation(XMLTypePackage.Literals.ENTITIES, entities, length, 1, diagnostics, context);
    4
    reportMinLengthViolation(XMLTypePackage.Literals.ENTITIES, entities, length, 1, diagnostics, context);
    4
    reportMinLengthViolation(XMLTypePackage.Literals.IDREFS, idrefs, length, 1, diagnostics, context);
    Differences
    Expression1Expression2Difference
    ENTITIESIDREFSVARIABLE_NAME_MISMATCH
    entitiesidrefsVARIABLE_NAME_MISMATCH
    java.util.List<>java.util.List<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<> of variable entities does not match with type java.util.List<> of variable idrefs
    • Make classes java.util.List<> and java.util.List<> extend a common superclass
    4
    reportMinLengthViolation(XMLTypePackage.Literals.IDREFS, idrefs, length, 1, diagnostics, context);
    5
    return result;
    5
    return result;
    Precondition Violations (2)
    Row Violation
    1Type java.util.List<> of variable entities does not match with type java.util.List<> of variable idrefs
    2Type java.util.List<> of variable entities does not match with type java.util.List<> of variable idrefs