if(false == sqlEntryPanel instanceof NetbeansSQLEntryPanel) { String msg = //i18n[syntax.findNetbeansOnly=Find is only available when the Netbeans editor is used.\nSee menu File --> New Session Properties --> Tab Syntax] s_stringMgr.getString("syntax.findNetbeansOnly"); JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg); return; } NetbeansSQLEntryPanel nsep = (NetbeansSQLEntryPanel) sqlEntryPanel; nsep.showFindDialog(evt);
if(false == sqlEntryPanel instanceof NetbeansSQLEntryPanel) { String msg = //i18n[syntax.replaceNetbeansOnly=Replace is only available when the Netbeans editor is used.\nSee menu File --> New Session Properties --> Tab Syntax] s_stringMgr.getString("syntax.replaceNetbeansOnly"); JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg); return; } NetbeansSQLEntryPanel nsep = (NetbeansSQLEntryPanel) sqlEntryPanel; nsep.showReplaceDialog(evt);
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/FindAction.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/ReplaceAction.java
Method name: void doActionPerformed(ISQLEntryPanel, ActionEvent) Method name: void doActionPerformed(ISQLEntryPanel, ActionEvent)
Number of AST nodes: 6 Number of AST nodes: 6
1
if(false == sqlEntryPanel instanceof NetbeansSQLEntryPanel)
1
if(false == sqlEntryPanel instanceof NetbeansSQLEntryPanel)
2
      {
2
      {
3
         String msg =
3
         String msg =
4
            //i18n[syntax.findNetbeansOnly=Find is only available when the Netbeans editor is used.\nSee menu File --> New Session Properties --> Tab Syntax]
4
            //i18n[syntax.replaceNetbeansOnly=Replace is only available when the Netbeans editor is used.\nSee menu File --> New Session Properties --> Tab Syntax]
5
            s_stringMgr.getString("syntax.findNetbeansOnly");
5
            s_stringMgr.getString("syntax.replaceNetbeansOnly");
6
         JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
6
         JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
7
         return;
7
         return;
8
      }
8
      }
9
      NetbeansSQLEntryPanel nsep = (NetbeansSQLEntryPanel) sqlEntryPanel;
9
      NetbeansSQLEntryPanel nsep = (NetbeansSQLEntryPanel) sqlEntryPanel;
10
      nsep.showFindDialog(evt);
10
      nsep.showReplaceDialog(evt);
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.2
Clones locationClones are in different classes having the same super class
Number of node comparisons20
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)16.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (false == sqlEntryPanel instanceof NetbeansSQLEntryPanel)
    1
    if (false == sqlEntryPanel instanceof NetbeansSQLEntryPanel)
    2
    String msg = s_stringMgr.getString("syntax.findNetbeansOnly");
    2
    String msg = s_stringMgr.getString("syntax.findNetbeansOnly");
    2
    String msg = s_stringMgr.getString("syntax.replaceNetbeansOnly");
    Differences
    Expression1Expression2Difference
    "syntax.findNetbeansOnly""syntax.replaceNetbeansOnly"LITERAL_VALUE_MISMATCH
    2
    String msg = s_stringMgr.getString("syntax.replaceNetbeansOnly");
    3
    JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
    3
    JOptionPane.showMessageDialog(_session.getApplication().getMainFrame(), msg);
    4
    return;
    4
    return;
    5
    NetbeansSQLEntryPanel nsep = (NetbeansSQLEntryPanel)sqlEntryPanel;
    5
    NetbeansSQLEntryPanel nsep = (NetbeansSQLEntryPanel)sqlEntryPanel;
    6
    nsep.showFindDialog(evt);
    6
    nsep.showFindDialog(evt);
    6
    nsep.showReplaceDialog(evt);
    Differences
    Expression1Expression2Difference
    showFindDialogshowReplaceDialogMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression nsep.showFindDialog(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression nsep.showReplaceDialog(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression nsep.showFindDialog(evt) is a void method call, and thus it cannot be parameterized
    Expression nsep.showReplaceDialog(evt) is a void method call, and thus it cannot be parameterized
    6
    nsep.showReplaceDialog(evt);
    Precondition Violations (4)
    Row Violation
    1Expression nsep.showFindDialog(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression nsep.showReplaceDialog(evt) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression nsep.showFindDialog(evt) is a void method call, and thus it cannot be parameterized
    4Expression nsep.showReplaceDialog(evt) is a void method call, and thus it cannot be parameterized