String sepChar = _dlg.txtSeparatorChar.getText(); if(null == sepChar || 1 != sepChar.trim().length()) { // i18n[TableExportCsvController.invalidSeparator=You must provide a single separator character or check "Use tab" to use the tab character.] String msg = s_stringMgr.getString("TableExportCsvController.invalidSeparator"); JOptionPane.showMessageDialog(_dlg, msg); return; }
AliasScript script = _plugin.getScriptsCache().get(alias); String sql = script.getSQL(); if (sql != null && sql.length() > 0) { _sqlEntry.setText(sql); setText = true; }
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/action/TableExportCsvController.java File path: /sql12/plugins/sessionscript/src/net/sourceforge/squirrel_sql/plugins/sessionscript/ViewSessionScriptsPanel.java
Method name: void onOK() Method name: void refreshScript()
Number of AST nodes: 5 Number of AST nodes: 5
1
String sepChar = _dlg.txtSeparatorChar.getText();
2
         if(nul
1
AliasScript script = _plugin.getScriptsCache().get(alias);
3
l == sepChar || 1 != sepChar.trim().length())
2
			String sql = s
4
         {
5
            // i18n[TableExportCsvController.invalidSeparator=You must provide a single separator character or check "Use tab" to use the tab character.]
6
            String msg = s_stringMgr.getString("TableExportCsvController.invalidSeparator");
7
            JOptionPane.showMessageDialog(_dlg, msg);
8
            return;
9
         
3
cript.getSQL();
4
			if (sql != null && sql.length() > 0)
5
			{
6
				_sqlEntry.setText(sql);
7
				setText = true;
10
}
8
			}
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 comparisons15
  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)2.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                                                          
    4
    AliasScript script = _plugin.getScriptsCache().get(alias);
                                                                
    5
    String sql = script.getSQL();
    7
    String sepChar = _dlg.txtSeparatorChar.getText();
                                                                                                        
    8
    if (null == sepChar || 1 != sepChar.trim().length())
    8
    if (null == sepChar || 1 != sepChar.trim().length())
    6
    if (sql != null && sql.length() > 0)
    Differences
    Expression1Expression2Difference
    nullsqlTYPE_COMPATIBLE_REPLACEMENT
    sepCharnullTYPE_COMPATIBLE_REPLACEMENT
    ==!=OPERATOR_MISMATCH
    1sql.length()TYPE_COMPATIBLE_REPLACEMENT
    sepChar.trim().length()0TYPE_COMPATIBLE_REPLACEMENT
    !=>OPERATOR_MISMATCH
    ||&&OPERATOR_MISMATCH
    Preondition Violations
    Expression sql cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sepChar cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression null == sepChar cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sql != null cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sql.length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression 1 != sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sql.length() > 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression null == sepChar || 1 != sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression sql != null && sql.length() > 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (sql != null && sql.length() > 0)
    9
    String msg = s_stringMgr.getString("TableExportCsvController.invalidSeparator");
    9
    String msg = s_stringMgr.getString("TableExportCsvController.invalidSeparator");
    Preondition Violations
    Unmatched statement String msg=s_stringMgr.getString("TableExportCsvController.invalidSeparator"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                                                                      
    10
    JOptionPane.showMessageDialog(_dlg, msg);
    10
    JOptionPane.showMessageDialog(_dlg, msg);
    7
    _sqlEntry.setText(sql);
    Differences
    Expression1Expression2Difference
    showMessageDialogsetTextMETHOD_INVOCATION_NAME_MISMATCH
    JOptionPane.showMessageDialog(_dlg,msg)_sqlEntry.setText(sql)TYPE_COMPATIBLE_REPLACEMENT
    JOptionPane.showMessageDialog(_dlg,msg)_sqlEntry.setText(sql)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression JOptionPane.showMessageDialog(_dlg,msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _sqlEntry.setText(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression JOptionPane.showMessageDialog(_dlg,msg) is a void method call, and thus it cannot be parameterized
    Expression _sqlEntry.setText(sql) is a void method call, and thus it cannot be parameterized
    Expression JOptionPane.showMessageDialog(_dlg,msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression _sqlEntry.setText(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression JOptionPane.showMessageDialog(_dlg,msg) is a void method call, and thus it cannot be parameterized
    Expression _sqlEntry.setText(sql) is a void method call, and thus it cannot be parameterized
    7
    _sqlEntry.setText(sql);
                                    
    8
    setText = true;
    11
    return;
    11
    return;
    Preondition Violations
    Unmatched return;
                          
    Precondition Violations (20)
    Row Violation
    1Expression sql cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression sepChar cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression null == sepChar cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression sql != null cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression sql.length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression 1 != sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression sql.length() > 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression null == sepChar || 1 != sepChar.trim().length() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression sql != null && sql.length() > 0 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Unmatched statement String msg=s_stringMgr.getString("TableExportCsvController.invalidSeparator"); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    12Expression JOptionPane.showMessageDialog(_dlg,msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression _sqlEntry.setText(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression JOptionPane.showMessageDialog(_dlg,msg) is a void method call, and thus it cannot be parameterized
    15Expression _sqlEntry.setText(sql) is a void method call, and thus it cannot be parameterized
    16Expression JOptionPane.showMessageDialog(_dlg,msg) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression _sqlEntry.setText(sql) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression JOptionPane.showMessageDialog(_dlg,msg) is a void method call, and thus it cannot be parameterized
    19Expression _sqlEntry.setText(sql) is a void method call, and thus it cannot be parameterized
    20Unmatched return;