DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir); // register all the DTDs, both the ones that are known and // any supplied by the user handler.registerDTD(PUBLICID_EJB11, ejb11DTD); for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) { EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation) i.next(); handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation()); } return handler;
DescriptorHandler h = new DescriptorHandler(getTask(), srcDir); registerKnownDTDs(h); // register any DTDs supplied by the user for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) { EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation) i.next(); h.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation()); } return h;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
Method name: DescriptorHandler getDescriptorHandler(File) Method name: DescriptorHandler getDescriptorHandler(File)
Number of AST nodes: 6 Number of AST nodes: 6
1
DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir);
1
DescriptorHandler h = new DescriptorHandler(getTask(), srcDir);
2
 
3
       // register all the DTDs, both the ones that are known and
2
        register
4
        // any supplied by the user
5
        handler.registerDTD(PUBLICID_EJB11, ejb11DTD);
3
KnownDTDs(h);
4
        // register any DTDs supplied by the user
6
        for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
5
        for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
7
            EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation) i.next();
6
            EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation) i.next();
8
            handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
7
            h.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
9
        }
8
        }
10
        return handler;
9
        return h;
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 in different classes having the same super class
Number of node comparisons15
  1. {Non-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)7.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir);
    1
    DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir);
    1
    DescriptorHandler h = new DescriptorHandler(getTask(), srcDir);
    Differences
    Expression1Expression2Difference
    handlerhVARIABLE_NAME_MISMATCH
    1
    DescriptorHandler h = new DescriptorHandler(getTask(), srcDir);
    2
    handler.registerDTD(PUBLICID_EJB11, ejb11DTD);
    2
    handler.registerDTD(PUBLICID_EJB11, ejb11DTD);
    2
    registerKnownDTDs(h);
    Differences
    Expression1Expression2Difference
    registerDTDregisterKnownDTDsMETHOD_INVOCATION_NAME_MISMATCH
    handler.registerDTD(PUBLICID_EJB11,ejb11DTD)registerKnownDTDs(h)ARGUMENT_NUMBER_MISMATCH
    handlerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression registerKnownDTDs(h) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) is a void method call, and thus it cannot be parameterized
    Expression registerKnownDTDs(h) is a void method call, and thus it cannot be parameterized
    Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression registerKnownDTDs(h) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) is a void method call, and thus it cannot be parameterized
    Expression registerKnownDTDs(h) is a void method call, and thus it cannot be parameterized
    2
    registerKnownDTDs(h);
    3
    for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext(); )
    3
    for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext(); )
    4
    EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next();
    4
    EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next();
    5
    handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
    5
    handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
    5
    h.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
    Differences
    Expression1Expression2Difference
    handlerhVARIABLE_NAME_MISMATCH
    5
    h.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
    6
    return handler;
    6
    return handler;
    6
    return h;
    Differences
    Expression1Expression2Difference
    handlerhVARIABLE_NAME_MISMATCH
    6
    return h;
    Precondition Violations (8)
    Row Violation
    1Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression registerKnownDTDs(h) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) is a void method call, and thus it cannot be parameterized
    4Expression registerKnownDTDs(h) is a void method call, and thus it cannot be parameterized
    5Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression registerKnownDTDs(h) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression handler.registerDTD(PUBLICID_EJB11,ejb11DTD) is a void method call, and thus it cannot be parameterized
    8Expression registerKnownDTDs(h) is a void method call, and thus it cannot be parameterized