Object creator = nestedCreators.get(elementName); if (creator == null) { throw new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \"" + elementName + "\" element.", elementName); } return ((NestedCreator) creator).method;
Object setter = attributeSetters.get(attributeName); if (setter == null) { throw new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \"" + attributeName + "\" attribute.", attributeName); } return ((AttributeSetter) setter).method;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/IntrospectionHelper.java
Method name: Method getElementMethod(String) Method name: Method getAttributeMethod(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
Object creator = nestedCreators.get(elementName);
1
Object setter = attributeSetters.get(attributeName);
2
        if (creator == null) {
2
        if (setter == null) {
3
            throw new UnsupportedElementException("Class "
3
            throw new UnsupportedAttributeException("Class "
4
                + bean.getName() + " doesn't support the nested \""
4
                + bean.getName() + " doesn't support the \""
5
                + elementName + "\" element.", elementName);
5
                + attributeName + "\" attribute.", attributeName);
6
        }
6
        }
7
        return ((NestedCreator) creator).method;
7
        return ((AttributeSetter) setter).method;
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.1
Clones locationClones are declared in the same class
Number of node comparisons8
  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)1.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Object creator = nestedCreators.get(elementName);
    1
    Object creator = nestedCreators.get(elementName);
    1
    Object setter = attributeSetters.get(attributeName);
    Differences
    Expression1Expression2Difference
    creatorsetterVARIABLE_NAME_MISMATCH
    elementNameattributeNameVARIABLE_NAME_MISMATCH
    nestedCreatorsattributeSettersVARIABLE_NAME_MISMATCH
    1
    Object setter = attributeSetters.get(attributeName);
    2
    if (creator == null)
    2
    if (creator == null)
    2
    if (setter == null)
    Differences
    Expression1Expression2Difference
    creatorsetterVARIABLE_NAME_MISMATCH
    2
    if (setter == null)
    3
    throw new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \"" + elementName + "\" element.", elementName);
    3
    throw new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \"" + elementName + "\" element.", elementName);
    3
    throw new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \"" + attributeName + "\" attribute.", attributeName);
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.UnsupportedElementExceptionorg.apache.tools.ant.UnsupportedAttributeExceptionSUBCLASS_TYPE_MISMATCH
    " doesn't support the nested \""" doesn't support the \""LITERAL_VALUE_MISMATCH
    elementNameattributeNameVARIABLE_NAME_MISMATCH
    "\" element.""\" attribute."LITERAL_VALUE_MISMATCH
    elementNameattributeNameVARIABLE_NAME_MISMATCH
    3
    throw new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \"" + attributeName + "\" attribute.", attributeName);
    4
    return ((NestedCreator)creator).method;
    4
    return ((NestedCreator)creator).method;
    4
    return ((AttributeSetter)setter).method;
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.IntrospectionHelper.NestedCreatororg.apache.tools.ant.IntrospectionHelper.AttributeSetterVARIABLE_TYPE_MISMATCH
    creatorsetterVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression (NestedCreator)creator cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (AttributeSetter)setter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.apache.tools.ant.IntrospectionHelper.NestedCreator of variable (NestedCreator)creator does not match with type org.apache.tools.ant.IntrospectionHelper.AttributeSetter of variable (AttributeSetter)setter
    • Make classes org.apache.tools.ant.IntrospectionHelper.NestedCreator and org.apache.tools.ant.IntrospectionHelper.AttributeSetter extend a common superclass
    4
    return ((AttributeSetter)setter).method;
    Precondition Violations (3)
    Row Violation
    1Expression (NestedCreator)creator cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression (AttributeSetter)setter cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.apache.tools.ant.IntrospectionHelper.NestedCreator of variable (NestedCreator)creator does not match with type org.apache.tools.ant.IntrospectionHelper.AttributeSetter of variable (AttributeSetter)setter