try { s.isSelected(basedir,filenames[0],files[0]); fail("DateSelector did not check for Datetime being in the " + "allowable range"); } catch (BuildException be2) { assertEquals("Date of 01/01/1969 01:01 AM results in negative " + "milliseconds value relative to epoch (January 1, " + "1970, 00:00:00 GMT).", be2.getMessage()); } s = (DateSelector)getInstance();
try { s.isSelected(basedir,filenames[0],files[0]); fail("DateSelector did not check for Datetime being in a " + "valid format"); } catch (BuildException be3) { assertEquals("Date of this is not a date" + " Cannot be parsed correctly. It should be in" + " MM/DD/YYYY HH:MM AM_PM format.", be3.getMessage()); } s = (DateSelector)getInstance();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/DateSelectorTest.java File path: /apache-ant-1.7.0/src/tests/junit/org/apache/tools/ant/types/selectors/DateSelectorTest.java
Method name: void testValidate() Method name: void testValidate()
Number of AST nodes: 4 Number of AST nodes: 4
1
try {
1
try {
2
            s.isSelected(basedir,filenames[0],files[0]);
2
            s.isSelected(basedir,filenames[0],files[0]);
3
            fail("DateSelector did not check for Datetime being in the "
3
            fail("DateSelector did not check for Datetime being in a "
4
                    + "allowable range");
4
                    + "valid format");
5
        } catch (BuildException be2) {
5
        } catch (BuildException be3) {
6
            assertEquals("Date of 01/01/1969 01:01 AM results in negative "
6
            assertEquals("Date of this is n
7
ot a date"
7
                    + "milliseconds value relative to epoch (January 1, "
8
                        + "
9
 Cannot be parsed correctly. It should be in"
8
                    + "1970, 00:00:00 GMT).", be2.getMessage());
10
                        + " MM/DD/YYYY HH:MM AM_PM format.", be3.getMessage());
9
        }
11
        }
10
        s = (DateSelector)getInstance();
12
        s = (DateSelector)getInstance();
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 in the same method
Number of node comparisons10
  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)9.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    7
    try
    7
    try
    12
    try
    Differences
    Expression1Expression2Difference
    be2be3VARIABLE_NAME_MISMATCH
    "1970, 00:00:00 GMT)."" MM/DD/YYYY HH:MM AM_PM format."LITERAL_VALUE_MISMATCH
    "Date of 01/01/1969 01:01 AM results in negative ""Date of this is not a date"LITERAL_VALUE_MISMATCH
    "milliseconds value relative to epoch (January 1, "" Cannot be parsed correctly. It should be in"LITERAL_VALUE_MISMATCH
    be2be3VARIABLE_NAME_MISMATCH
    12
    try
    8
    s.isSelected(basedir, filenames[0], files[0]);
    13
    s.isSelected(basedir, filenames[0], files[0]);
    9
    fail("DateSelector did not check for Datetime being in the " + "allowable range");
    9
    fail("DateSelector did not check for Datetime being in the " + "allowable range");
    14
    fail("DateSelector did not check for Datetime being in a " + "valid format");
    Differences
    Expression1Expression2Difference
    "DateSelector did not check for Datetime being in the ""DateSelector did not check for Datetime being in a "LITERAL_VALUE_MISMATCH
    "allowable range""valid format"LITERAL_VALUE_MISMATCH
    14
    fail("DateSelector did not check for Datetime being in a " + "valid format");
    10
    s = (DateSelector)getInstance();
    15
    s = (DateSelector)getInstance();
    Precondition Violations (0)
    Row Violation