if(mappedClassInfo.matches(parser, false, false)) { ciClasses.add(mappedClassInfo); } ciAttrs.addAll(mappedClassInfo.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 mouseReleased(MouseEvent)
Number of AST nodes: 3 Number of AST nodes: 2
1
if(mappedClassInfo.matches(parser, false, false))
1
if(
2
         {
3
            ciClasses.add(mappedClassInfo);
4
         }
5
         ciAttrs.addAll(mappedClassInfo.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.2
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)7.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    8
    if (mappedClassInfo.matches(parser, false, false))
    8
    if (mappedClassInfo.matches(parser, false, false))
    1
    if (popup.isPopupTrigger(event))
    Differences
    Expression1Expression2Difference
    matchesisPopupTriggerMETHOD_INVOCATION_NAME_MISMATCH
    mappedClassInfopopupVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.hibernate.mapping.MappedClassInfojavax.swing.JPopupMenuVARIABLE_TYPE_MISMATCH
    mappedClassInfo.matches(parser,false,false)popup.isPopupTrigger(event)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression mappedClassInfo.matches(parser,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type net.sourceforge.squirrel_sql.plugins.hibernate.mapping.MappedClassInfo of variable mappedClassInfo does not match with type javax.swing.JPopupMenu of variable popup
    • Make classes net.sourceforge.squirrel_sql.plugins.hibernate.mapping.MappedClassInfo and javax.swing.JPopupMenu extend a common superclass
    Expression mappedClassInfo.matches(parser,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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());
    9
    ciClasses.add(mappedClassInfo);
    9
    ciClasses.add(mappedClassInfo);
    Preondition Violations
    Unmatched statement ciClasses.add(mappedClassInfo); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                        
    10
    ciAttrs.addAll(mappedClassInfo.getQualifiedMatchingAttributes(parser));
                                                                                                                                                          
    Precondition Violations (6)
    Row Violation
    1Expression mappedClassInfo.matches(parser,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Type net.sourceforge.squirrel_sql.plugins.hibernate.mapping.MappedClassInfo of variable mappedClassInfo does not match with type javax.swing.JPopupMenu of variable popup
    3Expression mappedClassInfo.matches(parser,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Unmatched 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
    5Unmatched statement ciClasses.add(mappedClassInfo); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero