IQueryTokenizerPreferenceBean _prefs = _prefsManager.getPreferences(); removeMultiLineCommentCheckBox.setSelected(_prefs.isRemoveMultiLineComments()); lineCommentTextField.setText(_prefs.getLineComment()); statementSeparatorTextField.setText(_prefs.getStatementSeparator()); if (_showProcSep) { procedureSeparatorTextField.setText(_prefs.getProcedureSeparator()); } useCustomQTCheckBox.setSelected(_prefs.isInstallCustomQueryTokenizer()); updatePreferenceState();
IQueryTokenizerPreferenceBean _prefs = _prefsManager.getPreferences(); _prefs.setRemoveMultiLineComments(removeMultiLineCommentCheckBox.isSelected()); _prefs.setLineComment(lineCommentTextField.getText()); _prefs.setStatementSeparator(statementSeparatorTextField.getText()); if (_showProcSep) { _prefs.setProcedureSeparator(procedureSeparatorTextField.getText()); } _prefs.setInstallCustomQueryTokenizer(useCustomQTCheckBox.isSelected()); _prefsManager.savePrefs();
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/gui/PluginQueryTokenizerPreferencesPanel.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/plugin/gui/PluginQueryTokenizerPreferencesPanel.java
Method name: void loadData() Method name: void save()
Number of AST nodes: 8 Number of AST nodes: 8
1
IQueryTokenizerPreferenceBean _prefs = _prefsManager.getPreferences();
1
IQueryTokenizerPreferenceBean _prefs = _prefsManager.getPreferences();
2
		removeMultiLineCommentCheckBox.setSelected(
2
		_prefs.setRemoveMultiLineComments(removeMultiLineCommentCheckBox.isSelected());
3
_prefs.isRemoveMultiLineComments());
3
		_prefs.setLineComment
4
		lineCommentTextField.setText(
4
(lineCommentTextField.getText());
5
_prefs.getLineComment());
5
		_prefs.set
6
		statementSeparatorTextField.setText(_prefs.getStatementSeparator());
6
StatementSeparator(statementSeparatorTextField.getText());
7
		if (_showProcSep)
7
		if (_showProcSep)
8
		{
8
		{
9
			procedureSeparatorTextField.setText(_prefs.getProcedureSeparator());
9
			_prefs.setProcedureSeparator
10
		}
11
		useCustomQTCheckBox.setSelected(
10
(procedureSeparatorTextField.getText());
11
		}
12
_prefs.isInstallCustomQueryTokenizer());
12
		_prefs.setInstallCustomQueryTokenizer(
13
		updatePreferenceState
13
useCustomQTCheckBox.isSelected());
14
();
14
		_prefsManager.savePrefs();
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons40
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment5
    Time elapsed for statement mapping (ms)12.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    IQueryTokenizerPreferenceBean _prefs = _prefsManager.getPreferences();
    1
    IQueryTokenizerPreferenceBean _prefs = _prefsManager.getPreferences();
                                                                                                                                                                        
    2
    _prefs.setRemoveMultiLineComments(removeMultiLineCommentCheckBox.isSelected());
    Preondition Violations
    Unmatched statement _prefs.setRemoveMultiLineComments(removeMultiLineCommentCheckBox.isSelected()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2
    _prefs.setRemoveMultiLineComments(removeMultiLineCommentCheckBox.isSelected());
    2
    removeMultiLineCommentCheckBox.setSelected(_prefs.isRemoveMultiLineComments());
    2
    removeMultiLineCommentCheckBox.setSelected(_prefs.isRemoveMultiLineComments());
    Preondition Violations
    Unmatched statement removeMultiLineCommentCheckBox.setSelected(_prefs.isRemoveMultiLineComments()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                        
                                                                                                                      
    3
    _prefs.setLineComment(lineCommentTextField.getText());
    Preondition Violations
    Unmatched statement _prefs.setLineComment(lineCommentTextField.getText()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    _prefs.setLineComment(lineCommentTextField.getText());
    3
    lineCommentTextField.setText(_prefs.getLineComment());
    3
    lineCommentTextField.setText(_prefs.getLineComment());
    Preondition Violations
    Unmatched statement lineCommentTextField.setText(_prefs.getLineComment()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                      
                                                                                                                                                  
    4
    _prefs.setStatementSeparator(statementSeparatorTextField.getText());
    Preondition Violations
    Unmatched statement _prefs.setStatementSeparator(statementSeparatorTextField.getText()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    _prefs.setStatementSeparator(statementSeparatorTextField.getText());
    4
    statementSeparatorTextField.setText(_prefs.getStatementSeparator());
    4
    statementSeparatorTextField.setText(_prefs.getStatementSeparator());
    Preondition Violations
    Unmatched statement statementSeparatorTextField.setText(_prefs.getStatementSeparator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                  
    5
    if (_showProcSep)
    5
    if (_showProcSep)
                                                                                                                                                  
    6
    _prefs.setProcedureSeparator(procedureSeparatorTextField.getText());
    Preondition Violations
    Unmatched statement _prefs.setProcedureSeparator(procedureSeparatorTextField.getText()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6
    _prefs.setProcedureSeparator(procedureSeparatorTextField.getText());
    6
    procedureSeparatorTextField.setText(_prefs.getProcedureSeparator());
    6
    procedureSeparatorTextField.setText(_prefs.getProcedureSeparator());
    Preondition Violations
    Unmatched statement procedureSeparatorTextField.setText(_prefs.getProcedureSeparator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                  
                                                                                                                                                          
    7
    _prefs.setInstallCustomQueryTokenizer(useCustomQTCheckBox.isSelected());
    Preondition Violations
    Unmatched statement _prefs.setInstallCustomQueryTokenizer(useCustomQTCheckBox.isSelected()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    _prefs.setInstallCustomQueryTokenizer(useCustomQTCheckBox.isSelected());
    7
    useCustomQTCheckBox.setSelected(_prefs.isInstallCustomQueryTokenizer());
    7
    useCustomQTCheckBox.setSelected(_prefs.isInstallCustomQueryTokenizer());
    Preondition Violations
    Unmatched statement useCustomQTCheckBox.setSelected(_prefs.isInstallCustomQueryTokenizer()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                          
    8
    updatePreferenceState();
    8
    updatePreferenceState();
    8
    _prefsManager.savePrefs();
    Differences
    Expression1Expression2Difference
    updatePreferenceStatesavePrefsMETHOD_INVOCATION_NAME_MISMATCH
    _prefsManagerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression updatePreferenceState() is a void method call, and thus it cannot be parameterized
    Expression _prefsManager.savePrefs() is a void method call, and thus it cannot be parameterized
    Expression updatePreferenceState() is a void method call, and thus it cannot be parameterized
    Expression _prefsManager.savePrefs() is a void method call, and thus it cannot be parameterized
    8
    _prefsManager.savePrefs();
    Precondition Violations (14)
    Row Violation
    1Unmatched statement _prefs.setRemoveMultiLineComments(removeMultiLineCommentCheckBox.isSelected()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement removeMultiLineCommentCheckBox.setSelected(_prefs.isRemoveMultiLineComments()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3Unmatched statement _prefs.setLineComment(lineCommentTextField.getText()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement lineCommentTextField.setText(_prefs.getLineComment()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Unmatched statement _prefs.setStatementSeparator(statementSeparatorTextField.getText()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement statementSeparatorTextField.setText(_prefs.getStatementSeparator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched statement _prefs.setProcedureSeparator(procedureSeparatorTextField.getText()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement procedureSeparatorTextField.setText(_prefs.getProcedureSeparator()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9Unmatched statement _prefs.setInstallCustomQueryTokenizer(useCustomQTCheckBox.isSelected()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched statement useCustomQTCheckBox.setSelected(_prefs.isInstallCustomQueryTokenizer()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Expression updatePreferenceState() is a void method call, and thus it cannot be parameterized
    12Expression _prefsManager.savePrefs() is a void method call, and thus it cannot be parameterized
    13Expression updatePreferenceState() is a void method call, and thus it cannot be parameterized
    14Expression _prefsManager.savePrefs() is a void method call, and thus it cannot be parameterized