try { String pluginID = (String) data.getData("Plugin.ID"); IExtension extension = pluginHandler.getExtension(pluginID); importer = (DefaultAddressbookImporter) extension .instanciateExtension(args); importer.run(); } catch (Exception ex) { ex.printStackTrace(); if (ex.getCause() != null) { ex.getCause().printStackTrace(); } return; }
try { List files = (List) data.getTransferData(DataFlavor.javaFileListFlavor); for (Iterator iterator = files.iterator(); iterator.hasNext();) { attachmentController.addFileAttachment((File) iterator.next()); } dataWasImported = true; } catch (UnsupportedFlavorException e) { LOG.warning("A transferable with unsupported flavors tried to import data into the attachment gui."); } catch (IOException e) { LOG.warning("The data that was DnD into the attachment was no longer available."); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/dialog/importfilter/AddressbookImporter.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/composer/ComposerAttachmentTransferHandler.java
Method name: void wizardFinished(WizardModelEvent) Method name: boolean importData(JComponent, Transferable)
Number of AST nodes: 5 Number of AST nodes: 5
1
try {
1
try {
2
			String pluginID = (String) data.getData("Plugin.ID");
3
			IExtension extension = pluginHandler.getExtension(pluginID);
4
			i
2
            List files = (List) data.getTransferData(DataFlavor.javaFileListFlavor);
3
            for (Iterator iterator = files.iterator(); iterator.hasNext();) {
4
                attachmentController.addFileAttachment((File) iterator.next());
5
            }
5
mporter = (DefaultAddressbookImporter) extension
6
            dataWasImported = 
6
					.instanciateExtension(args);
7
			importer.run();
8
		
7
true;
8
        } catch (UnsupportedFlavorException e) {
9
            LOG.warning("A transferable with unsupported flavors tried to import data into the attachment gui.");
9
} catch (Exception ex) {
10
        } catch (IOException e) {
10
			ex.printStackTrace();
11
			if (ex.getCause() != null) {
12
				ex.getCause().printStackTrace();
13
			}
14
			return;
15
		
11
            LOG.warning("The data that was DnD into the attachment was no longer available.");
16
}
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.0
Clones locationClones are in different classes
Number of node comparisons1