if (_refreshPeriod != seconds) { _refreshPeriod = seconds; resetTimer(); }
if (show != _showLoadedDriversOnly) { _showLoadedDriversOnly = show; load(); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/sessioninfo/SessionInfoPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/db/DriversListModel.java
Method name: void setAutoRefreshPeriod(int) Method name: void setShowLoadedDriversOnly(boolean)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (_refreshPeriod != seconds)
1
if (
2
      {
3
         _refreshPeriod = seconds;
4
         resetTimer();
5
      
2
show != _showLoadedDriversOnly)
3
		{
4
			_showLoadedDriversOnly = show;
5
			load();
6
}
6
		}
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 in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)57.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_refreshPeriod != seconds)
    1
    if (_refreshPeriod != seconds)
    1
    if (show != _showLoadedDriversOnly)
    Differences
    Expression1Expression2Difference
    _refreshPeriodshowVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    seconds_showLoadedDriversOnlyVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable _refreshPeriod does not match with type boolean of variable show
    Type int of variable seconds does not match with type boolean of variable _showLoadedDriversOnly
    1
    if (show != _showLoadedDriversOnly)
                                                                  
    2
    _showLoadedDriversOnly = show;
    Preondition Violations
    Unmatched statement _showLoadedDriversOnly=show; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    _showLoadedDriversOnly = show;
    2
    _refreshPeriod = seconds;
    2
    _refreshPeriod = seconds;
    Preondition Violations
    Unmatched statement _refreshPeriod=seconds; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                        
    3
    resetTimer();
    3
    resetTimer();
    3
    load();
    Differences
    Expression1Expression2Difference
    resetTimerloadMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression resetTimer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method resetTimer
    Expression load() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    • Inline private method load
    Expression resetTimer() is a void method call, and thus it cannot be parameterized
    Expression load() is a void method call, and thus it cannot be parameterized
    3
    load();
    Precondition Violations (9)
    Row Violation
    1Type int of variable _refreshPeriod does not match with type boolean of variable show
    2Type int of variable seconds does not match with type boolean of variable _showLoadedDriversOnly
    3Unmatched statement _showLoadedDriversOnly=show; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement _refreshPeriod=seconds; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Expression resetTimer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression load() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression resetTimer() is a void method call, and thus it cannot be parameterized
    8Expression load() is a void method call, and thus it cannot be parameterized
    9The refactoring of the clones is infeasible, because classes net.sourceforge.squirrel_sql.plugins.oracle.sessioninfo.SessionInfoPanel and net.sourceforge.squirrel_sql.client.gui.db.DriversListModel do not have a common superclass