Object setter = attributeSetters.get(attributeName); if (setter == null) { throw new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \"" + attributeName + "\" attribute.", attributeName); }
Object creator = nestedCreators.get(elementName); if (creator == null) { throw new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \"" + elementName + "\" element.", elementName); }
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 getAttributeMethod(String) Method name: Method getElementMethod(String)
Number of AST nodes: 3 Number of AST nodes: 3
1
Object setter = attributeSetters.get(attributeName);
1
Object creator = nestedCreators.get(elementName);
2
        if (setter == null) {
2
        if (creator == null) {
3
            throw new UnsupportedAttributeException("Class "
3
            throw new UnsupportedElementException("Class "
4
                + bean.getName() + " doesn't support the \""
4
                + bean.getName() + " doesn't support the nested \""
5
                + attributeName + "\" attribute.", attributeName);
5
                + elementName + "\" element.", elementName);
6
        }
6
        }
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 comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Object setter = attributeSetters.get(attributeName);
    1
    Object setter = attributeSetters.get(attributeName);
    1
    Object creator = nestedCreators.get(elementName);
    Differences
    Expression1Expression2Difference
    settercreatorVARIABLE_NAME_MISMATCH
    attributeNameelementNameVARIABLE_NAME_MISMATCH
    attributeSettersnestedCreatorsVARIABLE_NAME_MISMATCH
    1
    Object creator = nestedCreators.get(elementName);
    2
    if (setter == null)
    2
    if (setter == null)
    2
    if (creator == null)
    Differences
    Expression1Expression2Difference
    settercreatorVARIABLE_NAME_MISMATCH
    2
    if (creator == null)
    3
    throw new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \"" + attributeName + "\" attribute.", attributeName);
    3
    throw new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \"" + attributeName + "\" attribute.", attributeName);
    3
    throw new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \"" + elementName + "\" element.", elementName);
    Differences
    Expression1Expression2Difference
    org.apache.tools.ant.UnsupportedAttributeExceptionorg.apache.tools.ant.UnsupportedElementExceptionSUBCLASS_TYPE_MISMATCH
    " doesn't support the \""" doesn't support the nested \""LITERAL_VALUE_MISMATCH
    attributeNameelementNameVARIABLE_NAME_MISMATCH
    "\" attribute.""\" element."LITERAL_VALUE_MISMATCH
    attributeNameelementNameVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \""+ attributeName+ "\" attribute.",attributeName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \""+ elementName+ "\" element.",elementName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    throw new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \"" + elementName + "\" element.", elementName);
    Precondition Violations (2)
    Row Violation
    1Expression new UnsupportedAttributeException("Class " + bean.getName() + " doesn't support the \""+ attributeName+ "\" attribute.",attributeName) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new UnsupportedElementException("Class " + bean.getName() + " doesn't support the nested \""+ elementName+ "\" element.",elementName) cannot be parameterized, because it has dependencies to/from statements that will be extracted