if (printJob.printDialog()) { try { printJob.print(); } catch (PrinterException e) { e.printStackTrace(); } }
while (!(FrameManager.getInstance().getActiveFrame().isDisplayable())) { try { Thread.sleep(100); } catch (InterruptedException e) { LOG.severe(e.getMessage()); } }
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/core/src/main/java/org/columba/core/print/cDocument.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/main/MailMain.java
Method name: void print(int, int) Method name: void checkDefaultClient()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (printJob.printDialog()) {
2
            try {
3
                printJob.print();
4
            
1
while (!(FrameManager.getInstance().getActiveFrame().isDisplayable())) {
2
					try {
3
						Thread.sleep(100);
5
} catch (PrinterException e) {
4
					} catch (InterruptedException e) {
6
                e.printStackTrace();
7
            }
8
        
5
						LOG.severe(e.getMessage());
6
					}
9
}
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 comparisons5
  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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    10
    try
    10
    try
    11
    try
    Differences
    Expression1Expression2Difference
    java.awt.print.PrinterExceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    java.awt.print.PrinterExceptionjava.lang.InterruptedExceptionSUBCLASS_TYPE_MISMATCH
    printStackTracesevereMETHOD_INVOCATION_NAME_MISMATCH
    eLOGVARIABLE_NAME_MISMATCH
    java.awt.print.PrinterExceptionjava.util.logging.LoggerVARIABLE_TYPE_MISMATCH
    e.printStackTrace()LOG.severe(e.getMessage())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.getMessage()) 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.getMessage()) 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.awt.print.PrinterException of variable e does not match with type java.util.logging.Logger of variable LOG
    • Make classes java.awt.print.PrinterException 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.getMessage()) 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.getMessage()) is a void method call, and thus it cannot be parameterized
    11
    try
    11
    printJob.print();
    11
    printJob.print();
    Preondition Violations
    Unmatched statement printJob.print(); 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
                                              
                                                
    12
    Thread.sleep(100);
    Preondition Violations
    Unmatched statement Thread.sleep(100); 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
    12
    Thread.sleep(100);
    Precondition Violations (12)
    Row Violation
    1Expression e.printStackTrace() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression LOG.severe(e.getMessage()) 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.getMessage()) 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.awt.print.PrinterException 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.getMessage()) 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.getMessage()) is a void method call, and thus it cannot be parameterized
    11Unmatched statement printJob.print(); 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 Thread.sleep(100); 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