if (null != expandedDname) { throw new BuildException("DName sub-element can only be " + "specified once."); } if (null != dname) { throw new BuildException("It is not possible to specify dname " + " both as attribute and element."); } expandedDname = new DistinguishedName(); return expandedDname;
if (change != null) { P4CmdOpts = "-c " + change; } if (P4View == null) { throw new BuildException("No view specified to edit"); } execP4Command("-s edit " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler(this));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/GenerateKey.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/perforce/P4Edit.java
Method name: DistinguishedName createDname() Method name: void execute()
Number of AST nodes: 6 Number of AST nodes: 5
1
if (null != expandedDname) {
1
if (
2
            throw new BuildException("DName sub-element can only be "
3
                                     + "specified once.")
2
change != null) {
4
;
3
            P4CmdOpts = "-c " + change;
5
        }
4
        }
6
        if (null != dname) {
5
        if (P4View == null) {
7
            throw new BuildException("It is not possible to specify dname "
6
            throw new BuildException("
8
                                    + " both as attribute and element.");
9
        }
10
        expandedDname = new DistinguishedName();
11
        return expandedDname
7
No view specified to edit");
8
        }
12
;
9
        execP4Command("-s edit " + P4CmdOpts + " " + P4View, new SimpleP4OutputHandler(this));
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (null != expandedDname)
    1
    if (null != expandedDname)
    1
    if (change != null)
    Differences
    Expression1Expression2Difference
    nullchangeTYPE_COMPATIBLE_REPLACEMENT
    expandedDnamenullTYPE_COMPATIBLE_REPLACEMENT
    1
    if (change != null)
                                                            
    2
    P4CmdOpts = "-c " + change;
    2
    throw new BuildException("DName sub-element can only be " + "specified once.");
    2
    throw new BuildException("DName sub-element can only be " + "specified once.");
    Preondition Violations
    Unmatched throw new BuildException("DName sub-element can only be " + "specified once.");
                                                                                                                                                                        
    Precondition Violations (1)
    Row Violation
    1Unmatched throw new BuildException("DName sub-element can only be " + "specified once.");