switch (onError) { case OnError.FAIL_ALL: throw new BuildException(message); case OnError.FAIL: // Fall Through case OnError.REPORT: log(message, Project.MSG_WARN); break; case OnError.IGNORE: // log at a lower level log(message, Project.MSG_VERBOSE); break; default: // Ignore the problem break; }
switch (onError) { case OnError.FAIL_ALL: throw new BuildException(message); case OnError.FAIL: case OnError.REPORT: log(message, Project.MSG_WARN); break; case OnError.IGNORE: log(message, Project.MSG_VERBOSE); break; default: // Ignore the problem break; }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Definer.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/Definer.java
Method name: URL fileToURL() Method name: Enumeration resourceToURLs(ClassLoader)
Number of AST nodes: 12 Number of AST nodes: 12
1
switch (onError) {
1
switch (onError) {
2
            case OnError.FAIL_ALL:
2
                case OnError.FAIL_ALL:
3
                throw new BuildException(message);
3
                    throw new BuildException(message);
4
            case OnError.FAIL:
4
                case OnError.FAIL:
5
                // Fall Through
5
    
6
            case OnError.REPORT:
6
            case OnError.REPORT:
7
                log(message, Project.MSG_WARN);
7
                    log(message, Project.MSG_WARN);
8
                break;
8
                    break;
9
            case OnError.IGNORE:
9
                case OnError.IGNORE:
10
                // log at a lower level
10
    
11
                log(message, Project.MSG_VERBOSE);
11
                log(message, Project.MSG_VERBOSE);
12
                break;
12
                    break;
13
            default:
13
                default:
14
                // Ignore the problem
14
                    // Ignore the problem
15
                break;
15
                    break;
16
        }
16
            }
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.2
Clones locationClones are declared in the same class
Number of node comparisons75
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements12
    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.8
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    9
    switch (onError)
    6
    switch (onError)
    10
    case OnError.FAIL_ALL:
    7
    case OnError.FAIL_ALL:
    11
    throw new BuildException(message);
    8
    throw new BuildException(message);
    12
    case OnError.FAIL:
    9
    case OnError.FAIL:
    13
    case OnError.REPORT:
    10
    case OnError.REPORT:
    14
    log(message, Project.MSG_WARN);
    11
    log(message, Project.MSG_WARN);
    15
    break;
    12
    break;
    16
    case OnError.IGNORE:
    13
    case OnError.IGNORE:
    17
    log(message, Project.MSG_VERBOSE);
    14
    log(message, Project.MSG_VERBOSE);
    18
    break;
    15
    break;
    19
    default:
    16
    default:
    20
    break;
    17
    break;
    Precondition Violations (0)
    Row Violation