int cOptions = getCompilerOptions(options); try { Pattern p = Pattern.compile(this.pattern, cOptions); return p; } catch (PatternSyntaxException e) { throw new BuildException(e); }
if (basedir != null) { try { canonBase = basedir.getCanonicalFile(); } catch (IOException ex) { throw new BuildException(ex); } }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/DirectoryScanner.java
Method name: Pattern getCompiledPattern(int) Method name: void checkIncludePatterns()
Number of AST nodes: 4 Number of AST nodes: 3
1
int cOptions = getCompilerOptions(options);
1
i
2
f (basedir != null) {
2
        try {
3
                try {
3
            Pattern p = Pattern.compile(this.pattern, cOptions);
4
            
4
            return p;
5
        } catch (PatternSyntax
5
        canonBase = basedir.getCanonicalFile();
6
Exception e) {
6
                } catch (IOException ex) {
7
            throw new BuildException(e);
7
                    throw new BuildException(ex);
8
                }
8
        }
9
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    int cOptions = getCompilerOptions(options);
                                                                                            
    2
    try
    2
    try
    14
    try
    Differences
    Expression1Expression2Difference
    java.util.regex.PatternSyntaxExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    eexVARIABLE_NAME_MISMATCH
    java.util.regex.PatternSyntaxExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    eexVARIABLE_NAME_MISMATCH
    java.util.regex.PatternSyntaxExceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    14
    try
    3
    Pattern p = Pattern.compile(this.pattern, cOptions);
                                                                                                            
    4
    return p;
    4
    return p;
    Preondition Violations
    Unmatched return p;
                            
                                                                                      
    15
    canonBase = basedir.getCanonicalFile();
    Preondition Violations
    Unmatched statement canonBase=basedir.getCanonicalFile(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    15
    canonBase = basedir.getCanonicalFile();
    Precondition Violations (2)
    Row Violation
    1Unmatched return p;
    2Unmatched statement canonBase=basedir.getCanonicalFile(); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted