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();
private static void setup(TestSuite suite, MailboxTstFactory factory) { try { for (int j = 0; j < list.length; j++) { Class clazz = Class .forName("org.columba.mail.gui.composer.command." + 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/folder/AllTests.java File path: /columba-1.4-src/mail/src/test/java/org/columba/mail/gui/composer/command/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 {
3
            
2
		try {
4
for (int j = 0; j < list.length; j++) {
3
			for (int j = 0; j < list.length; j++) {
5
                Class clazz = Class
4
				Class clazz = Class
6
.forName("org.columba.mail.folder."
5
						.forName("org.columba.mail.
7
                        + list[j]);
8
                
6
gui.composer.command."
7
								+ list[j]);
9
Method[] methods = clazz.getDeclaredMethods();
8
				Method[] methods = clazz.getDeclaredMethods();
10
                for (int i = 0; i < methods.length; i++) {
9
				for (int i = 0; i < methods.length; i++) {
11
                    if (methods[i].getName().startsWith("test")) {
10
					if (methods[i].getName().startsWith("test")) {
12
                        suite
11
						suite
13
.addTest((TestCase) clazz.getConstructor(
12
								.addTest((TestCase) clazz.getConstructor(
14
                                new Class[] { MailboxTstFactory.class,
13
										new Class[] { MailboxTstFactory.class,
15
                                        String.class}).newInstance(
14
												String.class }).newInstance(
16
                                new Object[] { factory, 
15
										new Object[] { factory,
17
methods[i].getName()}));
16
												methods[i].getName() }));
18
                    }
19
                }
20
            }
21
        
17
					}
18
				}
19
			}
22
} catch (SecurityException e) {
20
		} catch (SecurityException e) {
23
            e.printStackTrace();
21
			e.printStackTrace();
24
        } catch (IllegalArgumentException e) {
22
		} catch (IllegalArgumentException e) {
25
            e.printStackTrace();
23
			e.printStackTrace();
26
        } catch (ClassNotFoundException e) {
24
		} catch (ClassNotFoundException e) {
27
            e.printStackTrace();
25
			e.printStackTrace();
28
        } catch (InstantiationException e) {
26
		} catch (InstantiationException e) {
29
            e.printStackTrace();
27
			e.printStackTrace();
30
        } catch (IllegalAccessException e) {
28
		} catch (IllegalAccessException e) {
31
            e.printStackTrace();
29
			e.printStackTrace();
32
        } catch (InvocationTargetException e) {
30
		} catch (InvocationTargetException e) {
33
            e.printStackTrace();
31
			e.printStackTrace();
34
        } catch (NoSuchMethodException e) {
32
		} catch (NoSuchMethodException e) {
35
            e.printStackTrace();
33
			e.printStackTrace();
36
        
34
		
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