synchronized (chars) { try { chars.wait(); } catch (InterruptedException e) { } }
if (rs != null) { try { rs.close(); } catch (SQLException e) {} }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/parser/kernel/ParserThread.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java
Method name: void waitChars() Method name: IDataSet createDataSet()
Number of AST nodes: 3 Number of AST nodes: 3
1
synchronized (chars)
2
				{
3
					try
4
					{
5
						chars.wait();
6
					}
7
					catch (InterruptedException e)
8
					{
9
					}
10
				
1
if (rs != null) {
2
                try { rs.close(); } catch (SQLException e) {}
11
}
3
            }
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.2
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.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    try
    3
    try
    46
    try
    Differences
    Expression1Expression2Difference
    java.lang.InterruptedExceptionjava.sql.SQLExceptionSUBCLASS_TYPE_MISMATCH
    java.lang.InterruptedExceptionjava.sql.SQLExceptionSUBCLASS_TYPE_MISMATCH
    46
    try
    4
    chars.wait();
    4
    chars.wait();
    Preondition Violations
    Unmatched statement chars.wait(); 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
                                    
                                  
    47
    rs.close();
    Preondition Violations
    Unmatched statement rs.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
    47
    rs.close();
    Precondition Violations (3)
    Row Violation
    1Unmatched statement chars.wait(); 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
    2Unmatched statement rs.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
    3The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.client.session.parser.kernel.ParserThread.IncrementalBuffer and net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.table.ContentsTab do not have a common superclass