if (obj instanceof Number) { if (((Number)obj).intValue() == 0) { results = Boolean.FALSE; } else { results = Boolean.TRUE; } } else { results = Boolean.valueOf(obj.toString()); }
if (result instanceof Number) { if (((Number) result).intValue() == 0) { result = Boolean.FALSE; } else { result = Boolean.TRUE; } } else { result = Boolean.valueOf(result.toString()); }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/ResultSetColumnReader.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/sql/ResultSetReader.java
Method name: Boolean getBoolean(int) Method name: Object readBoolean(int)
Number of AST nodes: 5 Number of AST nodes: 5
1
if (obj instanceof Number)
1
if (result instanceof Number)
2
							{
3
								
2
 {
4
if (((Number)obj).intValue() == 0)
3
            if (((Number) result).intValue() == 0)
5
								{
6
									
4
 {
7
results = Boolean.FALSE;
5
               result = Boolean.FALSE;
8
								}
9
								else
10
								{
11
									
6
            } else {
12
results = Boolean.TRUE;
7
               result = Boolean.TRUE;
13
								}
14
							}
15
							else
16
							{
17
								
8
            }
9
         } else {
18
results = Boolean.valueOf(obj.toString());
10
            result = Boolean.valueOf(result.toString());
19
							}
11
         }
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.4
Clones locationClones are in different classes
Number of node comparisons13
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    13
    if (obj instanceof Number)
    13
    if (obj instanceof Number)
    4
    if (result instanceof Number)
    Differences
    Expression1Expression2Difference
    objresultVARIABLE_NAME_MISMATCH
    4
    if (result instanceof Number)
    14
    if (((Number)obj).intValue() == 0)
    14
    if (((Number)obj).intValue() == 0)
    5
    if (((Number)result).intValue() == 0)
    Differences
    Expression1Expression2Difference
    objresultVARIABLE_NAME_MISMATCH
    5
    if (((Number)result).intValue() == 0)
                                                    
    6
    result = Boolean.FALSE;
    Preondition Violations
    Unmatched statement result=Boolean.FALSE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    result = Boolean.FALSE;
    15
    results = Boolean.FALSE;
    15
    results = Boolean.FALSE;
    Preondition Violations
    Unmatched statement results=Boolean.FALSE; cannot be moved, because it updates a variable modified in other unmapped statements
                                                        
    else
            
                                                  
    7
    result = Boolean.TRUE;
    Preondition Violations
    Unmatched statement result=Boolean.TRUE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    result = Boolean.TRUE;
    16
    results = Boolean.TRUE;
    16
    results = Boolean.TRUE;
    Preondition Violations
    Unmatched statement results=Boolean.TRUE; cannot be moved, because it updates a variable modified in other unmapped statements
                                                      
    else
            
                                                                                              
    8
    result = Boolean.valueOf(result.toString());
    Preondition Violations
    Unmatched statement result=Boolean.valueOf(result.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    result = Boolean.valueOf(result.toString());
    17
    results = Boolean.valueOf(obj.toString());
    17
    results = Boolean.valueOf(obj.toString());
    Preondition Violations
    Unmatched statement results=Boolean.valueOf(obj.toString()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                            
    Precondition Violations (6)
    Row Violation
    1Unmatched statement result=Boolean.FALSE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement result=Boolean.TRUE; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement result=Boolean.valueOf(result.toString()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement results=Boolean.valueOf(obj.toString()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement results=Boolean.FALSE; cannot be moved, because it updates a variable modified in other unmapped statements
    6Unmatched statement results=Boolean.TRUE; cannot be moved, because it updates a variable modified in other unmapped statements