try { op.finish(); } catch (Exception e) { // Must create a ExceptionProcessor e.printStackTrace(); } unregister(); boss.operationFinished(op, this);
try { mboxFile.createNewFile(); } catch (IOException e) { LOG.severe(e.getLocalizedMessage()); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/command/Worker.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/folder/mbox/MboxDataStorage.java
Method name: void finished() Method name: void MboxDataStorage(AbstractMessageFolder)
Number of AST nodes: 4 Number of AST nodes: 2
1
try {
1
try {
2
	    op.finish();
2
				mboxFile.createNewFile();
3
	} catch (Exception e) {
3
			} catch (IOException e) {
4
	    // Must create a ExceptionProcessor
4
	
5
	    e.printStackTrace();
5
			LOG.severe(e.getLocalizedMessage());
6
	}
6
	
7
	unregister();
8
	boss.operationFinished(op, this);
7
		}
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 statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    6
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Exceptionjava.io.IOExceptionSUBCLASS_TYPE_MISMATCH
    printStackTracesevereMETHOD_INVOCATION_NAME_MISMATCH
    eLOGVARIABLE_NAME_MISMATCH
    java.lang.Exceptionjava.util.logging.LoggerVARIABLE_TYPE_MISMATCH
    e.printStackTrace()LOG.severe(e.getLocalizedMessage())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.severe(e.getLocalizedMessage()) 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 LOG.severe(e.getLocalizedMessage()) 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 java.lang.Exception of variable e does not match with type java.util.logging.Logger of variable LOG
    • Make classes java.lang.Exception and java.util.logging.Logger extend a common superclass
    Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression LOG.severe(e.getLocalizedMessage()) 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 LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    6
    try
    2
    op.finish();
    2
    op.finish();
    Preondition Violations
    Unmatched statement op.finish(); 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
                                  
                                                            
    7
    mboxFile.createNewFile();
    Preondition Violations
    Unmatched statement mboxFile.createNewFile(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement mboxFile.createNewFile(); 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
    7
    mboxFile.createNewFile();
    3
    unregister();
    3
    unregister();
    Preondition Violations
    Unmatched statement unregister(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                    
    4
    boss.operationFinished(op, this);
    4
    boss.operationFinished(op, this);
    Preondition Violations
    Unmatched statement boss.operationFinished(op,this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                          
    Precondition Violations (16)
    Row Violation
    1Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression LOG.severe(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    4Expression LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    5Expression e cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.Exception of variable e does not match with type java.util.logging.Logger of variable LOG
    7Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression LOG.severe(e.getLocalizedMessage()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression e.printStackTrace() is a void method call, and thus it cannot be parameterized
    10Expression LOG.severe(e.getLocalizedMessage()) is a void method call, and thus it cannot be parameterized
    11Unmatched statement op.finish(); 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
    12Unmatched statement mboxFile.createNewFile(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    13Unmatched statement mboxFile.createNewFile(); 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
    14Unmatched statement unregister(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    15Unmatched statement boss.operationFinished(op,this); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    16The refactoring of the clones is infeasible, because classes org.columba.core.command.Worker and org.columba.mail.folder.mbox.MboxDataStorage do not have a common superclass