File path: /jruby-1.4.0/src/org/jruby/RubyFile.java | File path: /jruby-1.4.0/src/org/jruby/RubyFile.java | |||
Method name: IRubyObject lchown(ThreadContext, IRubyObject, IRubyObject)
|
Method name: IRubyObject chown(ThreadContext, IRubyObject, IRubyObject)
|
|||
Number of AST nodes: 9 | Number of AST nodes: 9 | |||
1 | int owner = -1;↵ | 1 | int owner = -1;↵ | |
2 | if (!arg1.isNil()) {↵ | 2 | if (!arg1.isNil()) {↵ | |
3 | owner = RubyNumeric.num2int(arg1);↵ | 3 | owner = RubyNumeric.num2int(arg1);↵ | |
4 | }↵ | 4 | }↵ | |
5 | int group = -1;↵ | 5 | int group = -1;↵ | |
6 | if (!arg2.isNil()) {↵ | 6 | if (!arg2.isNil()) {↵ | |
7 | group = RubyNumeric.num2int(arg2);↵ | 7 | group = RubyNumeric.num2int(arg2);↵ | |
8 | }↵ | 8 | }↵ | |
9 | if (!new File(path).exists()) {↵ | 9 | if (!new File(path).exists()) {↵ | |
10 | throw context.getRuntime().newErrnoENOENTError("No such file or directory - " + path);↵ | 10 | throw context.getRuntime().newErrnoENOENTError("No such file or directory - " + path);↵ | |
11 | }↵ | 11 | }↵ | |
12 | return context.getRuntime().newFixnum(context.getRuntime().getPosix().lchown(path, owner, group)); | 12 | return context.getRuntime().newFixnum(context.getRuntime().getPosix().chown(path, owner, group)); | |
See real code fragment | See real code fragment |
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.9 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 36 |
Number of mapped statements | 9 |
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.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int owner = -1; | 1 | int owner = -1; | |||||||||||||
2 | if (!arg1.isNil()) | 2 | if (!arg1.isNil()) | |||||||||||||
3 | owner = RubyNumeric.num2int(arg1); | 3 | owner = RubyNumeric.num2int(arg1); | |||||||||||||
4 | int group = -1; | 4 | int group = -1; | |||||||||||||
5 | if (!arg2.isNil()) | 5 | if (!arg2.isNil()) | |||||||||||||
6 | group = RubyNumeric.num2int(arg2); | 6 | group = RubyNumeric.num2int(arg2); | |||||||||||||
7 | if (!new File(path).exists()) | 7 | if (!new File(path).exists()) | |||||||||||||
8 | throw context.getRuntime().newErrnoENOENTError("No such file or directory - " + path); | 8 | throw context.getRuntime().newErrnoENOENTError("No such file or directory - " + path); | |||||||||||||
9 | return context.getRuntime().newFixnum(context.getRuntime().getPosix().lchown(path, owner, group)); |
| 9 | return context.getRuntime().newFixnum(context.getRuntime().getPosix().chown(path, owner, group)); |
Row | Violation |
---|---|
1 | Expression context.getRuntime().getPosix().lchown(path,owner,group) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression context.getRuntime().getPosix().chown(path,owner,group) cannot be parameterized, because it has dependencies to/from statements that will be extracted |