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
                                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons39
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)3.8
    Clone typeType 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
    break;
    144
    break;
    101
    break;
    Preondition Violations
    Statement break; without innermost loop
    Statement break; without innermost loop
    101
    break;
    Precondition Violations (2)
    Row Violation
    1Statement break; without innermost loop
    2Statement break; without innermost loop