File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/filter/plugins/AllTests.java | File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/folder/AllTests.java | |||
Method name: void setup(TestSuite, MailboxTstFactory)
|
Method name: void setup(TestSuite, MailboxTstFactory)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | try {↵ | 1 | try {↵ | |
2 | for (int j = 0; j < list.length; j++) {↵ | 2 | for (int j = 0; j < list.length; j++) {↵ | |
3 | Class clazz = Class.forName("org.columba.mail.filter.plugins."↵ | 3 | Class clazz = Class.forName("org.columba.mail.folder."↵ | |
4 | + list[j]);↵ | 4 | + list[j]);↵ | |
5 | Method[] methods = clazz.getDeclaredMethods();↵ | 5 | Method[] methods = clazz.getDeclaredMethods();↵ | |
6 | for (int i = 0; i < methods.length; i++) {↵ | 6 | for (int i = 0; i < methods.length; i++) {↵ | |
7 | if (methods[i].getName().startsWith("test")) {↵ | 7 | if (methods[i].getName().startsWith("test")) {↵ | |
8 | suite.addTest((TestCase) clazz.getConstructor(↵ | 8 | suite.addTest((TestCase) clazz.getConstructor(↵ | |
9 | new Class[] { MailboxTstFactory.class,↵ | 9 | new Class[] { MailboxTstFactory.class,↵ | |
10 | String.class}).newInstance(↵ | 10 | String.class}).newInstance(↵ | |
11 | new Object[] { factory, methods[i].getName()}));↵ | 11 | new Object[] { factory, methods[i].getName()}));↵ | |
12 | }↵ | 12 | }↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | } catch (SecurityException e) {↵ | 15 | } catch (SecurityException e) {↵ | |
16 | e.printStackTrace();↵ | 16 | e.printStackTrace();↵ | |
17 | } catch (IllegalArgumentException e) {↵ | 17 | } catch (IllegalArgumentException e) {↵ | |
18 | e.printStackTrace();↵ | 18 | e.printStackTrace();↵ | |
19 | } catch (ClassNotFoundException e) {↵ | 19 | } catch (ClassNotFoundException e) {↵ | |
20 | e.printStackTrace();↵ | 20 | e.printStackTrace();↵ | |
21 | } catch (InstantiationException e) {↵ | 21 | } catch (InstantiationException e) {↵ | |
22 | e.printStackTrace();↵ | 22 | e.printStackTrace();↵ | |
23 | } catch (IllegalAccessException e) {↵ | 23 | } catch (IllegalAccessException e) {↵ | |
24 | e.printStackTrace();↵ | 24 | e.printStackTrace();↵ | |
25 | } catch (InvocationTargetException e) {↵ | 25 | } catch (InvocationTargetException e) {↵ | |
26 | e.printStackTrace();↵ | 26 | e.printStackTrace();↵ | |
27 | } catch (NoSuchMethodException e) {↵ | 27 | } catch (NoSuchMethodException e) {↵ | |
28 | e.printStackTrace();↵ | 28 | e.printStackTrace();↵ | |
29 | } | 29 |
| |
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) | 1.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 17 |
Number of mapped statements | 7 |
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) | 11.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | try | 1 | try | |||||||||||
2 | for (int j = 0; j < list.length; j++) | 2 | for (int j = 0; j < list.length; j++) | |||||||||||
3 | Class clazz = Class.forName("org.columba.mail.filter.plugins." + list[j]); |
| 3 | Class clazz = Class.forName("org.columba.mail.folder." + list[j]); | ||||||||||
4 | Method[] methods = clazz.getDeclaredMethods(); | 4 | Method[] methods = clazz.getDeclaredMethods(); | |||||||||||
5 | for (int i = 0; i < methods.length; i++) | 5 | for (int i = 0; i < methods.length; i++) | |||||||||||
6 | if (methods[i].getName().startsWith("test")) | 6 | if (methods[i].getName().startsWith("test")) | |||||||||||
7 | suite.addTest((TestCase)clazz.getConstructor(new Class[] {MailboxTstFactory.class, String.class}).newInstance(new Object[] {factory, methods[i].getName()})); | 7 | suite.addTest((TestCase)clazz.getConstructor(new Class[] {MailboxTstFactory.class, String.class}).newInstance(new Object[] {factory, methods[i].getName()})); |
Row | Violation |
---|