try { is.close(); } catch (Exception e) { s_log.error("closeInputStream: Unable to close InputStream - " + e.getMessage(), e); }
if (printJob.printDialog()) { try { printJob.print(); } catch (PrinterException pe) { s_log.error("Error printing", pe); } }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/util/IOUtilitiesImpl.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/util/PrintUtilities.java
Method name: void closeInputStream(InputStream) Method name: void print()
Number of AST nodes: 2 Number of AST nodes: 3
1
try
2
			{
3
				is.close();
4
			}
5
			catch (
1
if (printJob.printDialog()) {
2
            try {
3
                printJob.print();
6
Exception e)
4
            } catch (PrinterException pe)
7
			{
8
				s_log.error("closeInputStream: Unable to close InputStream - " + e.getMessage(), e);
9
			
5
 {
6
                s_log.error("Error printing", pe);
7
            }
10
}
8
        }
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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    4
    try
    Differences
    Expression1Expression2Difference
    java.lang.Exceptionjava.awt.print.PrinterExceptionSUBCLASS_TYPE_MISMATCH
    epeVARIABLE_NAME_MISMATCH
    java.lang.Exceptionjava.awt.print.PrinterExceptionSUBCLASS_TYPE_MISMATCH
    "closeInputStream: Unable to close InputStream - " + e.getMessage()"Error printing"TYPE_COMPATIBLE_REPLACEMENT
    epeVARIABLE_NAME_MISMATCH
    java.lang.Exceptionjava.awt.print.PrinterExceptionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression "closeInputStream: Unable to close InputStream - " + e.getMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    try
    3
    is.close();
    3
    is.close();
    Preondition Violations
    Unmatched statement is.close(); 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
                                
                                            
    5
    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
    5
    printJob.print();
    Precondition Violations (4)
    Row Violation
    1Expression "closeInputStream: Unable to close InputStream - " + e.getMessage() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Unmatched statement is.close(); 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
    3Unmatched 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
    4The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.fw.util.IOUtilitiesImpl and net.sourceforge.squirrel_sql.client.util.PrintUtilities do not have a common superclass