try { persistence.save(); } catch (Exception e) { e.printStackTrace(); }
try { commandSemaphore.waitUntilReleased(); } catch (InterruptedException e) { LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted."); }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/config/Config.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/message/command/SaveAttachmentTemporaryCommand.java
Method name: void run() Method name: void waitForCommandToComplete()
Number of AST nodes: 2 Number of AST nodes: 2
1
try {
1
try {
2
					persistence.save();
3
				} catch (Exception e) {
4
					e.printStackTrace();
5
				
2
            commandSemaphore.waitUntilReleased();
3
        } catch (InterruptedException e) {
4
            LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted.");
6
}
5
        }
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 fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    try
    1
    try
    1
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.Exceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    printStackTracewarningMETHOD_INVOCATION_NAME_MISMATCH
    eLOGVARIABLE_NAME_MISMATCH
    java.lang.Exceptionjava.util.logging.LoggerVARIABLE_TYPE_MISMATCH
    e.printStackTrace()LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted.")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 LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted.") 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 e.printStackTrace() is a void method call, and thus it cannot be parameterized
    Expression LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted.") is a void method call, and thus it cannot be parameterized
    1
    try
                                                                                    
    2
    commandSemaphore.waitUntilReleased();
    Preondition Violations
    Unmatched statement commandSemaphore.waitUntilReleased(); 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
    commandSemaphore.waitUntilReleased();
    2
    persistence.save();
    2
    persistence.save();
    Preondition Violations
    Unmatched statement persistence.save(); 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 (11)
    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 LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted.") 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 java.lang.Exception of variable e does not match with type java.util.logging.Logger of variable LOG
    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 LOG.warning("The thread waiting for the Save Attachment Temporary command was interrupted.") is a void method call, and thus it cannot be parameterized
    9Unmatched statement commandSemaphore.waitUntilReleased(); 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 persistence.save(); 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
    11The refactoring of the clones is infeasible, because classes and org.columba.mail.gui.message.command.SaveAttachmentTemporaryCommand do not have a common superclass