IMailFolder folder = getSourceFolder(); folder.addFolderListener(this); if (isRecursive()) { FolderChildrenIterator it = new FolderChildrenIterator(folder); while (it.hasMoreChildren()) { IMailFolder next = it.nextChild(); if (!(next instanceof VirtualFolder) && (next instanceof IMailbox)) { next.addFolderListener(this); } } }
IMailFolder folder = getSourceFolder(); folder.removeFolderListener(this); if (isRecursive()) { FolderChildrenIterator it = new FolderChildrenIterator(folder); while (it.hasMoreChildren()) { IMailFolder next = it.nextChild(); if (!(next instanceof VirtualFolder)) { next.removeFolderListener(this); } } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/virtual/VirtualFolder.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/virtual/VirtualFolder.java
Method name: void registerWithSource() Method name: void unregisterWithSource()
Number of AST nodes: 8 Number of AST nodes: 8
1
IMailFolder folder = getSourceFolder();
1
IMailFolder folder = getSourceFolder();
2
		folder.addFolderListener(this);
2
		folder.removeFolderListener(this);
3
		if (isRecursive()) {
3
		if (isRecursive()) {
4
			FolderChildrenIterator it = new FolderChildrenIterator(folder);
4
			FolderChildrenIterator it = new FolderChildrenIterator(folder);
5
			while (it.hasMoreChildren()) {
5
			while (it.hasMoreChildren()) {
6
				IMailFolder next = it.nextChild();
6
				IMailFolder next = it.nextChild();
7
				if (!(next instanceof VirtualFolder)
7
				if (!(next instanceof VirtualFolder)
8
						&& (next instanceof IMailbox)) {
8
) {
9
					next.addFolderListener(this);
9
					next.removeFolderListener(this);
10
				}
10
				}
11
			}
11
			}
12
		}
12
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons1