Map<String, RubyClass.VariableAccessor> ivarAccessors = getMetaClass().getRealClass().getVariableAccessorsForRead();
ArrayList<String> list = new ArrayList<String>();
for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) {
Object value = entry.getValue().get(this);
if (value == null) continue;
list.add(entry.getKey());
}
return list;
Map<String, RubyClass.VariableAccessor> ivarAccessors = getMetaClass().getRealClass().getVariableAccessorsForRead();
ArrayList<String> list = new ArrayList<String>();
for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) {
Object value = entry.getValue().get(this);
if (value == null || !(value instanceof IRubyObject) || !IdUtil.isInstanceVariable(entry.getKey())) continue;
list.add(entry.getKey());
}
return list;
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/RubyBasicObject.java
|
|
File path: /jruby-1.4.0/src/org/jruby/RubyBasicObject.java
|
Method name: List getVariableNameList()
|
|
Method name: List getInstanceVariableNameList()
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | Map<String, RubyClass.VariableAccessor> ivarAccessors = getMetaClass().getRealClass().getVariableAccessorsForRead();↵ | | 1 | Map<String, RubyClass.VariableAccessor> ivarAccessors = getMetaClass().getRealClass().getVariableAccessorsForRead();↵
|
2 | ArrayList<String> list = new ArrayList<String>();↵ | | 2 | ArrayList<String> list = new ArrayList<String>();↵
|
3 | for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) {↵ | | 3 | for (Map.Entry<String, RubyClass.VariableAccessor> entry : ivarAccessors.entrySet()) {↵
|
4 | Object value = entry.getValue().get(this);↵ | | 4 | Object value = entry.getValue().get(this);↵
|
5 | if (value == null) continue;↵ | | 5 | if (value == null || !(value instanceof IRubyObject) || !IdUtil.isInstanceVariable(entry.getKey())) continue;↵
|
6 | list.add(entry.getKey());↵ | | 6 | list.add(entry.getKey());↵
|
7 | }↵ | | 7 | }↵
|
8 | return list; | | 8 | return list;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 1 |