int result = s.indexOf('-');
if (result == -1) {
result = s.indexOf(',');
}
if (result == -1) {
result = s.indexOf(' ');
}
if (result == -1) {
result = s.indexOf('.');
}
return result;
int result = s.indexOf('-');
if (result == -1) {
result = s.indexOf(',');
}
if (result == -1) {
result = s.indexOf(' ');
}
if (result == -1) {
result = s.indexOf('.');
}
return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/Month.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/time/Week.java
|
Method name: int findSeparator(String)
|
|
Method name: int findSeparator(String)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | int result = s.indexOf('-');↵ | | 1 | int result = s.indexOf('-');↵
|
2 | if (result == -1) {↵ | | 2 | if (result == -1) {↵
|
3 | result = s.indexOf(',');↵ | | 3 | result = s.indexOf(',');↵
|
4 | }↵ | | 4 | }↵
|
5 | if (result == -1) {↵ | | 5 | if (result == -1) {↵
|
6 | result = s.indexOf(' ');↵ | | 6 | result = s.indexOf(' ');↵
|
7 | }↵ | | 7 | }↵
|
8 | if (result == -1) {↵ | | 8 | if (result == -1) {↵
|
9 | result = s.indexOf('.');↵ | | 9 | result = s.indexOf('.');↵
|
10 | }↵ | | 10 | }↵
|
11 | return result; | | 11 | return result;
|
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 31 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | int result = s.indexOf('-'); | | 1 | int result = s.indexOf('-'); |
2 | if (result == -1) | | 2 | if (result == -1) |
3 | | | 3 | |
4 | if (result == -1) | | 4 | if (result == -1) |
5 | | | 5 | |
6 | if (result == -1) | | 6 | if (result == -1) |
7 | | | 7 | |
8 | return result; | | 8 | return result; |
Precondition Violations (0)
Row |
Violation |