DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir) { protected void processElement() { if (currentElement.equals("type-storage")) { // Get the filename of vendor specific descriptor String fileNameWithMETA = currentText; //trim the META_INF\ off of the file name String fileName = fileNameWithMETA.substring(META_DIR.length(), fileNameWithMETA.length()); File descriptorFile = new File(srcDir, fileName); ejbFiles.put(fileNameWithMETA, descriptorFile); } } }; handler.registerDTD(PUBLICID_BORLAND_EJB, borlandDTD == null ? DEFAULT_BAS_DTD_LOCATION : borlandDTD);
DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir) { protected void processElement() { if (currentElement.equals("type-storage")) { // Get the filename of vendor specific descriptor String fileNameWithMETA = currentText; //trim the META_INF\ off of the file name String fileName = fileNameWithMETA.substring(META_DIR.length(), fileNameWithMETA.length()); File descriptorFile = new File(srcDir, fileName); ejbFiles.put(fileNameWithMETA, descriptorFile); } } }; handler.registerDTD(PUBLICID_WEBLOGIC_EJB510, DEFAULT_WL51_DTD_LOCATION);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
Method name: DescriptorHandler getBorlandDescriptorHandler(File) Method name: DescriptorHandler getWeblogicDescriptorHandler(File)
Number of AST nodes: 2 Number of AST nodes: 2
1
DescriptorHandler handler =
1
DescriptorHandler handler =
2
            new DescriptorHandler(getTask(), srcDir) {
2
            new DescriptorHandler(getTask(), srcDir) {
3
                    protected void processElement() {
3
                protected void processElement() {
4
                        if (currentElement.equals("type-storage")) {
4
                    if (currentElement.equals("type-storage")) {
5
                            // Get the filename of vendor specific descriptor
5
                        // Get the filename of vendor specific descriptor
6
                            String fileNameWithMETA = currentText;
6
                        String fileNameWithMETA = currentText;
7
                            //trim the META_INF\ off of the file name
7
                        //trim the META_INF\ off of the file name
8
                            String fileName
8
                        String fileName
9
                                = fileNameWithMETA.substring(META_DIR.length(),
9
                             = fileNameWithMETA.substring(META_DIR.length(),
10
                                    fileNameWithMETA.length());
10
                            fileNameWithMETA.length());
11
                            File descriptorFile = new File(srcDir, fileName);
11
                        File descriptorFile = new File(srcDir, fileName);
12
                            ejbFiles.put(fileNameWithMETA, descriptorFile);
12
                        ejbFiles.put(fileNameWithMETA, descriptorFile);
13
                        }
13
                    
14
    
14
}
15
                }
15
                }
16
                };
16
            };
17
        handler.registerDTD(PUBLICID_BORLAND_EJB,
17
        handler.registerDTD(PUBLICID_
18
                            borlandDTD == null ? DEFAULT_BAS_DTD_LOCATION : borlandDTD);
18
WEBLOGIC_EJB510, DEFAULT_WL51_DTD_LOCATION);
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons4
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir) {...};
    1
    DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir) {...};
    2
    handler.registerDTD(PUBLICID_BORLAND_EJB, borlandDTD == null ? DEFAULT_BAS_DTD_LOCATION : borlandDTD);
    2
    handler.registerDTD(PUBLICID_BORLAND_EJB, borlandDTD == null ? DEFAULT_BAS_DTD_LOCATION : borlandDTD);
    2
    handler.registerDTD(PUBLICID_WEBLOGIC_EJB510, DEFAULT_WL51_DTD_LOCATION);
    Differences
    Expression1Expression2Difference
    PUBLICID_BORLAND_EJBPUBLICID_WEBLOGIC_EJB510VARIABLE_NAME_MISMATCH
    borlandDTD == null ? DEFAULT_BAS_DTD_LOCATION : borlandDTDDEFAULT_WL51_DTD_LOCATIONTYPE_COMPATIBLE_REPLACEMENT
    2
    handler.registerDTD(PUBLICID_WEBLOGIC_EJB510, DEFAULT_WL51_DTD_LOCATION);
    Precondition Violations (0)
    Row Violation