if (_sqlResultsTabPlacement != value) { // if(value == SwingConstants.BOTTOM) // { // // Some way this property slipt into older Property files but it was never // // used earlier. We use this little (ugly) trick to keep users being confused by // // a bottom tab placing. This was introduced for 1.2 beta 7. // // TODO: Remove some time later // if(Preferences.userRoot().getBoolean("Squirrel.TabPlacementCorrectionONFirstStartOf1_2_beta7", true)) // { // value = SwingConstants.TOP; // Preferences.userRoot().putBoolean("Squirrel.TabPlacementCorrectionONFirstStartOf1_2_beta7", false); // } // } final int oldValue = _sqlResultsTabPlacement; _sqlResultsTabPlacement = value; getPropertyChangeReporter().firePropertyChange( IPropertyNames.SQL_RESULTS_TAB_PLACEMENT, oldValue, _sqlResultsTabPlacement); }
if (_contentsLimitRows != value) { final boolean oldValue = _contentsLimitRows; _contentsLimitRows = value; getPropertyChangeReporter().firePropertyChange( IPropertyNames.CONTENTS_LIMIT_ROWS, oldValue, _contentsLimitRows); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionProperties.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/properties/SessionProperties.java
Method name: void setSQLResultsTabPlacement(int) Method name: void setContentsLimitRows(boolean)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (_sqlResultsTabPlacement != value)
1
if (_contentsLimitRows != value)
2
      {
2
      {
3
//         if(value == SwingConstants.BOTTOM)
3
         
4
//         {
5
//            // Some way this property slipt into older Property files but it was never
6
//            // used earlier. We use this little (ugly) trick to keep users being confused by
7
//            // a bottom tab placing. This was introduced for 1.2 beta 7.
8
//            // TODO: Remove some time later
9
//            if(Preferences.userRoot().getBoolean("Squirrel.TabPlacementCorrectionONFirstStartOf1_2_beta7", true))
10
//            {
11
//               value = SwingConstants.TOP;
12
//               Preferences.userRoot().putBoolean("Squirrel.TabPlacementCorrectionONFirstStartOf1_2_beta7", false);
13
//            }
14
//         }
15
         final int oldValue = _sqlResultsTabPlacement;
16
         _sqlResultsTabPlacement
4
final boolean oldValue = _contentsLimitRows;
17
 = value;
5
         _contentsLimitRows = value;
18
         getPropertyChangeReporter().firePropertyChange(
6
         getPropertyChangeReporter().firePropertyChange(
19
            IPropertyNames.SQL_RESULTS_TAB_PLACEMENT,
7
            IPropertyNames.CONTENTS_LIMIT_ROWS,
20
            oldValue, _sqlResultsTabPlacement);
8
            oldValue, _contentsLimitRows);
21
      }
9
      }
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.1
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_sqlResultsTabPlacement != value)
    1
    if (_sqlResultsTabPlacement != value)
    1
    if (_contentsLimitRows != value)
    Differences
    Expression1Expression2Difference
    _sqlResultsTabPlacement_contentsLimitRowsVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable _sqlResultsTabPlacement does not match with type boolean of variable _contentsLimitRows
    Type int of variable value does not match with type boolean of variable value
    1
    if (_contentsLimitRows != value)
                                                                                              
    2
    final boolean oldValue = _contentsLimitRows;
    Preondition Violations
    Unmatched statement final boolean oldValue=_contentsLimitRows; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    final boolean oldValue = _contentsLimitRows;
    2
    final int oldValue = _sqlResultsTabPlacement;
    2
    final int oldValue = _sqlResultsTabPlacement;
    Preondition Violations
    Unmatched statement final int oldValue=_sqlResultsTabPlacement; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                
                                                            
    3
    _contentsLimitRows = value;
    Preondition Violations
    Unmatched statement _contentsLimitRows=value; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    _contentsLimitRows = value;
    3
    _sqlResultsTabPlacement = value;
    3
    _sqlResultsTabPlacement = value;
    Preondition Violations
    Unmatched statement _sqlResultsTabPlacement=value; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    4
    getPropertyChangeReporter().firePropertyChange(IPropertyNames.SQL_RESULTS_TAB_PLACEMENT, oldValue, _sqlResultsTabPlacement);
    4
    getPropertyChangeReporter().firePropertyChange(IPropertyNames.SQL_RESULTS_TAB_PLACEMENT, oldValue, _sqlResultsTabPlacement);
    4
    getPropertyChangeReporter().firePropertyChange(IPropertyNames.CONTENTS_LIMIT_ROWS, oldValue, _contentsLimitRows);
    Differences
    Expression1Expression2Difference
    SQL_RESULTS_TAB_PLACEMENTCONTENTS_LIMIT_ROWSVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    _sqlResultsTabPlacement_contentsLimitRowsVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable oldValue does not match with type boolean of variable oldValue
    Type int of variable _sqlResultsTabPlacement does not match with type boolean of variable _contentsLimitRows
    4
    getPropertyChangeReporter().firePropertyChange(IPropertyNames.CONTENTS_LIMIT_ROWS, oldValue, _contentsLimitRows);
    Precondition Violations (8)
    Row Violation
    1Type int of variable _sqlResultsTabPlacement does not match with type boolean of variable _contentsLimitRows
    2Type int of variable value does not match with type boolean of variable value
    3Unmatched statement final boolean oldValue=_contentsLimitRows; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement final int oldValue=_sqlResultsTabPlacement; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement _contentsLimitRows=value; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement _sqlResultsTabPlacement=value; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Type int of variable oldValue does not match with type boolean of variable oldValue
    8Type int of variable _sqlResultsTabPlacement does not match with type boolean of variable _contentsLimitRows