File path: /jruby-1.4.0/test/org/jruby/javasupport/test/TestBSF.java | File path: /jruby-1.4.0/test/org/jruby/javasupport/test/TestBSF.java | |||
Method name: void testNilList()
|
Method name: void testNilMap()
|
|||
Number of AST nodes: 5 | Number of AST nodes: 5 | |||
1 | SimpleInterface si = (SimpleInterface) manager.eval("ruby", "(java)", 1, 1, "EMPTY_LIST = SimpleInterfaceImpl.new");↵ | 1 | SimpleInterface si = (SimpleInterface) manager.eval("ruby", "(java)", 1, 1, "SimpleInterfaceImpl.new");↵ | |
2 | List list = si.getNilList();↵ | 2 | Map map = si.getNilMap();↵ | |
3 | ↵ | 3 | ↵ | |
4 | assertTrue(list == null);↵ | 4 | assertTrue(map == null);↵ | |
5 | ↵ | 5 | ↵ | |
6 | si.setNilList(null);↵ | 6 | si.setNilMap(null);↵ | |
7 | ↵ | 7 | ↵ | |
8 | assertTrue(si.isNilListNil()); | 8 | assertTrue(si.isNilMapNil()); | |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 25 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | SimpleInterface si = (SimpleInterface)manager.eval("ruby", "(java)", 1, 1, "EMPTY_LIST = SimpleInterfaceImpl.new"); |
| 1 | SimpleInterface si = (SimpleInterface)manager.eval("ruby", "(java)", 1, 1, "SimpleInterfaceImpl.new"); | ||||||||||||||
|
| 2 | Map map = si.getNilMap(); | |||||||||||||||
2 | List list = si.getNilList(); |
| | |||||||||||||||
3 | assertTrue(list == null); |
| 3 | assertTrue(map == null); | ||||||||||||||
4 | si.setNilList(null); |
| 4 | si.setNilMap(null); | ||||||||||||||
5 | assertTrue(si.isNilListNil()); |
| 5 | assertTrue(si.isNilMapNil()); |
Row | Violation |
---|---|
1 | Unmatched statement Map map=si.getNilMap(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement List list=si.getNilList(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Type java.util.List of variable list does not match with type java.util.Map of variable map |
4 | Expression si.setNilList(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression si.setNilMap(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression si.setNilList(null) is a void method call, and thus it cannot be parameterized |
7 | Expression si.setNilMap(null) is a void method call, and thus it cannot be parameterized |
8 | Expression si.isNilListNil() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression si.isNilMapNil() cannot be parameterized, because it has dependencies to/from statements that will be extracted |