if (dest == null) { String msg = "The destination directory must be specified using " + "the \"dest\" attribute."; throw new BuildException(msg, getLocation()); } if ((!dest.exists()) || (!dest.isDirectory())) { String msg = "The destination directory (" + dest + ") was not " + "found or isn't a directory."; throw new BuildException(msg, getLocation()); }
if (ejbdescriptor == null) { String msg = "The standard EJB descriptor must be specified using " + "the \"ejbdescriptor\" attribute."; throw new BuildException(msg, getLocation()); } if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile())) { String msg = "The standard EJB descriptor (" + ejbdescriptor + ") was not found or isn't a file."; throw new BuildException(msg, getLocation()); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbcTask.java
Method name: void checkConfiguration() Method name: void checkConfiguration()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (dest == null) {
1
if (ejbdescriptor == null) {
2
            String msg = "The destination directory must be specified using "
2
            String msg = "The standard EJB descriptor must be specified using "
3
                            + "the \"dest\" attribute.";
3
                            + "the \"ejbdescriptor\" attribute.";
4
            throw new BuildException(msg, getLocation());
4
            throw new BuildException(msg, getLocation());
5
        }
5
        }
6
        if ((!dest.exists()) || (!dest.isDirectory())) {
6
        if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile())) {
7
            String msg = "The destination directory (" + dest + ") was not "
7
            String msg = "The standard EJB descriptor (" + ejbdescriptor
8
                            + "found or isn't a directory.";
8
                            + ") was not found or isn't a file.";
9
            throw new BuildException(msg, getLocation());
9
            throw new BuildException(msg, getLocation());
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 the same method
Number of node comparisons20
  1. {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)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    if (dest == null)
    13
    if (dest == null)
    1
    if (ejbdescriptor == null)
    Differences
    Expression1Expression2Difference
    destejbdescriptorVARIABLE_NAME_MISMATCH
    1
    if (ejbdescriptor == null)
    14
    String msg = "The destination directory must be specified using " + "the \"dest\" attribute.";
    14
    String msg = "The destination directory must be specified using " + "the \"dest\" attribute.";
    2
    String msg = "The standard EJB descriptor must be specified using " + "the \"ejbdescriptor\" attribute.";
    Differences
    Expression1Expression2Difference
    "The destination directory must be specified using ""The standard EJB descriptor must be specified using "LITERAL_VALUE_MISMATCH
    "the \"dest\" attribute.""the \"ejbdescriptor\" attribute."LITERAL_VALUE_MISMATCH
    2
    String msg = "The standard EJB descriptor must be specified using " + "the \"ejbdescriptor\" attribute.";
    15
    throw new BuildException(msg, getLocation());
    3
    throw new BuildException(msg, getLocation());
    16
    if ((!dest.exists()) || (!dest.isDirectory()))
    16
    if ((!dest.exists()) || (!dest.isDirectory()))
    4
    if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile()))
    Differences
    Expression1Expression2Difference
    destejbdescriptorVARIABLE_NAME_MISMATCH
    isDirectoryisFileMETHOD_INVOCATION_NAME_MISMATCH
    destejbdescriptorVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression dest.isDirectory() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ejbdescriptor.isFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    if ((!ejbdescriptor.exists()) || (!ejbdescriptor.isFile()))
    17
    String msg = "The destination directory (" + dest + ") was not " + "found or isn't a directory.";
    17
    String msg = "The destination directory (" + dest + ") was not " + "found or isn't a directory.";
    5
    String msg = "The standard EJB descriptor (" + ejbdescriptor + ") was not found or isn't a file.";
    Differences
    Expression1Expression2Difference
    "The destination directory (""The standard EJB descriptor ("LITERAL_VALUE_MISMATCH
    destejbdescriptorVARIABLE_NAME_MISMATCH
    "The destination directory (" + dest + ") was not "+ "found or isn't a directory.""The standard EJB descriptor (" + ejbdescriptor + ") was not found or isn't a file."INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression "The destination directory (" + dest + ") was not "+ "found or isn't a directory." cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression "The standard EJB descriptor (" + ejbdescriptor + ") was not found or isn't a file." cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    String msg = "The standard EJB descriptor (" + ejbdescriptor + ") was not found or isn't a file.";
    18
    throw new BuildException(msg, getLocation());
    6
    throw new BuildException(msg, getLocation());
    Precondition Violations (4)
    Row Violation
    1Expression dest.isDirectory() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ejbdescriptor.isFile() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression "The destination directory (" + dest + ") was not "+ "found or isn't a directory." cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression "The standard EJB descriptor (" + ejbdescriptor + ") was not found or isn't a file." cannot be parameterized, because it has dependencies to/from statements that will be extracted