if (namespaces.getPersonalNamespaceSize() > 0) { it = namespaces.getPersonalIterator(); while (it.hasNext()) { Namespace pN = (Namespace) it.next(); ListInfo[] list = store.list("", pN.getPrefix() + '%'); result.addAll(Arrays.asList(list)); } }
if (namespaces.getOtherUserNamespaceSize() > 0) { it = namespaces.getOtherUserIterator(); while (it.hasNext()) { Namespace pN = (Namespace) it.next(); ListInfo[] list = store.list("", pN.getPrefix() + '%'); result.addAll(Arrays.asList(list)); } }
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/gui/config/subscribe/SynchronizeFolderListCommand.java
Method name: List fetchUnsubscribedFolders(String) Method name: List fetchUnsubscribedFolders(String)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (namespaces.getPersonalNamespaceSize() > 0) {
1
if (namespaces.getOtherUserNamespaceSize() > 0) {
2
			it = namespaces.getPersonalIterator();
2
			it = namespaces.getOtherUserIterator();
3
			while (it.hasNext()) {
3
			while (it.hasNext()) {
4
				Namespace pN = (Namespace) it.next();
4
				Namespace pN = (Namespace) it.next();
5
				ListInfo[] list = store.list("", pN.getPrefix() + '%');
5
				ListInfo[] list = store.list("", pN.getPrefix() + '%');
6
				result.addAll(Arrays.asList(list));
6
				result.addAll(Arrays.asList(list));
7
			}
7
			}
8
		}
8
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons24
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)110.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    if (namespaces.getPersonalNamespaceSize() > 0)
    8
    if (namespaces.getPersonalNamespaceSize() > 0)
    14
    if (namespaces.getOtherUserNamespaceSize() > 0)
    Differences
    Expression1Expression2Difference
    getPersonalNamespaceSizegetOtherUserNamespaceSizeMETHOD_INVOCATION_NAME_MISMATCH
    14
    if (namespaces.getOtherUserNamespaceSize() > 0)
    9
    it = namespaces.getPersonalIterator();
    9
    it = namespaces.getPersonalIterator();
    15
    it = namespaces.getOtherUserIterator();
    Differences
    Expression1Expression2Difference
    getPersonalIteratorgetOtherUserIteratorMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression namespaces.getPersonalIterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression namespaces.getOtherUserIterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15
    it = namespaces.getOtherUserIterator();
    10
    while (it.hasNext())
    16
    while (it.hasNext())
    11
    Namespace pN = (Namespace)it.next();
    17
    Namespace pN = (Namespace)it.next();
    12
    ListInfo[] list = store.list("", pN.getPrefix() + '%');
    18
    ListInfo[] list = store.list("", pN.getPrefix() + '%');
    13
    result.addAll(Arrays.asList(list));
    19
    result.addAll(Arrays.asList(list));
    Precondition Violations (2)
    Row Violation
    1Expression namespaces.getPersonalIterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression namespaces.getOtherUserIterator() cannot be parameterized, because it has dependencies to/from statements that will be extracted