if (hasCR) {
// second CR -> EOL + possibly empty line
line = linebuf.toString();
res = doReplace(regex, subs, line, options);
if (!res.equals(line)) {
changes = true;
}
pw.print(res);
pw.print('\r');
linebuf = new StringBuffer();
// hasCR is still true (for the second one)
} else {
// first CR in this line
hasCR = true;
}
line = linebuf.toString();
res = doReplace(regex, subs, line, options);
if (!res.equals(line)) {
changes = true;
}
pw.print(res);
if (hasCR) {
pw.print('\r');
hasCR = false;
}
linebuf = new StringBuffer();
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
|
|
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/taskdefs/optional/ReplaceRegExp.java
|
Method name:
|
|
Method name:
|
Number of AST nodes: 0
|
|
Number of AST nodes: 0
|
|
1 | if (hasCR) {↵ | | |
|
2 | // second CR -> EOL + possibly empty line↵ | | |
|
3 | line = linebuf.toString();↵ | | 1 | line = linebuf.toString();↵
|
4 | res = doReplace(regex, subs, line, options);↵ | | 2 | res = doReplace(regex, subs, line, options);↵
|
|
5 | if (!res.equals(line)) {↵ | | 3 | if (!res.equals(line)) {↵
|
6 | changes = true;↵ | | 4 | changes = true;↵
|
7 | }↵ | | 5 | }↵
|
|
8 | pw.print(res);↵ | | 6 | pw.print(res);↵
|
9 | pw.print('\r');↵ | | 7 | ↵
|
| | | 8 | if (hasCR) {↵
|
10 | linebuf = new StringBuffer();↵ | | 9 | pw.print('\r');↵
|
11 | // hasCR is still true (for the second one)↵ | | 10 | hasCR = false;↵
|
12 | } else {↵ | | 11 | ↵
|
13 | ↵ | | 12 | }↵
|
|
14 | // first CR in this line↵ | | 13 | ↵
|
15 | hasCR = true;↵ | | 14 | linebuf = new StringBuffer();↵
|
16 | } | | 15 |
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | |
Number of node comparisons | 0 |