_app = app; if (listener == null) { listener = new GlobalPrefsListener(); GlobalPreferencesSheet.addGlobalPreferencesActionListener(listener); }
super.addNotify(); if (_listLis == null) { _listLis = new StylesListSelectionListener(); _stylesList.addListSelectionListener(_listLis); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/UpdateControllerImpl.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/SyntaxPreferencesPanel.java
Method name: void UpdateControllerImpl(IApplication) Method name: void addNotify()
Number of AST nodes: 4 Number of AST nodes: 4
1
_app = app;
1
super.addNotify();
2
		if (listener == null)
2
			if (_listLis == null)
3
		{
3
			{
4
			listener = new GlobalPrefsListener();
4
				_listLis = new 
5
			GlobalPreferencesSheet.addGlobalPreferencesA
5
StylesListSelectionListener();
6
ctionListener(listener);
6
				_stylesList.addListSelectionListener(_listLis);
7
		}
7
			}
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 comparisons10
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)18.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                              
    1
    super.addNotify();
    1
    _app = app;
    1
    _app = app;
    Preondition Violations
    Unmatched statement _app=app; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                            
    2
    if (listener == null)
    2
    if (listener == null)
    2
    if (_listLis == null)
    Differences
    Expression1Expression2Difference
    listener_listLisVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.client.update.UpdateControllerImpl.GlobalPrefsListenernet.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesPanel.MyPanel.StylesListSelectionListenerVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.client.update.UpdateControllerImpl.GlobalPrefsListener of variable listener does not match with type net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesPanel.MyPanel.StylesListSelectionListener of variable _listLis
    • Make classes net.sourceforge.squirrel_sql.client.update.UpdateControllerImpl.GlobalPrefsListener and net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesPanel.MyPanel.StylesListSelectionListener extend a common superclass
    2
    if (_listLis == null)
                                                                                                
    3
    _listLis = new StylesListSelectionListener();
    Preondition Violations
    Unmatched statement _listLis=new StylesListSelectionListener(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    _listLis = new StylesListSelectionListener();
    3
    listener = new GlobalPrefsListener();
    3
    listener = new GlobalPrefsListener();
    Preondition Violations
    Unmatched statement listener=new GlobalPrefsListener(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                
                                                                                                        
    4
    _stylesList.addListSelectionListener(_listLis);
    Preondition Violations
    Unmatched statement _stylesList.addListSelectionListener(_listLis); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    _stylesList.addListSelectionListener(_listLis);
    4
    GlobalPreferencesSheet.addGlobalPreferencesActionListener(listener);
    4
    GlobalPreferencesSheet.addGlobalPreferencesActionListener(listener);
    Preondition Violations
    Unmatched statement GlobalPreferencesSheet.addGlobalPreferencesActionListener(listener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                  
    Precondition Violations (7)
    Row Violation
    1Unmatched statement _app=app; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Type net.sourceforge.squirrel_sql.client.update.UpdateControllerImpl.GlobalPrefsListener of variable listener does not match with type net.sourceforge.squirrel_sql.plugins.syntax.SyntaxPreferencesPanel.MyPanel.StylesListSelectionListener of variable _listLis
    3Unmatched statement _listLis=new StylesListSelectionListener(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement listener=new GlobalPrefsListener(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement _stylesList.addListSelectionListener(_listLis); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement GlobalPreferencesSheet.addGlobalPreferencesActionListener(listener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero