if (instanceValue == null) return null; if (instanceValue.isEmpty()) return ""; StringBuffer result = new StringBuffer(); for (Object item : instanceValue) { result.append(convertENTITY((String)item)); result.append(' '); } return result.substring(0, result.length() - 1);
if (instanceValue == null) return null; if (instanceValue.isEmpty()) return ""; StringBuffer result = new StringBuffer(); for (Object item : instanceValue) { result.append(convertIDREF((String)item)); result.append(' '); } return result.substring(0, result.length() - 1);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/XMLTypeFactoryImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xml/type/impl/XMLTypeFactoryImpl.java
Method name: String convertENTITIESBase(List) Method name: String convertIDREFSBase(List)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (instanceValue == null) return null;
1
if (instanceValue == null) return null;
2
    if (instanceValue.isEmpty()) return "";
2
    if (instanceValue.isEmpty()) return "";
3
    StringBuffer result = new StringBuffer();
3
    StringBuffer result = new StringBuffer();
4
    for (Object item : instanceValue)
4
    for (Object item : instanceValue)
5
    {
5
    {
6
      result.append(convertENTITY((String)item));
6
      result.append(convertIDREF((String)item));
7
      result.append(' ');
7
      result.append(' ');
8
    }
8
    }
9
    return result.substring(0, result.length() - 1);
9
    return result.substring(0, result.length() - 1);
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 declared in the same class
Number of node comparisons18
  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)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (instanceValue == null)
    1
    if (instanceValue == null)
    1
    if (instanceValue == null)
    Differences
    Expression1Expression2Difference
    java.util.List<>java.util.List<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<> of variable instanceValue does not match with type java.util.List<> of variable instanceValue
    • Make classes java.util.List<> and java.util.List<> extend a common superclass
    1
    if (instanceValue == null)
    2
    return null;
    2
    return null;
    3
    if (instanceValue.isEmpty())
    3
    if (instanceValue.isEmpty())
    3
    if (instanceValue.isEmpty())
    Differences
    Expression1Expression2Difference
    java.util.List<>java.util.List<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<> of variable instanceValue does not match with type java.util.List<> of variable instanceValue
    • Make classes java.util.List<> and java.util.List<> extend a common superclass
    3
    if (instanceValue.isEmpty())
    4
    return "";
    4
    return "";
    Precondition Violations (2)
    Row Violation
    1Type java.util.List<> of variable instanceValue does not match with type java.util.List<> of variable instanceValue
    2Type java.util.List<> of variable instanceValue does not match with type java.util.List<> of variable instanceValue