String attributeValue = getAttributeValue("Ecore", "xmlContentKind"); if (attributeValue != null) { Matcher matcher = CONTENT_VALUE_PATTERN.matcher(attributeValue); if (matcher.matches()) { return Integer.parseInt(matcher.group(1)); } } return 0;
String attributeValue = getAttributeValue("Ecore", "visibility"); if (attributeValue != null) { Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue); if (matcher.matches()) { return Integer.parseInt(matcher.group(1)); } } return VISIBILITY_UNSPECIFIED;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseNode.java File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/parser/RoseNode.java
Method name: int getXMLContentKind() Method name: int getVisibility()
Number of AST nodes: 6 Number of AST nodes: 6
1
String attributeValue = getAttributeValue("Ecore", "xmlContentKind");
1
String attributeValue = getAttributeValue("Ecore", "visibility");
2
    if (attributeValue != null)
2
    if (attributeValue != null)
3
    {
3
    {
4
      Matcher matcher = CONTENT_VALUE_PATTERN.matcher(attributeValue);
4
      Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue);
5
      if (matcher.matches())
5
      if (matcher.matches())
6
      {
6
      {
7
        return Integer.parseInt(matcher.group(1));
7
        return Integer.parseInt(matcher.group(1));
8
      }
8
      }
9
    }
9
    }
10
    return 0;
10
    return VISIBILITY_UNSPECIFIED;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String attributeValue = getAttributeValue("Ecore", "xmlContentKind");
    1
    String attributeValue = getAttributeValue("Ecore", "xmlContentKind");
    1
    String attributeValue = getAttributeValue("Ecore", "visibility");
    Differences
    Expression1Expression2Difference
    "xmlContentKind""visibility"LITERAL_VALUE_MISMATCH
    1
    String attributeValue = getAttributeValue("Ecore", "visibility");
    2
    if (attributeValue != null)
    2
    if (attributeValue != null)
    3
    Matcher matcher = CONTENT_VALUE_PATTERN.matcher(attributeValue);
    3
    Matcher matcher = CONTENT_VALUE_PATTERN.matcher(attributeValue);
    3
    Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue);
    Differences
    Expression1Expression2Difference
    CONTENT_VALUE_PATTERNVISIBILITY_VALUE_PATTERNVARIABLE_NAME_MISMATCH
    3
    Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue);
    4
    if (matcher.matches())
    4
    if (matcher.matches())
    5
    return Integer.parseInt(matcher.group(1));
    5
    return Integer.parseInt(matcher.group(1));
    6
    return 0;
    6
    return 0;
    6
    return VISIBILITY_UNSPECIFIED;
    Differences
    Expression1Expression2Difference
    0VISIBILITY_UNSPECIFIEDTYPE_COMPATIBLE_REPLACEMENT
    6
    return VISIBILITY_UNSPECIFIED;
    Precondition Violations (0)
    Row Violation