try { // at the moment we are only supporting gpg. So let us code hard // here the gpg driver JSCFDriverManager.registerJSCFDriver(new GPGDriver()); } catch (JSCFException e) { e.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/pgp/JSCFController.java File path: /columba-1.4-src/core/src/main/java/org/columba/core/desktop/JDICDesktop.java
Method name: void registerDrivers() Method name: void browse(URL)
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
			// at the moment we are only supporting gpg. So let us code hard
2
			
3
			// here the gpg driver
4
			JSCFDriverManager.registerJSCFDriver(new GPGDriver());
5
		} catch (JSCFException e) {
6
			e.printStackTrace(
3
Desktop.browse(url);
4
		} catch (DesktopException e) {
5
			JOptionPane.showMessageDialog(FrameManager.getInstance()
6
					.getActiveFrame(), GlobalResourceLoader.getString(
7
					"org.columba.core.i18n.dialog", "error", "no_browser"),
7
);
8
					"Error", JOptionPane.ERROR_MESSAGE);
8
		}
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.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)25.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    org.waffel.jscf.JSCFExceptionorg.jdesktop.jdic.desktop.DesktopExceptionSUBCLASS_TYPE_MISMATCH
    org.waffel.jscf.JSCFExceptionorg.jdesktop.jdic.desktop.DesktopExceptionSUBCLASS_TYPE_MISMATCH
    printStackTraceshowMessageDialogMETHOD_INVOCATION_NAME_MISMATCH
    org.waffel.jscf.JSCFExceptionjavax.swing.JOptionPaneVARIABLE_TYPE_MISMATCH
    e.printStackTrace()JOptionPane.showMessageDialog(FrameManager.getInstance().getActiveFrame(),GlobalResourceLoader.getString("org.columba.core.i18n.dialog","error","no_browser"),"Error",JOptionPane.ERROR_MESSAGE)TYPE_COMPATIBLE_REPLACEMENT
    e.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 e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e.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 e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.waffel.jscf.JSCFException of variable e does not match with type javax.swing.JOptionPane of variable JOptionPane
    • Make classes org.waffel.jscf.JSCFException and javax.swing.JOptionPane extend a common superclass
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression e.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);
    2
    JSCFDriverManager.registerJSCFDriver(new GPGDriver());
    2
    JSCFDriverManager.registerJSCFDriver(new GPGDriver());
    Preondition Violations
    Unmatched statement JSCFDriverManager.registerJSCFDriver(new GPGDriver()); 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 (10)
    Row Violation
    1Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression e.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 e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type org.waffel.jscf.JSCFException of variable e does not match with type javax.swing.JOptionPane of variable JOptionPane
    6Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression e.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 JSCFDriverManager.registerJSCFDriver(new GPGDriver()); 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