try { Desktop.open(file); } catch (DesktopException e) { JOptionPane.showMessageDialog(FrameManager.getInstance() .getActiveFrame(), GlobalResourceLoader.getString( "org.columba.core.i18n.dialog", "error", "no_viewer"), "Error", JOptionPane.ERROR_MESSAGE); return false; } return true;
try { Address.parse(address); } catch (ParserException pe) { JOptionPane.showMessageDialog(this, MailResourceLoader.getString("dialog", "account", "invalidaddress")); return false; }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/desktop/JDICDesktop.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/account/IdentityPanel.java
Method name: boolean open(File) Method name: boolean isFinished()
Number of AST nodes: 3 Number of AST nodes: 2
1
try {
1
try {
2
			Desktop.open(file);
3
		
2
                Address.parse(address);
4
} catch (DesktopException e) {
3
            } catch (ParserException pe) {
5
			JOptionPane.showMessageDialog(FrameManager.getInstance()
4
                JOptionPane.showMessageDialog(
6
					.getActiveFrame(), GlobalResourceLoader.getString(
7
					"org.columba.core.i18n.
5
this,
8
dialog", "error", "no_viewer"),
6
                    MailResourceLoader.getString("dialog", "
9
					"Error", JOptionPane.ERROR_MESSAGE);
10
			return false;
11
		}
12
		return true;
7
account", "invalidaddress"));
8
                return false;
9
            }
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.2
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 fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)18.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    8
    try
    Differences
    Expression1Expression2Difference
    org.jdesktop.jdic.desktop.DesktopExceptionorg.columba.ristretto.parser.ParserExceptionSUBCLASS_TYPE_MISMATCH
    epeVARIABLE_NAME_MISMATCH
    org.jdesktop.jdic.desktop.DesktopExceptionorg.columba.ristretto.parser.ParserExceptionSUBCLASS_TYPE_MISMATCH
    JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_viewer"),"Error",JOptionPane.ERROR_MESSAGE)JOptionPane.showMessageDialog(this,MailResourceLoader.getString("dialog","account","invalidaddress"))ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_viewer"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized
    Expression JOptionPane.showMessageDialog(this,MailResourceLoader.getString("dialog","account","invalidaddress")) is a void method call, and thus it cannot be parameterized
    8
    try
    2
    Desktop.open(file);
    2
    Desktop.open(file);
    Preondition Violations
    Unmatched statement Desktop.open(file); 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
                                                
                                                        
    9
    Address.parse(address);
    Preondition Violations
    Unmatched statement Address.parse(address); 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
    9
    Address.parse(address);
    3
    return true;
    3
    return true;
    Preondition Violations
    Unmatched return true;
                                  
    Precondition Violations (5)
    Row Violation
    1Expression JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_viewer"),"Error",JOptionPane.ERROR_MESSAGE) is a void method call, and thus it cannot be parameterized
    2Expression JOptionPane.showMessageDialog(this,MailResourceLoader.getString("dialog","account","invalidaddress")) is a void method call, and thus it cannot be parameterized
    3Unmatched statement Desktop.open(file); 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
    4Unmatched statement Address.parse(address); 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
    5Unmatched return true;