if (null == libraryFile && extensionFileSets.isEmpty()) { final String message = "File attribute not specified."; throw new BuildException(message); } if (null != libraryFile && !libraryFile.exists()) { final String message = "File '" + libraryFile + "' does not exist."; throw new BuildException(message); } if (null != libraryFile && !libraryFile.isFile()) { final String message = "\'" + libraryFile + "\' is not a file."; throw new BuildException(message); }
if (null == libraryFile && libraryFileSets.isEmpty()) { final String message = "File attribute not specified."; throw new BuildException(message); } if (null != libraryFile && !libraryFile.exists()) { final String message = "File '" + libraryFile + "' does not exist."; throw new BuildException(message); } if (null != libraryFile && !libraryFile.isFile()) { final String message = "\'" + libraryFile + "\' is not a file."; throw new BuildException(message); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/JarLibAvailableTask.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/extension/JarLibDisplayTask.java
Method name: void validate() Method name: void validate()
Number of AST nodes: 9 Number of AST nodes: 9
1
if (null == libraryFile && extensionFileSets.isEmpty()) {
1
if (null == libraryFile && libraryFileSets.isEmpty()) {
2
            final String message = "File attribute not specified.";
2
            final String message = "File attribute not specified.";
3
            throw new BuildException(message);
3
            throw new BuildException(message);
4
        }
4
        }
5
        if (null != libraryFile && !libraryFile.exists()) {
5
        if (null != libraryFile && !libraryFile.exists()) {
6
            final String message = "File '" + libraryFile + "' does not exist.";
6
            final String message = "File '" + libraryFile + "' does not exist.";
7
            throw new BuildException(message);
7
            throw new BuildException(message);
8
        }
8
        }
9
        if (null != libraryFile && !libraryFile.isFile()) {
9
        if (null != libraryFile && !libraryFile.isFile()) {
10
            final String message = "\'" + libraryFile + "\' is not a file.";
10
            final String message = "\'" + libraryFile + "\' is not a file.";
11
            throw new BuildException(message);
11
            throw new BuildException(message);
12
        }
12
        }
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)1.3
Clones locationClones are in different classes having the same super class
Number of node comparisons57
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (null == libraryFile && extensionFileSets.isEmpty())
    4
    if (null == libraryFile && extensionFileSets.isEmpty())
    1
    if (null == libraryFile && libraryFileSets.isEmpty())
    Differences
    Expression1Expression2Difference
    extensionFileSetslibraryFileSetsVARIABLE_NAME_MISMATCH
    1
    if (null == libraryFile && libraryFileSets.isEmpty())
    5
    final String message = "File attribute not specified.";
    2
    final String message = "File attribute not specified.";
    6
    throw new BuildException(message);
    3
    throw new BuildException(message);
    7
    if (null != libraryFile && !libraryFile.exists())
    4
    if (null != libraryFile && !libraryFile.exists())
    8
    final String message = "File '" + libraryFile + "' does not exist.";
    5
    final String message = "File '" + libraryFile + "' does not exist.";
    9
    throw new BuildException(message);
    6
    throw new BuildException(message);
    10
    if (null != libraryFile && !libraryFile.isFile())
    7
    if (null != libraryFile && !libraryFile.isFile())
    11
    final String message = "\'" + libraryFile + "\' is not a file.";
    8
    final String message = "\'" + libraryFile + "\' is not a file.";
    12
    throw new BuildException(message);
    9
    throw new BuildException(message);
    Precondition Violations (0)
    Row Violation