/** * @return a string describing this object */ public String toString() { StringBuffer buf = new StringBuffer("{presentselector targetdir: "); if (targetdir == null) { buf.append("NOT YET SET"); } else { buf.append(targetdir.getName()); } buf.append(" present: "); if (destmustexist) { buf.append("both"); } else { buf.append("srconly"); } if (map != null) { buf.append(map.toString()); } else if (mapperElement != null) { buf.append(mapperElement.toString()); } buf.append("}"); return buf.toString(); }
/** * @return a string describing this object */ public String toString() { StringBuffer buf = new StringBuffer("{containsselector text: "); buf.append('"').append(contains).append('"'); buf.append(" casesensitive: "); buf.append(casesensitive ? "true" : "false"); buf.append(" ignorewhitespace: "); buf.append(ignorewhitespace ? "true" : "false"); buf.append("}"); return buf.toString(); }
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/PresentSelector.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/types/selectors/ContainsSelector.java
Method name: String toString() Method name: String toString()
Number of AST nodes: 3 Number of AST nodes: 1
1
/**
1
/**
2
     * @return a string describing this object
2
     * @return a string describing this object
3
     */
3
     */
4
    public String toString() {
4
    public String toString() {
5
        StringBuffer buf = new StringBuffer("{presentselector targetdir: ");
5
        StringBuffer buf = new StringBuffer("{containsselector text: ");
6
        if (targetdir == null) {
6
        buf.append('"').append(contains).append('"');
7
            buf.append("NOT YET SET");
7
        buf.append(" casesensitive: ");
8
        } else {
8
        buf.append(casesensitive ? "true" : "false");
9
            buf.append(targetdir.getName());
9
        buf.append(" ignorewhitespace: ");
10
        }
10
        buf.append(ignorewhitespace ? "true" : "false");
11
        buf.append(" present: ");
11
        buf.append("}");
12
        if (destmustexist) {
12
        return buf.toString();
13
            buf.append("both");
13
    }
14
        } else {
15
            buf.append("srconly");
16
        }
17
        if (map != null) {
18
            buf.append(map.toString());
19
        } else if (mapperElement != null) {
20
            buf.append(mapperElement.toString());
21
        }
22
        buf.append("}");
23
        return buf.toString();
24
    }
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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
    Similarity Score1.000
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    6
    if (destmustexist)
    6
    if (destmustexist)
    4
    buf.append(casesensitive ? "true" : "false");
    Differences
    Expression1Expression2Difference
    destmustexistcasesensitiveVARIABLE_NAME_MISMATCH
    "both""true"LITERAL_VALUE_MISMATCH
    "srconly""false"LITERAL_VALUE_MISMATCH
    4
    buf.append(casesensitive ? "true" : "false");
    7
    buf.append("both");
    7
    buf.append("both");
    Differences
    Expression1Expression2Difference
    "both""true"LITERAL_VALUE_MISMATCH
                                                
    else
            
    8
    buf.append("srconly");
    8
    buf.append("srconly");
    Differences
    Expression1Expression2Difference
    "srconly""false"LITERAL_VALUE_MISMATCH
                                                      
    Precondition Violations (0)
    Row Violation