if(graphComponents[i] instanceof ConstraintView) { ((ConstraintView)graphComponents[i]).addConstraintViewListener(_constraintViewListener); } _graphComponents.add(graphComponents[i]);
if (framesOfSession[i] instanceof SessionPropertiesSheet) { return (SessionPropertiesSheet)framesOfSession[i]; }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/graph/src/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopPane.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/gui/WindowManager.java
Method name: void putGraphComponents(GraphComponent[]) Method name: SessionPropertiesSheet getSessionPropertiesDialog(ISession)
Number of AST nodes: 3 Number of AST nodes: 2
1
if(graphComponents[i] instanceof ConstraintView)
1
if (framesOfSession[i] instanceof SessionPropertiesSheet)
2
            {
2
         
3
  
3
{
4
             ((ConstraintView)graphComponents[i]).addConstraintViewListener(_constraintViewListener);
4
            
5
            }
6
            _graphComponents.add(graphComponents[i]);
5
return (SessionPropertiesSheet)framesOfSession[i];
6
         }
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 comparisons6
  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)0.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    3
    if (graphComponents[i] instanceof ConstraintView)
    3
    if (graphComponents[i] instanceof ConstraintView)
    3
    if (framesOfSession[i] instanceof SessionPropertiesSheet)
    Differences
    Expression1Expression2Difference
    graphComponentsframesOfSessionVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.graph.GraphComponent[]net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget[]VARIABLE_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.graph.ConstraintViewnet.sourceforge.squirrel_sql.client.session.properties.SessionPropertiesSheetVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.graph.GraphComponent[] of variable graphComponents does not match with type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget[] of variable framesOfSession
    • Make classes net.sourceforge.squirrel_sql.plugins.graph.GraphComponent[] and net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget[] extend a common superclass
    Type net.sourceforge.squirrel_sql.plugins.graph.ConstraintView does not match with type net.sourceforge.squirrel_sql.client.session.properties.SessionPropertiesSheet
    • Make classes net.sourceforge.squirrel_sql.plugins.graph.ConstraintView and net.sourceforge.squirrel_sql.client.session.properties.SessionPropertiesSheet extend a common superclass
    3
    if (framesOfSession[i] instanceof SessionPropertiesSheet)
                                                                                                              
    4
    return (SessionPropertiesSheet)framesOfSession[i];
    Preondition Violations
    Unmatched statement return (SessionPropertiesSheet)framesOfSession[i]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return (SessionPropertiesSheet)framesOfSession[i];
    4
    return (SessionPropertiesSheet)framesOfSession[i];
    4
    ((ConstraintView)graphComponents[i]).addConstraintViewListener(_constraintViewListener);
    4
    ((ConstraintView)graphComponents[i]).addConstraintViewListener(_constraintViewListener);
    Preondition Violations
    Unmatched statement ((ConstraintView)graphComponents[i]).addConstraintViewListener(_constraintViewListener); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                                          
    5
    _graphComponents.add(graphComponents[i]);
                                                                                            
    Precondition Violations (6)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.graph.GraphComponent[] of variable graphComponents does not match with type net.sourceforge.squirrel_sql.client.gui.desktopcontainer.ISessionWidget[] of variable framesOfSession
    2Type net.sourceforge.squirrel_sql.plugins.graph.ConstraintView does not match with type net.sourceforge.squirrel_sql.client.session.properties.SessionPropertiesSheet
    3Unmatched statement return (SessionPropertiesSheet)framesOfSession[i]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched return (SessionPropertiesSheet)framesOfSession[i];
    5Unmatched statement ((ConstraintView)graphComponents[i]).addConstraintViewListener(_constraintViewListener); 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