try { identity = new Identity(e); } catch (ParserException 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/config/AccountItem.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/desktop/JDICDesktop.java
Method name: Identity getIdentity() Method name: void browse(URL)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
                    identity = new Identity(e);
3
                
2
			Desktop.browse(url);
4
} catch (ParserException ex) {
3
		} catch (DesktopException e) {
5
                    ex.printStackTrace();
6
                
4
			JOptionPane.showMessageDialog(FrameManager.getInstance()
5
					.getActiveFrame(), GlobalResourceLoader.getString(
6
					"org.columba.core.i18n.dialog", "error", "no_browser"),
7
					"Error", JOptionPane.ERROR_MESSAGE);
7
}
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.4
Clones locationClones are in different classes
Number of node comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)22.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    try
    5
    try
    1
    try
    Differences
    Expression1Expression2Difference
    org.columba.ristretto.parser.ParserExceptionorg.jdesktop.jdic.desktop.DesktopExceptionSUBCLASS_TYPE_MISMATCH
    exeVARIABLE_NAME_MISMATCH
    org.columba.ristretto.parser.ParserExceptionorg.jdesktop.jdic.desktop.DesktopExceptionSUBCLASS_TYPE_MISMATCH
    printStackTraceshowMessageDialogMETHOD_INVOCATION_NAME_MISMATCH
    org.columba.ristretto.parser.ParserExceptionjavax.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 org.columba.ristretto.parser.ParserException of variable ex does not match with type javax.swing.JOptionPane of variable JOptionPane
    • Make classes org.columba.ristretto.parser.ParserException 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
                                                  
    2
    Desktop.browse(url);
    Preondition Violations
    Unmatched statement Desktop.browse(url); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    2
    Desktop.browse(url);
    6
    identity = new Identity(e);
    6
    identity = new Identity(e);
    Preondition Violations
    Unmatched statement identity=new Identity(e); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement identity=new Identity(e); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                            
    Precondition Violations (12)
    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 org.columba.ristretto.parser.ParserException 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
    9Unmatched statement Desktop.browse(url); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    10Unmatched statement identity=new Identity(e); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11Unmatched statement identity=new Identity(e); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    12The refactoring of the clones is infeasible, because classes org.columba.mail.config.AccountItem and org.columba.core.desktop.JDICDesktop do not have a common superclass