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;
String attributeValue = getAttributeValue("Ecore", "xmlFeatureKind"); if (attributeValue != null) { Matcher matcher = FEATURE_VALUE_PATTERN.matcher(attributeValue); if (matcher.matches()) { return Integer.parseInt(matcher.group(1)); } } return 0;
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 getVisibility() Method name: int getXMLFeatureKind()
Number of AST nodes: 6 Number of AST nodes: 6
1
String attributeValue = getAttributeValue("Ecore", "visibility");
1
String attributeValue = getAttributeValue("Ecore", "xmlFeatureKind");
2
    if (attributeValue != null)
2
    if (attributeValue != null)
3
    {
3
    {
4
      Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue);
4
      Matcher matcher = FEATURE_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 VISIBILITY_UNSPECIFIED;
10
    return 0;
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.1
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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    String attributeValue = getAttributeValue("Ecore", "visibility");
    1
    String attributeValue = getAttributeValue("Ecore", "visibility");
    1
    String attributeValue = getAttributeValue("Ecore", "xmlFeatureKind");
    Differences
    Expression1Expression2Difference
    "visibility""xmlFeatureKind"LITERAL_VALUE_MISMATCH
    1
    String attributeValue = getAttributeValue("Ecore", "xmlFeatureKind");
    2
    if (attributeValue != null)
    2
    if (attributeValue != null)
    3
    Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue);
    3
    Matcher matcher = VISIBILITY_VALUE_PATTERN.matcher(attributeValue);
    3
    Matcher matcher = FEATURE_VALUE_PATTERN.matcher(attributeValue);
    Differences
    Expression1Expression2Difference
    VISIBILITY_VALUE_PATTERNFEATURE_VALUE_PATTERNVARIABLE_NAME_MISMATCH
    3
    Matcher matcher = FEATURE_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 VISIBILITY_UNSPECIFIED;
    6
    return VISIBILITY_UNSPECIFIED;
    6
    return 0;
    Differences
    Expression1Expression2Difference
    VISIBILITY_UNSPECIFIED0TYPE_COMPATIBLE_REPLACEMENT
    6
    return 0;
    Precondition Violations (0)
    Row Violation