while (tokens.hasMoreTokens()) {
String tok=tokens.nextToken();
if ( tok.length()==1 // we have a single character; could be a token
&& delims.indexOf(tok)!=-1) // it is a token
{
if (lastWasDelim) {// we saw a delimiter last time
strList.add(def);// so add the default
}
lastWasDelim=true;
} else {
lastWasDelim=false;
strList.add(tok);
}
}
while (tokener.hasMoreTokens()) {
String token = tokener.nextToken();
if (token.equals(delim)) {
if (lastWasDelim) {
// two delimiters in a row; add an empty String
result.add("");
}
lastWasDelim = true;
} else {
lastWasDelim = false;
result.add(token);
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/util/JOrphanUtils.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/functions/FileRowColContainer.java
|
Method name: String[] split(String, String, String)
|
|
Method name: ArrayList splitLine(String, String)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | while (tokens.hasMoreTokens()) {↵ | | 1 | while (tokener.hasMoreTokens()) {↵
|
2 | String tok=tokens.nextToken();↵ | | 2 | String token = tokener.nextToken();↵
|
3 | if ( tok.length()==1 // we have a single character; could be a token ↵ | | 3 | if (↵
|
4 | && delims.indexOf(tok)!=-1) // it is a token↵ | | |
|
5 | {↵ | | |
|
6 | ↵ | | 4 | token.equals(delim)) {↵
|
7 | if (lastWasDelim) {// we saw a delimiter last time↵ | | 5 | if (lastWasDelim) {↵
|
8 | strList.add(def);// so add the default↵ | | |
|
9 | }↵ | | |
|
10 | ↵ | | |
|
| | | 6 | // two delimiters in a row; add an empty String↵
|
| | | 7 | result.add("");↵
|
| | | 8 | }↵
|
11 | lastWasDelim=true;↵ | | 9 | lastWasDelim = true;↵
|
12 | } else {↵ | | |
|
13 | ↵ | | 10 | } else {↵
|
14 | lastWasDelim=false;↵ | | 11 | lastWasDelim = false;↵
|
15 | strList.add(tok);↵ | | 12 | result.add(token);↵
|
16 | }↵ | | |
|
17 | ↵ | | 13 | }↵
|
18 | } | | 14 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 6 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
7 | if (lastWasDelim) | | 7 | if (lastWasDelim) |
| | | 8 | |
8 | | | | |
Precondition Violations (0)
Row |
Violation |