Ruby runtime = recv.getRuntime();
try {
runtime.getPosix().setpwent();
} catch (Exception e) {
if (runtime.getDebug().isTrue()) {
runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.setpwent is not supported by JRuby on this platform", e);
}
}
return runtime.getNil();
Ruby runtime = recv.getRuntime();
try {
runtime.getPosix().endgrent();
} catch (Exception e) {
if (runtime.getDebug().isTrue()) {
runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.engrent is not supported by JRuby on this platform", e);
}
}
return runtime.getNil();
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyEtc.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyEtc.java
|
Method name: IRubyObject setpwent(IRubyObject)
|
|
Method name: IRubyObject endgrent(IRubyObject)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | Ruby runtime = recv.getRuntime();↵ | | 1 | Ruby runtime = recv.getRuntime();↵
|
2 | try {↵ | | 2 | try {↵
|
3 | runtime.getPosix().setpwent();↵ | | 3 | runtime.getPosix().endgrent();↵
|
4 | } catch (Exception e) {↵ | | 4 | } catch (Exception e) {↵
|
5 | if (runtime.getDebug().isTrue()) {↵ | | 5 | if (runtime.getDebug().isTrue()) {↵
|
6 | runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.setpwent is not supported by JRuby on this platform", e);↵ | | 6 | runtime.getWarnings().warn(ID.NOT_IMPLEMENTED, "Etc.engrent is not supported by JRuby on this platform", e);↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | return runtime.getNil(); | | 9 | return runtime.getNil();
|
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 0.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Ruby runtime = recv.getRuntime(); | | 1 | Ruby runtime = recv.getRuntime(); |
2 | try | | 2 | try |
3 | runtime.getPosix().setpwent(); | | 3 | runtime.getPosix().endgrent(); |
4 | return runtime.getNil(); | | 4 | return runtime.getNil(); |
Precondition Violations (2)
Row |
Violation |
1 | Expression runtime.getPosix().setpwent() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression runtime.getPosix().endgrent() cannot be parameterized, because it has dependencies to/from statements that will be extracted |