int cOptions = Perl5Compiler.DEFAULT_MASK; if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK; } if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { cOptions |= Perl5Compiler.MULTILINE_MASK; } if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { cOptions |= Perl5Compiler.SINGLELINE_MASK; } return cOptions;
int cOptions = Pattern.UNIX_LINES; if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { cOptions |= Pattern.CASE_INSENSITIVE; } if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { cOptions |= Pattern.MULTILINE; } if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { cOptions |= Pattern.DOTALL; } return cOptions;
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/JakartaOroMatcher.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/util/regexp/Jdk14RegexpMatcher.java
Method name: int getCompilerOptions(int) Method name: int getCompilerOptions(int)
Number of AST nodes: 8 Number of AST nodes: 8
1
int cOptions = Perl5Compiler.DEFAULT_MASK;
1
int cOptions = Pattern.UNIX_LINES;
2
        if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
2
        if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
3
            cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;
3
            cOptions |= Pattern.CASE_INSENSITIVE;
4
        }
4
        }
5
        if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {
5
        if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {
6
            cOptions |= Perl5Compiler.MULTILINE_MASK;
6
            cOptions |= Pattern.MULTILINE;
7
        }
7
        }
8
        if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {
8
        if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {
9
            cOptions |= Perl5Compiler.SINGLELINE_MASK;
9
            cOptions |= Pattern.DOTALL;
10
        }
10
        }
11
        return cOptions;
11
        return cOptions;
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.6
Clones locationClones are in different classes
Number of node comparisons31
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int cOptions = Perl5Compiler.DEFAULT_MASK;
    1
    int cOptions = Perl5Compiler.DEFAULT_MASK;
    1
    int cOptions = Pattern.UNIX_LINES;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerjava.util.regex.PatternVARIABLE_TYPE_MISMATCH
    DEFAULT_MASKUNIX_LINESVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    • Make classes org.apache.oro.text.regex.Perl5Compiler and java.util.regex.Pattern extend a common superclass
    1
    int cOptions = Pattern.UNIX_LINES;
    2
    if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE))
    2
    if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE))
    3
    cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;
    3
    cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;
    3
    cOptions |= Pattern.CASE_INSENSITIVE;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerjava.util.regex.PatternVARIABLE_TYPE_MISMATCH
    CASE_INSENSITIVE_MASKCASE_INSENSITIVEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    • Make classes org.apache.oro.text.regex.Perl5Compiler and java.util.regex.Pattern extend a common superclass
    3
    cOptions |= Pattern.CASE_INSENSITIVE;
    4
    if (RegexpUtil.hasFlag(options, MATCH_MULTILINE))
    4
    if (RegexpUtil.hasFlag(options, MATCH_MULTILINE))
    5
    cOptions |= Perl5Compiler.MULTILINE_MASK;
    5
    cOptions |= Perl5Compiler.MULTILINE_MASK;
    5
    cOptions |= Pattern.MULTILINE;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerjava.util.regex.PatternVARIABLE_TYPE_MISMATCH
    MULTILINE_MASKMULTILINEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    • Make classes org.apache.oro.text.regex.Perl5Compiler and java.util.regex.Pattern extend a common superclass
    5
    cOptions |= Pattern.MULTILINE;
    6
    if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE))
    6
    if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE))
    7
    cOptions |= Perl5Compiler.SINGLELINE_MASK;
    7
    cOptions |= Perl5Compiler.SINGLELINE_MASK;
    7
    cOptions |= Pattern.DOTALL;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerjava.util.regex.PatternVARIABLE_TYPE_MISMATCH
    SINGLELINE_MASKDOTALLVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    • Make classes org.apache.oro.text.regex.Perl5Compiler and java.util.regex.Pattern extend a common superclass
    7
    cOptions |= Pattern.DOTALL;
    8
    return cOptions;
    8
    return cOptions;
    Precondition Violations (4)
    Row Violation
    1Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    2Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    3Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern
    4Type org.apache.oro.text.regex.Perl5Compiler does not match with type java.util.regex.Pattern