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