if (actionListeners[j].equals(listener)) { // We don't add a listener to a button twice // because the FindDialogSupport class will call // this method with the same button instances // whenever the replace dialog is opened. // // If we add the listener again and again replace // will be done as often as the dialog is opened. // This is especially nasty if the text to replace // is part of the replacement text. found = true; }
if (!childNode.getUserObject().toString().startsWith("BIN$")) { result.add(childNode); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/SquirrelNBDialogFactory.java File path: /sql12/plugins/oracle/src/net/sourceforge/squirrel_sql/plugins/oracle/expander/OracleTableParentExpander.java
Method name: Dialog createDialog(String, JPanel, boolean, JButton[], boolean, int, int, ActionListener) Method name: List createChildren(ISession, ObjectTreeNode)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (actionListeners[j].equals(listener))
1
if (
2
               {
3
                  // We don't add a listener to a button twice
4
                  // because the FindDialogSupport class will call
5
                  // this method with the same button instances
6
                  // whenever the replace dialog is opened.
7
                  //
8
                  // If we add the listener again and again replace
9
                  // will be done as often as the dialog is opened.
10
                  // This is especially nasty if the text to replace
11
                  // is part of the replacement text.
12
                  found = true
2
!childNode.getUserObject().toString().startsWith("BIN$")) {
13
;
3
                    result.add(childNode);
14
               }
4
                }
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.3
Clones locationClones are in different classes
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    17
    if (actionListeners[j].equals(listener))
    17
    if (actionListeners[j].equals(listener))
    5
    if (!childNode.getUserObject().toString().startsWith("BIN$"))
    Differences
    Expression1Expression2Difference
    actionListeners[j].equals(listener)!childNode.getUserObject().toString().startsWith("BIN$")TYPE_COMPATIBLE_REPLACEMENT
    5
    if (!childNode.getUserObject().toString().startsWith("BIN$"))
                                                      
    6
    result.add(childNode);
    Preondition Violations
    Unmatched statement result.add(childNode); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    result.add(childNode);
    18
    found = true;
                                  
    Precondition Violations (2)
    Row Violation
    1Unmatched statement result.add(childNode); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero