private static void setup(TestSuite suite, MailboxTstFactory factory) { try { for (int j = 0; j < list.length; j++) { Class clazz = Class.forName("org.columba.mail.filter.plugins." + list[j]); Method[] methods = clazz.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].getName().startsWith("test")) { suite.addTest((TestCase) clazz.getConstructor( new Class[] { MailboxTstFactory.class, String.class}).newInstance( new Object[] { factory, methods[i].getName()})); } } } } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace();
private static void setup(TestSuite suite, MailboxTstFactory factory) { try { for (int j = 0; j < list.length; j++) { Class clazz = Class.forName("org.columba.mail.folder." + list[j]); Method[] methods = clazz.getDeclaredMethods(); for (int i = 0; i < methods.length; i++) { if (methods[i].getName().startsWith("test")) { suite.addTest((TestCase) clazz.getConstructor( new Class[] { MailboxTstFactory.class, String.class}).newInstance( new Object[] { factory, methods[i].getName()})); } } } } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace();
Clone fragments detected by clone detection tool
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: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
private static void setup(TestSuite suite, MailboxTstFactory factory) {
1
private static void setup(TestSuite suite, MailboxTstFactory factory) {
2
        try {
2
        try {
3
            for (int j = 0; j < list.length; j++) {
3
            for (int j = 0; j < list.length; j++) {
4
                Class clazz = Class.forName("org.columba.mail.filter.plugins."
4
                Class clazz = Class.forName("org.columba.mail.folder."
5
                        + list[j]);
5
                        + list[j]);
6
                Method[] methods = clazz.getDeclaredMethods();
6
                Method[] methods = clazz.getDeclaredMethods();
7
                for (int i = 0; i < methods.length; i++) {
7
                for (int i = 0; i < methods.length; i++) {
8
                    if (methods[i].getName().startsWith("test")) {
8
                    if (methods[i].getName().startsWith("test")) {
9
                        suite.addTest((TestCase) clazz.getConstructor(
9
                        suite.addTest((TestCase) clazz.getConstructor(
10
                                new Class[] { MailboxTstFactory.class,
10
                                new Class[] { MailboxTstFactory.class,
11
                                        String.class}).newInstance(
11
                                        String.class}).newInstance(
12
                                new Object[] { factory, methods[i].getName()}));
12
                                new Object[] { factory, methods[i].getName()}));
13
                    }
13
                    }
14
                }
14
                }
15
            }
15
            }
16
        } catch (SecurityException e) {
16
        } catch (SecurityException e) {
17
            e.printStackTrace();
17
            e.printStackTrace();
18
        } catch (IllegalArgumentException e) {
18
        } catch (IllegalArgumentException e) {
19
            e.printStackTrace();
19
            e.printStackTrace();
20
        } catch (ClassNotFoundException e) {
20
        } catch (ClassNotFoundException e) {
21
            e.printStackTrace();
21
            e.printStackTrace();
22
        } catch (InstantiationException e) {
22
        } catch (InstantiationException e) {
23
            e.printStackTrace();
23
            e.printStackTrace();
24
        } catch (IllegalAccessException e) {
24
        } catch (IllegalAccessException e) {
25
            e.printStackTrace();
25
            e.printStackTrace();
26
        } catch (InvocationTargetException e) {
26
        } catch (InvocationTargetException e) {
27
            e.printStackTrace();
27
            e.printStackTrace();
28
        } catch (NoSuchMethodException e) {
28
        } catch (NoSuchMethodException e) {
29
            e.printStackTrace();
29
            e.printStackTrace();
30
        
30
        
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0