it = namespaces.getSharedIterator(); while (it.hasNext()) { Namespace pN = (Namespace) it.next(); ListInfo[] list = store.list("", pN.getPrefix() + '%'); result.addAll(Arrays.asList(list)); }
List authMechanisms = AuthenticationFactory.getInstance() .getSupportedMechanisms(capas[i]); Iterator it = authMechanisms.iterator(); while (it.hasNext()) { supportedMechanisms.add(new Integer(AuthenticationManager .getSaslCode((String) it.next()))); } break;
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/subscribe/SynchronizeFolderListCommand.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/smtp/SMTPServer.java
Method name: List fetchUnsubscribedFolders(String) Method name: List checkSupportedAuthenticationMethods()
Number of AST nodes: 5 Number of AST nodes: 5
1
it = namespaces.getSharedI
1
List authMechanisms = AuthenticationFactory.getInstance()
2
						.getSupportedMechanisms(capas[i]);
2
terator();
3
				Iterator it = authMechanisms.iterator();
3
			while (it.hasNext()) {
4
				while (it.hasNext()) {
4
				Namespace pN = (Namespace) it.next();
5
				
5
				ListInfo[] list = store.list("", pN.getPrefix() + '%');
6
				result.addAll(Arrays.asList(list));
7
			}
6
	supportedMechanisms.add(new Integer(AuthenticationManager
7
							.getSaslCode((String) it.next())));
8
				}
9
				break;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)550.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                                                                                            
    5
    List authMechanisms = AuthenticationFactory.getInstance().getSupportedMechanisms(capas[i]);
    Preondition Violations
    Unmatched statement List authMechanisms=AuthenticationFactory.getInstance().getSupportedMechanisms(capas[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    List authMechanisms = AuthenticationFactory.getInstance().getSupportedMechanisms(capas[i]);
    21
    it = namespaces.getSharedIterator();
    21
    it = namespaces.getSharedIterator();
    6
    Iterator it = authMechanisms.iterator();
    Differences
    Expression1Expression2Difference
    getSharedIteratoriteratorMETHOD_INVOCATION_NAME_MISMATCH
    namespacesauthMechanismsVARIABLE_NAME_MISMATCH
    org.columba.ristretto.imap.NamespaceCollectionjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression authMechanisms.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.columba.ristretto.imap.NamespaceCollection of variable namespaces does not match with type java.util.List of variable authMechanisms
    • Make classes org.columba.ristretto.imap.NamespaceCollection and java.util.List extend a common superclass
    6
    Iterator it = authMechanisms.iterator();
    22
    while (it.hasNext())
    7
    while (it.hasNext())
                                                                                                                                                                                                
    8
    supportedMechanisms.add(new Integer(AuthenticationManager.getSaslCode((String)it.next())));
    Preondition Violations
    Unmatched statement supportedMechanisms.add(new Integer(AuthenticationManager.getSaslCode((String)it.next()))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    supportedMechanisms.add(new Integer(AuthenticationManager.getSaslCode((String)it.next())));
    23
    Namespace pN = (Namespace)it.next();
    23
    Namespace pN = (Namespace)it.next();
    Preondition Violations
    Unmatched statement Namespace pN=(Namespace)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    24
    ListInfo[] list = store.list("", pN.getPrefix() + '%');
    24
    ListInfo[] list = store.list("", pN.getPrefix() + '%');
    Preondition Violations
    Unmatched statement ListInfo[] list=store.list("",pN.getPrefix() + '%'); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    Unmatched statement ListInfo[] list=store.list("",pN.getPrefix() + '%'); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                    
    25
    result.addAll(Arrays.asList(list));
    25
    result.addAll(Arrays.asList(list));
    Preondition Violations
    Unmatched statement result.addAll(Arrays.asList(list)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                  
                      
    9
    break;
    Preondition Violations
    Unmatched break;
    9
    break;
    Precondition Violations (10)
    Row Violation
    1Unmatched statement List authMechanisms=AuthenticationFactory.getInstance().getSupportedMechanisms(capas[i]); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression authMechanisms.iterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type org.columba.ristretto.imap.NamespaceCollection of variable namespaces does not match with type java.util.List of variable authMechanisms
    4Unmatched statement supportedMechanisms.add(new Integer(AuthenticationManager.getSaslCode((String)it.next()))); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement Namespace pN=(Namespace)it.next(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement ListInfo[] list=store.list("",pN.getPrefix() + '%'); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement ListInfo[] list=store.list("",pN.getPrefix() + '%'); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    8Unmatched statement result.addAll(Arrays.asList(list)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched break;
    10The refactoring of the clones is infeasible, because classes org.columba.mail.gui.config.subscribe.SynchronizeFolderListCommand and org.columba.mail.smtp.SMTPServer do not have a common superclass