reg.setPattern("^Line1"); assertTrue("^Line1 in default mode", reg.matches(text)); assertTrue("^Line1 in single line mode", reg.matches(text, RegexpMatcher.MATCH_SINGLELINE)); assertTrue("^Line1 in multi line mode", reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
reg.setPattern("Line4$"); assertTrue("Line4$ in default mode", reg.matches(text)); assertTrue("Line4$ in single line mode", reg.matches(text, RegexpMatcher.MATCH_SINGLELINE)); assertTrue("Line4$ in multi line mode", reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/util/regexp/RegexpMatcherTest.java
Method name: void doStartTest2(String) Method name: void doEndTest2(String)
Number of AST nodes: 4 Number of AST nodes: 4
1
reg.setPattern("^Line1");
1
reg.setPattern("Line4$");
2
        assertTrue("^Line1 in default mode", reg.matches(text));
2
        assertTrue("Line4$ in default mode", reg.matches(text));
3
        assertTrue("^Line1 in single line mode",
3
        assertTrue("Line4$ in single line mode",
4
               reg.matches(text, RegexpMatcher.MATCH_SINGLELINE));
4
               reg.matches(text, RegexpMatcher.MATCH_SINGLELINE));
5
        assertTrue("^Line1 in multi line mode",
5
        assertTrue("Line4$ in multi line mode",
6
               reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
6
               reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    reg.setPattern("^Line1");
    1
    reg.setPattern("^Line1");
    1
    reg.setPattern("Line4$");
    Differences
    Expression1Expression2Difference
    "^Line1""Line4$"LITERAL_VALUE_MISMATCH
    1
    reg.setPattern("Line4$");
    2
    assertTrue("^Line1 in default mode", reg.matches(text));
    2
    assertTrue("^Line1 in default mode", reg.matches(text));
    2
    assertTrue("Line4$ in default mode", reg.matches(text));
    Differences
    Expression1Expression2Difference
    "^Line1 in default mode""Line4$ in default mode"LITERAL_VALUE_MISMATCH
    2
    assertTrue("Line4$ in default mode", reg.matches(text));
    3
    assertTrue("^Line1 in single line mode", reg.matches(text, RegexpMatcher.MATCH_SINGLELINE));
    3
    assertTrue("^Line1 in single line mode", reg.matches(text, RegexpMatcher.MATCH_SINGLELINE));
    3
    assertTrue("Line4$ in single line mode", reg.matches(text, RegexpMatcher.MATCH_SINGLELINE));
    Differences
    Expression1Expression2Difference
    "^Line1 in single line mode""Line4$ in single line mode"LITERAL_VALUE_MISMATCH
    3
    assertTrue("Line4$ in single line mode", reg.matches(text, RegexpMatcher.MATCH_SINGLELINE));
    4
    assertTrue("^Line1 in multi line mode", reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
    4
    assertTrue("^Line1 in multi line mode", reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
    4
    assertTrue("Line4$ in multi line mode", reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
    Differences
    Expression1Expression2Difference
    "^Line1 in multi line mode""Line4$ in multi line mode"LITERAL_VALUE_MISMATCH
    4
    assertTrue("Line4$ in multi line mode", reg.matches(text, RegexpMatcher.MATCH_MULTILINE));
    Precondition Violations (0)
    Row Violation