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: boolean validateAndExecute()
|
Method name: void initMessageDigest()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
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 | }↵ | |
15 | } | 15 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 2 |
Number of refactorable cases | 2 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 11 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30 | try |
| 4 | try | |||||||||||||
31 | messageDigest = MessageDigest.getInstance(algorithm, provider); | 5 | messageDigest = MessageDigest.getInstance(algorithm, provider); |
Row | Violation |
---|
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
32 | try |
| 6 | try | ||||||||||
33 | messageDigest = MessageDigest.getInstance(algorithm); | 7 | messageDigest = MessageDigest.getInstance(algorithm); |
Row | Violation |
---|