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 = RE.MATCH_NORMAL; if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) { cOptions |= RE.MATCH_CASEINDEPENDENT; } if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) { cOptions |= RE.MATCH_MULTILINE; } if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) { cOptions |= RE.MATCH_SINGLELINE; } 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/JakartaRegexpMatcher.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 = RE.MATCH_NORMAL;
2
        if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
2
        if (RegexpUtil.hasFlag(options, MATCH_CASE_INSENSITIVE)) {
3
            cOptions |= Perl5Compiler.CASE_INSENSITIVE_MASK;
3
            cOptions |= RE.MATCH_CASEINDEPENDENT;
4
        }
4
        }
5
        if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {
5
        if (RegexpUtil.hasFlag(options, MATCH_MULTILINE)) {
6
            cOptions |= Perl5Compiler.MULTILINE_MASK;
6
            cOptions |= RE.MATCH_MULTILINE;
7
        }
7
        }
8
        if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {
8
        if (RegexpUtil.hasFlag(options, MATCH_SINGLELINE)) {
9
            cOptions |= Perl5Compiler.SINGLELINE_MASK;
9
            cOptions |= RE.MATCH_SINGLELINE;
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.8
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)1.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    int cOptions = Perl5Compiler.DEFAULT_MASK;
    1
    int cOptions = Perl5Compiler.DEFAULT_MASK;
    1
    int cOptions = RE.MATCH_NORMAL;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerorg.apache.regexp.REVARIABLE_TYPE_MISMATCH
    DEFAULT_MASKMATCH_NORMALVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    • Make classes org.apache.oro.text.regex.Perl5Compiler and org.apache.regexp.RE extend a common superclass
    1
    int cOptions = RE.MATCH_NORMAL;
    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 |= RE.MATCH_CASEINDEPENDENT;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerorg.apache.regexp.REVARIABLE_TYPE_MISMATCH
    CASE_INSENSITIVE_MASKMATCH_CASEINDEPENDENTVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    • Make classes org.apache.oro.text.regex.Perl5Compiler and org.apache.regexp.RE extend a common superclass
    3
    cOptions |= RE.MATCH_CASEINDEPENDENT;
    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 |= RE.MATCH_MULTILINE;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerorg.apache.regexp.REVARIABLE_TYPE_MISMATCH
    MULTILINE_MASKMATCH_MULTILINEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    • Make classes org.apache.oro.text.regex.Perl5Compiler and org.apache.regexp.RE extend a common superclass
    5
    cOptions |= RE.MATCH_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 |= RE.MATCH_SINGLELINE;
    Differences
    Expression1Expression2Difference
    org.apache.oro.text.regex.Perl5Compilerorg.apache.regexp.REVARIABLE_TYPE_MISMATCH
    SINGLELINE_MASKMATCH_SINGLELINEVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    • Make classes org.apache.oro.text.regex.Perl5Compiler and org.apache.regexp.RE extend a common superclass
    7
    cOptions |= RE.MATCH_SINGLELINE;
    8
    return cOptions;
    8
    return cOptions;
    Precondition Violations (4)
    Row Violation
    1Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    2Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    3Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE
    4Type org.apache.oro.text.regex.Perl5Compiler of variable Perl5Compiler does not match with type org.apache.regexp.RE of variable RE