if(aliasInfo.matches(parser)) { ciClasses.add(aliasInfo); } ciAttrs.addAll(aliasInfo.getQualifiedMatchingAttributes(parser));
if(popup.isPopupTrigger(event)){ popup.show(event.getComponent(), event.getX(),event.getY()); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/hibernate/src/net/sourceforge/squirrel_sql/plugins/hibernate/completion/HQLCompletionInfoCollection.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/update/gui/UpdateSummaryTable.java
Method name: CompletionCandidates getInfosStartingWith(CompletionParser) Method name: void mousePressed(MouseEvent)
Number of AST nodes: 3 Number of AST nodes: 2
1
if(aliasInfo.matches(parser))
1
if(
2
         {
3
            ciClasses.add(aliasInfo);
4
         }
5
         ciAttrs.addAll(aliasInfo.getQualifiedMatchingAttributes(parser));
2
popup.isPopupTrigger(event)){
3
           popup.show(event.getComponent(), event.getX(),event.getY());
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 comparisons4
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)5.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    if (aliasInfo.matches(parser))
    4
    if (aliasInfo.matches(parser))
    1
    if (popup.isPopupTrigger(event))
    Differences
    Expression1Expression2Difference
    parsereventVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.fw.completion.util.CompletionParserjava.awt.event.MouseEventVARIABLE_TYPE_MISMATCH
    matchesisPopupTriggerMETHOD_INVOCATION_NAME_MISMATCH
    aliasInfopopupVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.hibernate.completion.AliasInfojavax.swing.JPopupMenuVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.fw.completion.util.CompletionParser of variable parser does not match with type java.awt.event.MouseEvent of variable event
    • Make classes net.sourceforge.squirrel_sql.fw.completion.util.CompletionParser and java.awt.event.MouseEvent extend a common superclass
    Type net.sourceforge.squirrel_sql.plugins.hibernate.completion.AliasInfo of variable aliasInfo does not match with type javax.swing.JPopupMenu of variable popup
    • Make classes net.sourceforge.squirrel_sql.plugins.hibernate.completion.AliasInfo and javax.swing.JPopupMenu extend a common superclass
    1
    if (popup.isPopupTrigger(event))
                                                                                                                                
    2
    popup.show(event.getComponent(), event.getX(), event.getY());
    Preondition Violations
    Unmatched statement popup.show(event.getComponent(),event.getX(),event.getY()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    popup.show(event.getComponent(), event.getX(), event.getY());
    5
    ciClasses.add(aliasInfo);
    5
    ciClasses.add(aliasInfo);
    Preondition Violations
    Unmatched statement ciClasses.add(aliasInfo); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                            
    6
    ciAttrs.addAll(aliasInfo.getQualifiedMatchingAttributes(parser));
                                                                                                                                            
    Precondition Violations (5)
    Row Violation
    1Type net.sourceforge.squirrel_sql.fw.completion.util.CompletionParser of variable parser does not match with type java.awt.event.MouseEvent of variable event
    2Type net.sourceforge.squirrel_sql.plugins.hibernate.completion.AliasInfo of variable aliasInfo does not match with type javax.swing.JPopupMenu of variable popup
    3Unmatched statement popup.show(event.getComponent(),event.getX(),event.getY()); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement ciClasses.add(aliasInfo); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero