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); }
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); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
Method name: void processElement() Method name: void processElement()
Number of AST nodes: 5 Number of AST nodes: 5
1
if (currentElement.equals("type-storage")) {
1
if (currentElement.equals("type-storage")) {
2
                        // Get the filename of vendor specific descriptor
2
                            // Get the filename of vendor specific descriptor
3
                        String fileNameWithMETA = currentText;
3
                            String fileNameWithMETA = currentText;
4
                        //trim the META_INF\ off of the file name
4
                            //trim the META_INF\ off of the file name
5
                        String fileName
5
                            String fileName
6
                             = fileNameWithMETA.substring(META_DIR.length(),
6
                                = fileNameWithMETA.substring(META_DIR.length(),
7
                            fileNameWithMETA.length());
7
                                    fileNameWithMETA.length());
8
                        File descriptorFile = new File(srcDir, fileName);
8
                            File descriptorFile = new File(srcDir, fileName);
9
                        ejbFiles.put(fileNameWithMETA, descriptorFile);
9
                            ejbFiles.put(fileNameWithMETA, descriptorFile);
10
                    }
10
                        }
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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.1
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (currentElement.equals("type-storage"))
    1
    if (currentElement.equals("type-storage"))
    2
    String fileNameWithMETA = currentText;
    2
    String fileNameWithMETA = currentText;
    3
    String fileName = fileNameWithMETA.substring(META_DIR.length(), fileNameWithMETA.length());
    3
    String fileName = fileNameWithMETA.substring(META_DIR.length(), fileNameWithMETA.length());
    4
    File descriptorFile = new File(srcDir, fileName);
    4
    File descriptorFile = new File(srcDir, fileName);
    5
    ejbFiles.put(fileNameWithMETA, descriptorFile);
    5
    ejbFiles.put(fileNameWithMETA, descriptorFile);
    Precondition Violations (0)
    Row Violation