package org.columba.mail.gui.config.subscribe; import org.columba.api.command.IWorkerStatusController; import org.columba.core.command.Command; import org.columba.mail.folder.imap.IMAPRootFolder; import org.columba.mail.imap.IImapServer; public class SubscribeFolderCommand extends Command { private IMAPRootFolder root; private IImapServer store; /** * @param references */ public SubscribeFolderCommand(SubscribeCommandReference reference) { super(reference); } /* * (non-Javadoc) * * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker) */ public void execute(IWorkerStatusController worker) throws Exception { SubscribeCommandReference subscribeReference = (SubscribeCommandReference) getReference(); root = (IMAPRootFolder) subscribeReference.getSourceFolder(); store = root.getServer(); store.subscribeFolder(subscribeReference.getMailbox()); } /* * (non-Javadoc) * * @see org.columba.api.command.Command#updateGUI() */ public void updateGUI() throws Exception { SubscribeDialog dialog = ((SubscribeCommandReference) getReference()) .getDialog(); dialog.subscribeDone(); }
package org.columba.mail.gui.config.subscribe; import org.columba.api.command.IWorkerStatusController; import org.columba.core.command.Command; import org.columba.mail.folder.imap.IMAPRootFolder; import org.columba.mail.imap.IImapServer; public class UnsubscribeFolderCommand extends Command { private IMAPRootFolder root; private IImapServer store; /** * @param references */ public UnsubscribeFolderCommand(SubscribeCommandReference reference) { super(reference); } /* * (non-Javadoc) * * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker) */ public void execute(IWorkerStatusController worker) throws Exception { SubscribeCommandReference subscribeReference = (SubscribeCommandReference) getReference(); root = (IMAPRootFolder) subscribeReference.getSourceFolder(); store = root.getServer(); store.unsubscribeFolder(subscribeReference.getMailbox()); } /* * (non-Javadoc) * * @see org.columba.api.command.Command#updateGUI() */ public void updateGUI() throws Exception { SubscribeDialog dialog = ((SubscribeCommandReference) getReference()) .getDialog(); dialog.unsubscribeDone(); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/subscribe/SubscribeFolderCommand.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/subscribe/UnsubscribeFolderCommand.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
package org.columba.mail.gui.config.subscribe;
1
package org.columba.mail.gui.config.subscribe;
2
import org.columba.api.command.IWorkerStatusController;
2
import org.columba.api.command.IWorkerStatusController;
3
import org.columba.core.command.Command;
3
import org.columba.core.command.Command;
4
import org.columba.mail.folder.imap.IMAPRootFolder;
4
import org.columba.mail.folder.imap.IMAPRootFolder;
5
import org.columba.mail.imap.IImapServer;
5
import org.columba.mail.imap.IImapServer;
6
public class SubscribeFolderCommand extends Command {
6
public class UnsubscribeFolderCommand extends Command {
7
	private IMAPRootFolder root;
7
	private IMAPRootFolder root;
8
	private IImapServer store;
8
	private IImapServer store;
9
	/**
9
	/**
10
	 * @param references
10
	 * @param references
11
	 */
11
	 */
12
	public SubscribeFolderCommand(SubscribeCommandReference reference) {
12
	public UnsubscribeFolderCommand(SubscribeCommandReference reference) {
13
		super(reference);
13
		super(reference);
14
	}
14
	}
15
	/*
15
	/*
16
	 * (non-Javadoc)
16
	 * (non-Javadoc)
17
	 * 
17
	 * 
18
	 * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker)
18
	 * @see org.columba.api.command.Command#execute(org.columba.api.command.Worker)
19
	 */
19
	 */
20
	public void execute(IWorkerStatusController worker) throws Exception {
20
	public void execute(IWorkerStatusController worker) throws Exception {
21
		SubscribeCommandReference subscribeReference = (SubscribeCommandReference) getReference();
21
		SubscribeCommandReference subscribeReference = (SubscribeCommandReference) getReference();
22
		root = (IMAPRootFolder) subscribeReference.getSourceFolder();
22
		root = (IMAPRootFolder) subscribeReference.getSourceFolder();
23
		store = root.getServer();
23
		store = root.getServer();
24
		store.subscribeFolder(subscribeReference.getMailbox());
24
		store.unsubscribeFolder(subscribeReference.getMailbox());
25
	}
25
	}
26
	/*
26
	/*
27
	 * (non-Javadoc)
27
	 * (non-Javadoc)
28
	 * 
28
	 * 
29
	 * @see org.columba.api.command.Command#updateGUI()
29
	 * @see org.columba.api.command.Command#updateGUI()
30
	 */
30
	 */
31
	public void updateGUI() throws Exception {
31
	public void updateGUI() throws Exception {
32
		SubscribeDialog dialog = ((SubscribeCommandReference) getReference())
32
		SubscribeDialog dialog = ((SubscribeCommandReference) getReference())
33
				.getDialog();
33
				.getDialog();
34
		dialog.subscribeDone();
34
		dialog.unsubscribeDone();
35
	}
35
	}
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