File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/imap/MessageSetTokenizerTest.java | File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/imap/MessageSetTokenizerTest.java | |||
Method name: void test3()
|
Method name: void test5()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | int max = 999;↵ | 1 | int max = 1;↵ | |
2 | Object[] uids = new Object[max];↵ | 2 | Object[] uids = new Object[max];↵ | |
3 | for (int i = 0; i < max; i++)↵ | 3 | for (int i = 0; i < max; i++)↵ | |
4 | uids[i] = new Integer(i);↵ | 4 | uids[i] = new Integer(i);↵ | |
5 | int stepSize = 100;↵ | 5 | int stepSize = 100;↵ | |
6 | MessageSetTokenizer tok = new MessageSetTokenizer(uids, stepSize);↵ | 6 | MessageSetTokenizer tok = new MessageSetTokenizer(uids, stepSize);↵ | |
7 | while (tok.hasNext()) {↵ | 7 | while (tok.hasNext()) {↵ | |
8 | List sublist = (List) tok.next();↵ | 8 | List sublist = (List) tok.next();↵ | |
9 | System.out.print("start=" + sublist.get(0));↵ | 9 | System.out.print("start=" + sublist.get(0));↵ | |
10 | System.out.println(" end=" + sublist.get(sublist.size() - 1));↵ | 10 | System.out.println(" end=" + sublist.get(sublist.size() - 1));↵ | |
11 | // if this is the last token, check if the last element↵ | 11 | // if this is the last token, check if the last element↵ | |
12 | // is the same than in the array↵ | 12 | // is the same than in the array↵ | |
13 | if (tok.hasNext() == false) {↵ | 13 | if (tok.hasNext() == false) {↵ | |
14 | assertEquals(sublist.get(sublist.size() - 1),↵ | 14 | assertEquals(sublist.get(sublist.size() - 1),↵ | |
15 | uids[uids.length - 1]);↵ | 15 | uids[uids.length - 1]);↵ | |
16 | }↵ | 16 | }↵ | |
17 | } | 17 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 34 |
Number of mapped statements | 12 |
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) | 3.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int max = 999; |
| 1 | int max = 1; | ||||||||||
2 | Object[] uids = new Object[max]; | 2 | Object[] uids = new Object[max]; | |||||||||||
3 | for (int i = 0; i < max; i++) | 3 | for (int i = 0; i < max; i++) | |||||||||||
4 | uids[i] = new Integer(i); | 4 | uids[i] = new Integer(i); | |||||||||||
5 | int stepSize = 100; | 5 | int stepSize = 100; | |||||||||||
6 | MessageSetTokenizer tok = new MessageSetTokenizer(uids, stepSize); | 6 | MessageSetTokenizer tok = new MessageSetTokenizer(uids, stepSize); | |||||||||||
7 | while (tok.hasNext()) | 7 | while (tok.hasNext()) | |||||||||||
8 | List sublist = (List)tok.next(); | 8 | List sublist = (List)tok.next(); | |||||||||||
9 | System.out.print("start=" + sublist.get(0)); | 9 | System.out.print("start=" + sublist.get(0)); | |||||||||||
10 | System.out.println(" end=" + sublist.get(sublist.size() - 1)); | 10 | System.out.println(" end=" + sublist.get(sublist.size() - 1)); | |||||||||||
11 | if (tok.hasNext() == false) | 11 | if (tok.hasNext() == false) | |||||||||||
12 | assertEquals(sublist.get(sublist.size() - 1), uids[uids.length - 1]); | 12 | assertEquals(sublist.get(sublist.size() - 1), uids[uids.length - 1]); |
Row | Violation |
---|