if (child instanceof AbstractMessageFolder) { try { ((AbstractMessageFolder) child).save(); } catch (Exception ex) { ex.printStackTrace(); } }
try { Desktop.browse(url); } catch (DesktopException e) { JOptionPane.showMessageDialog(FrameManager.getInstance() .getActiveFrame(), GlobalResourceLoader.getString( "org.columba.core.i18n.dialog", "error", "no_browser"), "Error", JOptionPane.ERROR_MESSAGE); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/tree/FolderTreeModel.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/desktop/JDICDesktop.java
Method name: void saveFolder(IMailFolder) Method name: void browse(URL)
Number of AST nodes: 3 Number of AST nodes: 2
1
if (child instanceof AbstractMessageFolder) {
2
						try {
3
							((AbstractMessageFolder) child).save();
4
						} catch (Exception ex) {
5
							ex.printStackTrace();
6
						}
7
			
1
try {
2
			Desktop.browse(url);
3
		} catch (DesktopException e) {
4
			JOptionPane.showMessageDialog(FrameManager.getInstance()
5
					.getActiveFrame(), GlobalResourceLoader.getString(
6
					"org.columba.core.i18n.dialog", "error", "no_browser"),
7
					"Error", JOptionPane.ERROR_MESSAGE);
8
		}
8
		}
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.3
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)22.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    1
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionorg.jdesktop.jdic.desktop.DesktopExceptionSUBCLASS_TYPE_MISMATCH
    exeVARIABLE_NAME_MISMATCH
    java.lang.Exceptionorg.jdesktop.jdic.desktop.DesktopExceptionSUBCLASS_TYPE_MISMATCH
    printStackTraceshowMessageDialogMETHOD_INVOCATION_NAME_MISMATCH
    java.lang.Exceptionjavax.swing.JOptionPaneVARIABLE_TYPE_MISMATCH
    ex.printStackTrace()JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE)TYPE_COMPATIBLE_REPLACEMENT
    ex.printStackTrace()JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ex.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ex.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized
    Expression ex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.Exception of variable ex does not match with type javax.swing.JOptionPane of variable JOptionPane
    • Make classes java.lang.Exception and javax.swing.JOptionPane extend a common superclass
    Expression ex.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ex.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized
    1
    try
    6
    ((AbstractMessageFolder)child).save();
    6
    ((AbstractMessageFolder)child).save();
    2
    Desktop.browse(url);
    Differences
    Expression1Expression2Difference
    savebrowseMETHOD_INVOCATION_NAME_MISMATCH
    ((AbstractMessageFolder)child)DesktopAST_TYPE_MISMATCH
    ((AbstractMessageFolder)child).save()Desktop.browse(url)TYPE_COMPATIBLE_REPLACEMENT
    ((AbstractMessageFolder)child).save()Desktop.browse(url)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Desktop.browse(url) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    Expression Desktop.browse(url) is a void method call, and thus it cannot be parameterized
    Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression Desktop.browse(url) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    Expression Desktop.browse(url) is a void method call, and thus it cannot be parameterized
    2
    Desktop.browse(url);
    Precondition Violations (17)
    Row Violation
    1Expression ex.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression ex.printStackTrace() is a void method call, and thus it cannot be parameterized
    3Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized
    4Expression ex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.lang.Exception of variable ex does not match with type javax.swing.JOptionPane of variable JOptionPane
    6Expression ex.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression ex.printStackTrace() is a void method call, and thus it cannot be parameterized
    8Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized
    9Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    10Expression Desktop.browse(url) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    11Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    12Expression Desktop.browse(url) is a void method call, and thus it cannot be parameterized
    13Expression ((AbstractMessageFolder)child).save() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    14Expression Desktop.browse(url) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    15Expression ((AbstractMessageFolder)child).save() is a void method call, and thus it cannot be parameterized
    16Expression Desktop.browse(url) is a void method call, and thus it cannot be parameterized
    17The refactoring of the clones is infeasible, because classes and org.columba.core.desktop.JDICDesktop do not have a common superclass