if(je.isDirectory()) {
int t = buf.realSize;
buf.append(SLASH);
buf.append(DOUBLE_STAR);
buf.append(bytes, m, end - m);
status = glob_helper(cwd, buf.bytes, buf.begin, buf.realSize, t, flags, func, arg);
if(status != 0) {
break;
}
}
if(st.isDirectory() && !".".equals(dirp[i]) && !"..".equals(dirp[i])) {
int t = buf.realSize;
buf.append(SLASH);
buf.append(DOUBLE_STAR);
buf.append(bytes, m, end - m);
status = glob_helper(cwd, buf.bytes, buf.begin, buf.realSize, t, flags, func, arg);
if(status != 0) {
break;
}
}
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/util/Dir.java
|
|
File path: /jruby-1.4.0/src/org/jruby/util/Dir.java
|
Method name: int glob_helper(String, byte[], int, int, int, int, GlobFunc, GlobArgs)
|
|
Method name: int glob_helper(String, byte[], int, int, int, int, GlobFunc, GlobArgs)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if(je.isDirectory()) {↵ | | 1 | if(st.isDirectory() && !".".equals(dirp[i]) && !"..".equals(dirp[i])) {↵
|
2 | int t = buf.realSize;↵ | | 2 | int t = buf.realSize;↵
|
3 | buf.append(SLASH);↵ | | 3 | buf.append(SLASH);↵
|
4 | buf.append(DOUBLE_STAR);↵ | | 4 | buf.append(DOUBLE_STAR);↵
|
5 | buf.append(bytes, m, end - m);↵ | | 5 | buf.append(bytes, m, end - m);↵
|
6 | status = glob_helper(cwd, buf.bytes, buf.begin, buf.realSize, t, flags, func, arg);↵ | | 6 | status = glob_helper(cwd, buf.bytes, buf.begin, buf.realSize, t, flags, func, arg);↵
|
7 | if(status != 0) {↵ | | 7 | if(status != 0) {↵
|
8 | break;↵ | | 8 | break;↵
|
9 | }↵ | | 9 | ↵
|
10 | ↵ | | 10 | }↵
|
11 | } | | 11 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 39 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 3.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
138 | int t = buf.realSize; | | 95 | int t = buf.realSize; |
139 | buf.append(SLASH); | | 96 | buf.append(SLASH); |
140 | buf.append(DOUBLE_STAR); | | 97 | buf.append(DOUBLE_STAR); |
141 | buf.append(bytes, m, end - m); | | 98 | buf.append(bytes, m, end - m); |
142 | status = glob_helper(cwd, buf.bytes, buf.begin, buf.realSize, t, flags, func, arg); | | 99 | status = glob_helper(cwd, buf.bytes, buf.begin, buf.realSize, t, flags, func, arg); |
143 | if (status != 0) | | 100 | if (status != 0) |
144 | | | 101 | |
Precondition Violations (2)
Row |
Violation |
1 | Statement break; without innermost loop |
2 | Statement break; without innermost loop |