if (provider != null) { try { messageDigest = MessageDigest.getInstance(algorithm, provider); } catch (NoSuchAlgorithmException noalgo) { throw new BuildException(noalgo, getLocation()); } catch (NoSuchProviderException noprovider) { throw new BuildException(noprovider, getLocation()); } } else { try { messageDigest = MessageDigest.getInstance(algorithm); } catch (NoSuchAlgorithmException noalgo) { throw new BuildException(noalgo, getLocation());
if ((provider != null) && !"".equals(provider) && !"null".equals(provider)) { try { messageDigest = MessageDigest.getInstance(algorithm, provider); } catch (NoSuchAlgorithmException noalgo) { throw new BuildException(noalgo); } catch (NoSuchProviderException noprovider) { throw new BuildException(noprovider); } } else { try { messageDigest = MessageDigest.getInstance(algorithm); } catch (NoSuchAlgorithmException noalgo) { throw new BuildException(noalgo);
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Checksum.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/modifiedselector/DigestAlgorithm.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
if (provider != null) {
1
if ((provider != null) && !"".equals(provider) && !"null".equals(provider)) {
2
            try {
2
            try {
3
                messageDigest = MessageDigest.getInstance(algorithm, provider);
3
                messageDigest = MessageDigest.getInstance(algorithm, provider);
4
            } catch (NoSuchAlgorithmException noalgo) {
4
            } catch (NoSuchAlgorithmException noalgo) {
5
                throw new BuildException(noalgo, getLocation());
5
                throw new BuildException(noalgo);
6
            } catch (NoSuchProviderException noprovider) {
6
            } catch (NoSuchProviderException noprovider) {
7
                throw new BuildException(noprovider, getLocation());
7
                throw new BuildException(noprovider);
8
            }
8
            }
9
        } else {
9
        } else {
10
            try {
10
            try {
11
                messageDigest = MessageDigest.getInstance(algorithm);
11
                messageDigest = MessageDigest.getInstance(algorithm);
12
            } catch (NoSuchAlgorithmException noalgo) {
12
            } catch (NoSuchAlgorithmException noalgo) {
13
                throw new BuildException(noalgo, getLocation());
13
                throw new BuildException(noalgo);
14
            
14
            
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0